aboutsummaryrefslogtreecommitdiff
path: root/ports/opencv/0001-winrt-fixes.patch
blob: f913d92a4099918d3788477767481160fb20af9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,7 +311,7 @@ OCV_OPTION(INSTALL_TESTS            "Install accuracy and performance test binar
 # OpenCV build options
 # ===================================================
 OCV_OPTION(ENABLE_CCACHE              "Use ccache"                                               (UNIX AND NOT IOS AND (CMAKE_GENERATOR MATCHES "Makefile" OR CMAKE_GENERATOR MATCHES "Ninja")) )
-OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers"                                  ON IF (NOT IOS AND NOT CMAKE_CROSSCOMPILING) )
+OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers"                                  ON IF (NOT IOS AND (MSVC OR NOT CMAKE_CROSSCOMPILING)) )
 OCV_OPTION(ENABLE_SOLUTION_FOLDERS    "Solution folder in Visual Studio or in other IDEs"        (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) )
 OCV_OPTION(ENABLE_PROFILING           "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF  IF CMAKE_COMPILER_IS_GNUCXX )
 OCV_OPTION(ENABLE_COVERAGE            "Enable coverage collection with  GCov"                    OFF  IF CMAKE_COMPILER_IS_GNUCXX )
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -842,7 +842,7 @@ macro(ocv_create_module)
     set(the_module_target ${the_module})
   endif()

-  if(WINRT)
+  if(WINRT AND BUILD_TESTS)
     # removing APPCONTAINER from modules to run from console
     # in case of usual starting of WinRT test apps output is missing
     # so starting of console version w/o APPCONTAINER is required to get test results
--- a/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp
+++ b/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp
@@ -24,6 +24,7 @@
 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 // POSSIBILITY OF SUCH DAMAGE.

+#include "opencv2/core/cvdef.h"
 using namespace Windows::UI::Xaml::Controls;

 namespace cv
diff --git a/modules/highgui/src/window_winrt_bridge.hpp b/modules/highgui/src/window_winrt_bridge.hpp
index 25f4aef..5429f0b 100644
--- a/modules/highgui/src/window_winrt_bridge.hpp
+++ b/modules/highgui/src/window_winrt_bridge.hpp
@@ -28,6 +28,7 @@

 #include <map>
 #include <opencv2\core.hpp>
+#include "opencv2/highgui/highgui_c.h"

 using namespace Windows::UI::Xaml::Controls;

diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp
index 236e227..e2417dc 100644
--- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp
+++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp
@@ -94,10 +94,10 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber()

 void Media::CaptureFrameGrabber::ShowCameraSettings()
 {
-#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP
+#if (WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY!=WINAPI_FAMILY_APP)
     if (_state == State::Started)
     {
-        CameraOptionsUI::Show(_capture.Get());
+        CameraOptionsUI::Show(_capture.Get()); // TODO: Turn it on again in UWP mode by adding reference to UWP Desktop Extensions
     }
 #endif
 }