Computer Assited Medical Intervention Tool Kit  version 4.0
CamiTKInitTest.h
Go to the documentation of this file.
1 #
38  parse_arguments(CAMITK_INIT_TEST
39  "" # possible lists
40  ""
41  ${ARGN}
42  )
43 
44  set(CAMITK_TEST_ID "0")
45  set(CAMITK_TEST_LIST "")
46 
47  # check for executable
48  if(NOT CAMITK_INIT_TEST_DEFAULT_ARGS)
49  message(FATAL_ERROR "Initializing test ${CAMITK_TEST_BASENAME} cannot proceed: please specify the target in brackets")
50  else()
51  if(NOT TARGET ${CAMITK_INIT_TEST_DEFAULT_ARGS})
52  message(FATAL_ERROR "Initializing test ${CAMITK_TEST_BASENAME} cannot proceed: ${CAMITK_INIT_TEST_DEFAULT_ARGS} is not a proper target")
53  endif()
54 
55  # get the application real name using the target properties
56  get_target_property( APP_NAME ${CAMITK_INIT_TEST_DEFAULT_ARGS} OUTPUT_NAME )
57 
58  # add debug postfix if needed by MSVC
59  set( APP_SUFFIX "" )
60  if(MSVC)
61  get_target_property( APP_SUFFIX ${CAMITK_INIT_TEST_DEFAULT_ARGS} DEBUG_POSTFIX )
62  endif()
63  endif()
64 
65  # if there is an error, it might be that the macro is used with a non-camitk application, just use the default parameter as application name
66  if (APP_NAME STREQUAL "APP_NAME-NOTFOUND")
67  set(APP_NAME ${CAMITK_INIT_TEST_DEFAULT_ARGS})
68  # CAMITK_INIT_TEST_EXECUTABLE is not the application name but the full path to it
69  set(CAMITK_INIT_TEST_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/${APP_NAME}${APP_SUFFIX} )
70  else()
71  # CAMITK_INIT_TEST_EXECUTABLE is not the application name but the full path to the binary to be executed
72  set(CAMITK_INIT_TEST_EXECUTABLE ${CAMITK_BUILD_BIN_DIR}/${APP_NAME}${APP_SUFFIX} )
73  endif()
74 
75  set(CAMITK_TEST_BASENAME ${CAMITK_INIT_TEST_DEFAULT_ARGS})
76  # message(STATUS "Initializing test series for ${CAMITK_TEST_BASENAME}")
77 end(){)
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
parse_arguments()
macro parse_arguments is a fork from CMakeMacroParseArguments see http://www.cmake.org/Wiki/CMakeMacroParseArguments for more information
Definition: ParseArguments.h:13