ctkFunctionGetAllPluginTargets.cmake 792 B

123456789101112131415161718192021222324252627
  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
  7. function(ctkFunctionGetAllPluginTargets var_targets)
  8. if(NOT var_targets)
  9. message(FATAL_ERROR "Missing variable name in argument list")
  10. endif()
  11. set(plugin_targets )
  12. get_property(CTK_PLUGIN_LIBRARIES_VARS GLOBAL PROPERTY CTK_PLUGIN_LIBRARIES_VARS)
  13. if(CTK_PLUGIN_LIBRARIES_VARS)
  14. list(REMOVE_DUPLICATES CTK_PLUGIN_LIBRARIES_VARS)
  15. foreach(_var ${CTK_PLUGIN_LIBRARIES_VARS})
  16. if(${_var})
  17. list(APPEND plugin_targets ${${_var}})
  18. endif()
  19. endforeach()
  20. endif()
  21. set(${var_targets} ${plugin_targets} PARENT_SCOPE)
  22. endfunction()