-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (57 loc) · 1.74 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 2.8.2)
#-----------------------------------------------------------------
# DEFAULT FLAGS
#-----------------------------------------------------------------
if (NOT DEFINED LITHE_TESTS)
set(LITHE_TESTS FALSE)
endif()
# Print all the flags
message(STATUS "LITHE_TESTS -- ${LITHE_TESTS}")
#-----------------------------------------------------------------
# CONFIGURE LITHE
#-----------------------------------------------------------------
project(Lithe LANGUAGES CXX)
set(CMAKE_CXX_FLAGS "-std=c++11")
# Declare the library
file(GLOB lithe_sources
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Lithe/*.h
)
add_library(
lithe_core
STATIC
${lithe_sources}
)
target_include_directories(
lithe_core
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
# Install
file(GLOB lithe_headers
${CMAKE_CURRENT_SOURCE_DIR}/Lithe/*.h
)
install(
TARGETS lithe_core
DESTINATION lib
)
install(
FILES ${lithe_headers}
DESTINATION include/Lithe
)
#-----------------------------------------------------------------
# CONFIGURE DOXYGEN DOCUMENTATION
#-----------------------------------------------------------------
# Custom target to build docs
add_subdirectory(docs EXCLUDE_FROM_ALL)
#-----------------------------------------------------------------
# CONFIGURE LITHE UNIT TESTS
#-----------------------------------------------------------------
if(LITHE_TESTS)
message(STATUS "Setting up test target for Lithe")
# Pull the integration code that builds gtest
include(cmake/gtest-integration.cmake)
# Custom target to build and run test
add_subdirectory(test EXCLUDE_FROM_ALL)
message(STATUS "Setting up test target for Lithe (done)")
endif()