Skip to content
This repository was archived by the owner on Mar 22, 2020. It is now read-only.

Commit 19f895a

Browse files
authored
Merge pull request #26 from xsacha/hunter-3.4.3
Fix CMake find_package(OpenCV) for Windows when BUILD_SHARED_LIBS is not defined
2 parents 5daef5a + c1b807c commit 19f895a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmake/OpenCVDetectCXXCompiler.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ endif()
111111
# Similar code exists in OpenCVConfig.cmake
112112
if(NOT DEFINED OpenCV_STATIC)
113113
# look for global setting
114-
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
115-
set(OpenCV_STATIC OFF)
116-
else()
114+
if(NOT DEFINED BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
117115
set(OpenCV_STATIC ON)
116+
else()
117+
set(OpenCV_STATIC OFF)
118118
endif()
119119
endif()
120120

cmake/templates/OpenCVConfig.root-WIN32.cmake.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ endif()
4343

4444
if(NOT DEFINED OpenCV_STATIC)
4545
# look for global setting
46-
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
47-
set(OpenCV_STATIC OFF)
48-
else()
46+
if(NOT DEFINED BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
4947
set(OpenCV_STATIC ON)
48+
else()
49+
set(OpenCV_STATIC OFF)
5050
endif()
5151
endif()
5252

0 commit comments

Comments
 (0)