Fixed cram target not being run on cmake 2.8.x

This commit is contained in:
Snaipe 2016-01-16 15:34:32 +01:00
parent 7faaa7656f
commit 02194aa132

View file

@ -34,16 +34,18 @@ set_property(TEST criterion_unit_tests PROPERTY
) )
if (NOT MSVC) # we disable the scripted tests when building with MSVC if (NOT MSVC) # we disable the scripted tests when building with MSVC
add_custom_target(cram_tests)
add_custom_target(cram_tests ${CMAKE_COMMAND} -E env set(CMD "")
"PATH=$ENV{PATH}:${PROJECT_BINARY_DIR}/samples:${PROJECT_BINARY_DIR}/samples/tests" set(CMD "${CMD}PATH=$ENV{PATH}:${PROJECT_BINARY_DIR}/samples:${PROJECT_BINARY_DIR}/samples/tests ")
"LC_ALL=en_US.utf8" set(CMD "${CMD}LC_ALL=en_US.utf8 ")
"CRITERION_ALWAYS_SUCCEED=1" set(CMD "${CMD}CRITERION_ALWAYS_SUCCEED=1 ")
"CRITERION_SHORT_FILENAME=1" set(CMD "${CMD}CRITERION_SHORT_FILENAME=1 ")
"CRITERION_NO_EARLY_EXIT=1" # for coverage set(CMD "${CMD}CRITERION_NO_EARLY_EXIT=1 ")
"CRITERION_JOBS=1" # for output ordering set(CMD "${CMD}CRITERION_JOBS=1 ")
"CRITERION_DISABLE_TIME_MEASUREMENTS=1" # do not compare timings set(CMD "${CMD}CRITERION_DISABLE_TIME_MEASUREMENTS=1 ")
cram -v ${CMAKE_CURRENT_SOURCE_DIR}/cram) set(CMD "${CMD}cram -v ${CMAKE_CURRENT_SOURCE_DIR}/cram")
add_custom_command(TARGET cram_tests POST_BUILD COMMAND sh -c "${CMD}")
add_dependencies(cram_tests criterion_samples) add_dependencies(cram_tests criterion_samples)
add_test(cram_tests make cram_tests) add_test(cram_tests make cram_tests)