ctkFunctionGeneratePluginUseFile.cmake 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. SET(CTK_PLUGIN_INCLUDE_DIRS_CONFIG)
  25. FOREACH(plugin ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
  26. SET(${plugin}_INCLUDE_DIRS )
  27. # The call to ctkFunctionGetIncludeDirs returns all include dirs
  28. # the plugin itself needs. This does not include the plugin's
  29. # source dir, so we add it explicitly.
  30. IF(${plugin}_INCLUDE_SUFFIXES)
  31. FOREACH(_suffix ${${plugin}_INCLUDE_SUFFIXES})
  32. LIST(APPEND ${plugin}_INCLUDE_DIRS ${${plugin}_SOURCE_DIR}/${_suffix})
  33. ENDFOREACH()
  34. ELSE()
  35. LIST(APPEND ${plugin}_INCLUDE_DIRS ${${plugin}_SOURCE_DIR})
  36. ENDIF()
  37. LIST(APPEND ${plugin}_INCLUDE_DIRS ${${plugin}_BINARY_DIR})
  38. ctkFunctionGetIncludeDirs(${plugin}_INCLUDE_DIRS ${plugin})
  39. SET(CTK_PLUGIN_INCLUDE_DIRS_CONFIG "${CTK_PLUGIN_INCLUDE_DIRS_CONFIG}
  40. set(${plugin}_INCLUDE_DIRS \"${${plugin}_INCLUDE_DIRS}\")")
  41. ctkFunctionGetLibraryDirs(${plugin}_LIBRARY_DIRS ${plugin})
  42. SET(CTK_PLUGIN_LIBRARY_DIRS_CONFIG "${CTK_PLUGIN_LIBRARY_DIRS_CONFIG}
  43. set(${plugin}_LIBRARY_DIRS \"${${plugin}_LIBRARY_DIRS}\")")
  44. ENDFOREACH()
  45. SET(_ctk_plugin_libraries_variable ${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES)
  46. SET(_ctk_plugin_libraries ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
  47. CONFIGURE_FILE("${CTK_CMAKE_DIR}/../CTKPluginUseFile.cmake.in" "${filename}" @ONLY)
  48. ENDFUNCTION()