-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (37 loc) · 1.35 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
cmake_minimum_required(VERSION 3.17)
project(
Finances
VERSION 1.0.0
LANGUAGES CXX)
add_subdirectory(lib)
include(FetchContent)
FetchContent_Declare(
GSL
GIT_REPOSITORY https://github.com/microsoft/GSL
GIT_TAG v3.1.0)
FetchContent_MakeAvailable(GSL)
option(SBASH64_FINANCES_ENABLE_READLINE "Enable readline" OFF)
if(${SBASH64_FINANCES_ENABLE_READLINE})
set(FINANCES_CONSOLE_MAIN_SOURCE_FILE main-with-readline.cpp)
set(FINANCES_CONSOLE_ADDITIONAL_DEPENDENCIES readline)
else()
set(FINANCES_CONSOLE_MAIN_SOURCE_FILE main.cpp)
endif()
add_executable(sbash64-finances-console repl.cpp
${FINANCES_CONSOLE_MAIN_SOURCE_FILE})
target_compile_options(sbash64-finances-console
PRIVATE ${SBASH64_FINANCES_WARNINGS})
target_compile_features(sbash64-finances-console PRIVATE cxx_std_17)
set_target_properties(sbash64-finances-console PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(sbash64-finances-console sbash64-finances GSL
${FINANCES_CONSOLE_ADDITIONAL_DEPENDENCIES})
option(SBASH64_FINANCES_ENABLE_TESTS "Enable tests" OFF)
if(${SBASH64_FINANCES_ENABLE_TESTS})
FetchContent_Declare(
testcpplite
GIT_REPOSITORY https://github.com/sbash64/testcpplite
GIT_TAG v2.0.1)
FetchContent_MakeAvailable(testcpplite)
enable_testing()
add_subdirectory(test)
endif()