diff --git a/cmake/OpenCVConfig.cmake b/cmake/OpenCVConfig.cmake index 7a2678d580..4c88611556 100644 --- a/cmake/OpenCVConfig.cmake +++ b/cmake/OpenCVConfig.cmake @@ -61,7 +61,9 @@ if(NOT DEFINED OpenCV_CUDA) endif() endif() -if(MSVC) +if(DEFINED OpenCV_ARCH AND DEFINED OpenCV_RUNTIME) + # custom overrided values +elseif(MSVC) if(CMAKE_CL_64) set(OpenCV_ARCH x64) set(OpenCV_TBB_ARCH intel64) diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake index 55d861ea83..23d493dd13 100644 --- a/cmake/OpenCVDetectCXXCompiler.cmake +++ b/cmake/OpenCVDetectCXXCompiler.cmake @@ -82,7 +82,9 @@ if(NOT DEFINED OpenCV_STATIC) endif() endif() -if(MSVC) +if(DEFINED OpenCV_ARCH AND DEFINED OpenCV_RUNTIME) + # custom overrided values +elseif(MSVC) if(CMAKE_CL_64) set(OpenCV_ARCH x64) else()