-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
38 lines (29 loc) · 1 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
cmake_minimum_required (VERSION 3.22)
project ("pcs" VERSION 0 LANGUAGES CXX)
option(PCS_RUN_TESTS "Run tests" ON)
option(PCS_COMPILE_BENCHMARKS "Compile benchmarks" ON)
option(PCS_PCH "Use precompiled headers" ON)
option(PCS_VERBOSE_OUTPUT "Verbose output" OFF)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# Library
add_subdirectory(src/pcs)
# Application
add_subdirectory(app)
# Preprocessor definitions
if (PCS_VERBOSE_OUTPUT)
target_compile_definitions(pcs PRIVATE PCS_VERBOSE=1)
target_compile_definitions(pcs_cli PRIVATE PCS_VERBOSE=1)
endif()
# Tests
if ((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) AND PCS_RUN_TESTS)
include(CTest)
enable_testing()
include(GoogleTest)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(tests)
endif()
# Benchmarks
if ((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) AND PCS_COMPILE_BENCHMARKS)
add_subdirectory(benchmarks)
endif()