From fdefc4b09d1e80db83a017312c4fc9cc7905d89d Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 7 Nov 2017 13:55:13 +0300 Subject: [PATCH] cmake: allow custom OpenCV_ARCH / OpenCV_RUNTIME values backport 8e21f808bec00ec90e8077a12d04259e8573d430 --- cmake/OpenCVConfig.cmake | 4 +++- cmake/OpenCVDetectCXXCompiler.cmake | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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()