Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkFunctionAddLibrarySearchPaths.cmake
Go to the documentation of this file.
1 #! Helper function that stores additional library search paths in order to use them
2 #! in the mitkFunctionGetLibrarySearchPaths function.
3 #!
4 #! Calling this function registers an external project with the MITK
5 #! build system. Usage:
6 #!
7 #! mitkFunctionAddLibrarySearchPaths(NAME name
8 #! PATHS path1 [path2 ...]
9 #! [DEBUG_PATHS path1 [path2 ...]]
10 #! [MINSIZEREL_PATHS path1 [path2 ...]]
11 #! [RELWITHDEBINFO_PATHS path1 [path2 ...]]
12 #! )
13 #!
14 #! The function adds the passed paths to a file stored in
15 #! ${MITK_SUPERBUILD_BINARY_DIR}/MITK-AdditionalLibPaths.
16 #! This information will be later on used by mitkFunctionGetLibrarySearchPaths.
17 #! This allows external projects (also of extensions) to define library search
18 #! paths that will be used in the superbuild. By using DEBUG_PATHS, MINSIZEREL_PATHS
19 #! and RELWITHDEBINFO_PATHS, you can save special paths for debug, min size release
20 #! or "release with debug info". If special paths are not explicitly specified,
21 #! PATHS will be used for all configuration.
22 #!
23 
25  cmake_parse_arguments(LSP "" "NAME" "PATHS;DEBUG_PATHS;MINSIZEREL_PATHS;RELWITHDEBINFO_PATHS" ${ARGN})
26 
27  if(NOT LSP_NAME)
28  message(SEND_ERROR "The NAME argument is missing.")
29  endif()
30 
31  if(NOT DEFINED LSP_DEBUG_PATHS)
32  set(LSP_DEBUG_PATHS ${LSP_PATHS})
33  endif()
34 
35  if(NOT DEFINED LSP_MINSIZEREL_PATHS)
36  set(LSP_MINSIZEREL_PATHS ${LSP_PATHS})
37  endif()
38 
39  if(NOT DEFINED LSP_RELWITHDEBINFO_PATHS)
40  set(LSP_RELWITHDEBINFO_PATHS ${LSP_PATHS})
41  endif()
42 
43  set(_configured_file ${MITK_SUPERBUILD_BINARY_DIR}/MITK-AdditionalLibPaths/${LSP_NAME}.cmake)
44  if(${CMAKE_PROJECT_NAME} STREQUAL "MITK-superbuild")
45  set(_configured_file ${MITK_BINARY_DIR}/MITK-AdditionalLibPaths/${LSP_NAME}.cmake)
46  endif(${CMAKE_PROJECT_NAME} STREQUAL "MITK-superbuild")
47 
48  configure_file(${MITK_CMAKE_DIR}/AdditionalLibrarySearchPath.cmake.in ${_configured_file} @ONLY)
49 
50 endfunction()
mitkFunctionAddLibrarySearchPaths()