38 set(TEST_APPLICATION_ARG ${ARGN})
40 set(CAMITK_TEST_ID
"0")
41 set(CAMITK_TEST_LIST
"")
43 # check for executable
44 if(NOT TEST_APPLICATION_ARG)
45 message(FATAL_ERROR
"Initializing test cannot proceed: please specify the test application to use in brackets")
47 if(TARGET ${TEST_APPLICATION_ARG})
48 # get the application real name
using the target properties
49 get_target_property( APP_NAME ${TEST_APPLICATION_ARG} OUTPUT_NAME)
51 # add debug postfix
if needed by MSVC
54 get_target_property(APP_SUFFIX ${TEST_APPLICATION_ARG} DEBUG_POSTFIX)
57 # CAMITK_INIT_TEST_EXECUTABLE is not the application name but the full path to the binary to be executed
58 set(CAMITK_INIT_TEST_EXECUTABLE ${CMAKE_BINARY_DIR}/bin/${APP_NAME}${APP_SUFFIX})
60 # This is not an application of the current CEP
61 # In this case: the application name should be given as the default parameter
62 set(APP_NAME ${TEST_APPLICATION_ARG})
64 if(NOT CAMITK_COMMUNITY_EDITION_BUILD)
65 # this macro is called outside CamiTK CE
67 # find the complete path to the test programs (removing any previous attempt to find a test application
68 # as this could be another application)
69 unset(CAMITK_INIT_TEST_EXECUTABLE CACHE)
70 find_program(CAMITK_INIT_TEST_EXECUTABLE
71 NAMES ${APP_NAME}${CAMITK_DEBUG_POSTFIX} ${APP_NAME}
73 PATHS ${CAMITK_BIN_DIR}
76 if (NOT CAMITK_INIT_TEST_EXECUTABLE)
77 # Test programs should be installed
78 message(FATAL_ERROR
"${APP_NAME} not found.\n This means that automatic test applications were not installed during CamiTK SDK installation.")
83 # add debug postfix if needed by MSVC
85 # determine which version of the executable to use (debug-suffixed or not)
87 if(NOT CMAKE_BUILD_TYPE)
88 # Assume the developer that is running the test suite compiled everything in Debug
89 set(APP_SUFFIX ${CAMITK_DEBUG_POSTFIX})
91 # support multiplaform (sometimes the "Debug" type is all uppercase, as on Win32, sometimes it is CamelCase)
92 string(TOUPPER ${CMAKE_BUILD_TYPE} CAMITK_BUILD_TYPE_UPPER)
93 if (CAMITK_BUILD_TYPE_UPPER STREQUAL
"DEBUG")
94 # manage debug build only
95 set(APP_SUFFIX ${CAMITK_DEBUG_POSTFIX})
97 # if build type is not debug, everything is ok as
101 # In CamiTK CE build directly use the binary dir version
102 set(CAMITK_INIT_TEST_EXECUTABLE ${CMAKE_BINARY_DIR}/bin/${APP_NAME}${APP_SUFFIX})
107 set(CAMITK_TEST_BASENAME ${TEST_APPLICATION_ARG})
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition: CamiTKIncludeWhatYouUse.h:37
iwyu out CACHE PATH Output filename for include what you use set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXECUTABLE}) if(NOT EXISTS $
Definition: CamiTKIncludeWhatYouUse.h:22
test result unset(PREVIOUS_ATTEMPTS) file(GLOB ALL_OUTPUT_FILES $
Definition: CamiTKTestActionStateMachine.h:16
camitk_init_test()
camitk_init_test is a macro to initialize a group of test (for the same command) It is used to initia...
Definition: CamiTKInitTest.h:37