CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkFunctionGetAllPluginTargets.cmake
Go to the documentation of this file.
1#!
2#! Stores all known plug-in targets (potentially also from external projects)
3#! in the variable specified by the first argument.
4#!
5#! \param var_targets A variable name containing the output.
6#! \ingroup CMakeUtilities
7function(ctkFunctionGetAllPluginTargets var_targets)
8
9 if(NOT var_targets)
10 message(FATAL_ERROR "Missing variable name in argument list")
11 endif()
12
13 set(plugin_targets )
14 get_property(CTK_PLUGIN_LIBRARIES_VARS GLOBAL PROPERTY CTK_PLUGIN_LIBRARIES_VARS)
15 if(CTK_PLUGIN_LIBRARIES_VARS)
16 list(REMOVE_DUPLICATES CTK_PLUGIN_LIBRARIES_VARS)
17 foreach(_var ${CTK_PLUGIN_LIBRARIES_VARS})
18 if(${_var})
19 list(APPEND plugin_targets ${${_var}})
20 endif()
21 endforeach()
22 endif()
23
24 set(${var_targets} ${plugin_targets} PARENT_SCOPE)
25
26endfunction()