Commit 6066655c authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED more cmake_parse_arguments

Does not seem to speed up the config time though
parent c9437c8f
......@@ -2,11 +2,10 @@
macro(pml_tool)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} PMLTOOL_NAME)
parse_arguments(${PMLTOOL_NAME_CMAKE}
"" # possible lists
"NEEDS_LML" # possible options
${ARGN}
)
set(options NEEDS_LML)
set(oneValueArgs "")
set(multiValueArgs "")
cmake_parse_arguments(${PMLTOOL_NAME_CMAKE} "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# if this extension is enabled, do everything needed
# otherwise... do nothing
......@@ -64,4 +63,4 @@ message(STATUS "Building pml tools: ${PML_TOOLS}")
# using the FOREACH statement allows the case where tools_SUBDIRS is empty!
foreach(PMLTOOL_NAME ${PMLTOOLS_LIST})
add_subdirectory(${PMLTOOL_NAME})
endforeach()
\ No newline at end of file
endforeach()
......@@ -39,11 +39,11 @@
#! \endcode
macro(export_headers)
parse_arguments(EXPORT_HEADER
"COMPONENT;SUBDIRECTORY;GROUP;" # possible lists
"" # no possible options
${ARGN}
)
set(options "")
set(oneValueArgs COMPONENT SUBDIRECTORY GROUP)
set(multiValueArgs "")
cmake_parse_arguments(EXPORT_HEADER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# special case for components: remove prefix for the destination directory
string(REGEX REPLACE "^component-|^component_|^action-|^action_|^library_|^library-" "" EXPORT_HEADER_DESTINATION ${EXPORT_HEADER_COMPONENT})
......
......@@ -68,11 +68,10 @@ macro(camitk_application)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} APPLICATION_NAME)
parse_arguments(${APPLICATION_NAME_CMAKE}
"NEEDS_CEP_LIBRARIES;NEEDS_TOOL;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;DEFINES;CXX_FLAGS;ADDITIONAL_SOURCES;CEP_NAME;DESCRIPTION;EXTERNAL_LIBRARIES;INCLUDE_DIRECTORIES;EXTRA_TRANSLATE_LANGUAGE" # possible lists
"DISABLED;NEEDS_ITK;NEEDS_XSD;NEEDS_XERCESC;NEEDS_PYTHON" # possible options
${ARGN}
)
set(options DISABLED NEEDS_ITK NEEDS_XSD NEEDS_XERCESC NEEDS_PYTHON)
set(oneValueArgs "")
set(multiValueArgs NEEDS_CEP_LIBRARIES NEEDS_TOOL NEEDS_COMPONENT_EXTENSION NEEDS_ACTION_EXTENSION DEFINES CXX_FLAGS ADDITIONAL_SOURCES CEP_NAME DESCRIPTION EXTERNAL_LIBRARIES INCLUDE_DIRECTORIES EXTRA_TRANSLATE_LANGUAGE)
cmake_parse_arguments(${APPLICATION_NAME_CMAKE} "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
......
......@@ -29,11 +29,10 @@ macro(camitk_extension_project)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} CEP_DIR_NAME)
parse_arguments(${CEP_DIR_NAME}_CMAKE
"NEEDS_CEP;DEFAULT_APPLICATION;DESCRIPTION;CONTACT;NAME;LICENSE" # possible lists
"ENABLED" # possible options
${ARGN}
)
set(options ENABLED)
set(oneValueArgs DEFAULT_APPLICATION DESCRIPTION CONTACT NAME LICENSE)
set(multiValueArgs NEEDS_CEP)
cmake_parse_arguments(${CEP_DIR_NAME}_CMAKE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# get the proper name
if(NOT DEFINED ${CEP_DIR_NAME}_CMAKE_NAME)
......@@ -150,4 +149,4 @@ macro(camitk_extension_project)
endif()
endmacro()
\ No newline at end of file
endmacro()
......@@ -41,12 +41,11 @@
#! \endcode
macro(camitk_install_all_headers)
parse_arguments(CAMITK_INSTALL_ALL_HEADERS
"COMPONENT;GROUP;" # possible lists
"" # no possible options
${ARGN}
)
set(options "")
set(oneValueArgs COMPONENT GROUP)
set(multiValueArgs "")
cmake_parse_arguments(CAMITK_INSTALL_ALL_HEADERS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# The base include directories
set(CAMITK_INSTALL_ALL_HEADERS_BUILD_BASE_DIR ${CMAKE_BINARY_DIR}/include/${CAMITK_SHORT_VERSION_STRING})
set(CAMITK_INSTALL_ALL_HEADERS_INSTALL_RELATIVE_DIR include/${CAMITK_SHORT_VERSION_STRING})
......
......@@ -31,7 +31,7 @@
#! [HEADERS_TO_INSTALL]
#! [CEP_NAME]
#! [DESCRIPTION]
#! [EXTRA_TRANSLATE_LANGUAGE]
#! [EXTRA_TRANSLATE_LANGUAGE lang1 lang2...]
#! [CXX_FLAGS flag1 flag2 ...]
#!
#! )
......@@ -61,7 +61,7 @@
#! No CEP_NAME provided will result in default categorization (generic extension).
#! \param DESCRIPTION Simple description of the extension. Used for packaging presentation for instance.
#! \param EXTRA_TRANSLATE_LANGUAGE Additionnal extra language to translate the application
#! \param CXX_FLAGS = list of compiler flags to add (such as warning levels (-Wall ...)).
#! \param CXX_FLAGS list of compiler flags to add (such as warning levels (-Wall ...)).
macro(camitk_library)
......@@ -76,22 +76,21 @@ macro(camitk_library)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} DEFAULT_LIBRARY_NAME)
parse_arguments(${DEFAULT_LIBRARY_NAME_CMAKE}
"SOURCES;NEEDS_CEP_LIBRARIES;EXTERNAL_LIBRARIES;INCLUDE_DIRECTORIES;LIBNAME;DEFINES;LINK_DIRECTORIES;HEADERS_TO_INSTALL;CEP_NAME;DESCRIPTION;EXTRA_TRANSLATE_LANGUAGE;CXX_FLAGS" # possible lists
"SHARED;STATIC;NEEDS_CAMITKCORE;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XERCESC;NEEDS_XSD;NEEDS_QT;PUBLIC" # possible options
${ARGN}
)
set(options SHARED STATIC NEEDS_CAMITKCORE NEEDS_ITK NEEDS_LIBXML2 NEEDS_XERCESC NEEDS_XSD NEEDS_QT PUBLIC)
set(oneValueArgs LIBNAME CEP_NAME DESCRIPTION)
set(multiValueArgs SOURCES NEEDS_CEP_LIBRARIES EXTERNAL_LIBRARIES INCLUDE_DIRECTORIES DEFINES LINK_DIRECTORIES HEADERS_TO_INSTALL EXTRA_TRANSLATE_LANGUAGE CXX_FLAGS)
cmake_parse_arguments(${DEFAULT_LIBRARY_NAME_CMAKE} "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
#########################################################################
#########################################################################
# #
# Consider moc sources files #
# #
# * if you use Q_OBJECT in your classes #
# #
#########################################################################
file(GLOB_RECURSE MOC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/moc_*.cxx)
set(${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES} ${MOC_SRCS})
file(GLOB_RECURSE MOC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/moc_*.cxx)
set(${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES} ${MOC_SRCS})
#########################################################################
......
......@@ -6,7 +6,7 @@
#! usage:
#! \code
#! camitk_translate(
#! [EXTRA_LANGUAGE]
#! [EXTRA_LANGUAGE lang1 lang2...]
#! [USE_FLAGS]
#! )
#! \endcode
......
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