Commit 5b92e4cc authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED forgot extra arguments + more cmake-ization

parent 6066655c
......@@ -92,7 +92,7 @@ macro(export_headers)
# at build time, copy the files to build directory include files when the target is built
foreach(HEADER ${EXPORT_HEADER_DEFAULT_ARGS})
foreach(HEADER ${EXPORT_HEADER_UNPARSED_ARGUMENTS})
# check if file name is relative or not
set(FILE_TO_COPY ${HEADER})
......@@ -107,7 +107,7 @@ macro(export_headers)
endforeach()
# during installation, copy the files to install directory
install(FILES ${EXPORT_HEADER_DEFAULT_ARGS}
install(FILES ${EXPORT_HEADER_UNPARSED_ARGUMENTS}
# DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${CAMITK_SHORT_VERSION_STRING}/${EXPORT_HEADER_DESTINATION}/
DESTINATION include/${CAMITK_SHORT_VERSION_STRING}/${EXPORT_HEADER_DESTINATION}/
COMPONENT ${EXPORT_HEADER_COMPONENT}
......
......@@ -35,27 +35,23 @@
#
#! @sa camitk_add_test
macro(camitk_init_test)
parse_arguments(CAMITK_INIT_TEST
"" # possible lists
""
${ARGN}
)
set(TEST_APPLICATION_ARG ${ARGN})
set(CAMITK_TEST_ID "0")
set(CAMITK_TEST_LIST "")
# check for executable
if(NOT CAMITK_INIT_TEST_DEFAULT_ARGS)
message(FATAL_ERROR "Initializing test ${CAMITK_TEST_BASENAME} cannot proceed: please specify the target in brackets")
if(NOT TEST_APPLICATION_ARG)
message(FATAL_ERROR "Initializing test cannot proceed: please specify the test application to use in brackets")
else()
if(TARGET ${CAMITK_INIT_TEST_DEFAULT_ARGS})
if(TARGET ${TEST_APPLICATION_ARG})
# get the application real name using the target properties
get_target_property( APP_NAME ${CAMITK_INIT_TEST_DEFAULT_ARGS} OUTPUT_NAME )
get_target_property( APP_NAME ${TEST_APPLICATION_ARG} OUTPUT_NAME )
# add debug postfix if needed by MSVC
set( APP_SUFFIX "" )
if(MSVC)
get_target_property( APP_SUFFIX ${CAMITK_INIT_TEST_DEFAULT_ARGS} DEBUG_POSTFIX )
get_target_property( APP_SUFFIX ${TEST_APPLICATION_ARG} DEBUG_POSTFIX )
endif()
# CAMITK_INIT_TEST_EXECUTABLE is not the application name but the full path to the binary to be executed
......@@ -63,7 +59,7 @@ macro(camitk_init_test)
else()
# This is not an application of the current CEP)
# In this case: the application name should be given as the default parameter
set(APP_NAME ${CAMITK_INIT_TEST_DEFAULT_ARGS})
set(APP_NAME ${TEST_APPLICATION_ARG})
# find the complete path to the test programs
find_program(CAMITK_INIT_TEST_EXECUTABLE
......@@ -74,10 +70,10 @@ macro(camitk_init_test)
if (NOT CAMITK_INIT_TEST_EXECUTABLE)
# Test programs should be installed
message(FATAL_ERROR "${CAMITK_INIT_TEST_DEFAULT_ARGS} not found.\n This means that automatic test applications were not installed during CamiTK SDK installation.")
message(FATAL_ERROR "${TEST_APPLICATION_ARG} not found.\n This means that automatic test applications were not installed during CamiTK SDK installation.")
endif()
endif()
endif()
set(CAMITK_TEST_BASENAME ${CAMITK_INIT_TEST_DEFAULT_ARGS})
set(CAMITK_TEST_BASENAME ${TEST_APPLICATION_ARG})
endmacro()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment