0028999: Modify Qt Browser build option
authornds <nds@opencascade.com>
Tue, 15 Aug 2017 13:52:59 +0000 (16:52 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 24 Aug 2017 16:12:26 +0000 (19:12 +0300)
'BUILD_Inspector' CMake option switches ON/OFF Inspector in compilation procedure (add additional dependency to Qt third party product)
'inspector.bat' starts sample to demonstrate possibilities of this tool.
Replacing TOOLS to INSPECTOR key for 'pload' command in DRAW cases due to this change in DrawPlugin.

19 files changed:
CMakeLists.txt
adm/cmake/occt_macros.cmake
adm/cmake/occt_toolkit_tool.cmake
adm/cmake/qt.cmake [new file with mode: 0644]
adm/cmake/qt5.cmake [deleted file]
adm/cmake/qt5_macro.cmake [deleted file]
adm/cmake/qt_macro.cmake [new file with mode: 0644]
adm/cmake/vardescr.cmake
adm/templates/TInspectorEXE.vcxproj.user.in [new file with mode: 0644]
adm/templates/dfbrowser.bat [deleted file]
adm/templates/dfbrowser.sh [deleted file]
adm/templates/inspector.bat [new file with mode: 0644]
adm/templates/inspector.sh [new file with mode: 0644]
samples/tools/TInspectorEXE/TInspectorEXE.cxx
samples/tools/TStandalone/CMakeLists.txt
samples/tools/TStandalone/adm/cmake/occt_toolkit_standalone.cmake
src/DrawResources/DrawPlugin
tests/tools/dfbrowser/A1
tests/tools/dfbrowser/A2

index eac91c2..006cafa 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)
@@ -777,7 +776,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")
@@ -796,7 +795,7 @@ else()
 
   # 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()
 
@@ -978,11 +977,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 +989,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
index 65ac4d4..d0a3d99 100644 (file)
@@ -116,7 +116,7 @@ function (FIND_SUBDIRECTORY ROOT_DIRECTORY DIRECTORY_SUFFIX SUBDIRECTORY_NAME)
   foreach (SUBDIR_NAME ${SUBDIR_NAME_LIST})
     #message("Subdir: ${SUBDIR_NAME}, ${DIRECTORY_SUFFIX}")
     # REGEX failed if the directory name contains '++' combination, so we replace it
-    string(REPLACE "++" "\\+\\+" SUBDIR_NAME_ESCAPED ${SUBDIR_NAME})
+    string(REPLACE "+" "\\+" SUBDIR_NAME_ESCAPED ${SUBDIR_NAME})
     string (REGEX MATCH "${SUBDIR_NAME_ESCAPED}" DOES_PATH_CONTAIN "${DIRECTORY_SUFFIX}")
     if (DOES_PATH_CONTAIN)
       set(${SUBDIRECTORY_NAME} "${ROOT_DIRECTORY}/${SUBDIR_NAME}" PARENT_SCOPE)
index 31f686c..09de401 100644 (file)
@@ -1,9 +1,9 @@
 # script for each OCCT tool toolkit
 
 # Qt dependencies
-OCCT_INCLUDE_CMAKE_FILE (adm/cmake/qt5_macro)
+OCCT_INCLUDE_CMAKE_FILE (adm/cmake/qt_macro)
 
-FIND_QT5_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
+FIND_QT_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
 include_directories("${PROJECT_INCLUDES}"
                     "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/tools")
 
diff --git a/adm/cmake/qt.cmake b/adm/cmake/qt.cmake
new file mode 100644 (file)
index 0000000..0f76c94
--- /dev/null
@@ -0,0 +1,20 @@
+#qt
+
+#looking for 3RDPARTY_QT_DIR variable used later in qt_macro.cmake
+SET(CSF_QtCore "QtCore")
+THIRDPARTY_PRODUCT("QT" "" "CSF_QtCore" "d")
+
+list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
+
+list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_INCLUDE_DIR")
+list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_LIBRARY_DIR")
+list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_DLL_DIR")
+
+UNSET (${3RDPARTY_QT_DLL} CACHE)
+UNSET (${3RDPARTY_QT_DLL_DIR} CACHE)
+UNSET (${3RDPARTY_QT_INCLUDE_DIR} CACHE)
+UNSET (${3RDPARTY_QT_LIBRARY} CACHE)
+UNSET (${3RDPARTY_QT_LIBRARY_DIR} CACHE)
+
+set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
+message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
diff --git a/adm/cmake/qt5.cmake b/adm/cmake/qt5.cmake
deleted file mode 100644 (file)
index 2776f50..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#qt
-
-#looking for 3RDPARTY_QT_DIR variable used later in qt5_macro.cmake
-if (${USE_QT4})
-  SET(CSF_QtCore "QtCore")
-  THIRDPARTY_PRODUCT("QT" "" "CSF_QtCore" "d")
-else()
-  SET(CSF_Qt5Core "Qt5Core")
-  THIRDPARTY_PRODUCT("QT" "" "CSF_Qt5Core" "d")
-endif()
-
-list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_INCLUDE_DIR")
-list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_LIBRARY_DIR")
-list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_DLL_DIR")
-
-UNSET (${3RDPARTY_QT_DLL} CACHE)
-UNSET (${3RDPARTY_QT_DLL_DIR} CACHE)
-UNSET (${3RDPARTY_QT_INCLUDE_DIR} CACHE)
-UNSET (${3RDPARTY_QT_LIBRARY} CACHE)
-UNSET (${3RDPARTY_QT_LIBRARY_DIR} CACHE)
-
-set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
diff --git a/adm/cmake/qt5_macro.cmake b/adm/cmake/qt5_macro.cmake
deleted file mode 100644 (file)
index aa33635..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#qt
-
-macro (FIND_QT5_PACKAGE PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
-
-  if ("${3RDPARTY_QT_DIR}" STREQUAL "")
-    message (FATAL_ERROR "Empty Qt dir")
-  endif()
-
-  # Now set CMAKE_PREFIX_PATH to point to local Qt installation.
-  # Without this setting find_package() will not work
-  set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
-  if (USE_QT4)
-    # Now we can apply standard CMake finder for Qt. We do this mostly
-    # to have qt5_wrap_cpp() function available
-    find_package(Qt4)
-    #message (STATUS "Qt cmake configuration at directory ${Qt4DIR}")
-
-    set(PROJECT_INCLUDES ${QT_INCLUDES})
-    if (WIN32)
-      set(PROJECT_LIBRARIES_DEBUG "${3RDPARTY_QT_DIR}/lib/QtCored4.lib;${3RDPARTY_QT_DIR}/lib/QtGuid4.lib")
-      set(PROJECT_LIBRARIES_RELEASE "${3RDPARTY_QT_DIR}/lib/QtCore4.lib;${3RDPARTY_QT_DIR}/lib/QtGui4.lib")
-    else()
-      set(PROJECT_LIBRARIES_DEBUG "${3RDPARTY_QT_DIR}/lib/libQtCore.so;${3RDPARTY_QT_DIR}/lib/libQtGui.so")
-      set(PROJECT_LIBRARIES_RELEASE "${3RDPARTY_QT_DIR}/lib/libQtCore.so;${3RDPARTY_QT_DIR}/lib/libQtGui.so")
-    endif(WIN32)
-  else()
-    # Now we can apply standard CMake finder for Qt4. We do this mostly
-    # to have qt5_wrap_cpp() function available
-    find_package(Qt5 REQUIRED COMPONENTS Widgets)
-    #message (STATUS "Qt cmake configuration at directory ${Qt5DIR}")
-
-    set(PROJECT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS}")
-    set(PROJECT_LIBRARIES_DEBUG "${Qt5Widgets_LIBRARIES}")
-    set(PROJECT_LIBRARIES_RELEASE "${Qt5Widgets_LIBRARIES}")
-  endif()
-endmacro()
-
-
-macro (FIND_AND_WRAP_MOC_FILES SOURCE_FILES)
-  SET(CMAKE_AUTOMOC ON)
-
-  foreach (FILE ${SOURCE_FILES})
-    set (src_files ${src_files} ${FILE})
-    unset (MOC_FILE)
-    if (USE_QT4)
-      qt4_wrap_cpp(MOC_FILE ${FILE})
-    else()
-      qt5_wrap_cpp(MOC_FILE ${FILE})
-    endif()
-    #message (STATUS "... Info: next MOC file ${MOC_FILE}")
-
-  endforeach (FILE)
-
-endmacro()
-
-macro (FIND_AND_WRAP_RESOURCE_FILE RESOURCE_FILE_NAME RCC_FILES)
-  if(EXISTS "${RESOURCE_FILE_NAME}")
-    if (USE_QT4)
-      qt4_add_resources(RCC_FILES "${RESOURCE_FILE_NAME}")
-      # suppress some GCC warnings coming from source files generated from .qrc resources
-      if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
-      endif()
-    else()
-      qt5_add_resources(RCC_FILES "${RESOURCE_FILE_NAME}")
-    endif()
-  endif()
-endmacro()
diff --git a/adm/cmake/qt_macro.cmake b/adm/cmake/qt_macro.cmake
new file mode 100644 (file)
index 0000000..89e9bc5
--- /dev/null
@@ -0,0 +1,70 @@
+#qt
+
+macro (FIND_QT_PACKAGE PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
+
+  if ("${3RDPARTY_QT_DIR}" STREQUAL "")
+    message (FATAL_ERROR "Empty Qt dir")
+  endif()
+
+  # Now set CMAKE_PREFIX_PATH to point to local Qt installation.
+  # Without this setting find_package() will not work
+  set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
+
+  # Now we can apply standard CMake finder for Qt5. We do this mostly
+  # to have qt5_wrap_cpp() function available
+  find_package(Qt5 QUIET COMPONENTS Widgets PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
+  if (${Qt5_FOUND})
+    #message (STATUS "Qt5 cmake configuration")
+
+    set(PROJECT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS}")
+    set(PROJECT_LIBRARIES_DEBUG "${Qt5Widgets_LIBRARIES}")
+    set(PROJECT_LIBRARIES_RELEASE "${Qt5Widgets_LIBRARIES}")
+  else()
+    # Now we can apply standard CMake finder for Qt. We do this mostly
+    # to have qt4_wrap_cpp() function available
+    find_package(Qt4)
+
+    #message (STATUS "Qt4 cmake configuration")
+    set(PROJECT_INCLUDES ${QT_INCLUDES})
+    if (WIN32)
+      set(PROJECT_LIBRARIES_DEBUG "${3RDPARTY_QT_DIR}/lib/QtCored4.lib;${3RDPARTY_QT_DIR}/lib/QtGuid4.lib")
+      set(PROJECT_LIBRARIES_RELEASE "${3RDPARTY_QT_DIR}/lib/QtCore4.lib;${3RDPARTY_QT_DIR}/lib/QtGui4.lib")
+    else()
+      set(PROJECT_LIBRARIES_DEBUG "${3RDPARTY_QT_DIR}/lib/libQtCore.so;${3RDPARTY_QT_DIR}/lib/libQtGui.so")
+      set(PROJECT_LIBRARIES_RELEASE "${3RDPARTY_QT_DIR}/lib/libQtCore.so;${3RDPARTY_QT_DIR}/lib/libQtGui.so")
+    endif(WIN32)
+  endif()
+endmacro()
+
+
+macro (FIND_AND_WRAP_MOC_FILES SOURCE_FILES)
+
+  SET(CMAKE_AUTOMOC ON)
+
+  foreach (FILE ${SOURCE_FILES})
+    set (src_files ${src_files} ${FILE})
+    unset (MOC_FILE)
+    if (${Qt5_FOUND})
+      qt5_wrap_cpp(MOC_FILE ${FILE})
+    else()
+      qt4_wrap_cpp(MOC_FILE ${FILE})
+    endif()
+    #message (STATUS "... Info: next MOC file ${MOC_FILE}")
+
+  endforeach (FILE)
+
+endmacro()
+
+macro (FIND_AND_WRAP_RESOURCE_FILE RESOURCE_FILE_NAME RCC_FILES)
+  if(EXISTS "${RESOURCE_FILE_NAME}")
+    if (${Qt5_FOUND})
+      qt5_add_resources(RCC_FILES "${RESOURCE_FILE_NAME}")
+    else()
+      qt4_add_resources(RCC_FILES "${RESOURCE_FILE_NAME}")
+      # suppress some GCC warnings coming from source files generated from .qrc resources
+      if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
+      endif()
+    endif()
+  endif()
+endmacro()
index a218070..331c6e4 100644 (file)
@@ -122,6 +122,13 @@ set (BUILD_MODULE_MfcSamples_DESCR
 These samples show some possibilities of using OCCT and they can be executed
 with script samples.bat from the installation directory (INSTALL_DIR)")
 
+set (BUILD_Inspector_DESCR
+"Indicates whether OCCT inspector should be built together with OCCT.
+This inspector provides functionality to interactively inspect low-level content
+of the OCAF data model, OCCT viewer, etc. have been introduced in OCCT.
+It can be executed with script inspector.bat from the installation directory (INSTALL_DIR) or
+using 'tinspector' command in DRAW interpretator")
+
 set (BUILD_MODULE_UwpSample_DESCR
 "Indicates whether OCCT UWP sample should be built together with OCCT.")
 
@@ -172,11 +179,6 @@ 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 (BUILD_QT_TOOLS_DESCR "Indicates whether OCCT tools should be build or not")
-
-set (USE_QT_TOOLS_DESCR "Indicates whether OCCT tools should be used or not
-The tools will be searched in third-party directory or may be set manually")
-
 macro (BUILD_MODULE MODULE_NAME)
   set (ENABLE_MODULE TRUE)
   set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
diff --git a/adm/templates/TInspectorEXE.vcxproj.user.in b/adm/templates/TInspectorEXE.vcxproj.user.in
new file mode 100644 (file)
index 0000000..87277f3
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
+  <LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
+CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
+QTDIR=@3RDPARTY_QT_DIR@
+PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
+ </LocalDebuggerEnvironment>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ <LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
+  <LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
+CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
+QTDIR=@3RDPARTY_QT_DIR@
+PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
+ </LocalDebuggerEnvironment>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ <LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
+  <LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
+CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
+QTDIR=@3RDPARTY_QT_DIR@
+PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
+ </LocalDebuggerEnvironment>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ <LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/adm/templates/dfbrowser.bat b/adm/templates/dfbrowser.bat
deleted file mode 100644 (file)
index 0d971e5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-@echo off
-
-rem Setup environment and launch TInspector
-call "%~dp0env.bat" %1 %2 %3
-
-TInspectorEXE.exe --dfbrowser
-
diff --git a/adm/templates/dfbrowser.sh b/adm/templates/dfbrowser.sh
deleted file mode 100644 (file)
index 2dde874..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-aCurrentPath="$PWD"
-aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
-
-source "${aScriptPath}/env.sh" "$1"
-
-cd ${aCurrentPath}
-TInspectorEXE --dfbrowser
diff --git a/adm/templates/inspector.bat b/adm/templates/inspector.bat
new file mode 100644 (file)
index 0000000..3ffa7ad
--- /dev/null
@@ -0,0 +1,17 @@
+@echo off
+
+rem Use:
+rem - first argument specifies version of Visual Studio (vc8, vc9, or vc10),
+rem - second argument specifies architecture (win32 or win64),
+rem - third argument specifies build mode (Debug or Release)
+rem - fourth and next arguments specify loaded tool plugins
+rem     The arguments are: dfbrowser shapeview vinspector
+rem     If there are no tool plugins are specified, all plugins will be loaded
+rem Default options are:
+rem   vc8 win32 Release
+
+rem Setup environment and launch TInspector
+call "%~dp0env.bat" %1 %2 %3
+
+TInspectorEXE.exe %*
+
diff --git a/adm/templates/inspector.sh b/adm/templates/inspector.sh
new file mode 100644 (file)
index 0000000..d79f099
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+aCurrentPath="$PWD"
+aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
+
+source "${aScriptPath}/env.sh" "$1"
+
+cd ${aCurrentPath}
+TInspectorEXE
index 8b85620..5d3e051 100644 (file)
@@ -86,13 +86,13 @@ int main (int argc, char** argv)
   std::set<TCollection_AsciiString> aPlugins;
   for (int anArgId = 1; anArgId < argc; anArgId++ )
   {
-    if (!strcmp (argv[anArgId], "--dfbrowser"))
+    if (!strcmp (argv[anArgId], "dfbrowser"))
       aPlugins.insert ("TKDFBrowser");
 
-    if (!strcmp (argv[anArgId], "--shapeview"))
+    if (!strcmp (argv[anArgId], "shapeview"))
       aPlugins.insert ("TKShapeView");
 
-    if (!strcmp (argv[anArgId], "--vinspector"))
+    if (!strcmp (argv[anArgId], "vinspector"))
       aPlugins.insert ("TKVInspector");
   }
   NCollection_List<Handle(Standard_Transient)> aParameters;
index 4708389..a48dfe8 100644 (file)
@@ -5,8 +5,6 @@ set (CASROOT "" CACHE PATH "Third party OpenCascade dir" )
 set (3RDPARTY_DIR "" CACHE PATH "Third party dir" )
 set (INSTALL_DIR "" CACHE PATH "Where to install" )
 
-set (USE_QT4 ON CACHE BOOL "${USE_QT4}")
-
 if (NOT "$ENV{CASROOT}" STREQUAL "" AND EXISTS "$ENV{CASROOT}")
   set (CASROOT "$ENV{CASROOT}")
   #set (3RDPARTY_OCCT_DIR "${CASROOT}")
@@ -69,7 +67,7 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps")
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
-OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt5")
+OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
 
 #include (${CMAKE_SOURCE_DIR}/adm/cmake/3rdparty.cmake)
@@ -106,7 +104,7 @@ message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all header files i
 COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "${CASROOT_SOURCE_FILES}/tools" "${INSTALL_DIR_INCLUDE}")
 
 OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/standalone_macros")
-OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt5_macro")
+OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt_macro")
 
 set (BUILD_PROJECTS
   TInspectorAPI
index a8245ae..2eafae1 100644 (file)
@@ -19,7 +19,7 @@ FIND_SOURCES_AND_HEADERS_FILES(${SOURCE_DIR} SOURCE_FILES HEADER_FILES)
 
 unset(RCC_FILES)
 if (USE_QT)
-  FIND_QT5_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
+  FIND_QT_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
 
   FIND_AND_WRAP_MOC_FILES("${SOURCE_FILES}")
   FIND_AND_WRAP_RESOURCE_FILE("${SOURCE_DIR}/${PROJECT_NAME}.qrc" RCC_FILES)
index 722f756..5ab992a 100755 (executable)
@@ -48,4 +48,4 @@ TOBJ               : TKTObjDRAW
 DFBROWSER          : TKDFBrowser
 QAcommands         : TKQADraw
 VIS                : TKIVtkDraw
-TOOLS              : TKToolsDraw
+INSPECTOR          : TKToolsDraw
index 05ceb6c..2792359 100644 (file)
@@ -1,5 +1,5 @@
 pload DCAF
-pload TOOLS
+pload INSPECTOR
 
 NewDocument Doc BinOcaf
 
index ba9d9af..6e29d00 100644 (file)
@@ -1,6 +1,6 @@
 pload DCAF
 pload VISUALIZATION
-pload TOOLS
+pload INSPECTOR
 
 chrono qat start
 # Create a new document and set UndoLimit