From 8ee1be7d0942bb621b1a98946e32daa6c6ecbb1c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 5 Mar 2019 13:38:47 +0300 Subject: [PATCH] cmake: support MSVS 2019 --- cmake/OpenCVDetectCXXCompiler.cmake | 2 ++ cmake/templates/OpenCVConfig.root-WIN32.cmake.in | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake index 8c9ff0345a..d7fb4f9a80 100644 --- a/cmake/OpenCVDetectCXXCompiler.cmake +++ b/cmake/OpenCVDetectCXXCompiler.cmake @@ -143,6 +143,8 @@ elseif(MSVC) set(OpenCV_RUNTIME vc14) elseif(MSVC_VERSION MATCHES "^191[0-9]$") set(OpenCV_RUNTIME vc15) + elseif(MSVC_VERSION MATCHES "^192[0-9]$") + set(OpenCV_RUNTIME vc16) else() message(WARNING "OpenCV does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set OpenCV_RUNTIME") endif() diff --git a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in index 687298acbc..76027bf92e 100644 --- a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in +++ b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in @@ -113,6 +113,16 @@ elseif(MSVC) if(NOT has_VS2017) set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version endif() + elseif(MSVC_VERSION MATCHES "^192[0-9]$") + set(OpenCV_RUNTIME vc16) + check_one_config(has_VS2019) + if(NOT has_VS2019) + set(OpenCV_RUNTIME vc15) # selecting previous compatible runtime version + check_one_config(has_VS2017) + if(NOT has_VS2017) + set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version + endif() + endif() endif() elseif(MINGW) set(OpenCV_RUNTIME mingw)