-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (28 loc) · 925 Bytes
/
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.16)
project(coel CXX)
option(COEL_BUILD_EXAMPLE "Build example" OFF)
option(COEL_BUILD_TESTS "Build tests" OFF)
find_package(fmt REQUIRED)
if(COEL_BUILD_TESTS)
find_package(GTest REQUIRED)
include(GoogleTest)
enable_testing()
endif()
add_library(coel)
add_subdirectory(sources)
target_compile_features(coel PRIVATE cxx_std_20)
target_include_directories(coel PUBLIC include)
target_link_libraries(coel PRIVATE fmt::fmt)
if(COEL_BUILD_EXAMPLE)
add_executable(coel-example)
add_subdirectory(example)
target_compile_features(coel-example PRIVATE cxx_std_20)
target_link_libraries(coel-example PRIVATE coel)
endif()
if(COEL_BUILD_TESTS)
add_executable(coel-tests)
add_subdirectory(tests)
target_compile_features(coel-tests PRIVATE cxx_std_20)
target_link_libraries(coel-tests PRIVATE GTest::Main coel)
gtest_discover_tests(coel-tests)
endif()