1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0029684: Configuration: modification of build Inspector tool standalone on occt

- samples/tools/TStandalone is removed, to build Inspector out of OCCT, CMake should use tools/CMakeLists.txt fileName
- samples/tools/TInspectorEXE is moved to tools/TInspectorEXE
- TInspectorAPI_Version.hxx provides compilation inspector with earlier version of OCCT.
This commit is contained in:
nds 2018-04-12 06:56:58 +03:00 committed by bugmaster
parent 1ccef79a2a
commit ae5225dfcd
55 changed files with 492 additions and 587 deletions

View File

@ -805,6 +805,8 @@ endif()
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
# list <OCCT_TOOLS> will contain all tools
if (BUILD_Inspector)
add_definitions (-DHAVE_Inspector)
OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
foreach (OCCT_TOOL ${OCCT_TOOLS})
list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
@ -1028,11 +1030,6 @@ if (BUILD_Inspector OR BUILD_MODULE_QtSamples)
message (STATUS "Info: qt samples excluded due to BUILD_MODULE_QtSamples is disabled")
endif()
if (NOT BUILD_Inspector)
list (REMOVE_ITEM OCCT_SAMPLES tools)
message (STATUS "Info: TInspectorEXE sample excluded due to BUILD_Inspector is disabled")
endif()
foreach (OCCT_SAMPLE ${OCCT_SAMPLES})
list (APPEND BUILD_SAMPLE_TOOLKITS ${${OCCT_SAMPLE}_SAMPLES_TOOLKITS})
@ -1061,8 +1058,9 @@ if (BUILD_TOOL_TOOLKITS)
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
endif()
set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
# patch TInspectorEXE
OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/samples/tools/TInspectorEXE/TInspectorEXE.vcxproj.user")
OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/tools/TInspectorEXE/TInspectorEXE.vcxproj.user")
endif()
# Prepare variables for configuration of OpenCASCADE cmake config file

View File

@ -1,2 +1 @@
qt AndroidQt FuncDemo IESample Tutorial
tools TInspectorEXE
qt AndroidQt FuncDemo IESample Tutorial

View File

@ -1,4 +1,4 @@
TModelingData TKShapeView
TVisualization TKView TKVInspector
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
TTool TKTInspector TKToolsDraw
TTool TKTInspector TKToolsDraw TInspectorEXE

View File

@ -4,7 +4,7 @@
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
QTDIR=@3RDPARTY_QT_DIR@
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@;%PATH%
</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
@ -13,7 +13,7 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
QTDIR=@3RDPARTY_QT_DIR@
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@i;%PATH%
</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
@ -22,7 +22,7 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
QTDIR=@3RDPARTY_QT_DIR@
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@d;%PATH%
</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>

View File

@ -1,7 +0,0 @@
project(TInspectorEXE)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
set (RELATIVE_DIR "samples/tools")
include_directories("${CMAKE_SOURCE_DIR}/${RELATIVE_DIR}/TInspectorEXE/src")
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)

View File

@ -1,2 +0,0 @@
EXTERNLIB
PACKAGES

View File

@ -1 +0,0 @@
TInspectorEXE/src

View File

@ -1,6 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file alias="folder_open.png">../icons/folder_open.png</file>
<file alias="folder_import.png">../icons/folder_import.png</file>
</qresource>
</RCC>

View File

@ -1,125 +0,0 @@
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
project (TStandalone)
set (CASROOT "" CACHE PATH "Third party OpenCascade dir" )
set (3RDPARTY_DIR "" CACHE PATH "Third party dir" )
set (INSTALL_DIR "" CACHE PATH "Where to install" )
if (NOT "$ENV{CASROOT}" STREQUAL "" AND EXISTS "$ENV{CASROOT}")
set (CASROOT "$ENV{CASROOT}")
#set (3RDPARTY_OCCT_DIR "${CASROOT}")
#message("Environment CASROOT: ${CASROOT}")
#message("Environment 3RDPARTY_OCCT_DIR: ${CASROOT}")
endif()
if (NOT "$ENV{THIRDPARTY_DIR}" STREQUAL "" AND EXISTS "$ENV{THIRDPARTY_DIR}")
set (3RDPARTY_DIR "$ENV{THIRDPARTY_DIR}")
message("Environment THIRDPARTY_DIR: ${3RDPARTY_DIR}")
endif()
if (NOT "$ENV{INSTALL_DIR}" STREQUAL "")
set (INSTALL_DIR "$ENV{INSTALL_DIR}")
message("Environment INSTALL_DIR: ${INSTALL_DIR}")
endif()
# Define the next variable to has defined 3rdParties DLL dir variables
set (BUILD_SHARED_LIBS ON)
set (CASROOT_SOURCE_FILES "${CMAKE_SOURCE_DIR}/../../.." CACHE PATH "OCCT sources dir to find tools packages" )
if ("${CASROOT}" STREQUAL "")
set (CASROOT "${CASROOT_SOURCE_FILES}/work/install" CACHE PATH "OCCT sources dir to find tools packages" )
endif()
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
include (${CASROOT_SOURCE_FILES}/${BEING_INCLUDED_FILE}.cmake)
endmacro()
macro (OCCT_INCLUDE_CMAKE_FILE_STANDALONE BEING_INCLUDED_FILE)
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
endmacro()
set (ADDITIONAL_DLL_DIR "" CACHE PATH "Additional paths that should be included into PATH" )
if (NOT "$ENV{ADDITIONAL_DLL_DIR}" STREQUAL "")
set (ADDITIONAL_DLL_DIR "$ENV{ADDITIONAL_DLL_DIR}")
message("Environment ADDITIONAL_DLL_DIR: ${ADDITIONAL_DLL_DIR}")
endif()
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_INCLUDE_CMAKE_FILE_STANDALONE("adm/cmake/occt")
if (OCCT_LIBRARY_NOT_FOUND)
message (FATAL_ERROR "Could NOT find OCCT Library in : ${3RDPARTY_OCCT_LIBRARY_DIR}" )
endif()
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
set (INSTALL_API_DIR "${INSTALL_DIR}/api" CACHE PATH "" FORCE)
set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "" FORCE)
set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "" FORCE)
set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "")
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/qt")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
#include (${CMAKE_SOURCE_DIR}/adm/cmake/3rdparty.cmake)
set (3RDPARTY_DLL_PATH "${USED_3RDPARTY_OCCT_DIRS};\
${USED_3RDPARTY_FREETYPE_DIR};\
${USED_3RDPARTY_FREEIMAGE_DIRS};\
${USED_3RDPARTY_GL2PS_DIRS};\
${3RDPARTY_QT_DIR}/bin;\
${3RDPARTY_TBB_DLL_DIR}")
if (ADDITIONAL_DLL_DIR)
set (3RDPARTY_DLL_PATH "${3RDPARTY_DLL_PATH};\
${ADDITIONAL_DLL_DIR}")
endif()
set (3RDPARTY_DLL_DEB_PATH "${3RDPARTY_DLL_PATH}")
set (BUILD_TOOLKITS
TKTInspectorAPI
TKView
TKTreeModel
TKDFBrowser
TKVInspector
TKShapeView
TKTInspector
TKToolsDraw
)
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all header files into ${CMAKE_BINARY_DIR}/inc ...")
# collect all the headers to <binary dir>/inc folder
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "${CASROOT_SOURCE_FILES}/tools" "${INSTALL_DIR_INCLUDE}/inspector")
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/standalone_macros")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt_macro")
set (BUILD_PROJECTS
TInspectorAPI
View
TreeModel
DFBrowserPane
DFBrowserPaneXDE
DFBrowser
ShapeView
VInspector
TInspector
TInspectorEXE
ToolsDraw
)
# include patched toolkit projects or original ones
foreach (PROJECT_ITEM ${BUILD_PROJECTS})
OCCT_ADD_SUBDIRECTORY ("src/${PROJECT_ITEM}")
endforeach()

View File

@ -1,75 +0,0 @@
#freeimage
if(NOT "${CASROOT}" STREQUAL "")
#message(FATAL_ERROR, "Empty OCCT dir")
#return()
#set("3RDPARTY_OCCT_DIR ${CASROOT}")
endif()
#set(3RDPARTY_OCC_DIR ${CASROOT})
#message("3RDPARTY_OCC_DIR: ${3RDPARTY_OCC_DIR}")
#set("3RDPARTY_OCC_DIR ${3RDPARTY_OCCT_DIR}")
#message("3RDPARTY_OCC_DIR: ${3RDPARTY_OCC_DIR}")
set(CSF_TKernel "TKernel")
THIRDPARTY_PRODUCT("OCCT" "Standard.hxx" "CSF_TKernel" "")
set(3RDPARTY_OCCT_DIR ${3RDPARTY_OCC_DIR} CACHE PATH "OCCT dir")
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
SET(3RDPARTY_OCCT_INCLUDE_DIR "${3RDPARTY_OCC_INCLUDE_DIR}" CACHE PATH "OCCT include dir")
SET(3RDPARTY_OCCT_LIBRARY_DIR "${3RDPARTY_OCC_LIBRARY_DIR}" CACHE PATH "OCCT library dir")
SET(3RDPARTY_OCCT_DLL_DIR "${3RDPARTY_OCC_DLL_DIR}" CACHE PATH "OCCT dll dir")
SET(CSF_StandardDefaults_DIR ${CASROOT}/src/StdResource CACHE PATH "OCCT Standard Resource")
SET(CSF_XCAFDefaults_DIR ${CASROOT}/src/StdResource CACHE PATH "OCCT XCAF Defaults")
SET(CSF_PluginDefaults_DIR ${CASROOT}/src/StdResource CACHE PATH "OCCT Plugin Defaults")
message (STATUS "... OCCT dir: ${3RDPARTY_OCCT_DIR}")
message (STATUS "... OCCT Include dirs: ${3RDPARTY_OCCT_INCLUDE_DIR}")
message (STATUS "... OCCT Library dirs: ${3RDPARTY_OCCT_LIBRARY_DIRS}")
message (STATUS "... OCCT Binary dirs: ${3RDPARTY_OCCT_DLL_DIRS}")
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${3RDPARTY_OCCT_LIBRARY_DIRS}")
find_library(TKernel TKernel PATHS "${3RDPARTY_OCCT_LIBRARY_DIRS}"
PATH_SUFFIXES lib
NO_DEFAULT_PATH)
if ("${TKernel}" STREQUAL "TKernel-NOTFOUND")
set (OCCT_LIBRARY_NOT_FOUND ON)
endif()
find_library(TKMath TKMath)
find_library(TKCAF TKCAF)
find_library(TKCDF TKCDF)
find_library(TKLCAF TKLCAF)
find_library(TKVCAF TKVCAF)
find_library(TKBRep TKBRep)
find_library(TKService TKService)
find_library(TKOpenGl TKOpenGl)
find_library(TKV3d TKV3d)
find_library(TKXCAF TKXCAF)
find_library(TKXSBase TKXSBase)
find_library(TKXDESTEP TKXDESTEP)
find_library(TKXmlXCAF TKXmlXCAF)
find_library(TKXml TKXml)
find_library(TKBin TKBin)
find_library(TKBinL TKBinL)
find_library(TKBinXCAF TKBinXCAF)
find_library(TKStd TKStd)
find_library(TKXmlL TKXmlL)
find_library(TKStdL TKStdL)
# VInspector additionally:
find_library(TKBO TKBO)
# ShapeView additionally:
find_library(TKGeomBase TKGeomBase)
find_library(TKG3d TKG3d)

View File

@ -1,115 +0,0 @@
# script for each OCCT toolkit
#Qt dependencies
#message ("Project is ${PROJECT_NAME}")
if (EXECUTABLE_PROJECT)
set (PACKAGE_PREFIX_DIR "samples/tools")
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}/../${PROJECT_NAME})
include_directories("${SOURCE_DIR}")
#message("Inc dir: ${CMAKE_SOURCE_DIR}/../${PROJECT_NAME}")
else()
set (PACKAGE_PREFIX_DIR "tools")
SET(SOURCE_DIR ${CASROOT_SOURCE_FILES}/${PACKAGE_PREFIX_DIR}/${PROJECT_NAME})
endif()
FIND_SOURCES_AND_HEADERS_FILES(${SOURCE_DIR} SOURCE_FILES HEADER_FILES)
#message ("Source dir is ${SOURCE_DIR}")
#message ("Sources are ${SOURCE_FILES}")
unset(RCC_FILES)
if (USE_QT)
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)
endif()
if (TOOLKIT_NAME)
set(TARGET_NAME TK${PROJECT_NAME})
else ()
set(TARGET_NAME ${PROJECT_NAME})
endif()
if (EXECUTABLE_PROJECT)
add_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES})
else()
add_library(${TARGET_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES})
endif()
include_directories(
${PROJECT_INCLUDES}
${SOURCE_DIR}
${3RDPARTY_OCCT_INCLUDE_DIR}
"${CMAKE_BINARY_DIR}/inc")
add_definitions(-D__WIN32__)
add_definitions(-DWNT)
add_definitions(-D__${PROJECT_NAME}_DLL)
# parce EXTERNLIB file
FILE_TO_LIST ("src/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
if (NOT COMMENT_FOUND)
set (LIB_ITEM ${USED_ITEM})
set (LIB_PARSED_ITEM ${${USED_ITEM}})
if (LIB_PARSED_ITEM)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${${USED_ITEM}})
#message("Append external lib: ${${USED_ITEM}}")
else ()
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
#message("Append lib: ${USED_ITEM}")
endif()
endif()
endforeach()
target_link_libraries (${TARGET_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT})
if (USE_QT)
target_link_libraries (${TARGET_NAME} debug ${PROJECT_LIBRARIES_DEBUG})
target_link_libraries (${TARGET_NAME} optimized ${PROJECT_LIBRARIES_RELEASE})
if (NOT "${RCC_FILES}" STREQUAL "")
#message("RCC files: ${RCC_FILES}")
target_sources(${TARGET_NAME} PRIVATE ${RCC_FILES})
endif()
endif()
if (EXECUTABLE_PROJECT)
INSTALL(TARGETS ${TARGET_NAME} DESTINATION "${INSTALL_DIR_BIN}")
else()
if (MSVC)
install (DIRECTORY ${PROJECT_BINARY_DIR}/Debug/
DESTINATION "${INSTALL_DIR_BIN}"
FILES_MATCHING PATTERN *.pdb)
if (INSTALL_API_DIR)
install (DIRECTORY ${PROJECT_BINARY_DIR}/Debug/
DESTINATION "${INSTALL_API_DIR}/bin"
FILES_MATCHING PATTERN *.pdb)
endif()
endif()
install (TARGETS ${TARGET_NAME}
RUNTIME DESTINATION "${INSTALL_DIR_BIN}"
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}"
LIBRARY DESTINATION "${INSTALL_DIR_LIB}")
if (INSTALL_API_DIR)
install (TARGETS ${TARGET_NAME}
RUNTIME DESTINATION "${INSTALL_API_DIR}/bin")
if (INSTALL_API)
INSTALL(FILES ${HEADER_FILES} DESTINATION "${INSTALL_API_DIR}/${INSTALL_DIR_INCLUDE}")
install (DIRECTORY ${PROJECT_BINARY_DIR}/Debug/
DESTINATION "${INSTALL_API_DIR}/lib"
FILES_MATCHING PATTERN *.lib)
endif()
endif()
endif()

View File

@ -1,33 +0,0 @@
#freeimage
macro (FIND_SOURCES_AND_HEADERS_FILES CURRENT_SOURCES_DIR SOURCE_FILES HEADER_FILES)
if (EXISTS "${CURRENT_SOURCES_DIR}/FILES")
file (STRINGS "${CURRENT_SOURCES_DIR}/FILES" HEADER_FILES_H REGEX ".+[.]h")
file (STRINGS "${CURRENT_SOURCES_DIR}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if (NOT "${HEADER_FILES_H}" STREQUAL "")
foreach (ORIGIN_FILE ${HEADER_FILES_H})
list (APPEND HEADER_FILES_ ${CURRENT_SOURCES_DIR}/${ORIGIN_FILE})
endforeach()
#message("${HEADER_FILES_}")
set(${HEADER_FILES} ${HEADER_FILES_})
endif()
if(NOT "${SOURCE_FILES_C}" STREQUAL "")
foreach (ORIGIN_FILE ${SOURCE_FILES_C})
list (APPEND SOURCE_FILES_ ${CURRENT_SOURCES_DIR}/${ORIGIN_FILE})
endforeach()
#message("${SOURCE_FILES_}")
set(${SOURCE_FILES} ${SOURCE_FILES_})
endif()
#set(${HEADER_FILES} ${HEADER_FILES_H})
#set(${SOURCE_FILES} ${SOURCE_FILES_C})
else()
message(WARNING "file FILES is absent in $TARGET")
endif()
endmacro()

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<LocalDebuggerEnvironment>PATH=@3RDPARTY_DLL_DEB_PATH@;@CMAKE_INSTALL_PREFIX@/@INSTALL_DIR_BIN@;%PATH%
DATA_DIR=@INSTALL_DIR@/data
QTDIR=@3RDPARTY_QT_DIR@
CSF_OCCTDataPath=@3RDPARTY_OCCT_DIR@/data
</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<LocalDebuggerEnvironment>PATH=@3RDPARTY_DLL_DEB_PATH@;@CMAKE_INSTALL_PREFIX@/@INSTALL_DIR_BIN@;%PATH%
DATA_DIR=@INSTALL_DIR@/data
QTDIR=@3RDPARTY_QT_DIR@
CSF_OCCTDataPath=@3RDPARTY_OCCT_DIR@/data
</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<LocalDebuggerEnvironment>PATH=@3RDPARTY_DLL_DEB_PATH@;@CMAKE_INSTALL_PREFIX@/@INSTALL_DIR_BIN@;%PATH%
DATA_DIR=@INSTALL_DIR@/data
QTDIR=@3RDPARTY_QT_DIR@
CSF_OCCTDataPath=@3RDPARTY_OCCT_DIR@/data
CSF_ShadersDirectory=@CASROOT@/src/Shaders
</LocalDebuggerEnvironment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
</PropertyGroup>
</Project>

View File

@ -1 +0,0 @@
@OCCT_HEADER_FILE_CONTENT@

View File

@ -1,11 +0,0 @@
project(DFBrowser)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
set (USE_QT ON)
set (TOOLKIT_NAME ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)
unset (TOOLKIT_NAME)

View File

@ -1,29 +0,0 @@
DFBrowserPane
DFBrowserPaneXDE
TKBRep
TKMath
TKV3d
TKBRep
TKBin
TKBinL
TKBinXCAF
TKCAF
TKCDF
TKernel
TKLCAF
TKMath
TKOpenGl
TKService
TKStd
TKStdL
TKTInspector
TKTInspectorAPI
TKTreeModel
TKV3d
TKView
TKXSBase
TKXCAF
TKXDESTEP
TKXmlXCAF
TKXml
TKXmlL

View File

@ -1,5 +0,0 @@
project(DFBrowserPane)
set (USE_QT ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)

View File

@ -1,12 +0,0 @@
TKG3d
TKTInspectorAPI
TKTreeModel
TKernel
TKMath
TKService
TKV3d
TKVCAF
TKCDF
TKCAF
TKLCAF
TKBRep

View File

@ -1,5 +0,0 @@
project(DFBrowserPaneXDE)
set (USE_QT ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)

View File

@ -1,7 +0,0 @@
DFBrowserPane
TKernel
TKTInspectorAPI
TKXSBase
TKXDESTEP
TKBRep
TKXCAF

View File

@ -1,11 +0,0 @@
project(ShapeView)
set (USE_QT ON)
set (TOOLKIT_NAME ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)
unset (TOOLKIT_NAME)

View File

@ -1,8 +0,0 @@
TKBRep
TKGeomBase
TKG3d
TKMath
TKTInspectorAPI
TKTreeModel
TKService
TKView

View File

@ -1,11 +0,0 @@
project(TInspector)
set (USE_QT ON)
set (TOOLKIT_NAME ON)
set (INSTALL_API ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)
unset (TOOLKIT_NAME)
unset (INSTALL_API)

View File

@ -1,2 +0,0 @@
TKernel
TKTInspectorAPI

View File

@ -1,10 +0,0 @@
project(TInspectorAPI)
set (TOOLKIT_NAME ON)
set (INSTALL_API ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (TOOLKIT_NAME)
unset (INSTALL_API)

View File

@ -1,2 +0,0 @@
TKernel
TKLCAF

View File

@ -1,13 +0,0 @@
project(TInspectorEXE)
set (USE_QT ON)
set (EXECUTABLE_PROJECT ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)
unset (EXECUTABLE_PROJECT)
configure_file(${CMAKE_SOURCE_DIR}/adm/templates/${PROJECT_NAME}.vcxproj.user.in
${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}.vcxproj.user @ONLY)

View File

@ -1,8 +0,0 @@
TKBRep
TKG3d
TKService
TKTInspector
TKXCAF
TKXDESTEP
TKXSBase
TKView

View File

@ -1,10 +0,0 @@
project(TreeModel)
set (USE_QT ON)
set (TOOLKIT_NAME ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)

View File

@ -1,9 +0,0 @@
project(VInspector)
set (USE_QT ON)
set (TOOLKIT_NAME ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)
unset (TOOLKIT_NAME)

View File

@ -1,10 +0,0 @@
TKBO
TKBRep
TKG3d
TKernel
TKMath
TKTInspectorAPI
TKTreeModel
TKService
TKV3d
TKView

View File

@ -1,9 +0,0 @@
project(View)
set (USE_QT ON)
set (TOOLKIT_NAME ON)
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
unset (USE_QT)

View File

@ -1,5 +0,0 @@
TKernel
TKMath
TKService
TKOpenGl
TKV3d

401
tools/CMakeLists.txt Normal file
View File

@ -0,0 +1,401 @@
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (ADDITIONAL_INLCUDE_DIR_DESCR "Additional directory to be added in the projects include section")
if (NOT DEFINED ADDITIONAL_INLCUDE_DIR)
set (ADDITIONAL_INLCUDE_DIR "" CACHE PATH ${ADDITIONAL_INLCUDE_DIR_DESCR})
get_filename_component (ADDITIONAL_INLCUDE_DIR "${ADDITIONAL_INLCUDE_DIR}" ABSOLUTE)
else()
file (TO_CMAKE_PATH "${ADDITIONAL_INLCUDE_DIR}" ADDITIONAL_INLCUDE_DIR)
set (ADDITIONAL_INLCUDE_DIR "${ADDITIONAL_INLCUDE_DIR}" CACHE PATH "${ADDITIONAL_INLCUDE_DIR_DESCR}" FORCE)
endif()
set (ADDITIONAL_DLL_DIR_DESCR "Additional directories that should be included into PATH")
if (NOT DEFINED ADDITIONAL_DLL_DIR)
set (ADDITIONAL_DLL_DIR "" CACHE PATH ${ADDITIONAL_DLL_DIR_DESCR})
get_filename_component (ADDITIONAL_DLL_DIR "${ADDITIONAL_DLL_DIR}" ABSOLUTE)
else()
file (TO_CMAKE_PATH "${ADDITIONAL_DLL_DIR}" ADDITIONAL_DLL_DIR)
set (ADDITIONAL_DLL_DIR "${ADDITIONAL_DLL_DIR}" CACHE PATH "${ADDITIONAL_DLL_DIR_DESCR}" FORCE)
endif()
set (CURRENT_DIR "${CMAKE_SOURCE_DIR}")
set (CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/.." CACHE INTERNAL "" FORCE)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
# macro: include patched file if it exists
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
include (${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake)
else()
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
endif()
endmacro()
macro (OCCT_INCLUDE_3RDPARTY_PRODUCT USE_PRODUCT PRODUCT_CONFIG_FILE)
if (${USE_PRODUCT})
OCCT_INCLUDE_CMAKE_FILE ("${PRODUCT_CONFIG_FILE}")
endif (${USE_PRODUCT})
endmacro()
# include variable description
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
# set type of OCCT libraries
if (NOT BUILD_LIBRARY_TYPE)
set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "${BUILD_LIBRARY_TYPE_DESCR}" FORCE)
SET_PROPERTY(CACHE BUILD_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
endif()
if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
set (BUILD_SHARED_LIBS ON)
if (NOT DEFINED BUILD_SHARED_LIBRARY_NAME_POSTFIX)
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX "" CACHE STRING "${BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR}" FORCE)
endif()
else()
unset (BUILD_SHARED_LIBS)
unset (BUILD_SHARED_LIBRARY_NAME_POSTFIX)
endif()
# the name of the project
project (Inspector)
if (WIN32)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
endif()
# include occt macros
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# Solution folder property
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
# a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
# check this variable and set if it's required
if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
if (BUILD_WITH_DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
endif()
# install dir of the project
if (NOT DEFINED INSTALL_DIR)
# set default install directory for Windows
if (WIN32 AND NOT DEFINED CMAKE_INSTALL_PREFIX)
set (CMAKE_INSTALL_PREFIX "C:/opencascade-${OCC_VERSION_STRING_EXT}/inspector")
endif()
set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}")
else()
file (TO_CMAKE_PATH "${INSTALL_DIR}" INSTALL_DIR)
set (INSTALL_DIR "${INSTALL_DIR}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
endif()
# choose a variant of the layout of the install paths
if (NOT INSTALL_DIR_LAYOUT)
if (WIN32)
set (INSTALL_DIR_LAYOUT "Windows" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
else()
set (INSTALL_DIR_LAYOUT "Unix" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
endif()
SET_PROPERTY(CACHE INSTALL_DIR_LAYOUT PROPERTY STRINGS Windows Unix)
endif()
# check INSTALL_DIR_LAYOUT changes and update INSTALL_DIR_* paths if necessary
if (NOT DEFINED INSTALL_DIR_LAYOUT_PREV)
set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
elseif (NOT "${INSTALL_DIR_LAYOUT_PREV}" STREQUAL "${INSTALL_DIR_LAYOUT}")
set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
# The structure of install folder should be reset due to changed layout
OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
# Unset INSTALL_DIR_WITH_VERSION on windows
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
OCCT_CHECK_AND_UNSET (INSTALL_DIR_WITH_VERSION)
else()
if (NOT DEFINED INSTALL_DIR_WITH_VERSION)
set (INSTALL_DIR_WITH_VERSION OFF CACHE BOOL "${INSTALL_DIR_WITH_VERSION_DESCR}")
endif()
endif()
endif()
# check CMAKE_INSTALL_PREFIX changes and update INSTALL_DIR if necessary
if (NOT DEFINED CMAKE_INSTALL_PREFIX_PREV)
set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
# CMAKE_INSTALL_PREFIX has been changed at previous step
set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
# INSTALL_DIR is required to be updated
set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
endif()
# check INSTALL_DIR changes and update CMAKE_INSTALL_PREFIX if necessary
if (NOT DEFINED INSTALL_DIR_PREV)
set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}")
# INSTALL_DIR has been changed at previous step
set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
# sync CMAKE_INSTALL_PREFIX with INSTALL_DIR
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
# set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder
set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
endif()
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
if (NOT DEFINED INSTALL_DIR_WITH_VERSION_PREV)
set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
elseif (NOT "${INSTALL_DIR_WITH_VERSION_PREV}" STREQUAL "${INSTALL_DIR_WITH_VERSION}")
# INSTALL_DIR_WITH_VERSION has been changed at previous step
set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
endif()
endif()
# hide CMAKE_INSTALL_PREFIX from a user
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
set (BIN_LETTER "")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set (BIN_LETTER "d")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
set (BIN_LETTER "i")
endif()
# Get all used variables: OS_WITH_BIT, COMPILER
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
# do not define INSTALL_DIR_BIN for win.
# Leave library structure for win: <prefix>/win64/vc10/bin(d)
if (NOT DEFINED INSTALL_DIR_BIN)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
set (INSTALL_DIR_BIN "bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
else()
set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
endif()
endif()
# define folder contaning all shell/batch scripts
if (NOT DEFINED INSTALL_DIR_SCRIPT)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
else()
set (INSTALL_DIR_SCRIPT "." CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
endif()
endif()
# place the libraries to <prefix>/lib folder for unix and leave old structure for windows
if (NOT DEFINED INSTALL_DIR_LIB)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
set (INSTALL_DIR_LIB "lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
else()
set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
endif()
endif()
# OCCT headers: <prefix>/inc for windows,
# <prefix>/include/opencascade-7.0.0 for unix
if (NOT DEFINED INSTALL_DIR_INCLUDE)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
set (INSTALL_DIR_INCLUDE "include/opencascade" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
if (INSTALL_DIR_WITH_VERSION)
set (INSTALL_DIR_INCLUDE "include/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}" FORCE)
endif()
else()
set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
endif()
endif()
# OCCT resources: <prefix>/src for windows,
# <prefix>/share/opencascade-7.0.0/resources for unix
if (NOT DEFINED INSTALL_DIR_RESOURCE)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
set (INSTALL_DIR_RESOURCE "share/opencascade/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
if (INSTALL_DIR_WITH_VERSION)
set (INSTALL_DIR_RESOURCE "share/opencascade-${OCC_VERSION_STRING_EXT}/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}" FORCE)
endif()
else()
set (INSTALL_DIR_RESOURCE "src" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
endif()
endif()
# OCCT data
if (NOT DEFINED INSTALL_DIR_DATA)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
set (INSTALL_DIR_DATA "share/opencascade/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
if (INSTALL_DIR_WITH_VERSION)
set (INSTALL_DIR_DATA "share/opencascade-${OCC_VERSION_STRING_EXT}/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}" FORCE)
endif()
else()
set (INSTALL_DIR_DATA "data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
endif()
endif()
# 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")
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()
find_package(OpenCASCADE QUIET PATHS "${OpenCASCADE_DIR}" "${OpenCASCADE_INSTALL_PREFIX}" NO_DEFAULT_PATH)
# include OCCT headers
include_directories ("${OpenCASCADE_INCLUDE_DIR}")
if (NOT OpenCASCADE_FOUND)
message (FATAL_ERROR "coult not find OpenCASCADE, please set OpenCASCADE_DIR variable" )
else()
set (OpenCASCADE_DIR "${OpenCASCADE_INSTALL_PREFIX}" CACHE PATH "OpenCASCADE directory" FORCE)
message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" )
endif()
set (USE_TCL "${OpenCASCADE_WITH_TCL}")
set (USE_FREETYPE "${OpenCASCADE_WITH_FREETYPE}")
set (USE_FREEIMAGE "${OpenCASCADE_WITH_FREEIMAGE}")
set (USE_GL2PS "${OpenCASCADE_WITH_GL2PS}")
set (USE_TBB "${OpenCASCADE_WITH_TBB}")
set (USE_VTK "${OpenCASCADE_WITH_VTK}")
set (USE_FFMPEG "${OpenCASCADE_WITH_FFMPEG}")
set (USE_GLES2 "${OpenCASCADE_WITH_GLES2}")
set (USE_GLX "${OpenCASCADE_WITH_GLX}")
# define CSF variable
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
# custom definitions (CMakeConfig of OCCT)
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_TCL "adm/cmake/tcl")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FREETYPE "adm/cmake/freetype")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FREEIMAGE "adm/cmake/freeimage")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GL2PS "adm/cmake/gl2ps")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_TBB "adm/cmake/tbb")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_VTK "adm/cmake/vtk")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FFMPEG "adm/cmake/ffmpeg")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLES2 "adm/cmake/egl")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLES2 "adm/cmake/gles2")
OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLX "adm/cmake/glx")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
#include (${CMAKE_SOURCE_DIR}/adm/cmake/3rdparty.cmake)
set (3RDPARTY_DLL_DEB_PATH "${3RDPARTY_DLL_PATH}")
# build directories
if (SINGLE_GENERATOR)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
if (WIN32)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
endif()
endif()
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
if (WIN32)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
endif()
# OCCT tools
# 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 (BUILD_Inspector)
OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
foreach (OCCT_TOOL ${OCCT_TOOLS})
list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
endforeach()
# collect all the headers to <binary dir>/inc/inspector folder
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...")
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "${CMAKE_SOURCE_DIR}/tools" "${INSTALL_DIR_INCLUDE}/inspector")
#endif()
# include <cmake binary folder>/inc
include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})
include_directories (${ADDITIONAL_INLCUDE_DIR})
if (3RDPARTY_INCLUDE_DIRS)
list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
message (STATUS "Info: The directories of 3rdparty headers: \n\t${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
include_directories (${3RDPARTY_INCLUDE_DIRS})
endif()
if (3RDPARTY_LIBRARY_DIRS)
list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
message (STATUS "Info: The directories of 3rdparty libraries: \n\t${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
link_directories (${3RDPARTY_LIBRARY_DIRS})
endif()
# include patched toolkit projects or original ones
if (BUILD_TOOL_TOOLKITS)
foreach (BUILD_TOOL_TOOLKIT ${BUILD_TOOL_TOOLKITS})
OCCT_ADD_SUBDIRECTORY ("tools/${BUILD_TOOL_TOOLKIT}")
endforeach()
endif()
message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed")
OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES)
# patch TInspectorEXE
if (MSVC AND 3RDPARTY_DLL_DIRS)
list (REMOVE_DUPLICATES 3RDPARTY_DLL_DIRS)
set (3RDPARTY_DLL_DIRS_FOR_PATH "")
foreach (3RDPARTY_DLL_DIR ${3RDPARTY_DLL_DIRS})
set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
endforeach()
if (ADDITIONAL_DLL_DIR)
foreach (3RDPARTY_DLL_DIR ${ADDITIONAL_DLL_DIR})
set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
endforeach()
endif (ADDITIONAL_DLL_DIR)
OCCT_MAKE_COMPILER_BITNESS()
set (X_COMPILER_BITNESS "x64")
if ("${COMPILER_BITNESS}" STREQUAL "32")
set (X_COMPILER_BITNESS "Win32")
endif()
# patch TInspectorEXE
OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/TInspectorEXE/TInspectorEXE.vcxproj.user")
endif()
message (STATUS "Info: \(${CURRENT_TIME}\) Inspector configuration files prepared")

View File

@ -3,3 +3,4 @@ TInspectorAPI_Communicator.hxx
TInspectorAPI_PluginParameters.cxx
TInspectorAPI_PluginParameters.hxx
TInspectorAPI_PreferencesDataMap.hxx
TInspectorAPI_Version.hxx

View File

@ -14,6 +14,7 @@
// commercial license or contractual agreement.
#include <inspector/TInspectorAPI_PluginParameters.hxx>
#include <inspector/TInspectorAPI_Version.hxx>
#if OCC_VERSION_HEX <= 0x060901
IMPLEMENT_STANDARD_HANDLE (TInspectorAPI_PluginParameters, Standard_Transient)
@ -274,6 +275,7 @@ void TInspectorAPI_PluginParameters::ParametersToShape (const TCollection_AsciiS
return;
anOrientationStr.Split (anOrientationStr.Length() - 1);
#if TINSPECTORAPI_VERSION_HEX > 0x070200
TopAbs_Orientation anOrientation;
if (!TopAbs::ShapeOrientationFromString (anOrientationStr.ToCString(), anOrientation))
return;
@ -282,4 +284,7 @@ void TInspectorAPI_PluginParameters::ParametersToShape (const TCollection_AsciiS
theShape.Location (aLocation);
theShape.Orientation (anOrientation);
#else
(void)theValue; (void)theShape;
#endif
}

View File

@ -0,0 +1,41 @@
// Copyright (c) 2018 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
/*======================================================================
//
// Purpose: Defines macros identifying current version of Inspector
// The version is equal to current OCCT version and used to support compile compatibility
// to previous OCCT versions interface.
// To compile Inspector with earlier version of OCCT, change version variable here to needed OCCT version.
//
// TINSPECTORAPI_VERSION_MAJOR : (integer) number identifying major version
// TINSPECTORAPI_VERSION_MINOR : (integer) number identifying minor version
// TINSPECTORAPI_VERSION_MAINTENANCE : (integer) number identifying maintenance version
// TINSPECTORAPI_VERSION_HEX : (hex) complete number as hex, two positions per each of major, minor, and patch number
//
//======================================================================*/
#ifndef _TInspectorAPI_Version_HeaderFile
#define _TInspectorAPI_Version_HeaderFile
#include <Standard_Version.hxx>
// Primary definitions
#define TINSPECTORAPI_VERSION_MAJOR OCC_VERSION_MAJOR
#define TINSPECTORAPI_VERSION_MINOR OCC_VERSION_MINOR
#define TINSPECTORAPI_VERSION_MAINTENANCE 0//OCC_VERSION_MAINTENANCE
// Derived: complete version as hex (0x0'major'0'minor'0'maintenance')
#define TINSPECTORAPI_VERSION_HEX (TINSPECTORAPI_VERSION_MAJOR << 16 | TINSPECTORAPI_VERSION_MINOR << 8 | TINSPECTORAPI_VERSION_MAINTENANCE)
#endif /* _TInspectorAPI_Version_HeaderFile */

View File

@ -0,0 +1,7 @@
project(TInspectorEXE)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
set (EXECUTABLE_PROJECT ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
unset (EXECUTABLE_PROJECT)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -3,4 +3,5 @@ TInspectorEXE_OpenFileDialog.cxx
TInspectorEXE_OpenFileDialog.hxx
TInspectorEXE_OpenFileViewModel.cxx
TInspectorEXE_OpenFileViewModel.hxx
TInspectorEXE.qrc
TInspectorEXE.qrc
EXTERNLIB

View File

@ -0,0 +1 @@
TInspectorEXE

View File

@ -14,7 +14,7 @@
// commercial license or contractual agreement.
#include <TInspectorEXE_OpenFileDialog.hxx>
#include <inspector/TInspectorEXE_OpenFileDialog.hxx>
#include <inspector/TInspector_Communicator.hxx>

View File

@ -0,0 +1,6 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file alias="folder_open.png">icons/folder_open.png</file>
<file alias="folder_import.png">icons/folder_import.png</file>
</qresource>
</RCC>

View File

@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TInspectorEXE_OpenFileDialog.hxx>
#include <TInspectorEXE_OpenFileViewModel.hxx>
#include <inspector/TInspectorEXE_OpenFileDialog.hxx>
#include <inspector/TInspectorEXE_OpenFileViewModel.hxx>
#include <inspector/TInspector_Communicator.hxx>

View File

@ -13,7 +13,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <TInspectorEXE_OpenFileViewModel.hxx>
#include <inspector/TInspectorEXE_OpenFileViewModel.hxx>
#include <Standard_WarningsDisable.hxx>
#include <QApplication>

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,3 +1,4 @@
TKDraw
TKDCAF
TKTInspector
TKTInspectorAPI

View File

@ -1,3 +1,4 @@
TKG3d
TKernel
TKMath
TKService

View File

@ -19,6 +19,8 @@
#include <inspector/View_Window.hxx>
#include <inspector/TInspectorAPI_Version.hxx>
#include <inspector/View_Displayer.hxx>
#include <inspector/View_ToolBar.hxx>
#include <inspector/View_Tools.hxx>
@ -156,6 +158,7 @@ void View_Window::onCheckedStateChanged (int theActionId, bool theState)
// =======================================================================
void View_Window::onViewContextMenuRequested (const QPoint& thePosition)
{
#if TINSPECTORAPI_VERSION_HEX > 0x070200
QMenu* aMenu = new QMenu (this);
QMenu* anOrientationSubMenu = aMenu->addMenu ("Set View Orientation");
@ -169,6 +172,9 @@ void View_Window::onViewContextMenuRequested (const QPoint& thePosition)
QPoint aPoint = myView->mapToGlobal (thePosition);
aMenu->exec (aPoint);
#else
(void)thePosition;
#endif
}
// =======================================================================
@ -177,6 +183,7 @@ void View_Window::onViewContextMenuRequested (const QPoint& thePosition)
// =======================================================================
void View_Window::onSetOrientation()
{
#if TINSPECTORAPI_VERSION_HEX > 0x070200
QAction* anAction = (QAction*)(sender());
TCollection_AsciiString anOrientationStr (anAction->text().toStdString().c_str());
@ -192,6 +199,7 @@ void View_Window::onSetOrientation()
aView->SetProj (anOrientationType);
aView->FitAll();
aView->Redraw();
#endif
}
// =======================================================================

View File

@ -0,0 +1,5 @@
if ("${TARGET_FOLDER}" STREQUAL "")
set (CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/..")
endif("${TARGET_FOLDER}" STREQUAL "")
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)