From 2f4b334ef29e4e00c8c95cb76ab8d065ed2c3c29 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 18 Dec 2015 17:23:17 +0300 Subject: [PATCH] fix MSVS2010 builds --- cmake/OpenCVCRTLinkage.cmake | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cmake/OpenCVCRTLinkage.cmake b/cmake/OpenCVCRTLinkage.cmake index 98da02dd7c..f5509d83f3 100644 --- a/cmake/OpenCVCRTLinkage.cmake +++ b/cmake/OpenCVCRTLinkage.cmake @@ -2,15 +2,14 @@ if(NOT MSVC) message(FATAL_ERROR "CRT options are available only for MSVC") endif() -#if (${CMAKE_SYSTEM_NAME} MATCHES "WindowsStore" OR ${CMAKE_SYSTEM_NAME} MATCHES "WindowsPhone") -# set(WINRT TRUE) - -if (WINRT AND CMAKE_SYSTEM_VERSION MATCHES 10) - add_definitions(/DWINVER=_WIN32_WINNT_WIN10 /DNTDDI_VERSION=NTDDI_WIN10 /D_WIN32_WINNT=_WIN32_WINNT_WIN10) -elseif(WINRT AND CMAKE_SYSTEM_VERSION MATCHES 8.1) - add_definitions(/DWINVER=_WIN32_WINNT_WINBLUE /DNTDDI_VERSION=NTDDI_WINBLUE /D_WIN32_WINNT=_WIN32_WINNT_WINBLUE) -else() - add_definitions(/DWINVER=_WIN32_WINNT_WIN8 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=_WIN32_WINNT_WIN8) +if (WINRT) + if (CMAKE_SYSTEM_VERSION MATCHES 10) + add_definitions(/DWINVER=_WIN32_WINNT_WIN10 /DNTDDI_VERSION=NTDDI_WIN10 /D_WIN32_WINNT=_WIN32_WINNT_WIN10) + elseif(CMAKE_SYSTEM_VERSION MATCHES 8.1) + add_definitions(/DWINVER=_WIN32_WINNT_WINBLUE /DNTDDI_VERSION=NTDDI_WINBLUE /D_WIN32_WINNT=_WIN32_WINNT_WINBLUE) + else() + add_definitions(/DWINVER=_WIN32_WINNT_WIN8 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=_WIN32_WINNT_WIN8) + endif() endif() # Removing LNK4075 warnings for debug WinRT builds