1 ###########################################################################
5 # Copyright (c) German Cancer Research Center,
6 # Division of Medical and Biological Informatics
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
12 # http://www.apache.org/licenses/LICENSE-2.0
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.
20 ###########################################################################
22 #! Write a set of variables containing CTK plugin specific include and library directories
24 function(ctkFunctionGeneratePluginUseFile filename)
25 set(CTK_PLUGIN_INCLUDE_DIRS_CONFIG)
27 foreach(plugin ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
28 set(${plugin}_INCLUDE_DIRS )
30 # The call to ctkFunctionGetIncludeDirs returns all include dirs
31 # the plugin itself needs. This does not include the plugin's
32 # source dir, so we add it explicitly.
33 if(${plugin}_INCLUDE_SUFFIXES)
34 foreach(_suffix ${${plugin}_INCLUDE_SUFFIXES})
35 list(APPEND ${plugin}_INCLUDE_DIRS ${${plugin}_SOURCE_DIR}/${_suffix})
38 list(APPEND ${plugin}_INCLUDE_DIRS ${${plugin}_SOURCE_DIR})
41 list(APPEND ${plugin}_INCLUDE_DIRS ${${plugin}_BINARY_DIR})
43 ctkFunctionGetIncludeDirs(${plugin}_INCLUDE_DIRS ${plugin})
45 set(CTK_PLUGIN_INCLUDE_DIRS_CONFIG "${CTK_PLUGIN_INCLUDE_DIRS_CONFIG}
46 set(${plugin}_INCLUDE_DIRS \"${${plugin}_INCLUDE_DIRS}\")")
48 ctkFunctionGetLibraryDirs(${plugin}_LIBRARY_DIRS ${plugin})
49 set(CTK_PLUGIN_LIBRARY_DIRS_CONFIG "${CTK_PLUGIN_LIBRARY_DIRS_CONFIG}
50 set(${plugin}_LIBRARY_DIRS \"${${plugin}_LIBRARY_DIRS}\")")
53 set(_ctk_plugin_libraries_variable ${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES)
54 set(_ctk_plugin_libraries ${${CMAKE_PROJECT_NAME}_PLUGIN_LIBRARIES})
56 configure_file("${CTK_CMAKE_DIR}/../CMake/CTKPluginUseFile.cmake.in" "${filename}" @ONLY)