From 1ab7acf0154f1f519e98b64d30e8958fac4e1366 Mon Sep 17 00:00:00 2001 From: Gregory Morse Date: Wed, 9 Dec 2015 03:42:25 +0100 Subject: [PATCH 1/2] Update CMakeLists.txt Fix C++/CX support for all WINRT and bring back native-mode only support which was removed --- modules/videoio/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index 75851c224e..b28efc7c4a 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -7,7 +7,7 @@ ocv_add_module(videoio opencv_imgproc opencv_imgcodecs WRAP java python) # Jose Luis Blanco, 2008 # ---------------------------------------------------------------------------- -if(WINRT_8_1) +if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW") endif() @@ -38,7 +38,7 @@ list(REMOVE_ITEM videoio_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${n # Dependencies used by the implementation referenced # below are not available on WinRT 8.0. # Enabling it for WiRT 8.1+ only. -if(DEFINED WINRT AND NOT DEFINED WINRT_8_0) +if(DEFINED WINRT AND NOT DEFINED WINRT_8_0 AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE) # WinRT detected. Adding WinRT API header message(STATUS " ${name}: WinRT detected. Adding WinRT API header") From bcf78daed209f0af49307879ec2cfca79b00fbbf Mon Sep 17 00:00:00 2001 From: Gregory Morse Date: Wed, 9 Dec 2015 03:45:10 +0100 Subject: [PATCH 2/2] Update CMakeLists.txt WinRT parallels library is causing conflicts in VC++ due to inconsistent usage with C++/CX which is now present in parallels.cpp. This support should be included in all projects with WinRT specific code except if doing special native C++ tasks. --- modules/core/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 14fac578a6..1ac4c9e25d 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -11,6 +11,10 @@ if(WINRT AND CMAKE_SYSTEM_NAME MATCHES WindowsStore AND CMAKE_SYSTEM_VERSION MAT list(APPEND extra_libs ole32.lib) endif() +if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW") +endif() + if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wenum-compare -Wunused-function -Wshadow) endif()