]> OCCT Git - occt-copy.git/commitdiff
0032268: Introduce a MINIMAL_BUILD CMake option to be able to build a minimal algorit... CR0032268
authorDzmitry Razmyslovich <razmyslovich@volumegraphics.com>
Tue, 30 Mar 2021 11:49:47 +0000 (13:49 +0200)
committerDzmitry Razmyslovich <razmyslovich@volumegraphics.com>
Tue, 30 Mar 2021 11:49:47 +0000 (13:49 +0200)
14 files changed:
CMakeLists.txt
adm/MODULES_MIN [new file with mode: 0644]
adm/cmake/occt_csf.cmake
adm/cmake/vardescr.cmake
src/AIS/AIS_TextLabel.cxx
src/Aspect/Aspect_DisplayConnection.cxx
src/Font/Font_FTFont.cxx
src/Font/Font_FTLibrary.cxx
src/Font/Font_FontMgr.cxx
src/Font/Font_TextFormatter.cxx
src/PrsDim/PrsDim_Dimension.cxx
src/StdPrs/StdPrs_BRepFont.cxx
src/StdPrs/StdPrs_BRepTextBuilder.cxx
src/Xw/Xw_Window.cxx

index abe4a8fa7db38385dd00cd3403a482712001ff58..9e69e8a61838d938afb4d1f41bca7d028b1e0a21 100644 (file)
@@ -396,15 +396,29 @@ else()
   set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
 endif()
 
+set (MINIMAL_BUILD OFF CACHE BOOL "${MINIMAL_BUILD_DESCR}")
+
 # include the patched or original list of modules
 # list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
 # list <OCCT_MODULES> will contain all modules
-OCCT_MODULES_AND_TOOLKITS (MODULES "TOOLKITS" OCCT_MODULES)
+if (MINIMAL_BUILD)
+  OCCT_MODULES_AND_TOOLKITS (MODULES_MIN "TOOLKITS" OCCT_MODULES)
+  
+  set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}" FORCE)
+  set (BUILD_MODULE_MfcSamples OFF CACHE BOOL "${BUILD_MODULE_MfcSamples_DESCR}" FORCE)
+else ()
+  OCCT_MODULES_AND_TOOLKITS (MODULES "TOOLKITS" OCCT_MODULES)
+endif ()
 
 foreach (OCCT_MODULE ${OCCT_MODULES})
   BUILD_MODULE (${OCCT_MODULE})
 endforeach()
 
+if (MINIMAL_BUILD AND BUILD_MODULE_Draw)
+  message (STATUS "Info. Draw module is turned off for the minimal configuration")
+  set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
+endif()
+
 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)
@@ -456,204 +470,232 @@ set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS})
 # include the patched or original list of definitions and flags
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
 
-OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
-
-# search for TKIVtk and TKIVtkDraw in BUILD_TOOLKITS
-list (FIND BUILD_TOOLKITS TKIVtk CAN_USE_VTK)
-if (CAN_USE_VTK EQUAL -1)
-  list (FIND BUILD_TOOLKITS TKIVtkDraw CAN_USE_VTK)
+if (MINIMAL_BUILD)
+  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOCC_MINIMAL_BUILD")
+  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOCC_MINIMAL_BUILD")
 endif()
 
-if (NOT CAN_USE_VTK EQUAL -1)
-  if (NOT DEFINED USE_VTK)
-    set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
-  endif()
-else()
-  OCCT_CHECK_AND_UNSET (USE_VTK)
-endif()
+if (NOT MINIMAL_BUILD)
+  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
 
-# Rebuild *.yacc and *.lex files that are contained by TKMath toolkit
-list (FIND BUILD_TOOLKITS TKMath   CAN_REBUILD_PDC_FOR_TKMATH)
-list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
+  # search for TKIVtk and TKIVtkDraw in BUILD_TOOLKITS
+  list (FIND BUILD_TOOLKITS TKIVtk CAN_USE_VTK)
+  if (CAN_USE_VTK EQUAL -1)
+    list (FIND BUILD_TOOLKITS TKIVtkDraw CAN_USE_VTK)
+  endif()
 
-if (NOT ${CAN_REBUILD_PDC_FOR_TKMATH} EQUAL -1 OR NOT ${CAN_REBUILD_PDC_FOR_STEPFILE} EQUAL -1)
-  set (BUILD_YACCLEX OFF CACHE BOOL "${BUILD_YACCLEX_DESCR}")
-else()
-  OCCT_CHECK_AND_UNSET (BUILD_YACCLEX)
-endif()
+  if (NOT CAN_USE_VTK EQUAL -1)
+    if (NOT DEFINED USE_VTK)
+      set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
+    endif()
+  else()
+    OCCT_CHECK_AND_UNSET (USE_VTK)
+  endif()
 
-if (NOT DEFINED 3RDPARTY_DIR)
-  set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
-  get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
-else()
-  file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
-  set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
-endif()
+  # Rebuild *.yacc and *.lex files that are contained by TKMath toolkit
+  list (FIND BUILD_TOOLKITS TKMath   CAN_REBUILD_PDC_FOR_TKMATH)
+  list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
 
-# search for CSF variable in EXTERNLIB of each being used toolkit
-OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
-OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
-OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
-OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_OPENGL)
-OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlesLibs CAN_USE_GLES2)
-OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
-OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
+  if (NOT ${CAN_REBUILD_PDC_FOR_TKMATH} EQUAL -1 OR NOT ${CAN_REBUILD_PDC_FOR_STEPFILE} EQUAL -1)
+    set (BUILD_YACCLEX OFF CACHE BOOL "${BUILD_YACCLEX_DESCR}")
+  else()
+    OCCT_CHECK_AND_UNSET (BUILD_YACCLEX)
+  endif()
 
-# define CSF variable
-OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
+  if (NOT DEFINED 3RDPARTY_DIR)
+    set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
+    get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
+  else()
+    file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
+    set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
+  endif()
 
-if (USE_TCL)
-  message (STATUS "Info: TCL is used by OCCT")
-  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
+  OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
+  if (USE_TCL)
+    message (STATUS "Info: TCL is used by OCCT")
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
 
-  message (STATUS "Info: TK is used by OCCT")
-  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
-else()
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
+    message (STATUS "Info: TK is used by OCCT")
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
+  else()
+    OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
+    OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
 
-  OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
-  OCCT_CHECK_AND_UNSET ("INSTALL_TK")
-endif()
+    OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
+    OCCT_CHECK_AND_UNSET ("INSTALL_TK")
+  endif()
 
-if (USE_FREETYPE)
-  message (STATUS "Info: Freetype is used by OCCT")
-  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
-else()
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
-  OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
-  OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
-  OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
-endif()
+  OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
+  if (USE_FREETYPE)
+    message (STATUS "Info: Freetype is used by OCCT")
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
+  else()
+    OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
+    OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
+    OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
+    OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
+  endif()
 
-# VTK
-if (USE_VTK)
-  add_definitions (-DHAVE_VTK)
-  set (OCCT_VTK_USED_TARGETS "" CACHE INTERNAL "" FORCE)
-  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
-else()
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
+  # VTK
+  if (USE_VTK)
+    add_definitions (-DHAVE_VTK)
+    set (OCCT_VTK_USED_TARGETS "" CACHE INTERNAL "" FORCE)
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
+  else()
+    OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
 
-  if (NOT CAN_USE_VTK EQUAL -1)
-    message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled")
+    if (NOT CAN_USE_VTK EQUAL -1)
+      message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled")
 
-    list (REMOVE_ITEM BUILD_TOOLKITS TKIVtk)
-    list (REMOVE_ITEM BUILD_TOOLKITS TKIVtkDraw)
+      list (REMOVE_ITEM BUILD_TOOLKITS TKIVtk)
+      list (REMOVE_ITEM BUILD_TOOLKITS TKIVtkDraw)
+    endif()
   endif()
-endif()
 
-# GLX
-if (USE_GLX)
-  add_definitions (-DMACOSX_USE_GLX)
-  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
-endif()
+  # GLX
+  if (USE_GLX)
+    add_definitions (-DMACOSX_USE_GLX)
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
+  endif()
 
-# FREEIMAGE
-if (CAN_USE_FREEIMAGE)
-  set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
+  # FREEIMAGE
+  OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
+  if (CAN_USE_FREEIMAGE)
+    set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
 
-  if (USE_FREEIMAGE)
-    add_definitions (-DHAVE_FREEIMAGE)
-    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
+    if (USE_FREEIMAGE)
+      add_definitions (-DHAVE_FREEIMAGE)
+      OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
+    else()
+      OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
+      OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
+    endif()
   else()
+    OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE")
+
     OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
     OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
   endif()
-else()
-  OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE")
-
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
-  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}")
+  # 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")
+    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()
-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)
+  if (CAN_USE_FFMPEG)
+    set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
 
-# FFmpeg
-# search for CSF_FFmpeg variable in EXTERNLIB of each being used toolkit
-OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
-
-if (CAN_USE_FFMPEG)
-  set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
-
-  if (USE_FFMPEG)
-    add_definitions (-DHAVE_FFMPEG)
-    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
+    if (USE_FFMPEG)
+      add_definitions (-DHAVE_FFMPEG)
+      OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
+    else()
+      OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
+      OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
+    endif()
   else()
+    OCCT_CHECK_AND_UNSET ("USE_FFMPEG")
+
     OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
     OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
   endif()
-else()
-  OCCT_CHECK_AND_UNSET ("USE_FFMPEG")
 
-  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
-  OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
-endif()
-
-# OpenGL
-if (CAN_USE_OPENGL)
-  if (USE_OPENGL)
-    add_definitions (-DHAVE_OPENGL_EXT)
+  # OpenGL
+  OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_OPENGL)
+  if (CAN_USE_OPENGL)
+    if (USE_OPENGL)
+      add_definitions (-DHAVE_OPENGL_EXT)
+    else()
+      list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGl)
+      list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlTest)
+    endif()
   else()
-    list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGl)
-    list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlTest)
+    OCCT_CHECK_AND_UNSET ("USE_OPENGL")
   endif()
-else()
-  OCCT_CHECK_AND_UNSET ("USE_OPENGL")
-endif()
 
-# OpenGL ES 2.0
-if (CAN_USE_GLES2)
-  if (USE_GLES2)
-    add_definitions (-DHAVE_GLES2_EXT)
-    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
-    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
+  # OpenGL ES 2.0
+  OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlesLibs CAN_USE_GLES2)
+  if (CAN_USE_GLES2)
+    if (USE_GLES2)
+      add_definitions (-DHAVE_GLES2_EXT)
+      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")
+      list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGles)
+      list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlesTest)
+    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")
-    list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGles)
-    list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlesTest)
+  endif()
+
+  # D3D
+  if (USE_D3D)
+    add_definitions (-DHAVE_D3D)
+    #if(MSVC_VERSION LESS 1700)
+    #OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
+    #endif()
+  else()
+    list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHost)
+    list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHostTest)
   endif()
 else()
+  OCCT_CHECK_AND_UNSET (USE_VTK)
+  OCCT_CHECK_AND_UNSET (BUILD_YACCLEX)
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
+  OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
+  OCCT_CHECK_AND_UNSET ("INSTALL_TK")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
+  OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
+  OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
+  OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
+  OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
+  OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
   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()
-
-# D3D
-if (USE_D3D)
-  add_definitions (-DHAVE_D3D)
-  #if(MSVC_VERSION LESS 1700)
-  #OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
-  #endif()
-else()
-  list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHost)
-  list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHostTest)
+  OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")  
+  OCCT_CHECK_AND_UNSET ("USE_GL2PS")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
+  OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS")
+  OCCT_CHECK_AND_UNSET ("USE_FFMPEG")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
+  OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
+  OCCT_CHECK_AND_UNSET ("USE_OPENVR")
+  OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENVR")
+  OCCT_CHECK_AND_UNSET ("INSTALL_OPENVR")
 endif()
 
 # TBB
+OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
 if (NOT DEFINED ANDROID AND CAN_USE_TBB)
   set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
 
@@ -694,6 +736,8 @@ else()
 endif()
 
 # EIGEN
+# search for CSF_EIGEN variable in EXTERNLIB of each being used toolkit
+OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
 if (CAN_USE_EIGEN)
   set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
 
@@ -711,8 +755,11 @@ else()
   OCCT_CHECK_AND_UNSET ("INSTALL_EIGEN")
 endif()
 
+# define CSF variable
+OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
+
 # Doxygen
-if (BUILD_DOC_Overview)
+if (NOT MINIMAL_BUILD AND BUILD_DOC_Overview)
   if (NOT DEFINED INSTALL_DOC_Overview)
     set (INSTALL_DOC_Overview OFF CACHE BOOL "${INSTALL_DOC_Overview_DESCR}")
   endif()
diff --git a/adm/MODULES_MIN b/adm/MODULES_MIN
new file mode 100644 (file)
index 0000000..f4161ee
--- /dev/null
@@ -0,0 +1,6 @@
+FoundationClasses TKernel TKMath
+ModelingData TKG2d TKG3d TKGeomBase TKBRep
+ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKMesh TKShHealing
+Visualization TKService TKV3d
+ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKBin TKVCAF
+DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKBinXCAF
index 4d716241b080efdea55c6c9d2937342b96469386..4c022fb836ebf0f44335e9c3f5e94b63bddf01ca 100644 (file)
@@ -114,10 +114,14 @@ else()
     set (CSF_androidlog  "log")
   elseif (UNIX)
     set (CSF_ThreadLibs  "pthread rt stdc++")
-    set (CSF_OpenGlLibs   "GL")
-    set (CSF_OpenGlesLibs "EGL GLESv2")
-    set (CSF_XwLibs      "X11 Xext Xmu Xi")
+    
+    if (NOT MINIMAL_BUILD)
+      set (CSF_OpenGlLibs   "GL")
+      set (CSF_OpenGlesLibs "EGL GLESv2")
+      set (CSF_XwLibs      "X11 Xext Xmu Xi")
+      set (CSF_fontconfig  "fontconfig")
+    endif()
+
     set (CSF_dl          "dl")
-    set (CSF_fontconfig  "fontconfig")
   endif()
 endif()
index 19182d8e9bb2b12602b8731c32538d93aecffb44..37658aa49d20ce055a74cd74e2c582706887b6de 100644 (file)
@@ -194,6 +194,8 @@ set (USE_GLX_DESCR "Indicates whether X11 OpenGl on OSX is used or not")
 
 set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
 
+set (MINIMAL_BUILD_DESCR "Indicates whether minimal build should be produced.")
+
 macro (BUILD_MODULE MODULE_NAME)
   set (ENABLE_MODULE TRUE)
   set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
index f20758e852a11d657a8e4fdd63975f31cc1ca036..6a81a981d4cb321f2893f25cb7fc085d44368e3d 100644 (file)
 #include <AIS_TextLabel.hxx>
 
 #include <AIS_InteractiveContext.hxx>
+#ifndef OCC_MINIMAL_BUILD
 #include <Font_FTFont.hxx>
 #include <Font_FontMgr.hxx>
 #include <Font_Rect.hxx>
+#endif
 #include <Graphic3d_AspectText3d.hxx>
 #include <Graphic3d_RenderingParams.hxx>
 #include <Graphic3d_Text.hxx>
@@ -404,6 +406,8 @@ Standard_Boolean AIS_TextLabel::calculateLabelParams (const gp_Pnt& thePosition,
 {
   // Get width and height of text
   Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect();
+
+#ifndef OCC_MINIMAL_BUILD  
   Font_FTFontParams aFontParams;
   aFontParams.PointSize = (unsigned int) anAsp->Height();
   aFontParams.Resolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution;
@@ -440,6 +444,9 @@ Standard_Boolean AIS_TextLabel::calculateLabelParams (const gp_Pnt& thePosition,
   }
 
   return Standard_True;
+#else
+  return Standard_False;
+#endif
 }
 
 //=======================================================================
index 53a7d3a1617638d09419cc1b1954e62a9715753d..0149fecb1cd5169f29ff1b6281daac7d790a6031 100755 (executable)
@@ -24,7 +24,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient)
 // =======================================================================
 Aspect_DisplayConnection::Aspect_DisplayConnection()
 {
-#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
+#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) && !defined (OCC_MINIMAL_BUILD)
   myDisplay = NULL;
   myDefVisualInfo = NULL;
   myDefFBConfig = NULL;
@@ -41,7 +41,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
 // =======================================================================
 Aspect_DisplayConnection::~Aspect_DisplayConnection()
 {
-#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
+#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) && !defined (OCC_MINIMAL_BUILD)
   if (myDefVisualInfo != NULL)
   {
     XFree (myDefVisualInfo);
@@ -54,7 +54,7 @@ Aspect_DisplayConnection::~Aspect_DisplayConnection()
 #endif
 }
 
-#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
+#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) && !defined (OCC_MINIMAL_BUILD)
 // =======================================================================
 // function : Aspect_DisplayConnection
 // purpose  :
index 5464195e2a94e7db09ad6163bde8ff93b293116c..5aa3c1a51e9fd1ce85ffbf8b0adfc7e31ed3f176 100755 (executable)
@@ -13,6 +13,8 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#ifndef OCC_MINIMAL_BUILD
+
 #include <Font_FTFont.hxx>
 
 #include <Font_FTLibrary.hxx>
@@ -621,3 +623,5 @@ const FT_Outline* Font_FTFont::renderGlyphOutline (const Standard_Utf32Char theC
   }
   return &myActiveFTFace->glyph->outline;
 }
+
+#endif
index 31976bffc32cfc25ed52afba691a180fca2303fb..856c96b4eafffa9be62a816ea332d669443ab36e 100755 (executable)
@@ -13,6 +13,8 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#ifndef OCC_MINIMAL_BUILD
+
 #include <Font_FTLibrary.hxx>
 
 #include <ft2build.h>
@@ -44,3 +46,5 @@ Font_FTLibrary::~Font_FTLibrary()
     FT_Done_FreeType (myFTLib);
   }
 }
+
+#endif
index 620f8410189504b2daee94634015436f88d9d09c..fb3d3308d39f707651e785c8cae491edcdb06267 100644 (file)
@@ -13,6 +13,8 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#ifndef OCC_MINIMAL_BUILD
+
 #include <Font_FontMgr.hxx>
 
 #include <Font_NameOfFont.hxx>
@@ -1158,3 +1160,5 @@ Handle(NCollection_Buffer) Font_FontMgr::EmbedFallbackFont()
                                  Font_DejavuSans_Latin_woff_size,
                                  const_cast<Standard_Byte*>(Font_DejavuSans_Latin_woff));
 }
+
+#endif
index c32f253f87a5459888bb9c70c5debc96cd694a59..6bdeb40feed4d7249ef01bac9d79a1a6f3e40c20 100644 (file)
@@ -13,6 +13,8 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#ifndef OCC_MINIMAL_BUILD
+
 #include <Font_TextFormatter.hxx>
 
 #include <Font_FTFont.hxx>
@@ -424,3 +426,5 @@ Standard_ShortReal Font_TextFormatter::LineWidth (const Standard_Integer theInde
 
   return 0;
 }
+
+#endif
index eea797ce7f5ff82e58ca776d777f479f9bcee357..966a48b034727d785fc16e8b5093755601c8d210 100644 (file)
 #include <BRepBndLib.hxx>
 #include <Bnd_Box.hxx>
 #include <ElCLib.hxx>
+
+#ifndef OCC_MINIMAL_BUILD
 #include <Font_BRepFont.hxx>
 #include <Font_BRepTextBuilder.hxx>
+#endif
+
 #include <GC_MakeCircle.hxx>
 #include <Geom_Line.hxx>
 #include <GeomAdaptor_Curve.hxx>
@@ -311,6 +315,7 @@ TCollection_ExtendedString PrsDim_Dimension::GetValueString (Standard_Real& theW
 
   theWidth = 0.0;
 
+#ifndef OCC_MINIMAL_BUILD
   if (myDrawer->DimensionAspect()->IsText3d())
   {
     // text width produced by BRepFont
@@ -341,6 +346,7 @@ TCollection_ExtendedString PrsDim_Dimension::GetValueString (Standard_Real& theW
       }
     }
   }
+#endif
 
   return aValueStr;
 }
@@ -412,6 +418,9 @@ void PrsDim_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentati
                                  const Standard_Integer theLabelPosition)
 {
   Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
+
+
+#ifndef OCC_MINIMAL_BUILD
   if (myDrawer->DimensionAspect()->IsText3d())
   {
     // getting font parameters
@@ -545,6 +554,9 @@ void PrsDim_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentati
 
     return;
   }
+#else
+  (void)theLabelPosition;
+#endif
 
   // generate primitives for 2D text
   myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION);
index 177601b9e90b400723cdfe586fc51a8b73e620a5..1686b996c207175050a52aadd3c244cddd150be1 100644 (file)
@@ -12,6 +12,8 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#ifndef OCC_MINIMAL_BUILD
+
 #include <StdPrs_BRepFont.hxx>
 
 #include <BRep_Tool.hxx>
@@ -670,3 +672,5 @@ Standard_Boolean StdPrs_BRepFont::renderGlyph (const Standard_Utf32Char theChar,
   myCache.Bind (theChar, theShape);
   return !theShape.IsNull();
 }
+
+#endif
\ No newline at end of file
index 9facb1d7f68672ef1ae41a7da7c5caae9c9c961d..0769f312486fd78fb20fee53d83e5857199e64f9 100644 (file)
@@ -12,6 +12,7 @@
 //
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
+#ifndef OCC_MINIMAL_BUILD
 
 #include <StdPrs_BRepTextBuilder.hxx>
 
@@ -75,3 +76,5 @@ TopoDS_Shape StdPrs_BRepTextBuilder::Perform (StdPrs_BRepFont&
 
   return Perform (theFont, aFormatter, thePenLoc);
 }
+
+#endif
\ No newline at end of file
index c3d9de7016df30e78b521007f6a072ca4e120a1f..6ac8abccba9d8529a13510be129d36c39c64c848 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <Xw_Window.hxx>
 
-#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
+#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) && !defined (OCC_MINIMAL_BUILD)
 
 #include <Aspect_Convert.hxx>
 #include <Aspect_WindowDefinitionError.hxx>