0028599: Replacement of old Boolean operations with new ones in BRepProj_Projection...
[occt.git] / CMakeLists.txt
index eac91c2..feeaa9a 100644 (file)
@@ -347,6 +347,8 @@ if (MSVC)
   set (BUILD_MODULE_MfcSamples OFF CACHE BOOL "${BUILD_MODULE_MfcSamples_DESCR}")
 endif()
 
+set (BUILD_Inspector OFF CACHE BOOL "${BUILD_Inspector_DESCR}")
+
 # uwp sample
 if (MSVC)
   if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
@@ -365,9 +367,6 @@ if (WIN32)
   set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
 endif()
 
-set (USE_QT_TOOLS OFF CACHE BOOL "${USE_QT_TOOLS_DESCR}")
-set (USE_QT4 ON CACHE BOOL "${USE_QT4}")
-
 # Enable/Disable the floating point exceptions (FPE) during runtime.
 if (NOT BUILD_ENABLE_FPE_SIGNAL_HANDLER)
   set (BUILD_ENABLE_FPE_SIGNAL_HANDLER OFF CACHE BOOL "${BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR}" FORCE)
@@ -516,6 +515,7 @@ 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")
@@ -656,11 +656,13 @@ if (CAN_USE_EIGEN)
     OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
   else()
     OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
+    OCCT_CHECK_AND_UNSET ("INSTALL_EIGEN")
   endif()
 else()
   OCCT_CHECK_AND_UNSET ("USE_EIGEN")
 
   OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
+  OCCT_CHECK_AND_UNSET ("INSTALL_EIGEN")
 endif()
 
 # Doxygen
@@ -777,7 +779,7 @@ endif()
 # include the patched or original list of tools
 # list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
 # list <OCCT_TOOLS> will contain all tools
-if (NOT USE_QT_TOOLS)
+if (NOT BUILD_Inspector)
   OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
   OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
   OCCT_CHECK_AND_UNSET ("INSTALL_QT")
@@ -790,13 +792,12 @@ else()
   # collect all the headers to <binary dir>/inc folder
   string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
   message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/tools/inc ...")
-  COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}" "${BUILD_TOOL_TOOLKITS}" "${CMAKE_SOURCE_DIR}/tools" "tools")
-  include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/tools)
+  COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "${CMAKE_SOURCE_DIR}/tools" "${INSTALL_DIR_INCLUDE}/inspector")
 
 
   # check qt 3rdparty path
   add_definitions (-DHAVE_QT)
-  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt5")
+  OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
   message (STATUS "Info: Qt is used by OCCT")
 endif()
 
@@ -872,6 +873,22 @@ else()
   OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}")
 endif()
 
+if (WIN32)
+  set (THIRDPARTY_DIR_REPLACE "%THIRDPARTY_DIR%")
+else()
+  set (THIRDPARTY_DIR_REPLACE "\${THIRDPARTY_DIR}")
+endif()
+get_cmake_property(USED_3RDPARTY_CACHE_VARIABLES VARIABLES)
+string (REGEX MATCHALL "(^|;)USED_3RDPARTY_[^;]+_DIR[^;]*" USED_3RDPARTY_CACHE_VARIABLES "${USED_3RDPARTY_CACHE_VARIABLES}")
+file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
+foreach (USED_3RDPARTY_CACHE_VARIABLE ${USED_3RDPARTY_CACHE_VARIABLES})
+   file (TO_CMAKE_PATH "${${USED_3RDPARTY_CACHE_VARIABLE}}" ${USED_3RDPARTY_CACHE_VARIABLE})
+   string (REPLACE "${3RDPARTY_DIR}" "${THIRDPARTY_DIR_REPLACE}" ${USED_3RDPARTY_CACHE_VARIABLE} "${${USED_3RDPARTY_CACHE_VARIABLE}}")
+   if (NOT WIN32)
+     string (REGEX REPLACE ";" ":" ${USED_3RDPARTY_CACHE_VARIABLE} "${${USED_3RDPARTY_CACHE_VARIABLE}}")
+   endif()
+endforeach()
+
 # write current custom.bat/sh (for install directory)
 set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
 OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR_SCRIPT}")
@@ -978,11 +995,11 @@ endif()
 
 if (BUILD_TOOL_TOOLKITS)
   # copy tinspector script to install script folder
-  if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/dfbrowser.${SCRIPT_EXT}")
-    install (FILES "${BUILD_PATCH}/adm/templates/dfbrowser.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR_SCRIPT}"
+  if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}")
+    install (FILES "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR_SCRIPT}"
             PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
   else()
-    install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/dfbrowser.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR_SCRIPT}"
+    install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR_SCRIPT}"
             PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
   endif()
 
@@ -990,6 +1007,9 @@ if (BUILD_TOOL_TOOLKITS)
   foreach (BUILD_SAMPLE_TOOL_TOOLKIT ${BUILD_SAMPLE_TOOLKITS})
     OCCT_ADD_SUBDIRECTORY ("samples/tools/${BUILD_SAMPLE_TOOL_TOOLKIT}")
   endforeach()
+
+  # patch TInspectorEXE
+  OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/samples/tools/TInspectorEXE/TInspectorEXE.vcxproj.user")
 endif()
 
 # Prepare variables for configuration of OpenCASCADE cmake config file