ctkFunctionGeneratePluginUseFile.cmake 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ###########################################################################
  2. #
  3. # Library: CTK
  4. #
  5. # Copyright (c) German Cancer Research Center,
  6. # Division of Medical and Biological Informatics
  7. #
  8. # Licensed under the Apache License, Version 2.0 (the "License");
  9. # you may not use this file except in compliance with the License.
  10. # You may obtain a copy of the License at
  11. #
  12. # http://www.apache.org/licenses/LICENSE-2.0
  13. #
  14. # Unless required by applicable law or agreed to in writing, software
  15. # distributed under the License is distributed on an "AS IS" BASIS,
  16. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. # See the License for the specific language governing permissions and
  18. # limitations under the License.
  19. #
  20. ###########################################################################
  21. #! Write a set of variables containing CTK plugin specific include and library directories
  22. #! \ingroup CMakeAPI
  23. FUNCTION(ctkFunctionGeneratePluginUseFile filename)
  24. IF(COMMAND GetMyTargetLibraries)
  25. GetMyTargetLibraries("${CTK_PLUGIN_LIBRARIES}" my_ctk_plugin_libraries)
  26. ELSE()
  27. SET(my_ctk_plugin_libraries ${CTK_PLUGIN_LIBRARIES})
  28. ENDIF()
  29. SET(CTK_PLUGIN_INCLUDE_DIRS_CONFIG)
  30. FOREACH(plugin ${my_ctk_plugin_libraries})
  31. SET(${plugin}_INCLUDE_DIRS ${${plugin}_SOURCE_DIR} ${${plugin}_BINARY_DIR})
  32. ctkFunctionGetIncludeDirs(${plugin}_INCLUDE_DIRS ${plugin})
  33. SET(CTK_PLUGIN_INCLUDE_DIRS_CONFIG "${CTK_PLUGIN_INCLUDE_DIRS_CONFIG}
  34. SET(${plugin}_INCLUDE_DIRS \"${${plugin}_INCLUDE_DIRS}\")")
  35. ctkFunctionGetLibraryDirs(${plugin}_LIBRARY_DIRS ${plugin})
  36. SET(CTK_PLUGIN_LIBRARY_DIRS_CONFIG "${CTK_PLUGIN_LIBRARY_DIRS_CONFIG}
  37. SET(${plugin}_LIBRARY_DIRS \"${${plugin}_LIBRARY_DIRS}\")")
  38. ENDFOREACH()
  39. CONFIGURE_FILE("${CTK_CMAKE_DIR}/../CTKPluginUseFile.cmake.in" "${filename}" @ONLY)
  40. ENDFUNCTION()