Skip to content

Commit 00bc0d6

Browse files
committed
Merge branch 'T24668-CorrectlySetOpenCVSearchDirectory'
2 parents c1c6774 + c0d6582 commit 00bc0d6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

CMake/mitkFunctionGetLibrarySearchPaths.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,17 @@ function(mitkFunctionGetLibrarySearchPaths search_path intermediate_dir)
8585
endif()
8686
endif()
8787

88-
if(OpenCV_DIR)
88+
# If OpenCV is built within the MITK superbuild set the binary directory
89+
# according to the lib path provided by OpenCV.
90+
# In the case where an external OpenCV is provided use the binary directory
91+
# of this OpenCV directory
92+
if(MITK_USE_OpenCV)
8993
if(WIN32)
90-
list(APPEND _dir_candidates "${OpenCV_LIB_PATH}/../bin")
94+
if (EXISTS ${OpenCV_LIB_PATH})
95+
list(APPEND _dir_candidates "${OpenCV_LIB_PATH}/../bin") # OpenCV is built in superbuild
96+
else()
97+
list(APPEND _dir_candidates "${OpenCV_DIR}/bin") # External OpenCV build is used
98+
endif()
9199
endif()
92100
endif()
93101

0 commit comments

Comments
 (0)