Skip to content

Commit 34bdd47

Browse files
committed
Issue #33: Make consistent build settings on Windows.
1 parent 9702eca commit 34bdd47

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
set(CMAKE_CXX_EXTENSIONS OFF)
77
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
88

9+
# Use static MSVC runtime on Windows to match static OpenCV
10+
if(MSVC)
11+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "" FORCE)
12+
endif()
13+
914
option(BUILD_TESTING "Build C++ unit tests" OFF)
1015
option(BUILD_PYTHON_BINDINGS "Build Python pybind11 module" ON)
1116

@@ -67,6 +72,7 @@ set(BUILD_ZLIB ON CACHE BOOL "" FORCE)
6772
set(OPENCV_GENERATE_PKGCONFIG OFF CACHE BOOL "" FORCE)
6873
set(OPENCV_ENABLE_NONFREE OFF CACHE BOOL "" FORCE)
6974
set(CV_DISABLE_OPTIMIZATION OFF CACHE BOOL "" FORCE)
75+
set(CPU_DISPATCH "" CACHE STRING "" FORCE)
7076
set(ENABLE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE)
7177

7278
FetchContent_Declare(

0 commit comments

Comments
 (0)