2020-10-18 16:59:15 +00:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
2021-08-23 20:30:39 +00:00
|
|
|
project(template_test)
|
2014-08-06 19:46:28 +00:00
|
|
|
|
2021-08-23 20:30:39 +00:00
|
|
|
set(PROJECT_INCLUDE_DIR
|
2020-10-18 16:59:15 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/include
|
2014-08-06 19:46:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(TEST_SRCS
|
2020-10-18 16:59:15 +00:00
|
|
|
mustachetest.cpp
|
2014-08-06 19:46:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(mustachetest ${TEST_SRCS})
|
2021-08-23 20:30:39 +00:00
|
|
|
target_link_libraries(mustachetest Crow::Crow)
|
|
|
|
add_warnings_optimizations(mustachetest)
|
2021-04-14 11:03:27 +00:00
|
|
|
|
2021-08-23 20:30:39 +00:00
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
2021-04-14 11:03:27 +00:00
|
|
|
set_target_properties(mustachetest PROPERTIES COMPILE_FLAGS "--coverage -fprofile-arcs -ftest-coverage")
|
|
|
|
target_link_libraries(mustachetest gcov)
|
|
|
|
endif()
|
|
|
|
|
2020-10-18 16:59:15 +00:00
|
|
|
file(COPY DIRECTORY . DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILES_MATCHING PATTERN "*.json")
|
2014-08-06 19:46:28 +00:00
|
|
|
|
|
|
|
add_custom_command(OUTPUT test.py
|
2020-10-19 08:02:57 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E
|
|
|
|
copy ${PROJECT_SOURCE_DIR}/test.py ${CMAKE_CURRENT_BINARY_DIR}/test.py
|
|
|
|
DEPENDS ${PROJECT_SOURCE_DIR}/test.py
|
2020-10-18 16:59:15 +00:00
|
|
|
)
|
|
|
|
|
2014-08-06 19:46:28 +00:00
|
|
|
add_custom_target(template_test_copy ALL DEPENDS test.py)
|