1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-02 21:53:51 +00:00
CLI11/tests/CMakeLists.txt
2017-03-27 13:53:57 -04:00

43 lines
817 B
CMake

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()