4 "${MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
5 "${MITK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins"
6 "${MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
7 "${MITK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins"
9 if(MITK_EXTERNAL_PROJECT_PREFIX)
10 list(APPEND _dir_candidates
11 "${MITK_EXTERNAL_PROJECT_PREFIX}/bin"
12 "${MITK_EXTERNAL_PROJECT_PREFIX}/lib"
16 # Determine the Qt5 library installation prefix
18 if(MITK_USE_Qt5 AND
TARGET ${Qt5Core_QMAKE_EXECUTABLE})
19 get_property(_qmake_location
TARGET ${Qt5Core_QMAKE_EXECUTABLE}
20 PROPERTY IMPORT_LOCATION)
23 if(NOT _qt_install_libs)
25 execute_process(COMMAND ${_qmake_location} -query QT_INSTALL_BINS
26 OUTPUT_VARIABLE _qt_install_libs
27 OUTPUT_STRIP_TRAILING_WHITESPACE)
29 execute_process(COMMAND ${_qmake_location} -query QT_INSTALL_LIBS
30 OUTPUT_VARIABLE _qt_install_libs
31 OUTPUT_STRIP_TRAILING_WHITESPACE)
33 file(TO_CMAKE_PATH "${_qt_install_libs}
" _qt_install_libs)
34 set(_qt_install_libs ${_qt_install_libs} CACHE INTERNAL "Qt library installation prefix
" FORCE)
37 list(APPEND _dir_candidates ${_qt_install_libs})
40 message(WARNING "The qmake executable could not be found.
")
43 get_property(_additional_paths GLOBAL PROPERTY MITK_ADDITIONAL_LIBRARY_SEARCH_PATHS)
46 FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED shared)
47 get_target_property(_location hdf5-shared LOCATION)
48 get_filename_component(_location ${_location} PATH)
49 list(APPEND _additional_paths ${_location})
51 # This is a work-around. The hdf5-config.cmake file is not robust enough
52 # to be included several times via find_pakcage calls.
53 set(HDF5_LIBRARIES ${HDF5_LIBRARIES} PARENT_SCOPE)
56 # we cannot use _find_package(Vigra) here because the vigra-config.cmake file
57 # always includes the target-exports files without using an include guard. This
58 # would lead to errors when another find_package(Vigra) call is processed. The
59 # (bad) assumption here is that for the time being, only the Classification module
62 list(APPEND _additional_paths ${Vigra_DIR}/lib)
64 list(APPEND _additional_paths ${Vigra_DIR}/bin)
69 list(APPEND _dir_candidates ${_additional_paths})
72 # The code below is sub-optimal. It makes assumptions about
73 # the structure of the build directories, pointed to by
74 # the *_DIR variables. Instead, we should rely on package
75 # specific "LIBRARY_DIRS
" variables, if they exist.
78 list(APPEND _dir_candidates "${SOFA_DIR}/bin
")
80 list(APPEND _dir_candidates "${ITK_DIR}/bin
")
83 list(APPEND _dir_candidates "${SOFA_DIR}/lib
")
87 if(MITK_USE_MatchPoint)
89 list(APPEND _dir_candidates "${MatchPoint_DIR}/bin
")
91 list(APPEND _dir_candidates "${MatchPoint_DIR}/lib
")
96 set(_opencv_link_directories
97 "${OpenCV_LIB_DIR_DBG}
"
98 "${OpenCV_LIB_DIR_OPT}
"
99 "${OpenCV_3RDPARTY_LIB_DIR_DBG}
"
100 "${OpenCV_3RDPARTY_LIB_DIR_OPT}
")
101 list(REMOVE_DUPLICATES _opencv_link_directories)
103 foreach(_opencv_link_directory ${_opencv_link_directories})
104 list(APPEND _dir_candidates "${_opencv_link_directory}/../bin
")
107 list(APPEND _dir_candidates ${_opencv_link_directories})
112 list(APPEND _dir_candidates "${CTK_DIR}/CMakeExternals/Install/bin
")
113 list(APPEND _dir_candidates "${MITK_EXTERNAL_PROJECT_PREFIX}/lib/python2.7/bin
")
116 if(MITK_USE_TOF_PMDO3 OR MITK_USE_TOF_PMDCAMCUBE OR MITK_USE_TOF_PMDCAMBOARD)
117 list(APPEND _dir_candidates "${MITK_PMD_SDK_DIR}/plugins
" "${MITK_PMD_SDK_DIR}/bin
")
121 list(APPEND _dir_candidates "${CTK_LIBRARY_DIRS}
")
122 foreach(_ctk_library ${CTK_LIBRARIES})
123 if(${_ctk_library}_LIBRARY_DIRS)
124 list(APPEND _dir_candidates "${${_ctk_library}_LIBRARY_DIRS}
")
129 if(MITK_USE_BLUEBERRY)
130 if(DEFINED CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY)
131 if(IS_ABSOLUTE "${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}
")
132 list(APPEND _dir_candidates "${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}
")
134 list(APPEND _dir_candidates "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CTK_PLUGIN_RUNTIME_OUTPUT_DIRECTORY}
")
139 if(MITK_LIBRARY_DIRS)
140 list(APPEND _dir_candidates ${MITK_LIBRARY_DIRS})
143 list(REMOVE_DUPLICATES _dir_candidates)
146 foreach(_dir ${_dir_candidates})
147 if(EXISTS "${_dir}/${intermediate_dir}
")
148 list(APPEND _search_dirs "${_dir}/${intermediate_dir}
")
150 list(APPEND _search_dirs "${_dir}
")
154 # Special handling for "internal" search dirs. The intermediate directory
155 # might not have been created yet, so we can't check for its existence.
156 # Hence we just add it for Windows without checking.
157 set(_internal_search_dirs "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins
")
159 foreach(_dir ${_internal_search_dirs})
160 set(_search_dirs "${_dir}/${intermediate_dir}
" ${_search_dirs})
163 set(_search_dirs ${_internal_search_dirs} ${_search_dirs})
165 list(REMOVE_DUPLICATES _search_dirs)
167 set(${search_path} ${_search_dirs} PARENT_SCOPE)
mitkFunctionGetLibrarySearchPaths(search_path, intermediate_dir)