cppcheck/test/CMakeLists.txt

27 lines
944 B
CMake
Raw Normal View History

2015-02-13 19:00:14 +01:00
if (BUILD_TESTS)
include_directories(${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/cli/)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml)
include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/)
2015-02-13 19:00:14 +01:00
file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp")
add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if (HAVE_RULES)
target_link_libraries(testrunner pcre)
endif()
2015-02-13 19:00:14 +01:00
add_custom_target(copy_cfg ALL
COMMENT "Copying cfg files")
add_custom_command(
TARGET copy_cfg
COMMAND ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/cfg"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cfg")
add_dependencies(testrunner copy_cfg)
2015-11-26 21:01:07 +01:00
add_test(NAME testrunner COMMAND testrunner WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
2015-02-13 19:00:14 +01:00
endif()