-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
42 lines (33 loc) · 1.12 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
cmake_minimum_required(VERSION 3.14)
set(ITC_MAIN_PROJECT ON)
if(DEFINED PROJECT_SOURCE_DIR)
set(ITC_MAIN_PROJECT OFF)
endif()
project(itc)
include(CTest)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/utility")
option(BUILD_ITC_SHARED "Build as a shared library." ${ITC_MAIN_PROJECT})
option(BUILD_ITC_TESTS "Build the tests" ${ITC_MAIN_PROJECT})
option(BUILD_ITC_WITH_CODE_STYLE_CHECKS "Build with code style checks." ${ITC_MAIN_PROJECT})
if(BUILD_ITC_TESTS)
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
endif()
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
endif()
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
endif()
endif()
if(BUILD_ITC_SHARED)
set(BUILD_SHARED_LIBS ON)
endif()
if(BUILD_ITC_WITH_CODE_STYLE_CHECKS)
set(BUILD_WITH_CODE_STYLE_CHECKS ON)
endif()
add_subdirectory(itc)
if(BUILD_ITC_TESTS)
add_subdirectory(tests)
endif()