-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
77 lines (59 loc) · 2.62 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
74
75
76
77
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
PROJECT (MasterProject)
SET(ROOT_DIR ${CMAKE_SOURCE_DIR})
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
INCLUDE(${ROOT_DIR}/buildsystem/CMake/configuration.cmake)
INCLUDE(${ROOT_DIR}/buildsystem/CMake/compiler_support.cmake)
INCLUDE(${ROOT_DIR}/buildsystem/CMake/library_support.cmake)
INCLUDE(${ROOT_DIR}/buildsystem/CMake/utilities.cmake)
SET(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/exe)
MESSAGE(STATUS "Using library output directory: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
MESSAGE(STATUS "Using runtime output directory: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
SET_WARNING_LEVEL()
DISABLE_COMPILER_EXTENSIONS()
ENABLE_MULTIPROCESSOR_BUILD()
ADD_SANITIZERS_TO_BUILD()
SET_PROPER_STANDARD_LIBRARY()
SET_PROPER_STANDARD_VERSION("c++1y")
ADD_DEFINITIONS(-DUSE_BOOST_PROGRAM_OPTIONS=${USE_BOOST_PROGRAM_OPTIONS})
ADD_DEFINITIONS(-DUSE_LYRA_PROGRAM_OPTIONS=${USE_LYRA_PROGRAM_OPTIONS})
MESSAGE(STATUS "Using C++ compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
SET(EXTERNAL_LIBRARIES Qt::Widgets Qt::Xml Qt::Core ${LIBXML2_LIBRARIES})
#External dependencies
IF(${USE_MULTITHREADING})
FIND_PACKAGE(Threads REQUIRED)
SET(EXTERNAL_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
ENABLE_MULTITHREADING()
ENDIF(${USE_MULTITHREADING})
IF(${USE_BOOST})
ADD_DEPENDENCY_TO_BOOST(${Boost_VERSION} ${Boost_REQUIRED_LIBRARIES})
SET(EXTERNAL_LIBRARIES "${Boost_LIBRARIES};${EXTERNAL_LIBRARIES}")
ENDIF(${USE_BOOST})
IF(${USE_OPENCV})
ADD_DEPENDENCY_TO_OPEN_CV()
SET(EXTERNAL_LIBRARIES "${OpenCV_LIBS};${EXTERNAL_LIBRARIES}")
ENDIF(${USE_OPENCV})
ADD_SUBDIRECTORY(production)
SET(TARGETS ${INTERNAL_LIBRARIES} ${SEMI_INTERNAL_LIBRARIES})
IF (${PRODUCTION_INCLUDE_DIR} STREQUAL "")
MESSAGE(FATAL_ERROR "PRODUCTION_INCLUDE_DIR shall be set by cmake files in production code")
ENDIF(${PRODUCTION_INCLUDE_DIR} STREQUAL "")
INCLUDE_DIRECTORIES(${PRODUCTION_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${LIBRARY_INCLUDE_DIRS})
IF(${WITH_TESTCASES} OR ${WITH_BENCHMARKS})
ADD_SUBDIRECTORY(tests)
IF(${WITH_TESTCASES})
SET(TARGETS ${TARGETS} ${TESTCASES_PROJECT})
ENDIF(${WITH_TESTCASES})
IF(${WITH_BENCHMARKS})
SET(TARGETS ${TARGETS} ${BENCHMARK_PROJECT})
ENDIF(${WITH_BENCHMARKS})
ENDIF(${WITH_TESTCASES} OR ${WITH_BENCHMARKS})
IF(${WITH_EXECUTABLE})
ADD_SUBDIRECTORY(executable)
ADD_DEPENDENCIES(${EXECUTABLE_PROJECT} ${INTERNAL_LIBRARIES} ${SEMI_INTERNAL_LIBRARIES})
SET(TARGETS ${TARGETS} ${EXECUTABLE_PROJECT})
ENDIF(${WITH_EXECUTABLE})
SET_OUTPUT_DIRECTORIES(${TARGETS})