libcron/test/CMakeLists.txt

38 lines
1.1 KiB
CMake
Raw Normal View History

2018-03-09 06:21:26 +08:00
cmake_minimum_required(VERSION 3.6)
project(cron_test)
set(CMAKE_CXX_STANDARD 17)
2018-03-23 05:38:55 +08:00
# Deactivate Iterator-Debugging on Windows
option(LIBCRON_DEACTIVATE_ITERATOR_DEBUGGING "Build with iterator-debugging (MSVC only)." OFF)
2018-03-23 05:38:55 +08:00
if( MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
if (LIBCRON_DEACTIVATE_ITERATOR_DEBUGGING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_HAS_ITERATOR_DEBUGGING=0")
endif()
2018-03-23 05:38:55 +08:00
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()
2018-03-09 06:21:26 +08:00
include_directories(
2018-03-12 03:24:55 +08:00
${CMAKE_CURRENT_LIST_DIR}/externals/Catch2/single_include/
${CMAKE_CURRENT_LIST_DIR}/../libcron/externals/date/include
${CMAKE_CURRENT_LIST_DIR}/..
2018-03-09 06:21:26 +08:00
)
add_executable(
${PROJECT_NAME}
2018-03-11 06:42:00 +08:00
CronDataTest.cpp
2019-03-15 00:09:25 +08:00
CronRandomizationTest.cpp
CronScheduleTest.cpp
CronTest.cpp)
2018-03-09 06:21:26 +08:00
2018-03-13 07:46:03 +08:00
target_link_libraries(${PROJECT_NAME} libcron)
set_target_properties(${PROJECT_NAME} PROPERTIES
2019-03-15 00:09:25 +08:00
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/out"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/out"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/out")