46 set(oneValueArgs REASON)
47 set(multiValueArgs TESTS)
48 cmake_parse_arguments(CAMITK_DISABLE_TESTS
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
50 foreach(TEST_NAME ${CAMITK_DISABLE_TESTS_TESTS})
51 # CMake < 3.9 did not have the DISABLED test property. Use WILL_FAIL instead
52 if(${CMAKE_VERSION} VERSION_LESS
"3.9")
53 set_tests_properties(${TEST_NAME} PROPERTIES WILL_FAIL
true)
55 set_tests_properties(${TEST_NAME} PROPERTIES DISABLED
true)
59 # message to the developper
60 string(REPLACE
"" " " CAMITK_DISABLE_TESTS_TESTS_STRING
"${CAMITK_DISABLE_TESTS_TESTS}")
61 set(DISABLE_MESSAGE
"Unconditionally disabling tests:\n Disabled tests: ${CAMITK_DISABLE_TESTS_TESTS_STRING}\n")
62 if(${CMAKE_VERSION} VERSION_LESS
"3.9")
63 set(DISABLE_MESSAGE ${DISABLE_MESSAGE}
" (using WILL_FAIL property because CMake < 3.9)\n")
65 set(DISABLE_MESSAGE ${DISABLE_MESSAGE}
" Reason: ${CAMITK_DISABLE_TESTS_REASON}")
66 message(STATUS ${DISABLE_MESSAGE})