Permalink
Browse files

More accurate guards for WinRT features in CMake.

  • Loading branch information...
1 parent 3d594c7 commit 429cd85b46f85418a3fea5a6e2d70e9ccfba9639 @asmorkalov asmorkalov committed Mar 20, 2013
@@ -123,7 +123,7 @@ file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h")
list(APPEND lib_srcs "${tbb_src_dir}/src/rml/client/rml_tbb.cpp")
if (WIN32)
-add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0
+ add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0
-D__TBB_BUILD=1
-D_UNICODE
-DUNICODE
@@ -162,7 +162,7 @@ endif()
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
-if ((${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") AND NOT WIN32)
+if (ARM AND NOT WIN32)
if (NOT ANDROID)
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
endif()
View
@@ -60,11 +60,6 @@ endif()
project(OpenCV CXX C)
-if ((${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") AND WIN32)
- set(CMAKE_REQUIRED_DEFINITIONS -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
- add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
-endif()
-
include(cmake/OpenCVUtils.cmake)
# ----------------------------------------------------------------------------
@@ -613,7 +608,7 @@ else()
status(" QT 4.x:" NO)
endif()
if(WIN32)
- status(" Win32 UI:" NO)
+ status(" Win32 UI:" ARM THEN NO ELSE YES)
else()
if(APPLE)
if(WITH_CARBON)
@@ -103,4 +103,6 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" OR CMAKE_GENERATOR
set(X86_64 1)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
set(X86 1)
+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
+ set(ARM 1)
endif()
@@ -90,7 +90,9 @@ if(HAVE_QT)
set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS -Wno-missing-declarations)
endif()
elseif(WIN32)
- #list(APPEND highgui_srcs src/window_w32.cpp)
+ if (NOT ARM)
+ list(APPEND highgui_srcs src/window_w32.cpp)
+ endif()
elseif(HAVE_GTK)
list(APPEND highgui_srcs src/window_gtk.cpp)
elseif(APPLE)
@@ -105,10 +107,12 @@ elseif(APPLE)
endif()
endif()
-#if(WIN32)
+if(WIN32)
list(APPEND highgui_srcs src/cap_dshow.cpp)
- #list(APPEND highgui_srcs src/cap_vfw.cpp src/cap_cmu.cpp)
-#endif(WIN32)
+ if (NOT ARM)
+ list(APPEND highgui_srcs src/cap_vfw.cpp src/cap_cmu.cpp)
+ endif()
+endif(WIN32)
if(HAVE_XINE)
list(APPEND highgui_srcs src/cap_xine.cpp)
@@ -0,0 +1,5 @@
+set(CMAKE_SYSTEM_NAME Windows) # WindowsRT breaks cmake 2.8.10.2 and earler
+set(CMAKE_SYSTEM_PROCESSOR "arm")
+
+set(CMAKE_REQUIRED_DEFINITIONS -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
+add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
@@ -3,6 +3,4 @@ cd build
rem call "C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
-SET PATH=C:\Program Files\Ninja;%PATH%
-
-"C:\Program Files\CMake 2.8\bin\cmake.exe" -GNinja -DCMAKE_BUILD_TYPE=Release -DWITH_TIFF=OFF -DWITH_FFMPEG=OFF -DBUILD_opencv_gpu=OFF -DENABLE_SSE=OFF -DENABLE_SSE2=OFF ..\..\..
+cmake.exe -GNinja -DWITH_FFMPEG=OFF -DBUILD_opencv_gpu=OFF -DBUILD_opencv_python=OFF -DCMAKE_TOOLCHAIN_FILE=..\..\winrt\arm.winrt.toolchain.cmake ..\..\..

0 comments on commit 429cd85

Please sign in to comment.