]> OCCT Git - occt.git/commitdiff
0031790: Configuration, CMake - add optional OpenVR dependency
authorkgv <kgv@opencascade.com>
Fri, 16 Oct 2020 12:45:43 +0000 (15:45 +0300)
committerkgv <kgv@opencascade.com>
Sat, 17 Oct 2020 15:07:29 +0000 (18:07 +0300)
CMakeLists.txt
adm/cmake/3rdparty_macro.cmake
adm/cmake/occt_csf.cmake
adm/cmake/openvr.cmake [new file with mode: 0644]
adm/cmake/vardescr.cmake
adm/templates/custom.build.bat.in
adm/templates/custom.install.bat.in
adm/templates/env.bat.in
dox/introduction/introduction.md

index a68900ddf9e2818aa08d9b6d65d5b778a1239b52..100d61339d4d16e7b2acc5ad4e912725f8b2b3db 100644 (file)
@@ -565,6 +565,26 @@ else()
   OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
 endif()
 
+# OpenVR
+# search for CSF_OpenVR variable in EXTERNLIB of each being used toolkit
+OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
+if (CAN_USE_OPENVR)
+  set (USE_OPENVR OFF CACHE BOOL "${USE_OPENVR_DESCR}")
+
+  if (USE_OPENVR)
+    add_definitions (-DHAVE_OPENVR)
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/openvr")
+  else()
+    OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENVR")
+    OCCT_CHECK_AND_UNSET ("INSTALL_OPENVR")
+  endif()
+else()
+  OCCT_CHECK_AND_UNSET ("USE_OPENVR")
+
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENVR")
+  OCCT_CHECK_AND_UNSET ("INSTALL_OPENVR")
+endif()
+
 # FFmpeg
 # search for CSF_FFmpeg variable in EXTERNLIB of each being used toolkit
 OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
index 7794a73ebaa81865c0d6852e7e039fa6bfaa28fc..a3621f762134f5b4e3a7bf768a989c32bf2c6a23 100644 (file)
@@ -97,12 +97,12 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
     if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
       find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
                                                       PATHS ${3RDPARTY_${PRODUCT_NAME}_DIR}
-                                                      PATH_SUFFIXES include inc
+                                                      PATH_SUFFIXES include inc headers
                                                       CMAKE_FIND_ROOT_PATH_BOTH
                                                       NO_DEFAULT_PATH)
     else()
       find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
-                                                      PATH_SUFFIXES include inc
+                                                      PATH_SUFFIXES include inc headers
                                                       CMAKE_FIND_ROOT_PATH_BOTH)
     endif()
   endif()
@@ -125,10 +125,14 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
         set (${PRODUCT_NAME}_PATH_SUFFIXES lib)
         if (WIN32)
           set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} win${COMPILER_BITNESS}/${COMPILER}/lib)
+          set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} lib/win${COMPILER_BITNESS})
         endif()
         if (ANDROID)
           set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} libs/${ANDROID_ABI})
         endif()
+        if(UNIX AND NOT APPLE AND NOT ANDROID)
+          set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} lib/linux${COMPILER_BITNESS})
+        endif()
 
         # set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
         set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} "3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
@@ -184,7 +188,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
           if ((3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") OR (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}"))
             find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}  NAMES ${LIBRARY_NAME}
                                                                                PATHS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
-                                                                               PATH_SUFFIXES bin  win${COMPILER_BITNESS}/${COMPILER}/bin
+                                                                               PATH_SUFFIXES bin win${COMPILER_BITNESS}/${COMPILER}/bin bin/win${COMPILER_BITNESS}
                                                                                NO_DEFAULT_PATH)
             if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}-NOTFOUND")
               # find directory recursive
@@ -238,6 +242,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
       if (INSTALL_${PRODUCT_NAME})
         OCCT_MAKE_OS_WITH_BITNESS()
         OCCT_MAKE_COMPILER_SHORT_NAME()
+        set (USED_3RDPARTY_${PRODUCT_NAME}_DIR "")
 
         if (WIN32)
           if (SINGLE_GENERATOR)
@@ -280,14 +285,17 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
         endif()
       else()
         # the library directory for using by the executable
-      foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
-        string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
+        foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
+          string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
           if (WIN32)
             set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}};${USED_3RDPARTY_${PRODUCT_NAME}_DIRS}")
           else()
             set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}:${USED_3RDPARTY_${PRODUCT_NAME}_DIRS}")
           endif()
         endforeach()
+        if (WIN32)
+          set (USED_3RDPARTY_${PRODUCT_NAME}_DIR ${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}})
+        endif()
       endif()
 
       mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX})
index 353f6cf2087d6360b644cacc171f0f0566a8005c..46d22ff4e3898c3e797e33763ca5c5f29f1069bc 100644 (file)
@@ -42,6 +42,13 @@ else()
   endif()
 endif()
 
+# OpenVR
+if (USE_OPENVR)
+  set (CSF_OpenVR "openvr_api")
+else()
+  set (CSF_OpenVR)
+endif()
+
 # TCL/TK
 if (USE_TCL)
   if (WIN32)
diff --git a/adm/cmake/openvr.cmake b/adm/cmake/openvr.cmake
new file mode 100644 (file)
index 0000000..b61fbe1
--- /dev/null
@@ -0,0 +1,5 @@
+# OpenVR SDK
+# OpenVR is an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting.
+# https://github.com/ValveSoftware/openvr
+
+THIRDPARTY_PRODUCT("OPENVR" "openvr.h" "CSF_OpenVR" "")
index 845fc28a00ac89dc7429dad1f4411b42c392a7f1..91b124ffca436615ad1176a98c5a868bc2b46799 100644 (file)
@@ -89,6 +89,7 @@ INSTALL_MESSAGE (INSTALL_TEST_CASES       "non-regression OCCT test scripts")
 INSTALL_MESSAGE (INSTALL_DOC_Overview     "OCCT overview documentation (HTML format)")
 INSTALL_MESSAGE (INSTALL_FFMPEG           "FFmpeg binaries")
 INSTALL_MESSAGE (INSTALL_FREEIMAGE        "FreeImage binaries")
+INSTALL_MESSAGE (INSTALL_OPENVR           "OpenVR binaries")
 INSTALL_MESSAGE (INSTALL_EIGEN            "EIGEN header files")
 INSTALL_MESSAGE (INSTALL_EGL              "EGL binaries")
 INSTALL_MESSAGE (INSTALL_GLES2            "OpenGL ES 2.0 binaries")
@@ -162,6 +163,9 @@ set (USE_FREEIMAGE_DESCR
 "Indicates whether Freeimage product should be used in OCCT visualization
 module for support of popular graphics image formats (PNG, BMP etc)")
 
+set (USE_OPENVR_DESCR
+"Indicates whether OpenVR should be used in OCCT visualization module for VR support")
+
 set (USE_RAPIDJSON_DESCR
 "Indicates whether RapidJSON product should be used in OCCT DataExchange
 module for support of JSON-based formats like glTF")
index a08d82cddfa479783f6136fdc6967885bb5073c9..c03a7fc0d42c75e5bd9d93b05e3c78a393df5ef7 100644 (file)
@@ -14,6 +14,7 @@ if /I "%VCVER%" == "@COMPILER@" (
     set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
     set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
     set "FFMPEG_DIR=@3RDPARTY_FFMPEG_DLL_DIR@"
+    set "OPENVR_DIR=@3RDPARTY_OPENVR_DLL_DIRS@"
 
     if not "@3RDPARTY_QT_DIR@" == "" (
       set "QTDIR=@3RDPARTY_QT_DIR@"
index c057ff66366dcebf0b1ac20fceb866c9fdce0162..041152bddae5ec79e7f9b36d4e9737b796d2e696 100644 (file)
@@ -10,12 +10,13 @@ if /I "%VCVER%" == "@COMPILER@" (
     set "TCL_DIR=@USED_3RDPARTY_TCL_DIR@"
     set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
     set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
-    set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_DIRS@"
+    set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_DIR@"
     set "EGL_DIR=@USED_3RDPARTY_EGL_DIRS@"
     set "GLES2_DIR=@USED_3RDPARTY_GLES2_DIRS@"
     set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
     set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
     set "FFMPEG_DIR=@USED_3RDPARTY_FFMPEG_DIR@"
+    set "OPENVR_DIR=@USED_3RDPARTY_OPENVR_DIR@"
 
     if not "@USED_3RDPARTY_QT_DIR@" == "" (
       set "QTDIR=@USED_3RDPARTY_QT_DIR@"
index 624ea48d05130c3fe4f2fb08325dec3a1e4307a0..ab85ae16f822fd988169b2b5e8ca23a82ab502d3 100644 (file)
@@ -140,6 +140,7 @@ if not ["%GLES2_DIR%"] == [""]         set "PATH=%GLES2_DIR%;%PATH%"
 if not ["%TBB_DIR%"] == [""]           set "PATH=%TBB_DIR%;%PATH%"
 if not ["%VTK_DIR%"] == [""]           set "PATH=%VTK_DIR%;%PATH%"
 if not ["%FFMPEG_DIR%"] == [""]        set "PATH=%FFMPEG_DIR%;%PATH%"
+if not ["%OPENVR_DIR%"] == [""]        set "PATH=%OPENVR_DIR%;%PATH%"
 if not ["%QTDIR%"] == [""] (
   set "PATH=%QTDIR%/bin;%PATH%"
   set "QT_PLUGIN_PATH=%QTDIR%/plugins"
index 0c9e5eb3f11da49ce6b160dcb9c86881670cff60..6587340761945cd66025c8967172c639b0c40ce6 100644 (file)
@@ -358,7 +358,7 @@ for which OCCT is certified to work.
 The following third-party libraries and tools are not included in OCCT sources but are either required or can be optionally used for the indicated components of OCCT.
 They are not needed if relevant component is not needed.
 
-Note that pe-built packages of many of the listed libraries are available at
+Note that pre-built packages of many of the listed libraries are available at
 https://www.opencascade.com/content/3rd-party-components
 
 | Component | Where to find | Used for | Required or optional |
@@ -366,6 +366,7 @@ https://www.opencascade.com/content/3rd-party-components
 | CMake 2.8+ | https://cmake.org/ | Build from sources | Optional |
 | Intel TBB 4.x or later | https://www.threadingbuildingblocks.org/ | All | Optional (advanced parallelization of algorithms) |
 | OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required |
+| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | Optional (VR support) |
 | Direct3D 9 | Windows | Visualization | Optional (integration with GUI using Direct3D) |
 | FreeType 2.4.11-2.7.1 | https://sourceforge.net/projects/freetype/files/ | Visualization | Required |
 | FreeImage 3.17.0+ | https://sourceforge.net/projects/freeimage/files | Visualization | Optional (support of common 2D graphic formats) |
@@ -583,7 +584,14 @@ implementation of 3D viewer. OpenGL specification is developed by the
 Khronos group, https://www.khronos.org/opengl/. OCCT code includes header 
 file *glext.h* obtained from Khronos web site.
 
-**VTK** -- The **Visualization Toolkit (VTK)** is an open-source, freely available software system for 3D computer graphics, image processing and visualization. OCCT VIS component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library. If you need further information on VTK, refer to VTK Homepage https://www.vtk.org/.
+**OpenVR** is an API and runtime that allows access to VR hardware from multiple vendors
+without requiring that applications have specific knowledge of the hardware they are targeting.
+OpenVR is optionally used by OCCT for VR support.
+OpenVR is released under BSD-like license (https://github.com/ValveSoftware/openvr/blob/master/LICENSE).
+
+**VTK** -- The **Visualization Toolkit (VTK)** is an open-source, freely available software system for 3D computer graphics, image processing and visualization.
+OCCT VIS component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
+If you need further information on VTK, refer to VTK Homepage https://www.vtk.org/.
 
 **Doxygen** developed by Dimitri van Heesch is open source documentation system for 
 C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology 
@@ -621,7 +629,8 @@ It is available under GNU GPL v3 license (https://www.gnu.org/software/bison/).
 Delabella is used by BRepMesh as one of alternative 2D triangulation algorithms. 
 Delabella is licensed under the MIT license (https://github.com/msokalski/delabella).
 
-**CMake** is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. 
+**CMake** is an open-source, cross-platform family of tools designed to build, test and package software.
+CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. 
 OCCT uses CMake as a build system. CMake is available under BSD 3-Clause license. 
 See more at https://cmake.org/