48 set(oneValueArgs ACTION COMPONENT CEP_LIBRARY APPLICATION CORELIB)
49 set(multiValueArgs DEPENDENCIES)
50 cmake_parse_arguments(ADD_SUB_PROJECT
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
53 # 1.
get the subproject name and add it to the corresponding target list
57 if(ADD_SUB_PROJECT_CORELIB)
58 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_CORELIB})
62 if(ADD_SUB_PROJECT_CEP_LIBRARY)
63 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_CEP_LIBRARY})
64 # Add the project to the corresponding list
65 set(CAMITK_CEP_LIBRARY_TARGETS ${CAMITK_CEP_LIBRARY_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of library targets" FORCE)
69 if(ADD_SUB_PROJECT_COMPONENT)
70 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_COMPONENT})
71 # Add the project to the corresponding list
72 set(CAMITK_COMPONENT_TARGETS ${CAMITK_COMPONENT_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of component extension targets" FORCE)
76 if(ADD_SUB_PROJECT_ACTION)
77 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_ACTION})
78 # Add the project to the corresponding list
79 set(CAMITK_ACTION_TARGETS ${CAMITK_ACTION_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of action extension targets" FORCE)
83 if(ADD_SUB_PROJECT_APPLICATION)
84 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_APPLICATION})
85 # Add the project to the corresponding list
86 set(CAMITK_APPLICATION_TARGETS ${CAMITK_APPLICATION_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of application targets" FORCE)
90 # 2. Create the XML fragment (including name and dependency list 92 set(SUBPROJECT_XML_FRAGMENT
"\n <SubProject name=\"${SUB_PROJECT_NAME}\">")
93 if(SUB_PROJECT_NAME STREQUAL
"action-application")
94 # Particular case of action-applications: only depends on CamiTK core library 95 set(SUBPROJECT_XML_FRAGMENT ${SUBPROJECT_XML_FRAGMENT}
"<Dependency name=\"library-camitkcore\"/>")
97 # concatenate all dependencies 98 foreach(DEPENDENCY ${ADD_SUB_PROJECT_DEPENDENCIES})
99 set(SUBPROJECT_XML_FRAGMENT ${SUBPROJECT_XML_FRAGMENT}
"<Dependency name=\"${DEPENDENCY}\"/>")
102 set(SUBPROJECT_XML_FRAGMENT ${SUBPROJECT_XML_FRAGMENT}
"</SubProject>")
105 # 3. add the project to the list of the CEP/CEP
set subprojects
107 set(CAMITK_TARGETS ${CAMITK_TARGETS} ${SUB_PROJECT_NAME} CACHE INTERNAL
"")
110 # 4. add the xml fragment
for the corresponding subproject XML fragment
114 if(ADD_SUB_PROJECT_CORELIB)
115 set(CAMITK_CORE_LIBRARY_SUBPROJECTS ${CAMITK_CORE_LIBRARY_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of Core library subprojects")
119 if(ADD_SUB_PROJECT_CEP_LIBRARY)
120 set(CAMITK_CEP_LIBRARY_SUBPROJECTS ${CAMITK_CEP_LIBRARY_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of library subprojects")
124 if(ADD_SUB_PROJECT_COMPONENT)
125 set(CAMITK_COMPONENT_SUBPROJECTS ${CAMITK_COMPONENT_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of component extension subprojects")
129 if(ADD_SUB_PROJECT_ACTION)
130 # Particular case of action-applications 131 if(SUB_PROJECT_NAME STREQUAL
"action-application")
132 set(CAMITK_APPLICATION_ACTION_SUBPROJECTS ${CAMITK_APPLICATION_ACTION_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of application action extension subprojects")
134 set(CAMITK_ACTION_SUBPROJECTS ${CAMITK_ACTION_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of action extension subprojects")
139 if(ADD_SUB_PROJECT_APPLICATION)
140 # Add the xml fragment for the current subproject 141 set(CAMITK_APPLICATION_SUBPROJECTS ${CAMITK_APPLICATION_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of application subprojects")
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
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition: CamiTKIncludeWhatYouUse.h:37
camitk_register_subproject()
macro camitk_register_subproject adds a subproject definition for the CDash report ...
Definition: CamiTKAddSubProject.h:45