50 set(oneValueArgs ACTION COMPONENT VIEWER CEP_LIBRARY APPLICATION CORELIB)
51 set(multiValueArgs DEPENDENCIES)
52 cmake_parse_arguments(ADD_SUB_PROJECT
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
55 # 1. get the subproject name and add it to the corresponding target list
59 if(ADD_SUB_PROJECT_CORELIB)
60 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_CORELIB})
64 if(ADD_SUB_PROJECT_CEP_LIBRARY)
65 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_CEP_LIBRARY})
66 # Add the project to the corresponding list
67 set(CAMITK_CEP_LIBRARY_TARGETS ${CAMITK_CEP_LIBRARY_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of library targets" FORCE)
71 if(ADD_SUB_PROJECT_COMPONENT)
72 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_COMPONENT})
73 # Add the project to the corresponding list
74 set(CAMITK_COMPONENT_TARGETS ${CAMITK_COMPONENT_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of component extension targets" FORCE)
78 if(ADD_SUB_PROJECT_ACTION)
79 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_ACTION})
80 # Add the project to the corresponding list
81 set(CAMITK_ACTION_TARGETS ${CAMITK_ACTION_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of action extension targets" FORCE)
85 if(ADD_SUB_PROJECT_VIEWER)
86 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_VIEWER})
87 # Add the project to the corresponding list
88 set(CAMITK_VIEWER_TARGETS ${CAMITK_VIEWER_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of viewer extension targets" FORCE)
92 if(ADD_SUB_PROJECT_APPLICATION)
93 set(SUB_PROJECT_NAME ${ADD_SUB_PROJECT_APPLICATION})
94 # Add the project to the corresponding list
95 set(CAMITK_APPLICATION_TARGETS ${CAMITK_APPLICATION_TARGETS} ${SUB_PROJECT_NAME} CACHE STRING
"List of application targets" FORCE)
99 # 2. Create the XML fragment (including name and dependency list
101 set(SUBPROJECT_XML_FRAGMENT
"<SubProject name=\"${SUB_PROJECT_NAME}\">")
102 if(SUB_PROJECT_NAME STREQUAL
"action-application")
103 # Particular case of action-applications: only depends on CamiTK core library
104 set(SUBPROJECT_XML_FRAGMENT ${SUBPROJECT_XML_FRAGMENT}
"<Dependency name=\"library-camitkcore\"/>")
106 # concatenate all dependencies
107 foreach(DEPENDENCY ${ADD_SUB_PROJECT_DEPENDENCIES})
108 set(SUBPROJECT_XML_FRAGMENT ${SUBPROJECT_XML_FRAGMENT}
"<Dependency name=\"${DEPENDENCY}\"/>")
111 set(SUBPROJECT_XML_FRAGMENT ${SUBPROJECT_XML_FRAGMENT}
"</SubProject>")
114 # 3. add the project to the list of the CEP/CEP
set subprojects
116 set(CAMITK_TARGETS ${CAMITK_TARGETS} ${SUB_PROJECT_NAME} CACHE INTERNAL
"")
119 # 4. add the xml fragment
for the corresponding subproject XML fragment
123 if(ADD_SUB_PROJECT_CORELIB)
124 set(CAMITK_CORE_LIBRARY_SUBPROJECTS ${CAMITK_CORE_LIBRARY_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of Core library subprojects")
128 if(ADD_SUB_PROJECT_CEP_LIBRARY)
129 set(CAMITK_CEP_LIBRARY_SUBPROJECTS ${CAMITK_CEP_LIBRARY_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of library subprojects")
133 if(ADD_SUB_PROJECT_COMPONENT)
134 set(CAMITK_COMPONENT_SUBPROJECTS ${CAMITK_COMPONENT_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of component extension subprojects")
138 if(ADD_SUB_PROJECT_ACTION)
139 # Particular case of action-applications
140 if(SUB_PROJECT_NAME STREQUAL
"action-application")
141 set(CAMITK_APPLICATION_ACTION_SUBPROJECTS ${CAMITK_APPLICATION_ACTION_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of application action extension subprojects")
143 set(CAMITK_ACTION_SUBPROJECTS ${CAMITK_ACTION_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of action extension subprojects")
148 if(ADD_SUB_PROJECT_VIEWER)
149 set(CAMITK_VIEWER_SUBPROJECTS ${CAMITK_VIEWER_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of viewer extension subprojects")
153 if(ADD_SUB_PROJECT_APPLICATION)
154 # Add the xml fragment for the current subproject
155 set(CAMITK_APPLICATION_SUBPROJECTS ${CAMITK_APPLICATION_SUBPROJECTS} ${SUBPROJECT_XML_FRAGMENT} CACHE INTERNAL
"XML description of application subprojects")
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition: CamiTKIncludeWhatYouUse.h:37
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
camitk_register_subproject()
macro camitk_register_subproject adds a subproject definition for the CDash report
Definition: CamiTKAddSubProject.h:47