-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
33 lines (24 loc) · 1.02 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
cmake_minimum_required(VERSION 3.24)
project(DiscriminatedUnion)
set(CMAKE_CXX_STANDARD 20)
# Include paths
# PROJECT_SOURCE_DIR provides path of CMakeLists.txt where project() declaration was used
set(DEMO_INCLUDES ${DEMO_INCLUDES} ${PROJECT_SOURCE_DIR}/src)
set(DEMO_INCLUDES ${DEMO_INCLUDES} ${PROJECT_SOURCE_DIR}/shared)
include_directories(include)
# Gather all sources except the main entry point
file(GLOB_RECURSE INC_FILES include/*/*.h)
file(GLOB_RECURSE SRC_FILES src/*/*.cpp)
# Build object files for reuse (e.g. in test)
#ADD_LIBRARY(demo_objects OBJECT ${INC_FILES} ${SRC_FILES})
# Dependencies
find_package(Boost COMPONENTS filesystem system unit_test_framework REQUIRED)
# Unit tests
add_subdirectory(tests)
# Assign the include directories
include_directories(${Boost_INCLUDE_DIRS})
# Build
#set(SOURCE_FILES src/main.cpp $<TARGET_OBJECTS:demo_objects>)
set(SOURCE_FILES src/main.cpp ${INC_FILES} ${SRC_FILES})
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})