1 #! Checks if all required modules and packages exist and stores missing
2 #! dependencies in <missing_deps>.
6 #! mitk_check_module_dependencies(
7 #! MODULES <module-list>
8 #! PACKAGES <package-list>
9 #! MISSING_DEPENDENCIES_VAR <missing_deps>
10 #! MODULE_DEPENDENCIES_VAR <module_deps>
11 #! PACKAGE_DEPENDENCIES_VAR <package_deps>)
16 MISSING_DEPENDENCIES_VAR # variable
for storing missing dependencies
17 MODULE_DEPENDENCIES_VAR # variable
for storing all module dependencies
18 PACKAGE_DEPENDENCIES_VAR # variable
for storing all package dependencies
21 set(_macro_multiparams
22 MODULES # MITK modules which the given
TARGET uses
23 PACKAGES # MITK packages which the given
TARGET uses
28 cmake_parse_arguments(CHECK "" "${_macro_params}
" "${_macro_multiparams}
" ${ARGN})
31 set(depends ${CHECK_MODULES})
32 set(package_depends ${CHECK_PACKAGES})
36 foreach(dep ${depends})
37 if(NOT dep STREQUAL "PUBLIC
" AND NOT dep STREQUAL "PRIVATE
" AND NOT dep STREQUAL "INTERFACE
")
39 list(APPEND missing_deps ${dep})
41 list(APPEND module_names ${dep})
47 _mitk_parse_package_args(${package_depends})
48 set(package_names ${PUBLIC_PACKAGE_NAMES} ${PRIVATE_PACKAGE_NAMES} ${INTERFACE_PACKAGE_NAMES})
49 list(REMOVE_DUPLICATES package_names)
50 foreach(_package ${package_names})
51 if((DEFINED MITK_USE_${_package}) AND NOT (${MITK_USE_${_package}}))
52 list(APPEND missing_deps ${_package})
58 list(REMOVE_DUPLICATES missing_deps)
59 if(CHECK_MISSING_DEPENDENCIES_VAR)
60 set(${CHECK_MISSING_DEPENDENCIES_VAR} ${missing_deps} PARENT_SCOPE)
63 if(CHECK_MODULE_DEPENDENCIES_VAR)
64 set(${CHECK_MODULE_DEPENDENCIES_VAR} ${module_names} PARENT_SCOPE)
66 if(CHECK_PACKAGE_DEPENDENCIES_VAR)
67 set(${CHECK_PACKAGE_DEPENDENCIES_VAR} ${package_names} PARENT_SCOPE)
mitk_check_module_dependencies()