-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (52 loc) · 2.2 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 3.20)
project(test_task
VERSION 0.0.1
DESCRIPTION "Test Task"
LANGUAGES C CXX
)
#-----------------------------------------------------------------------------------------------------------------------------------------
# General options
#-----------------------------------------------------------------------------------------------------------------------------------------
if(WIN32)
add_compile_definitions(_WIN32_WINNT=0x0601)
endif()
option(TT_BUILD_TESTS "Enable build unit tests" OFF)
if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRING "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(MAIN_TARGET_NAME "${PROJECT_NAME}")
add_custom_target(${MAIN_TARGET_NAME})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(3rdparty)
# other option
#-----------------------------------------------------------------------------------------------------------------------------------------
# Dependencies
#-----------------------------------------------------------------------------------------------------------------------------------------
set(${MAIN_TARGET_NAME}_depencies
game_of_life
)
if(TT_BUILD_TESTS)
list(APPEND
${MAIN_TARGET_NAME}_depencies
tests
)
endif()
add_dependencies(${MAIN_TARGET_NAME}
${${MAIN_TARGET_NAME}_depencies}
)
# other dependencies
#------------------------------------------------------------------------------------------------------------------------------------------
# Sources
#------------------------------------------------------------------------------------------------------------------------------------------
# other source
#------------------------------------------------------------------------------------------------------------------------------------------
# Target
#------------------------------------------------------------------------------------------------------------------------------------------
add_subdirectory(source)
if(TT_BUILD_TESTS)
message(STATUS "Tests add to build")
add_subdirectory(tests)
enable_testing()
endif()