mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-27 00:28:49 +03:00
added option to turn check target off for unittest-cpp
This commit is contained in:
parent
36c424df17
commit
be87c5b36c
1 changed files with 19 additions and 17 deletions
|
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8.1)
|
|||
project(UnitTest++)
|
||||
|
||||
option(UTPP_USE_PLUS_SIGN "Set this to OFF is you with to use '-cpp' instead of '++' in lib/include paths" ON)
|
||||
option(UTPP_BUILD_TESTS "Build the unittest++ test programs" ON)
|
||||
|
||||
# get the main sources
|
||||
file(GLOB headers_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.h)
|
||||
|
|
@ -27,26 +28,27 @@ if(${UTPP_USE_PLUS_SIGN})
|
|||
set_target_properties(UnitTest++ PROPERTIES OUTPUT_NAME UnitTest++)
|
||||
endif()
|
||||
|
||||
IF (UTPP_BUILD_TESTS)
|
||||
# build the test runner
|
||||
file(GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tests/*.cpp tests/*.h)
|
||||
source_group( "" FILES ${TEST_SRCS})
|
||||
add_executable(TestUnitTest++ ${TEST_SRCS})
|
||||
include_directories(.)
|
||||
|
||||
# build the test runner
|
||||
file(GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tests/*.cpp tests/*.h)
|
||||
source_group( "" FILES ${TEST_SRCS})
|
||||
add_executable(TestUnitTest++ ${TEST_SRCS})
|
||||
include_directories(.)
|
||||
if(${UTPP_USE_PLUS_SIGN})
|
||||
set_target_properties(TestUnitTest++ PROPERTIES OUTPUT_NAME TestUnitTest++)
|
||||
endif()
|
||||
|
||||
if(${UTPP_USE_PLUS_SIGN})
|
||||
set_target_properties(TestUnitTest++ PROPERTIES OUTPUT_NAME TestUnitTest++)
|
||||
endif()
|
||||
target_link_libraries(TestUnitTest++ UnitTest++)
|
||||
|
||||
target_link_libraries(TestUnitTest++ UnitTest++)
|
||||
# turn on testing
|
||||
enable_testing()
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V)
|
||||
|
||||
# turn on testing
|
||||
enable_testing()
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V)
|
||||
|
||||
# add the test runner as a test
|
||||
add_test(NAME TestUnitTest++ COMMAND TestUnitTest++ ${CONFIG_PATH} ${CONFIG_TASKS_PATH} ${SOUND_LOG_PATH})
|
||||
add_dependencies(check TestUnitTest++)
|
||||
# add the test runner as a test
|
||||
add_test(NAME TestUnitTest++ COMMAND TestUnitTest++ ${CONFIG_PATH} ${CONFIG_TASKS_PATH} ${SOUND_LOG_PATH})
|
||||
add_dependencies(check TestUnitTest++)
|
||||
ENDIF()
|
||||
|
||||
|
||||
# add install targets
|
||||
|
|
@ -60,4 +62,4 @@ endif()
|
|||
|
||||
install(TARGETS UnitTest++ DESTINATION lib)
|
||||
install(FILES ${headers_} DESTINATION ${UTPP_INSTALL_DESTINATION})
|
||||
install(FILES ${platformHeaders_} DESTINATION ${UTPP_INSTALL_DESTINATION}/${platformDir_})
|
||||
install(FILES ${platformHeaders_} DESTINATION ${UTPP_INSTALL_DESTINATION}/${platformDir_})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue