Commit c9437c8f authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED remplace old macro by inbuilt command cmake_parse_arguments

(aka a tentative to accelerate config performance)
parent 3c72ddab
......@@ -105,22 +105,12 @@ macro(camitk_extension)
#########################################################################
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} EXTENSION_NAME)
parse_arguments(${EXTENSION_NAME_CMAKE} #prefix
"NEEDS_TOOL;NEEDS_CEP_LIBRARIES;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;INCLUDE_DIRECTORIES;EXTERNAL_LIBRARIES;HEADERS_TO_INSTALL;DEFINES;CXX_FLAGS;EXTERNAL_SOURCES;TARGET_NAME;CEP_NAME;DESCRIPTION;EXTRA_TRANSLATE_LANGUAGE;TEST_FILES;AUTO_TEST_LEVEL" # possible lists
"ACTION_EXTENSION;COMPONENT_EXTENSION;DISABLED;NEEDS_XERCESC;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XSD;NEEDS_OPENCV;NEEDS_IGSTK;INSTALL_ALL_HEADERS;NEEDS_GDCM;AUTO_TEST;" # possible options
${ARGN}
)
#
# set(options ACTION_EXTENSION COMPONENT_EXTENSION DISABLED NEEDS_XERCESC NEEDS_ITK NEEDS_LIBXML2 NEEDS_XSD NEEDS_OPENCV NEEDS_IGSTK INSTALL_ALL_HEADERS NEEDS_GDCM AUTO_TEST)
# set(oneValueArgs TARGET_NAME CEP_NAME DESCRIPTION AUTO_TEST_LEVEL)
# set(multiValueArgs NEEDS_TOOL NEEDS_CEP_LIBRARIES NEEDS_COMPONENT_EXTENSION NEEDS_ACTION_EXTENSION INCLUDE_DIRECTORIES EXTERNAL_LIBRARIES HEADERS_TO_INSTALL DEFINES CXX_FLAGS EXTERNAL_SOURCES EXTRA_TRANSLATE_LANGUAGE TEST_FILES)
# cmake_parse_arguments(EXTENSION_NAME_CMAKE "${options}" "${oneValueArgs}"
# "${multiValueArgs}" ${ARGN} )
set(options ACTION_EXTENSION COMPONENT_EXTENSION DISABLED NEEDS_XERCESC NEEDS_ITK NEEDS_LIBXML2 NEEDS_XSD NEEDS_OPENCV NEEDS_IGSTK INSTALL_ALL_HEADERS NEEDS_GDCM AUTO_TEST)
set(oneValueArgs TARGET_NAME CEP_NAME DESCRIPTION AUTO_TEST_LEVEL)
set(multiValueArgs NEEDS_TOOL NEEDS_CEP_LIBRARIES NEEDS_COMPONENT_EXTENSION NEEDS_ACTION_EXTENSION INCLUDE_DIRECTORIES EXTERNAL_LIBRARIES HEADERS_TO_INSTALL DEFINES CXX_FLAGS EXTERNAL_SOURCES EXTRA_TRANSLATE_LANGUAGE TEST_FILES)
cmake_parse_arguments(${EXTENSION_NAME_CMAKE} "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )
#########################################################################
# #
......
......@@ -49,17 +49,14 @@
#
#! @sa camitk_init_test
macro(camitk_add_test)
parse_arguments(CAMITK_ADD_TEST
"EXECUTABLE_ARGS;PASS_FILE;PASS_REGULAR_EXPRESSION;FAIL_REGULAR_EXPRESSION;PASS_FILE_OUTPUT;TEST_SUFFIX;PROJECT_NAME;" # possible lists #PASS_FILE -> compare the std output to a ref file # PASS_FILE_OUTPUT -> compare two files given as parameters
"" # possible options
${ARGN}
)
#set(options "")
set(oneValueArgs EXECUTABLE_ARGS PASS_FILE PASS_REGULAR_EXPRESSION FAIL_REGULAR_EXPRESSION PASS_FILE_OUTPUT TEST_SUFFIX PROJECT_NAME)
#set(multiValueArgs "")
cmake_parse_arguments(CAMITK_ADD_TEST "" "${oneValueArgs}" "" ${ARGN} )
math(EXPR CAMITK_TEST_ID "${CAMITK_TEST_ID} + 1")
set(CAMITK_TEST_NAME "${CAMITK_ADD_TEST_PROJECT_NAME}${CAMITK_ADD_TEST_TEST_SUFFIX}${CAMITK_TEST_ID}")
set(CAMITK_TEST_LIST ${CAMITK_TEST_LIST} ${CAMITK_TEST_NAME})
# message(STATUS "Configuring test ${CAMITK_TEST_NAME}")
# determine cmake macro path
if (NOT EXISTS SDK_TOP_LEVEL_SOURCE_DIR)
......@@ -76,7 +73,6 @@ macro(camitk_add_test)
# create test output directory
set(CAMITK_TEST_OUTPUT_DIR "${CMAKE_BINARY_DIR}/Testing/Temporary/${CAMITK_TEST_NAME}")
# message(STATUS "Creating test output dir ${CAMITK_TEST_OUTPUT_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CAMITK_TEST_OUTPUT_DIR})
# check which test is to be done
......@@ -130,10 +126,10 @@ macro(camitk_add_test)
endif()
# set the label for tests
if( CAMITK_ADD_TEST_PROJECT_NAME )
if( CAMITK_ADD_TEST_PROJECT_NAME )
set_tests_properties( ${CAMITK_TEST_NAME} PROPERTIES LABELS ${CAMITK_ADD_TEST_PROJECT_NAME} )#associate tests to a project name in CDash
else()
set_tests_properties( ${CAMITK_TEST_NAME} PROPERTIES LABELS ${CAMITK_TEST_BASENAME} )
endif()
else()
set_tests_properties( ${CAMITK_TEST_NAME} PROPERTIES LABELS ${CAMITK_TEST_BASENAME} )
endif()
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