CMakeLists.txt
817 Bytes
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
include(AddGoogletest)
set(CLI_TESTS
HelpersTest
IniTest
SimpleTest
AppTest
CreationTest
SubcommandTest
HelpTest
NewParseTest
)
set(CLI_SINGLE_TESTS
TimerTest
)
# Only affects current directory, so safe
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
foreach(T ${CLI_TESTS})
add_executable(${T} ${T}.cpp ${CLI_headers})
target_link_libraries(${T} PUBLIC CLI11)
add_gtest(${T})
if(CLI_SINGLE_FILE AND CLI_SINGLE_FILE_TESTS)
add_executable(${T}_Single ${T}.cpp)
target_link_libraries(${T}_Single PUBLIC CLI11_SINGLE)
add_gtest(${T}_Single)
endif()
endforeach()
foreach(T ${CLI_SINGLE_TESTS})
add_executable(${T} ${T}.cpp ${CLI_headers})
target_link_libraries(${T} PUBLIC CLI11)
add_gtest(${T})
endforeach()