-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (25 loc) · 1.25 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
cmake_minimum_required(VERSION 3.3)
project(CPP_Argument_Parser)
include_directories(include)
set(CMAKE_CXX_STANDARD 11)
set(src src/argvParser.cpp include/argvParser.h src/configFileReader.cpp src/configFileReader.h src/argParserAdvancedConfiguration.h src/argParserAdvancedConfiguration.cpp)
add_executable(extendedExmple ${src} exampleMainExtended.cpp)
add_executable(simpleExample ${src} exampleMainSimple.cpp)
find_package(GTest)
if (GTest_FOUND)
message(" -- gtest found at " ${GTEST_INCLUDE_DIRS})
include_directories(${GTEST_INCLUDE_DIRS})
set(tests_src tests/argvParserTest.cpp tests/configReaderTest.cpp tests/exampleTest.cpp tests/definedNumberOfArgs.cpp tests/advancedConfigurationTest.cpp tests/lambdaTest.cpp tests/defaultConfigFileTest.cpp)
add_executable(argParser_Test ${tests_src} ${src})
target_link_libraries(argParser_Test ${GTEST_BOTH_LIBRARIES} pthread)
enable_testing()
if(VERSION VERSION_GREATER 3.10)
gtest_discover_tests(argParser_Test tests)
else()
add_test(argParser_Test argParser_Test)
endif()
else ()
message(WARNING "to enable self test install gtest")
endif ()
ADD_LIBRARY(CPPArgvParsLib STATIC ${src})
#ADD_LIBRARY(CPPArgvParsTestLib STATIC ${tests_src} ${src})