0024073: Coding rules - ambiguous call to overloaded function StdPrs_DeflectionCurve...
[occt.git] / CMakeLists.txt
index de625e7..6e66756 100644 (file)
@@ -65,7 +65,7 @@ if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration ge
 endif()
 
 # enable extended messages of many OCCT algorithms
-if ((SINGLE_GENERATOR AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR NOT SINGLE_GENERATOR)
+if (((SINGLE_GENERATOR AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR NOT SINGLE_GENERATOR) AND (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore"))
   if (NOT BUILD_WITH_DEBUG)
     set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}")
   endif()
@@ -309,6 +309,15 @@ if (MSVC)
   set (BUILD_MODULE_MfcSamples OFF CACHE BOOL "${BUILD_MODULE_MfcSamples_DESCR}")
 endif()
 
+# uwp sample
+if (MSVC)
+  if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
+    set (BUILD_MODULE_UwpSample OFF CACHE BOOL "${BUILD_MODULE_UwpSample_DESCR}")
+  else()
+    unset (BUILD_MODULE_UwpSample)
+  endif()
+endif()
+
 # whether use optional 3rdparty or not
 if (APPLE)
   set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
@@ -331,6 +340,10 @@ if (ANDROID AND BUILD_MODULE_Draw)
   message (STATUS "Info. Draw module is turned off due to it is not supported on Android")
   set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
 endif()
+if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND BUILD_MODULE_Draw)
+  message (STATUS "Info. Draw module is turned off due to it is not supported on UWP")
+  set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
+endif()
 
 # Overview
 if (NOT DEFINED BUILD_DOC_Overview)
@@ -492,6 +505,34 @@ else()
   OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
 endif()
 
+# OpenGL ES 2.0
+OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
+if (WIN32 AND CAN_USE_GLES2)
+  if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
+    set (USE_GLES2 ON)
+  else()
+    set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
+  endif()
+
+  if (USE_GLES2)
+    add_definitions (-DHAVE_GLES2)
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
+       OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
+  else()
+    OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
+    OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
+    OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
+    OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
+  endif()
+else()
+  OCCT_CHECK_AND_UNSET ("USE_GLES2")
+
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
+  OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
+  OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
+endif()
+
 # GL2PS
 # search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit
 OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS)
@@ -647,6 +688,10 @@ if (INSTALL_SAMPLES)
     OCCT_INSTALL_FILE_OR_DIR ("samples/CSharp" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
     OCCT_INSTALL_FILE_OR_DIR ("samples/mfc" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
 
+    if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
+      OCCT_INSTALL_FILE_OR_DIR ("samples/xaml" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
+    endif()
+
     install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/CSharp" RENAME "env.${SCRIPT_EXT}")
     install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/mfc/standard" RENAME "env.${SCRIPT_EXT}")
   endif()
@@ -795,6 +840,10 @@ if (BUILD_MODULE_MfcSamples)
   add_subdirectory(samples/mfc/standard/10_Convert)
 endif()
 
+if (BUILD_MODULE_UwpSample)
+  add_subdirectory(samples/xaml)
+endif()
+
 # Prepare variables for configuration of OpenCASCADE cmake config file
 set (OCCT_MODULES_ENABLED)
 set (OCCT_LIBRARIES)