xlnt/cmake/xlnt.test.cmake

33 lines
988 B
CMake
Raw Normal View History

2015-11-02 01:31:29 +08:00
project(xlnt.test)
include_directories(../include)
include_directories(../source)
include_directories(../third-party/pugixml/src)
include_directories(../third-party/cxxtest)
2015-11-02 12:52:19 +08:00
FILE(GLOB TEST_HEADERS ../tests/*.hpp)
FILE(GLOB TEST_HELPERS_HEADERS ../tests/helpers/*.hpp)
FILE(GLOB TEST_HELPERS_SOURCES ../tests/helpers/*.cpp)
add_executable(xlnt.test ../tests/runner-autogen.cpp ${TEST_HEADERS} ${TEST_HELPERS_HEADERS} ${TEST_HELPERS_SOURCES})
source_group(runner FILES ../tests/runner-autogen.cpp)
source_group(tests FILES ${TEST_HEADERS})
source_group(helpers FILES ${TEST_HELPERS_HEADERS} ${TEST_HELPERS_SOURCES})
2015-11-02 01:31:29 +08:00
target_link_libraries(xlnt.test xlnt)
2015-11-02 12:52:19 +08:00
add_custom_target (generate-test-runner
2015-11-03 03:22:13 +08:00
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generate-tests
2015-11-02 01:31:29 +08:00
COMMENT "Generating test runner tests/runner-autogen.cpp"
)
2015-11-02 12:52:19 +08:00
add_dependencies(xlnt.test generate-test-runner)
2015-11-02 01:31:29 +08:00
add_custom_command(
2015-11-02 12:52:19 +08:00
TARGET xlnt.test
POST_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../bin/xlnt.test
VERBATIM
2015-11-02 01:31:29 +08:00
)