1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

..

6 Commits

Author SHA1 Message Date
dpasukhi
706b94cc6d 0033206: Data Exchange, Step - Supplemental geometry support
Updated import methods to add supplemental geometry as a reference to the PMI
Updated export methods to handle supplemental geometry as a special type.
Created new GUID for supplemental geometry container - compound contains all sup. geom. shapes.
Created new GUID for supplemental geometry label - supplemental geometry shape.
Created new GUID for supplemental geometry reference - relation for depends on.
Supplemental geometry: surfaces and curves.
2022-11-15 19:48:11 +00:00
dpasukhi
3e1adab2d9 Data Exchange, Step Import - Incorrect computing of PMI text location
Fixed problem with too large box of the representation. In this case incorrect annotation plane is used as internal location.
2022-03-03 13:20:54 +03:00
dpasukhi
fcdfd45836 0032731: Data Exchange, Step Import - Incorrect PMI text location
Added new complex Entity for representation of PMI
Added moving the presentation with new entity
2022-02-01 13:38:08 +03:00
mgn
3bd2f8ebbe Fixed mapping the given an interactive object and a corresponding status passed in the setObjectStatus method. 2021-02-25 17:56:33 +03:00
kgv
49c3828bcf 0032168: Visualization - Wrong computation of screen axis in V3d_View::SetTwist method
Fixed wrong axis check.
2021-02-25 17:29:04 +03:00
jgv
19f77300a8 Fix of regression in Extrema, improvement in 3D offset. 2021-02-25 15:20:48 +03:00
14235 changed files with 255008 additions and 298991 deletions

4
.gitattributes vendored
View File

@@ -1,8 +1,6 @@
.gitattributes eol=lf
.gitignore eol=lf
*.txt eol=lf
*.htm eol=lf
*.html eol=lf
*.h eol=lf
*.c eol=lf
*.inl eol=lf
@@ -31,7 +29,6 @@
*.xib eol=lf
*.plist eol=lf
*.java eol=lf
*.js eol=lf
*.igs eol=lf
*.iges eol=lf
*.stp eol=lf
@@ -47,7 +44,6 @@
FILES eol=lf
PACKAGES eol=lf
EXTERNLIB eol=lf
EXTERNLIB_STATIC eol=lf
UDLIST eol=lf
tests/* eol=lf
tests/*/* eol=lf

View File

@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
@@ -6,26 +6,6 @@ set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
# set using C++ standard
set (BUILD_CPP_STANDARD "C++11" CACHE STRING "Select using c++ standard.")
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++11" "C++14" "C++17" "C++20" "C++23")
# Set desired C++ standard
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++11")
set (CMAKE_CXX_STANDARD 11)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++14")
set (CMAKE_CXX_STANDARD 14)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
set (CMAKE_CXX_STANDARD 17)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++20")
set (CMAKE_CXX_STANDARD 20)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++23")
set (CMAKE_CXX_STANDARD 23)
else ()
message (FATAL_ERROR, "misprint in c++ standard name")
endif()
set (CMAKE_CXX_STANDARD_REQUIRED ON)
# 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")
@@ -76,20 +56,6 @@ set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE})
# set soversion variable determining compatibility version on platforms with symlinks
# 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance
if (NOT BUILD_SOVERSION_NUMBERS)
set (BUILD_SOVERSION_NUMBERS "0" CACHE STRING "${BUILD_SOVERSION_NUMBERS_DESCR}" FORCE)
SET_PROPERTY(CACHE BUILD_SOVERSION_NUMBERS PROPERTY STRINGS 0 1 2 3)
# update default state of soversion on different platforms
if (WIN32 OR ANDROID OR EMSCRIPTEN)
set (BUILD_SOVERSION_NUMBERS 0)
else()
set (BUILD_SOVERSION_NUMBERS 2)
endif()
endif()
set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
# Regeneration of OCCT resource files
@@ -125,16 +91,6 @@ if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
endif()
if (MSVC)
set (BUILD_FORCE_RelWithDebInfo OFF CACHE BOOL "${BUILD_FORCE_RelWithDebInfo_DESCR}")
else()
set (BUILD_FORCE_RelWithDebInfo OFF)
endif()
if (BUILD_FORCE_RelWithDebInfo)
set (CMAKE_CONFIGURATION_TYPES Release Debug CACHE INTERNAL "" FORCE)
endif()
# option to enable or disable use of precompiled headers
if (NOT DEFINED BUILD_USE_PCH)
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")
@@ -263,7 +219,7 @@ if (NOT DEFINED INSTALL_DIR_BIN)
endif()
endif()
# define folder containing all shell/batch scripts
# 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}")
@@ -355,7 +311,7 @@ if (NOT DEFINED INSTALL_DIR_DOC)
endif()
endif()
# define folder containing CMake configuration files
# define folder contaning CMake configuration files
if (NOT DEFINED INSTALL_DIR_CMAKE)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
if (INSTALL_DIR_WITH_VERSION)
@@ -408,28 +364,12 @@ if (MSVC)
endif()
# whether use optional 3rdparty or not
set (USE_TK ON CACHE BOOL "${USE_TK_DESCR}")
set (USE_FREETYPE ON CACHE BOOL "${USE_FREETYPE_DESCR}")
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
set (USE_OPENVR OFF CACHE BOOL "${USE_OPENVR_DESCR}")
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
set (USE_DRACO OFF CACHE BOOL "${USE_DRACO_DESCR}")
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
if (WIN32 OR ANDROID OR IOS OR EMSCRIPTEN)
# no Xlib
elseif (APPLE)
set (USE_XLIB OFF CACHE BOOL "${USE_XLIB_DESCR}")
else()
set (USE_XLIB ON CACHE BOOL "${USE_XLIB_DESCR}")
if (APPLE)
set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
endif()
if (WIN32)
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
else()
set (USE_D3D OFF)
endif()
# Enable/Disable the floating point exceptions (FPE) during runtime.
@@ -443,15 +383,6 @@ else()
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 0)
endif()
# OpenGL
if (ANDROID OR IOS OR EMSCRIPTEN OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_OPENGL OFF)
set (USE_GLES2 ON)
else()
set (USE_OPENGL ON CACHE BOOL "${USE_OPENGL_DESCR}")
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
# 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
@@ -483,6 +414,10 @@ if (NOT DEFINED BUILD_DOC_Overview)
set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
endif()
if (NOT USE_D3D)
list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
endif()
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
@@ -492,6 +427,12 @@ foreach (OCCT_MODULE ${OCCT_MODULES})
endif()
endforeach()
# DRAWEXE excluded when library build is static
if (NOT BUILD_SHARED_LIBS)
list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
endif()
# accumulate all used toolkits
list (REMOVE_DUPLICATES BUILD_TOOLKITS)
set (RAW_BUILD_TOOLKITS)
@@ -543,70 +484,35 @@ endif()
# 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_TclTkLibs CAN_USE_TK)
OCCT_IS_PRODUCT_REQUIRED (CSF_XwLibs CAN_USE_XLIB)
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE CAN_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_FREETYPE USE_FREETYPE)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
# define CSF variable
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
# Tcl (mandatory for Draw Harness)
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 ("INSTALL_TCL")
endif()
# Tk (optional for Draw Harness)
if (CAN_USE_TK)
if (USE_TK)
message (STATUS "Info: TK is used by OCCT")
add_definitions (-DHAVE_TK)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_TK")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
endif()
# Xlib
if (CAN_USE_XLIB)
if (USE_XLIB)
message (STATUS "Info: Xlib is used by OCCT")
add_definitions (-DHAVE_XLIB)
if (APPLE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
endif()
endif()
if (USE_FREETYPE)
message (STATUS "Info: Freetype is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
else()
OCCT_CHECK_AND_UNSET ("USE_XLIB")
endif()
# FreeType
if (CAN_USE_FREETYPE)
if (USE_FREETYPE)
message (STATUS "Info: FreeType is used by OCCT")
add_definitions (-DHAVE_FREETYPE)
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()
else()
OCCT_CHECK_AND_UNSET ("USE_FREETYPE")
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()
@@ -626,8 +532,25 @@ else()
endif()
endif()
# D3D
if (USE_D3D)
add_definitions (-DHAVE_D3D)
#if(MSVC_VERSION LESS 1700)
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
#endif()
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}")
if (USE_FREEIMAGE)
add_definitions (-DHAVE_FREEIMAGE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
@@ -646,6 +569,8 @@ endif()
# 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")
@@ -665,6 +590,8 @@ endif()
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")
@@ -679,33 +606,23 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
endif()
# 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()
OCCT_CHECK_AND_UNSET ("USE_OPENGL")
endif()
# OpenGL ES 2.0
if (CAN_USE_GLES2)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_GLES2 ON)
else()
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
if (USE_GLES2)
add_definitions (-DHAVE_GLES2_EXT)
if (NOT IOS)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
endif()
add_definitions (-DHAVE_GLES2)
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")
@@ -716,19 +633,10 @@ else()
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)
endif()
# TBB
if (NOT DEFINED ANDROID AND CAN_USE_TBB)
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
if (USE_TBB)
add_definitions (-DHAVE_TBB)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
@@ -749,6 +657,8 @@ endif()
# search for CSF_RapidJSON variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON)
if (CAN_USE_RAPIDJSON)
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
if (USE_RAPIDJSON)
add_definitions (-DHAVE_RAPIDJSON)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/rapidjson")
@@ -763,26 +673,10 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
endif()
# Draco library
# search for CSF_Draco variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_Draco CAN_USE_DRACO)
if (CAN_USE_DRACO)
if (USE_DRACO)
add_definitions (-DHAVE_DRACO)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/draco")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_DRACO")
OCCT_CHECK_AND_UNSET ("INSTALL_DRACO")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_DRACO")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_DRACO")
OCCT_CHECK_AND_UNSET ("INSTALL_DRACO")
endif()
# EIGEN
if (CAN_USE_EIGEN)
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
if (USE_EIGEN)
add_definitions (-DHAVE_EIGEN)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
@@ -820,12 +714,6 @@ else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
endif()
# ExpToCasExe
if (EMSCRIPTEN)
list (REMOVE_ITEM BUILD_TOOLKITS TKExpress)
list (REMOVE_ITEM BUILD_TOOLKITS ExpToCasExe)
endif()
# bison
if (BUILD_YACCLEX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
@@ -1166,8 +1054,14 @@ if (BUILD_SAMPLES_MFC)
add_subdirectory(samples/mfc/standard/mfcsample)
add_subdirectory(samples/mfc/standard/01_Geometry)
add_subdirectory(samples/mfc/standard/02_Modeling)
add_subdirectory(samples/mfc/standard/03_ImportExport)
add_subdirectory(samples/mfc/standard/04_HLR)
add_subdirectory(samples/mfc/standard/03_Viewer2d)
add_subdirectory(samples/mfc/standard/04_Viewer3d)
add_subdirectory(samples/mfc/standard/05_ImportExport)
add_subdirectory(samples/mfc/standard/06_Ocaf)
add_subdirectory(samples/mfc/standard/07_Triangulation)
add_subdirectory(samples/mfc/standard/08_HLR)
add_subdirectory(samples/mfc/standard/09_Animation)
add_subdirectory(samples/mfc/standard/10_Convert)
message (STATUS "Info: \(${CURRENT_TIME}\) MFC Sample projects added")
endif()
@@ -1245,9 +1139,6 @@ foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
endforeach()
list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS)
# these macros are defined for specific tookits, not globalwise
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_OPENGL)
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_GLES2)
# export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files
foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
@@ -1265,7 +1156,7 @@ foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
endforeach()
# install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
install (CODE "file(INSTALL FILES \"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" DESTINATION \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/\" TYPE FILE)")
install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
foreach (OCCT_MODULE ${OCCT_MODULES})
if (BUILD_MODULE_${OCCT_MODULE})
@@ -1301,7 +1192,7 @@ if (WIN32)
set (SET_OpenCASCADE_WITH_D3D "set (OpenCASCADE_WITH_D3D ${USE_D3D})")
endif()
if (APPLE)
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_XLIB})")
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_GLX})")
endif()
# Configure and install cmake config file

View File

@@ -1,7 +1,7 @@
FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXDE TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh TKXDECascade TKExpress ExpToCasExe
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE

View File

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

View File

@@ -11,6 +11,7 @@ n Expr
n ExprIntrp
n FSD
n GeomAbs
n MMgt
n Message
n OSD
n PLib
@@ -197,6 +198,7 @@ t TKPrim
t TKShHealing
t TKTopAlgo
t TKXMesh
n InterfaceGraphic
n AIS
n Aspect
n DsgPrs
@@ -206,7 +208,6 @@ n Image
n Media
n MeshVS
n OpenGl
n OpenGles
n D3DHost
n Prs3d
n PrsMgr
@@ -216,7 +217,6 @@ n SelectMgr
n StdPrs
n StdSelect
n V3d
n Wasm
n WNT
n Xw
n Cocoa
@@ -225,7 +225,6 @@ r Shaders
r XRResources
t TKMeshVS
t TKOpenGl
t TKOpenGles
t TKD3DHost
t TKService
t TKV3d
@@ -328,7 +327,6 @@ n RWStepDimTol
n RWStepElement
n RWStepFEA
n RWStepGeom
n RWStepKinematics
n RWStepRepr
n RWStepShape
n RWStepVisual
@@ -348,7 +346,6 @@ n StepDimTol
n StepElement
n StepFEA
n StepGeom
n StepKinematics
n StepRepr
n StepSelect
n StepShape
@@ -384,8 +381,6 @@ t TKSTEPBase
t TKSTL
t TKVRML
t TKXCAF
t TKXDE
t TKXDECascade
t TKXDEIGES
t TKXDESTEP
t TKXSBase
@@ -396,9 +391,6 @@ n DBRep
n DDF
n DDataStd
n DDocStd
n DE
n DEXCAFCascade
n DEBRepCascade
n DNaming
n DPrsStd
n Draw
@@ -411,9 +403,6 @@ n HLRTest
n MeshTest
n SWDRAW
n TObjDRAW
n OpenGlTest
n OpenGlesTest
n D3DHostTest
n ViewerTest
n XDEDRAW
n XSDRAW
@@ -425,9 +414,6 @@ t TKDCAF
t TKDraw
t TKTObjDRAW
t TKTopTest
t TKOpenGlTest
t TKOpenGlesTest
t TKD3DHostTest
t TKViewerTest
t TKXDEDRAW
t TKXSDRAW
@@ -459,7 +445,6 @@ t TKRWMesh
n RWGltf
n RWMesh
n RWObj
n RWPly
n DFBrowser
n DFBrowserPane
n DFBrowserPaneXDE
@@ -480,6 +465,3 @@ n TreeModel
n View
n ViewControl
n VInspector
n Express
t TKExpress
x ExpToCasExe

View File

@@ -22,4 +22,6 @@ if (3RDPARTY_DIR)
endforeach()
endif()
find_package (BISON 3.7.4)
# bison 3.2 is required because it provides options to avoid generation of redundant header
# files and embedding of local paths in the generated code
find_package (BISON 3.2)

View File

@@ -3,7 +3,7 @@
# See the cotire manual for usage hints.
#
#=============================================================================
# Copyright 2012-2018 Sascha Kratky
# Copyright 2012-2016 Sascha Kratky
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@@ -43,7 +43,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE)
endif()
set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
set (COTIRE_CMAKE_MODULE_VERSION "1.8.1")
set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")
# activate select policies
if (POLICY CMP0025)
@@ -106,11 +106,6 @@ if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if (POLICY CMP0055)
# strict checking for break() command
cmake_policy(SET CMP0055 NEW)
endif()
include(CMakeParseArguments)
include(ProcessorCount)
@@ -239,13 +234,7 @@ function (cotire_filter_language_source_files _language _target _sourceFilesVar
# add to excluded sources, if file has custom compile flags
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
if (_sourceCompileOptions)
# add to excluded sources, if file has list of custom compile options
list (APPEND _excludedSourceFiles "${_sourceFile}")
else()
list (APPEND _sourceFiles "${_sourceFile}")
endif()
list (APPEND _sourceFiles "${_sourceFile}")
endif()
endif()
endforeach()
@@ -304,7 +293,7 @@ function (cotire_get_source_file_property_values _valuesVar _property)
set (${_valuesVar} ${_values} PARENT_SCOPE)
endfunction()
function (cotire_resolve_config_properties _configurations _propertiesVar)
function (cotire_resolve_config_properites _configurations _propertiesVar)
set (_properties "")
foreach (_property ${ARGN})
if ("${_property}" MATCHES "<CONFIG>")
@@ -320,8 +309,8 @@ function (cotire_resolve_config_properties _configurations _propertiesVar)
set (${_propertiesVar} ${_properties} PARENT_SCOPE)
endfunction()
function (cotire_copy_set_properties _configurations _type _source _target)
cotire_resolve_config_properties("${_configurations}" _properties ${ARGN})
function (cotire_copy_set_properites _configurations _type _source _target)
cotire_resolve_config_properites("${_configurations}" _properties ${ARGN})
foreach (_property ${_properties})
get_property(_isSet ${_type} ${_source} PROPERTY ${_property} SET)
if (_isSet)
@@ -331,18 +320,13 @@ function (cotire_copy_set_properties _configurations _type _source _target)
endforeach()
endfunction()
function (cotire_get_target_usage_requirements _target _config _targetRequirementsVar)
function (cotire_get_target_usage_requirements _target _targetRequirementsVar)
set (_targetRequirements "")
get_target_property(_librariesToProcess ${_target} LINK_LIBRARIES)
while (_librariesToProcess)
# remove from head
list (GET _librariesToProcess 0 _library)
list (REMOVE_AT _librariesToProcess 0)
if (_library MATCHES "^\\$<\\$<CONFIG:${_config}>:([A-Za-z0-9_:-]+)>$")
set (_library "${CMAKE_MATCH_1}")
elseif (_config STREQUAL "None" AND _library MATCHES "^\\$<\\$<CONFIG:>:([A-Za-z0-9_:-]+)>$")
set (_library "${CMAKE_MATCH_1}")
endif()
if (TARGET ${_library})
list (FIND _targetRequirements ${_library} _index)
if (_index LESS 0)
@@ -457,7 +441,7 @@ function (cotire_get_target_compile_flags _config _language _target _flagsVar)
# interface compile options from linked library targets
if (_target)
set (_linkedTargets "")
cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
cotire_get_target_usage_requirements(${_target} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_targetOptions ${_linkedTarget} INTERFACE_COMPILE_OPTIONS)
if (_targetOptions)
@@ -589,7 +573,7 @@ function (cotire_get_target_include_directories _config _language _target _inclu
# interface include directories from linked library targets
if (_target)
set (_linkedTargets "")
cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
cotire_get_target_usage_requirements(${_target} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
@@ -643,7 +627,7 @@ function (cotire_get_target_include_directories _config _language _target _inclu
if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
endif()
if (WIN32 AND NOT MINGW)
if (WIN32)
# convert Windows paths in include directories to CMake paths
if (_includeDirs)
set (_paths "")
@@ -719,7 +703,7 @@ function (cotire_get_target_compile_definitions _config _language _target _defin
endif()
# interface compile definitions from linked library targets
set (_linkedTargets "")
cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
cotire_get_target_usage_requirements(${_target} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_definitions ${_linkedTarget} INTERFACE_COMPILE_DEFINITIONS)
if (_definitions)
@@ -727,7 +711,7 @@ function (cotire_get_target_compile_definitions _config _language _target _defin
endif()
endforeach()
# parse additional compile definitions from target compile flags
# and do not look at directory compile definitions, which we already handled
# and don't look at directory compile definitions, which we already handled
set (_targetFlags "")
cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
cotire_filter_compile_flags("${_language}" "D" _definitions _ignore ${_targetFlags})
@@ -875,9 +859,6 @@ macro (cotire_set_cmd_to_prologue _cmdVar)
list (APPEND ${_cmdVar} "--warn-uninitialized")
endif()
list (APPEND ${_cmdVar} "-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>")
if (XCODE)
list (APPEND ${_cmdVar} "-DXCODE:BOOL=TRUE")
endif()
if (COTIRE_VERBOSE)
list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=ON")
elseif("${CMAKE_GENERATOR}" MATCHES "Makefiles")
@@ -895,9 +876,6 @@ function (cotire_init_compile_cmd _cmdVar _language _compilerLauncher _compilerE
if (NOT _compilerArg1)
set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
endif()
if (WIN32)
file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe)
endif()
string (STRIP "${_compilerArg1}" _compilerArg1)
if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
# compiler launcher is only supported for Makefile and Ninja
@@ -924,16 +902,16 @@ function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemInclu
foreach (_include ${_includeDirs})
if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
file (TO_NATIVE_PATH "${_include}" _include)
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
else()
set (_index -1)
if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
list (FIND ${_systemIncludesVar} "${_include}" _index)
endif()
if (_index GREATER -1)
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
else()
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
endif()
endif()
endforeach()
@@ -1068,10 +1046,10 @@ macro (cotire_check_ignore_header_file_path _headerFile _headerIsIgnoredVar)
set (${_headerIsIgnoredVar} TRUE)
elseif (IS_DIRECTORY "${_headerFile}")
set (${_headerIsIgnoredVar} TRUE)
elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed")
# heuristic: ignore headers with embedded parent directory references or "-fixed" or "_fixed" in path
elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed" AND "${_headerFile}" MATCHES "\\.h$")
# heuristic: ignore C headers with embedded parent directory references or "-fixed" or "_fixed" in path
# these often stem from using GCC #include_next tricks, which may break the precompiled header compilation
# with the error message "error: no include path in which to search for header"
# with the error message "error: no include path in which to search for header.h"
set (${_headerIsIgnoredVar} TRUE)
else()
set (${_headerIsIgnoredVar} FALSE)
@@ -1092,11 +1070,12 @@ endmacro()
macro (cotire_parse_line _line _headerFileVar _headerDepthVar)
if (MSVC)
# cl.exe /showIncludes produces different output, depending on the language pack used, e.g.:
# cl.exe /showIncludes output looks different depending on the language pack used, e.g.:
# English: "Note: including file: C:\directory\file"
# German: "Hinweis: Einlesen der Datei: C:\directory\file"
# We use a very general regular expression, relying on the presence of the : characters
if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
# Visual Studio compiler output
string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
else()
@@ -1254,19 +1233,11 @@ function (cotire_scan_includes _includesVar)
set (${_includesVar} "" PARENT_SCOPE)
return()
endif()
# add source files to be scanned
if (WIN32)
foreach (_sourceFile ${_existingSourceFiles})
file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
list (APPEND _cmd "${_sourceFileNative}")
endforeach()
else()
list (APPEND _cmd ${_existingSourceFiles})
endif()
list (APPEND _cmd ${_existingSourceFiles})
if (COTIRE_VERBOSE)
message (STATUS "execute_process: ${_cmd}")
endif()
if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
if (_option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
endif()
@@ -1502,16 +1473,11 @@ function (cotire_generate_prefix_header _prefixFile)
if (_unparsedLines)
if (COTIRE_VERBOSE OR _scanResult OR NOT _selectedHeaders)
list (LENGTH _unparsedLines _skippedLineCount)
if (WIN32)
file (TO_NATIVE_PATH "${_unparsedLinesFile}" _unparsedLinesLogPath)
else()
set (_unparsedLinesLogPath "${_unparsedLinesFile}")
endif()
message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesLogPath}")
message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesFile}")
endif()
string (REPLACE ";" "\n" _unparsedLines "${_unparsedLines}")
endif()
file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}\n")
file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}")
endfunction()
function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flagsVar)
@@ -1541,7 +1507,7 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags
# append to list
list (APPEND _flags -H -E)
if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
list (APPEND _flags -fdirectives-only)
list (APPEND _flags "-fdirectives-only")
endif()
else()
# return as a flag string
@@ -1551,36 +1517,16 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags
endif()
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
endif()
elseif (WIN32)
# Clang-cl.exe options used
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
# /EP preprocess to stdout without #line directives
# -H print the name of each header file used
# -fno-color-diagnostics do not print diagnostics in color
# -Eonly just run preprocessor, no output
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
else()
# return as a flag string
set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
endif()
# Clang options used
# -H print the name of each header file used
# -E invoke preprocessor
# -fno-color-diagnostics don't prints diagnostics in color
if (_flags)
# append to list
list (APPEND _flags -H -E -fno-color-diagnostics)
else()
# return as a flag string
set (_flags "-H -E -fno-color-diagnostics")
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@@ -1654,8 +1600,8 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
endif()
endif()
elseif (_compilerID MATCHES "GNU")
# GCC options used
elseif (_compilerID MATCHES "GNU|Clang")
# GCC / Clang options used
# -x specify the source language
# -c compile but do not link
# -o place output in file
@@ -1665,55 +1611,11 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -x specify the source language
# -c compile but do not link
# -o place output in file
# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
if (_flags)
# append to list
list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
list (APPEND _flags -Xclang -fno-pch-timestamp)
endif()
else()
# return as a flag string
set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
set (_flags "${_flags} -Xclang -fno-pch-timestamp")
endif()
endif()
elseif (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
# Clang-cl.exe options used
# /Yc creates a precompiled header file
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
# /Zs syntax check only
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags "${_sourceFileType${_language}}"
"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
else()
# return as a flag string
set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
@@ -1755,28 +1657,20 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
get_filename_component(_pchName "${_pchFile}" NAME)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
set (_pchSuppressMessages FALSE)
if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
set(_pchSuppressMessages TRUE)
endif()
if (_flags)
# append to list
if ("${_language}" STREQUAL "CXX")
list (APPEND _flags -Kc++)
endif()
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-create "${_pchName}" -fsyntax-only "${_hostFile}")
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags -Wpch-messages)
endif()
list (APPEND _flags "-Wpch-messages")
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
set (_flags "${_flags} -Wpch-messages")
endif()
set (_flags "${_flags} -Wpch-messages")
endif()
endif()
endif()
@@ -1827,48 +1721,23 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags -Winvalid-pch -include "${_prefixFile}")
list (APPEND _flags "-Winvalid-pch" "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
endif()
elseif (_compilerID MATCHES "Clang")
if (UNIX)
# Clang options used
# -include process include file as the first line of the primary source file
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
endif()
elseif (WIN32)
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
# Clang-cl.exe options used
# /Yu uses a precompiled header file during build
# /Fp specifies precompiled header binary file name
# /FI forces inclusion of file
if (_pchFile)
file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
if (_flags)
# append to list
list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
else()
# return as a flag string
set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags "/FI${_prefixFileNative}")
else()
# return as a flag string
set (_flags "/FI\"${_prefixFileNative}\"")
endif()
endif()
# Clang options used
# -include process include file as the first line of the primary source file
# -include-pch include precompiled header file
# -Qunused-arguments don't emit warning for unused driver arguments
# note: ccache requires the -include flag to be used in order to process precompiled header correctly
if (_flags)
# append to list
list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
endif()
elseif (_compilerID MATCHES "Intel")
if (WIN32)
@@ -1912,32 +1781,24 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
if (_pchFile)
get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
get_filename_component(_pchName "${_pchFile}" NAME)
set (_pchSuppressMessages FALSE)
if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
set(_pchSuppressMessages TRUE)
endif()
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-use "${_pchName}")
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
list (APPEND _flags -Wpch-messages)
endif()
list (APPEND _flags "-Wpch-messages")
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
if (NOT _pchSuppressMessages)
set (_flags "${_flags} -Wpch-messages")
endif()
set (_flags "${_flags} -Wpch-messages")
endif()
endif()
else()
# no precompiled header, force inclusion of prefix header
if (_flags)
# append to list
list (APPEND _flags -include "${_prefixFile}")
list (APPEND _flags "-include" "${_prefixFile}")
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\"")
@@ -1975,17 +1836,9 @@ function (cotire_precompile_prefix_header _prefixFile _pchFile _hostFile)
if (COTIRE_VERBOSE)
message (STATUS "execute_process: ${_cmd}")
endif()
if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
if (_option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
elseif (_option_COMPILER_ID MATCHES "Clang" AND _option_COMPILER_VERSION VERSION_LESS "4.0.0")
if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
_option_COMPILER_EXECUTABLE MATCHES "ccache")
# Newer versions of Clang embed a compilation timestamp into the precompiled header binary,
# which results in "file has been modified since the precompiled header was built" errors if ccache is used.
# We work around the problem by disabling ccache upon pre-compiling the prefix header.
set (ENV{CCACHE_DISABLE} "true")
endif()
endif()
execute_process(
COMMAND ${_cmd}
@@ -2000,7 +1853,7 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
set (_unsupportedCompiler
"Precompiled headers not supported for ${_language} compiler ${CMAKE_${_language}_COMPILER_ID}")
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
# PCH supported since Visual Studio C++ 6.0
# supported since Visual Studio C++ 6.0
# and CMake does not support an earlier version
set (${_msgVar} "" PARENT_SCOPE)
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
@@ -2011,16 +1864,8 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
set (${_msgVar} "" PARENT_SCOPE)
endif()
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
if (UNIX)
# all Unix Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
elseif (WIN32)
# only clang-cl is supported under Windows
get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
if (NOT _compilerName MATCHES "cl$")
set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
endif()
endif()
# all Clang versions have PCH support
set (${_msgVar} "" PARENT_SCOPE)
elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
# Intel PCH support requires version >= 8.0.0
if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
@@ -2031,38 +1876,29 @@ function (cotire_check_precompiled_header_support _language _target _msgVar)
else()
set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
endif()
# check if ccache is used as a compiler launcher
get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" REALPATH)
if (_realCompilerExe MATCHES "ccache" OR _launcher MATCHES "ccache")
# verify that ccache configuration is compatible with precompiled headers
# always check environment variable CCACHE_SLOPPINESS, because earlier versions of ccache
# do not report the "sloppiness" setting correctly upon printing ccache configuration
if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
if (DEFINED ENV{CCACHE_SLOPPINESS})
if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR
NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
set (${_msgVar}
"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
PARENT_SCOPE)
endif()
else()
if (_realCompilerExe MATCHES "ccache")
set (_ccacheExe "${_realCompilerExe}")
if (_launcher MATCHES "ccache")
get_filename_component(_ccacheExe "${_launcher}" REALPATH)
else()
set (_ccacheExe "${_launcher}")
get_filename_component(_ccacheExe "${CMAKE_${_language}_COMPILER}" REALPATH)
endif()
# ccache 3.7.0 replaced --print-config with --show-config
# use -p instead, which seems to work for all version for now, sigh
execute_process(
COMMAND "${_ccacheExe}" "-p"
COMMAND "${_ccacheExe}" "--print-config"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
RESULT_VARIABLE _result
OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if (_result)
set (${_msgVar} "ccache configuration cannot be determined." PARENT_SCOPE)
elseif (NOT _ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR
NOT _ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
if (_result OR NOT
_ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR NOT
_ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
set (${_msgVar}
"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
PARENT_SCOPE)
@@ -2355,7 +2191,7 @@ function (cotire_generate_target_script _language _configurations _target _targe
XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_SEP_${_language}
CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
@@ -2388,9 +2224,8 @@ endfunction()
function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
set (_sourceFiles ${ARGN})
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# for Visual Studio and Intel, we attach the precompiled header compilation to the host file
# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
if (_sourceFiles)
set (_flags "")
@@ -2398,9 +2233,6 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" "${_hostFile}" _flags)
set_property (SOURCE ${_hostFile} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_hostFile} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_OUTPUTS "${_pchFile}")
# make object file generated from host file depend on prefix header
set_property (SOURCE ${_hostFile} APPEND PROPERTY OBJECT_DEPENDS "${_prefixFile}")
@@ -2438,9 +2270,8 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
endfunction()
function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# for Visual Studio and Intel, we include the precompiled header in all but the host file
# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
set (_sourceFiles ${ARGN})
list (LENGTH _sourceFiles _numberOfSourceFiles)
@@ -2452,9 +2283,6 @@ function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefix
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
# make object files generated from source files depend on precompiled header
set_property (SOURCE ${_sourceFiles} APPEND PROPERTY OBJECT_DEPENDS "${_pchFile}")
endif()
@@ -2468,9 +2296,6 @@ function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefix
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
# mark sources as cotired to prevent them from being used in another cotired target
set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
endif()
@@ -2488,9 +2313,6 @@ function (cotire_setup_prefix_file_inclusion _language _target _prefixFile)
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _flags)
set_property (SOURCE ${_sourceFiles} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flags} ")
if (COTIRE_DEBUG)
message (STATUS "set_property: SOURCE ${_sourceFiles} APPEND_STRING COMPILE_FLAGS ${_flags}")
endif()
# mark sources as cotired to prevent them from being used in another cotired target
set_source_files_properties(${_sourceFiles} PROPERTIES COTIRE_TARGET "${_target}")
# make object files generated from source files depend on prefix header
@@ -2595,10 +2417,9 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
# if this is a single-language target without any excluded files
if (_wholeTarget)
set (_language "${_languages}")
# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
# for Visual Studio and Intel, precompiled header inclusion is always done on the source file level
# see cotire_setup_pch_file_inclusion
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
if (_prefixFile)
get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
@@ -2607,9 +2428,6 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
"${_language}" "${CMAKE_${_language}_COMPILER_ID}" "${CMAKE_${_language}_COMPILER_VERSION}"
"${_prefixFile}" "${_pchFile}" _options)
set_property(TARGET ${_target} APPEND PROPERTY ${_options})
if (COTIRE_DEBUG)
message (STATUS "set_property: TARGET ${_target} APPEND PROPERTY ${_options}")
endif()
endif()
endif()
endif()
@@ -2636,8 +2454,7 @@ function (cotire_setup_unity_generation_commands _language _target _targetScript
set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
endif()
if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# unity file compilation results in potentially huge object file,
# thus use /bigobj by default unter cl.exe and Windows Intel
# unity file compilation results in potentially huge object file, thus use /bigobj by default unter MSVC and Windows Intel
set_property (SOURCE "${_unityFile}" APPEND_STRING PROPERTY COMPILE_FLAGS "/bigobj")
endif()
cotire_set_cmd_to_prologue(_unityCmd)
@@ -2843,9 +2660,6 @@ function (cotire_make_target_message _target _languages _disableMsg _targetMsgVa
else()
set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build.")
endif()
if (_disableMsg)
set (_targetMsg "${_targetMsg} ${_disableMsg}")
endif()
else()
if (_excludedStr)
set (_targetMsg "${_languagesStr} target ${_target} cotired ${_excludedStr}.")
@@ -2935,20 +2749,6 @@ function (cotire_choose_target_languages _target _targetLanguagesVar _wholeTarge
set (_targetUsePCH FALSE)
endif()
endif()
if (_targetAddSCU)
# disable unity builds if automatic Qt processing is used
get_target_property(_targetAutoMoc ${_target} AUTOMOC)
get_target_property(_targetAutoUic ${_target} AUTOUIC)
get_target_property(_targetAutoRcc ${_target} AUTORCC)
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
if (_disableMsg)
set (_disableMsg "${_disableMsg} Target uses automatic CMake Qt processing.")
else()
set (_disableMsg "Target uses automatic CMake Qt processing.")
endif()
set (_targetAddSCU FALSE)
endif()
endif()
set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER ${_targetUsePCH})
set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD ${_targetAddSCU})
cotire_make_target_message(${_target} "${_targetLanguages}" "${_disableMsg}" _targetMsg ${_allExcludedSourceFiles})
@@ -2976,11 +2776,7 @@ function (cotire_compute_unity_max_number_of_includes _target _maxIncludesVar)
set (_sourceFiles ${ARGN})
get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
if (DEFINED CMAKE_MATCH_2)
set (_numberOfThreads "${CMAKE_MATCH_2}")
else()
set (_numberOfThreads "")
endif()
set (_numberOfThreads "${CMAKE_MATCH_2}")
if (NOT _numberOfThreads)
# use all available cores
ProcessorCount(_numberOfThreads)
@@ -3093,9 +2889,8 @@ function (cotire_setup_pch_target _languages _configurations _target)
set (_dependsFiles "")
foreach (_language ${_languages})
set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# MSVC, Intel and clang-cl only create precompiled header as a side effect
if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
# Visual Studio and Intel only create precompiled header as a side effect
list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
endif()
cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})
@@ -3143,7 +2938,6 @@ function (cotire_collect_unity_target_sources _target _languages _unityTargetSou
list (APPEND _unityTargetSources ${_unityFiles})
endif()
endforeach()
# handle object libraries which are part of the target's sources
get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$")
cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles})
@@ -3188,6 +2982,21 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
# determine unity target sources
set (_unityTargetSources "")
cotire_collect_unity_target_sources(${_target} "${_languages}" _unityTargetSources)
# handle automatic Qt processing
get_target_property(_targetAutoMoc ${_target} AUTOMOC)
get_target_property(_targetAutoUic ${_target} AUTOUIC)
get_target_property(_targetAutoRcc ${_target} AUTORCC)
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# if the original target sources are subject to CMake's automatic Qt processing,
# also include implicitly generated <targetname>_automoc.cpp file
if (CMAKE_VERSION VERSION_LESS "3.8.0")
list (APPEND _unityTargetSources "${_target}_automoc.cpp")
set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
else()
list (APPEND _unityTargetSources "${_target}_autogen/moc_compilation.cpp")
set_property (SOURCE "${_target}_autogen/moc_compilation.cpp" PROPERTY GENERATED TRUE)
endif()
endif()
# prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
set (CMAKE_AUTOMOC OFF)
set (CMAKE_AUTOUIC OFF)
@@ -3201,6 +3010,21 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
else()
add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
endif()
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
# depend on original target's automoc target, if it exists
if (TARGET ${_target}_automoc)
add_dependencies(${_unityTargetName} ${_target}_automoc)
endif()
else()
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# depend on the original target's implicity generated <targetname>_automoc target
if (CMAKE_VERSION VERSION_LESS "3.8.0")
add_dependencies(${_unityTargetName} ${_target}_automoc)
else()
add_dependencies(${_unityTargetName} ${_target}_autogen)
endif()
endif()
endif()
# copy output location properties
set (_outputDirProperties
ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
@@ -3212,8 +3036,8 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
set (_outputDir "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
else()
# append relative COTIRE_UNITY_OUTPUT_DIRECTORY to target's actual output directory
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
cotire_resolve_config_properties("${_configurations}" _properties ${_outputDirProperties})
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
cotire_resolve_config_properites("${_configurations}" _properties ${_outputDirProperties})
foreach (_property ${_properties})
get_property(_outputDir TARGET ${_target} PROPERTY ${_property})
if (_outputDir)
@@ -3233,11 +3057,11 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
RUNTIME_OUTPUT_DIRECTORY "${_outputDir}")
endif()
else()
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
${_outputDirProperties})
endif()
# copy output name
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_<CONFIG>
LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
OUTPUT_NAME OUTPUT_NAME_<CONFIG>
@@ -3245,7 +3069,7 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
PREFIX <CONFIG>_POSTFIX SUFFIX
IMPORT_PREFIX IMPORT_SUFFIX)
# copy compile stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
COMPILE_FLAGS COMPILE_OPTIONS
Fortran_FORMAT Fortran_MODULE_DIRECTORY
@@ -3257,12 +3081,12 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN
C_CLANG_TIDY CXX_CLANG_TIDY)
# copy compile features
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED
COMPILE_FEATURES)
# copy interface stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN
COMPATIBLE_INTERFACE_STRING
INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS
@@ -3270,9 +3094,8 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
# copy link stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUILD_WITH_INSTALL_RPATH BUILD_WITH_INSTALL_NAME_DIR
INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUILD_WITH_INSTALL_RPATH INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
LINK_FLAGS LINK_FLAGS_<CONFIG>
LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_<CONFIG>
@@ -3280,18 +3103,18 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
NO_SONAME SOVERSION VERSION
LINK_WHAT_YOU_USE BUILD_RPATH)
LINK_WHAT_YOU_USE)
# copy cmake stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
# copy Apple platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
IOS_INSTALL_COMBINED XCODE_EXPLICIT_FILE_TYPE XCODE_PRODUCT_TYPE)
IOS_INSTALL_COMBINED)
# copy Windows platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
GNUtoMS
COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -3305,19 +3128,15 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
VS_SDK_REFERENCES VS_USER_PROPS VS_DEBUGGER_WORKING_DIRECTORY)
VS_SDK_REFERENCES)
# copy Android platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
ANDROID_API ANDROID_API_MIN ANDROID_GUI
ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
# copy CUDA platform specific stuff
cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
CUDA_PTX_COMPILATION CUDA_SEPARABLE_COMPILATION CUDA_RESOLVE_DEVICE_SYMBOLS
CUDA_EXTENSIONS CUDA_STANDARD CUDA_STANDARD_REQUIRED)
# use output name from original target
get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
if (NOT _targetOutputName)
@@ -3331,13 +3150,6 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
set_property(TARGET ${_unityTargetName} PROPERTY ENABLE_EXPORTS TRUE)
endif()
endif()
# enable parallel compilation for MSVC
if (MSVC AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
list (LENGTH _unityTargetSources _numberOfUnityTargetSources)
if (_numberOfUnityTargetSources GREATER 1)
set_property(TARGET ${_unityTargetName} APPEND PROPERTY COMPILE_OPTIONS "/MP")
endif()
endif()
cotire_init_target(${_unityTargetName})
cotire_add_to_unity_all_target(${_unityTargetName})
set_property(TARGET ${_target} PROPERTY COTIRE_UNITY_TARGET_NAME "${_unityTargetName}")
@@ -3496,13 +3308,6 @@ function (cotire_target_link_libraries _target)
message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
endif()
endif()
get_target_property(_manualDependencies ${_target} MANUALLY_ADDED_DEPENDENCIES)
if (_manualDependencies)
cotire_map_libraries("${_linkLibrariesStrategy}" _unityManualDependencies ${_manualDependencies})
if (_unityManualDependencies)
add_dependencies("${_unityTargetName}" ${_unityManualDependencies})
endif()
endif()
endif()
endif()
endfunction(cotire_target_link_libraries)
@@ -3535,9 +3340,9 @@ function (cotire_init_target _targetName)
set_target_properties(${_targetName} PROPERTIES FOLDER "${COTIRE_TARGETS_FOLDER}")
endif()
set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_ALL TRUE)
# if (MSVC_IDE)
# set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
# endif()
if (MSVC_IDE)
set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
endif()
endfunction()
function (cotire_add_to_pch_all_target _pchTargetName)
@@ -3799,7 +3604,7 @@ else()
set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
"Ignore sources with the listed file extensions from the generated unity source.")
set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "2" CACHE STRING
set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "3" CACHE STRING
"Minimum number of sources in target required to enable use of precompiled header.")
if (NOT DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT)
@@ -3898,7 +3703,7 @@ else()
FULL_DOCS
"The variable can be set to an integer > 0."
"If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
"If not defined, defaults to 2."
"If not defined, defaults to 3."
)
define_property(

View File

@@ -1,96 +0,0 @@
# Draco - a library for a lossy vertex data compression, used as extension to glTF format.
# https://github.com/google/draco
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
if (NOT DEFINED INSTALL_DRACO)
set (INSTALL_DRACO OFF CACHE BOOL "${INSTALL_DRACO_DESCR}")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_DIR)
set (3RDPARTY_DRACO_DIR "" CACHE PATH "The directory containing Draco")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_INCLUDE_DIR)
set (3RDPARTY_DRACO_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the Draco")
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY OR NOT 3RDPARTY_DRACO_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
set (3RDPARTY_DRACO_LIBRARY "" CACHE FILEPATH "Draco library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_DRACO_LIBRARY_DIR)
set (3RDPARTY_DRACO_LIBRARY_DIR "" CACHE PATH "The directory containing Draco library")
endif()
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_DRACO_DIR OR NOT EXISTS "${3RDPARTY_DRACO_DIR}")
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" draco DRACO_DIR_NAME)
if (DRACO_DIR_NAME)
set (3RDPARTY_DRACO_DIR "${3RDPARTY_DIR}/${DRACO_DIR_NAME}" CACHE PATH "The directory containing Draco" FORCE)
endif()
endif()
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
set (DRACO_INCLUDE_PATH "${3RDPARTY_DRACO_DIR}/include")
set (DRACO_LIBRARY_PATH "${3RDPARTY_DRACO_DIR}/lib")
endif()
if (NOT 3RDPARTY_DRACO_INCLUDE_DIR)
if (DRACO_INCLUDE_PATH AND EXISTS "${DRACO_INCLUDE_PATH}")
set (3RDPARTY_DRACO_INCLUDE_DIR "${DRACO_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of DRACO" FORCE)
endif()
endif()
if (NOT 3RDPARTY_DRACO_LIBRARY_DIR)
if (DRACO_LIBRARY_PATH AND EXISTS "${DRACO_LIBRARY_PATH}")
set (3RDPARTY_DRACO_LIBRARY_DIR "${DRACO_LIBRARY_PATH}" CACHE FILEPATH "The directory containing DRACO library" FORCE)
endif()
endif()
if (3RDPARTY_DRACO_INCLUDE_DIR AND EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_DRACO_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DRACO_INCLUDE_DIR)
endif()
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
PATHS "${3RDPARTY_DRACO_LIBRARY_DIR}"
PATH_SUFFIXES lib
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if (3RDPARTY_DRACO_LIBRARY AND EXISTS "${3RDPARTY_DRACO_LIBRARY}")
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY}" PATH)
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
endif()
endif()
endif()
if (3RDPARTY_DRACO_LIBRARY_DIR AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_DRACO_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_DRACO_LIBRARY_DIR)
endif()
if (INSTALL_DRACO)
get_filename_component(3RDPARTY_DRACO_LIBRARY_REALPATH ${3RDPARTY_DRACO_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_DRACO_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()

View File

@@ -1,3 +1,3 @@
# EGL
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlesLibs" "")
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlLibs" "")

View File

@@ -191,13 +191,13 @@ foreach (LIBRARY_NAME ${CSF_FFmpeg})
else()
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}")
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}i")
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}d")
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
endif()
else()
get_filename_component(3RDPARTY_FFMPEG_LIBRARY_ABS ${3RDPARTY_FFMPEG_LIBRARY_${LIBRARY_NAME}} REALPATH)

View File

@@ -26,7 +26,9 @@ if (3RDPARTY_DIR)
endforeach()
endif()
find_package (FLEX 2.6.4)
# flex 2.5.37 is required because closest known lower version, 2.5.3 from WOK 6.8.0,
# generates code which is unusable on Windows (includes unistd.h without any way to avoid this)
find_package (FLEX 2.5.37)
if (NOT FLEX_FOUND OR NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_INCLUDE_DIR)

View File

@@ -110,19 +110,8 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
endif()
unset (FREETYPE_LIBRARY_RELEASE)
find_package(Freetype)
# Only for UNIX (not APPLE)
if ((NOT WIN32) AND (NOT APPLE))
# To avoid linker error on Ubuntu 18.04 and others linux distributives we should
# link with freetype library, compiled as Position Independent Code (PIC),
# for example, with shared object.
if ((DEFINED FREETYPE_LIBRARY_RELEASE) AND (NOT "${FREETYPE_LIBRARY_RELEASE}" STREQUAL "") AND (EXISTS "${FREETYPE_LIBRARY_RELEASE}"))
string (REPLACE "\.a" "\.so" FREETYPE_LIBRARY_RELEASE "${FREETYPE_LIBRARY_RELEASE}")
endif()
endif()
# restore ENV{FREETYPE_DIR}
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
set (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
@@ -133,7 +122,7 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_ft2build FILEPATH "The directory containing ft2build.h header")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "The directory containing ftheader.h header")
if (BUILD_SHARED_LIBS)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY_RELEASE FILEPATH "freetype library")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY FILEPATH "freetype library")
endif()
endif()
@@ -152,8 +141,8 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
if (FREETYPE_LIBRARY_RELEASE AND EXISTS "${FREETYPE_LIBRARY_RELEASE}")
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY_RELEASE}" CACHE FILEPATH "The path to freetype library" FORCE)
if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "The path to freetype library" FORCE)
endif()
endif()
@@ -231,7 +220,7 @@ endif()
# freetype library
#if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (FREETYPE_PATH_SUFFIXES lib)
if (ANDROID)
@@ -253,16 +242,6 @@ endif()
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
# Only for UNIX (not APPLE)
if ((NOT WIN32) AND (NOT APPLE))
# To avoid linker error on Ubuntu 18.04 and some others linux distributives we should
# link with freetype library, compiled as Position Independent Code (PIC),
# for example, with shared object.
if ((DEFINED 3RDPARTY_FREETYPE_LIBRARY) AND (NOT "${3RDPARTY_FREETYPE_LIBRARY}" STREQUAL "") AND (EXISTS "${3RDPARTY_FREETYPE_LIBRARY}"))
string (REPLACE "\.a" "\.so" 3RDPARTY_FREETYPE_LIBRARY "${3RDPARTY_FREETYPE_LIBRARY}")
endif()
endif()
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
@@ -371,7 +350,7 @@ endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY_RELEASE)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY)
if (BUILD_SHARED_LIBS)
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)

View File

@@ -1,3 +1,3 @@
# OpenGL ES 2.0
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlesLibs" "")
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlLibs" "")

View File

@@ -49,39 +49,22 @@ else()
set (CSF_OpenVR)
endif()
# TCL
# TCL/TK
if (USE_TCL)
if (WIN32)
set (CSF_TclLibs "tcl86")
else()
if(APPLE)
set (CSF_TclLibs Tcl)
elseif(UNIX)
set (CSF_TclLibs "tcl8.6")
endif()
endif()
endif()
# TK
if (USE_TK)
if (WIN32)
set (CSF_TclTkLibs "tk86")
else()
if(APPLE)
set (CSF_TclTkLibs Tk)
set (CSF_TclLibs Tcl)
elseif(UNIX)
set (CSF_TclTkLibs "tk8.6")
set (CSF_TclLibs "tcl8.6")
set (CSF_TclTkLibs "tk8.6")
endif()
endif()
endif()
# Draco
if (USE_DRACO)
set (CSF_Draco "draco")
else()
set (CSF_Draco)
endif()
if (WIN32)
set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib")
@@ -91,8 +74,12 @@ if (WIN32)
set (CSF_psapi "psapi.lib")
set (CSF_winmm "winmm.lib")
set (CSF_d3d9 "D3D9.lib")
set (CSF_OpenGlLibs "opengl32.lib")
set (CSF_OpenGlesLibs "libEGL libGLESv2")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
set (CSF_OpenGlLibs "libEGL libGLESv2")
else()
set (CSF_OpenGlLibs "opengl32.lib")
endif()
else()
if (APPLE)
@@ -113,38 +100,31 @@ else()
OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (IOS)
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
elseif (USE_XLIB)
set (CSF_OpenGlLibs "GL")
set (CSF_XwLibs "X11")
find_library (OpenGlLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
elseif (USE_GLX)
set (CSF_OpenGlLibs GL)
set (CSF_XwLibs "X11 Xext Xmu Xi")
else()
find_library (OpenGlLibs_LIB NAMES OpenGL)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
elseif (EMSCRIPTEN)
set (CSF_ThreadLibs "pthread rt stdc++")
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_dl "dl")
elseif (ANDROID)
set (CSF_ThreadLibs "c")
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_OpenGlLibs "EGL GLESv2")
set (CSF_androidlog "log")
elseif (UNIX)
set (CSF_ThreadLibs "pthread rt stdc++")
if (USE_XLIB)
set (CSF_OpenGlLibs "GL")
set (CSF_XwLibs "X11")
if (USE_GLES2)
set (CSF_OpenGlLibs "EGL GLESv2")
else()
set (CSF_OpenGlLibs "GL EGL")
set (CSF_OpenGlLibs "GL")
endif()
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_XwLibs "X11 Xext Xmu Xi")
set (CSF_dl "dl")
if (USE_FREETYPE)
set (CSF_fontconfig "fontconfig")
endif()
set (CSF_fontconfig "fontconfig")
endif()
endif()

View File

@@ -25,9 +25,6 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
endif()
if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
@@ -43,19 +40,6 @@ elseif (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")
endif()
if (MSVC)
# string pooling (GF), function-level linking (Gy)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GF /Gy")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GF /Gy")
if (BUILD_FORCE_RelWithDebInfo)
# generate debug info (Zi), inline expansion level (Ob1)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /Ob1")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi /Ob1")
# generate debug info (debug), OptimizeReferences=true (OPT:REF), EnableCOMDATFolding=true (OPT:ICF)
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /debug /OPT:REF /OPT:ICF")
endif()
endif()
# remove _WINDOWS flag if it exists
string (REGEX MATCH "/D_WINDOWS" IS_WINDOWSFLAG "${CMAKE_CXX_FLAGS}")
if (IS_WINDOWSFLAG)
@@ -116,11 +100,8 @@ if (MSVC)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]"))
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
endif()
if (BUILD_SHARED_LIBS)
if (APPLE)
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
@@ -130,24 +111,30 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
if (APPLE)
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
elseif(NOT WIN32)
# CLang for Windows (at least CLang 8.0 distributed with VS 2019)
# does not support option "-std=c++0x"
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
elseif(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
#set (CMAKE_SYSTEM_VERSION "6.1")
add_definitions(-D_WIN32_WINNT=0x0501)
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
# Require C++11
set (CMAKE_CXX_FLAGS "-std=gnu++0x ${CMAKE_CXX_FLAGS}")
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
# Require C++11
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")

View File

@@ -80,9 +80,9 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (COMPILER icc)
else()
set (COMPILER ${CMAKE_GENERATOR})
@@ -160,8 +160,6 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
if ("${lower_PRODUCT_NAME}" STREQUAL "egl")
string (SUBSTRING "${lower_PRODUCT_NAME}" 1 -1 lower_PRODUCT_NAME)
list (APPEND SEARCH_TEMPLATES "[^gl]+${lower_PRODUCT_NAME}.*")
elseif ("${lower_PRODUCT_NAME}" STREQUAL "tbb")
list (APPEND SEARCH_TEMPLATES "^.*${lower_PRODUCT_NAME}.*")
else()
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
@@ -591,7 +589,9 @@ macro (OCCT_UPDATE_TARGET_FILE)
endif()
install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
"cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
@@ -600,7 +600,8 @@ macro (OCCT_UPDATE_TARGET_FILE)
string (REGEX REPLACE \"[\\\\]?[\\\$]{OCCT_INSTALL_BIN_LETTER}\" \"\${OCCT_INSTALL_BIN_LETTER}\" line \"\${line}\")
file (APPEND \"\${TARGET_FILENAME}\" \"\${line}\\n\")
endforeach()
endforeach()")
endforeach()
cmake_policy(POP)")
endmacro()
macro (OCCT_INSERT_CODE_FOR_TARGET)
@@ -614,14 +615,17 @@ macro (OCCT_INSERT_CODE_FOR_TARGET)
endmacro()
macro (OCCT_UPDATE_DRAW_DEFAULT_FILE)
install(CODE "set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\")
install(CODE "cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\")
file (STRINGS \"\${DRAW_DEFAULT_FILE_NAME}\" DRAW_DEFAULT_CONTENT)
file (REMOVE \"\${DRAW_DEFAULT_FILE_NAME}\")
foreach (line IN LISTS DRAW_DEFAULT_CONTENT)
string (REGEX MATCH \": TK\([a-zA-Z]+\)$\" IS_TK_LINE \"\${line}\")
string (REGEX REPLACE \": TK\([a-zA-Z]+\)$\" \": TK\${CMAKE_MATCH_1}${BUILD_SHARED_LIBRARY_NAME_POSTFIX}\" line \"\${line}\")
file (APPEND \"\${DRAW_DEFAULT_FILE_NAME}\" \"\${line}\\n\")
endforeach()")
endforeach()
cmake_policy(POP)")
endmacro()
macro (OCCT_CREATE_SYMLINK_TO_FILE LIBRARY_NAME LINK_NAME)

View File

@@ -22,7 +22,7 @@ if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
set (OCCT_TOOLKITS_NAME_SUFFIX "TOOLKITS")
endif()
# parse PACKAGES file
# parce PACKAGES file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
if ("${USED_PACKAGES}" STREQUAL "")
set (USED_PACKAGES ${PROJECT_NAME})
@@ -39,7 +39,7 @@ set (PRECOMPILED_DEFS)
if (NOT BUILD_SHARED_LIBS)
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
if (WIN32 AND NOT EXECUTABLE_PROJECT)
if (WIN32)
list (APPEND PRECOMPILED_DEFS "-DOCCT_STATIC_BUILD")
endif()
endif()
@@ -95,7 +95,7 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
# Note: files are generated in original source directory (not in patch!)
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}")
# choose appropriate extension for generated files: "cxx" if source file contains
# choose apropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
@@ -106,12 +106,6 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${FLEX_BISON_TARGET_DIR}/FlexLexer.h")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/FlexLexer.h)
endif()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
@@ -127,19 +121,6 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
message (STATUS "Info: remove old output FLEX file: ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
endif()
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
@@ -245,47 +226,14 @@ endif (USE_QT)
if (EXECUTABLE_PROJECT)
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
if (EMSCRIPTEN)
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
endif()
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
if (MSVC)
if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release")
else()
set (aReleasePdbConf)
endif()
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
CONFIGURATIONS Debug RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
endif()
@@ -298,8 +246,7 @@ else()
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
INCLUDES DESTINATION ${INSTALL_DIR_INCLUDE})
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
if (NOT WIN32)
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
@@ -324,27 +271,20 @@ get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)
get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR)
get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE)
set (OCC_SOVERSION "")
if (BUILD_SOVERSION_NUMBERS GREATER 2)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
elseif (BUILD_SOVERSION_NUMBERS GREATER 1)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}")
elseif (BUILD_SOVERSION_NUMBERS GREATER 0)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}")
if (ANDROID)
# do not append version to the filename
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
else()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_VERSION_MAJOR}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
endif()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_SOVERSION}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
# parse EXTERNLIB file
if (CUSTOM_EXTERNLIB)
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
else()
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
endif()
# parce EXTERNLIB file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${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)
@@ -363,13 +303,6 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
add_definitions (-DHAVE_GLES2)
endif()
set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF})
@@ -411,7 +344,7 @@ endforeach()
if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1)
find_package (X11 COMPONENTS X11)
find_package (X11 COMPONENTS X11 Xext Xmu Xi)
if (NOT X11_FOUND)
message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
endif()
@@ -443,7 +376,7 @@ else()
endif()
endif()
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
if (BUILD_SHARED_LIBS)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()

View File

@@ -1,240 +1,294 @@
# tbb
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS)
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
endif()
# tbb directory
if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
endif()
if (MSVC AND BUILD_SHARED_LIBS)
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
endif()
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS)
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
endif()
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# Initialize tbb directory.
if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
endif()
# specify TBB folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_TBB_DIR PATH "The directory containing tbb")
if (WIN32)
if (NOT DEFINED 3RDPARTY_DIR)
message (FATAL_ERROR "3RDPARTY_DIR is not defined.")
endif()
if ("${3RDPARTY_DIR}" STREQUAL "")
message (FATAL_ERROR "3RDPARTY_DIR is empty string.")
endif()
if (NOT EXISTS "${3RDPARTY_DIR}")
message (FATAL_ERROR "3RDPARTY_DIR is not exist.")
endif()
# Below, we have correct 3RDPARTY_DIR.
# Initialize TBB folder in connectin with 3RDPARTY_DIR.
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
if (NOT 3RDPARTY_TBB_DIR OR NOT EXISTS "${3RDPARTY_TBB_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME)
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
endif()
endif()
else()
#set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing TBB" FORCE)
endif()
# Here we have full path name to installation directory of TBB.
# Employ it.
if (EXISTS "${3RDPARTY_TBB_DIR}")
find_package (
TBB 2021.5
PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH
REQUIRED
CONFIG)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
endif()
# Achive include directory
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
# check 3RDPARTY_TBB_INCLUDE_DIR for consictency with specified 3RDPARTY_TBB_DIR
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_TBB_INCLUDE_DIR PATH "The directory containing headers of the TBB")
endif()
# tbb.h
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
set (HEADER_NAMES tbb.h tbb/tbb.h)
# set 3RDPARTY_TBB_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_TBB_INCLUDE_DIR
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to tbb.h" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_TBB_DIR}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
endif()
# common steps for tbb and tbbmalloc
macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
string (TOUPPER ${PRODUCT_LIBRARY_NAME} upper_PRODUCT_LIBRARY_NAME)
# define required tbb/tbbmalloc variables
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library")
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif()
if (EXISTS "${TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "${TBB_INCLUDE_DIR}" CACHE PATH "The directory containing headers of the TBB" FORCE)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
endif()
if (WIN32 AND NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library")
endif()
# check 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_ paths for consistency with specified 3RDPARTY_TBB_DIR
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY FILEPATH "the path to ${upper_PRODUCT_LIBRARY_NAME} library")
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library")
endif()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
if (WIN32)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL FILEPATH "the path to ${upper_PRODUCT_LIBRARY_NAME} shared library")
# Achive *.lib files and directory containing it.
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_RELEASE)
# Reserve cache variable for *.lib.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.lib)")
endif()
# Reserve cache variable for directory containing *.lib file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.lib)")
endif()
if (EXISTS "${TBB_LIB_FILE}")
set (3RDPARTY_${LIB_UPPER}_LIBRARY
"${TBB_LIB_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.lib)"
FORCE)
get_filename_component (TBB_LIB_FILE_DIRECTORY "${TBB_LIB_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR
"${TBB_LIB_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.lib)"
FORCE)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_UPPER}_LIBRARY_DIR}")
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# Achive *.dll files and directory containing it.
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Reserve cache variable for *.dll.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library")
endif()
# Reserve cache variable for directory containing *.dll file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL_DIR)
set (3RDPARTY_${LIB_UPPER}_DLL_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.dll)")
endif()
if (EXISTS "${TBB_DLL_FILE}")
set (3RDPARTY_${LIB_UPPER}_DLL
"${TBB_DLL_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.dll)"
FORCE)
get_filename_component (TBB_DLL_FILE_DIRECTORY "${TBB_DLL_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_DLL_DIR
"${TBB_DLL_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.dll)"
FORCE)
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIB_UPPER}_DLL_DIR}")
endif()
endif()
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
if (${COMPILER_BITNESS} EQUAL 32)
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME ia32)
else()
set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME intel64)
endif()
# tbb/tbbmalloc library
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME})
# set 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}")
file (GLOB ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/*")
if (${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST)
list (GET ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${LIB_UPPER}_DLL_DIR)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif()
# install *.dll (tbb & tbbmalloc)
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATHS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
# tbb/tbbmalloc shared library
if (WIN32)
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
set (PRODUCT_PATH_SUFFIXES bin)
# set 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}")
file (GLOB ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/*")
if (${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST)
list (GET ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES bin bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else()
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_BIN}d")
set (PRODUCT_PATH_SUFFIXES bin bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif()
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME}
PATHS "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME} PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES})
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif()
endif()
mark_as_advanced (3RDPARTY_${LIB_UPPER}_LIBRARY 3RDPARTY_${LIB_UPPER}_DLL)
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the *.dll/*.so* directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
endif()
else()
message (FATAL_ERROR "Installation directory with TBB is not exist.")
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR)
endif()
endif()
else ()
# NOT WIN32 branch
if ((DEFINED 3RDPARTY_DIR) AND (NOT "${3RDPARTY_DIR}" STREQUAL "") AND (EXISTS "${3RDPARTY_DIR}"))
# Here, we have correct 3RDPARTY_DIR.
# Trying to specify TBB folder in connection with 3RDPARTY_DIR
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME)
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
# install tbb/tbbmalloc
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
endif()
if ((NOT "${3RDPARTY_TBB_DIR}" STREQUAL "") AND (EXISTS "${3RDPARTY_TBB_DIR}"))
# Find TBB 2021.5 in existing directory.
find_package (
TBB 2021.5
PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH
REQUIRED
CONFIG)
else()
# Find TBB 2021.5 in system directory.
find_package (
TBB 2021.5
REQUIRED
CONFIG)
endif()
else()
# Find TBB 2021.5 in system directory.
find_package (
TBB 2021.5
REQUIRED
CONFIG)
endif()
# TBB has been configured (in other case FATAL_ERROR occures).
# Achive include directory.
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
endif()
if (EXISTS "${TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "${TBB_INCLUDE_DIR}" CACHE PATH "The directory containing headers of the TBB" FORCE)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
endif()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
# Achive *.so files and directory containing it.
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Reserve cache variable for *.so.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.so)")
endif()
# Reserve cache variable for directory containing *.so file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.so)")
endif()
if (EXISTS "${TBB_SO_FILE}")
set (3RDPARTY_${LIB_UPPER}_LIBRARY
"${TBB_SO_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.so)"
FORCE)
get_filename_component (TBB_SO_FILE_DIRECTORY "${TBB_SO_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR
"${TBB_SO_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.so)"
FORCE)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_UPPER}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# install *.so* (tbb & tbbmalloc)
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY} NAME)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
else()
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_LIB}d")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
endif()
endif()
endif()
mark_as_advanced (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL)
endmacro()
#if (BUILD_SHARED_LIBS)
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
TBB_PRODUCT_SEARCH (${LIB})
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the *.so* directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
else()
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
endif()
endif()
endif()
#endif()

View File

@@ -1,6 +1,6 @@
# tcl
if (NOT DEFINED INSTALL_TCL)
if (NOT DEFINED INSTALL_TCL AND BUILD_SHARED_LIBS)
set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
endif()
@@ -14,30 +14,30 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
endif()
if (BUILD_SHARED_LIBS)
# tcl library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
endif()
# tcl library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
endif()
# tcl library directory
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
endif()
# tcl library directory
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
endif()
# tcl shared library (with absolute path)
if (WIN32)
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
endif()
endif()
# tcl shared library (with absolute path)
if (WIN32)
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
# tcl shared library directory
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
endif()
endif()
# tcl shared library directory
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
endif()
# search for tcl in user defined directory
if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
@@ -64,197 +64,203 @@ if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
endif()
endif()
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
if (BUILD_SHARED_LIBS)
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif()
endif()
endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
elseif (3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
elseif (3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
endif()
endif()
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
NO_DEFAULT_PATH)
if (BUILD_SHARED_LIBS)
# tcl dir and library
if (NOT 3RDPARTY_TCL_LIBRARY)
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
NO_DEFAULT_PATH)
# search in another place if previous search doesn't find anything
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_DIR}/lib"
NO_DEFAULT_PATH)
# search in another place if previous search doesn't find anything
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_DIR}/lib"
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
endif()
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif()
set (3RDPARTY_TCL_LIBRARY_VERSION "")
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
message (STATUS "Info: TCL version isn't found")
endif()
endif()
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
if (3RDPARTY_TCL_LIBRARY_VERSION)
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
else()
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif()
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
set (3RDPARTY_TCL_LIBRARY_VERSION "")
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
message (STATUS "Info: TCL version isn't found")
endif()
endif()
endif()
# include found paths to common variables
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
endif()
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
endif()
if (WIN32)
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
if (3RDPARTY_TCL_LIBRARY_VERSION)
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
endif()
endif()
# install tcl
if (INSTALL_TCL)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
# collect and install all dlls from tcl dll dirs
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
else()
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
if (SINGLE_GENERATOR)
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES ${TCL_DLLS}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${TCL_DLLS}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${TCL_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
endif()
endif()
else()
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
endif()
endif()
if (TCL_TCLSH_VERSION)
# tcl is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
# include found paths to common variables
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
else()
message (STATUS "\nWarning: tclX.X subdir won't be copied during the installation process.")
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
endif()
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
endif()
set (USED_3RDPARTY_TCL_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
else()
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
endif()
endif()
endif()
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
# install tcl
if (INSTALL_TCL)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
# collect and install all dlls from tcl dll dirs
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
if (SINGLE_GENERATOR)
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES ${TCL_DLLS}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${TCL_DLLS}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${TCL_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()
if (TCL_TCLSH_VERSION)
# tcl is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
else()
message (STATUS "\nWarning: tclX.X subdir won't be copyied during the installation process.")
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
endif()
set (USED_3RDPARTY_TCL_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
else()
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
endif()
endif()
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
endif()
if (TK_FOUND AND 3RDPARTY_TCL_DIR)
@@ -279,3 +285,10 @@ OCCT_CHECK_AND_UNSET (TK_LIBRARY)
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TK_WISH)
if (NOT BUILD_SHARED_LIBS)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY_DIR)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL_DIR)
OCCT_CHECK_AND_UNSET (INSTALL_TCL)
endif()

View File

@@ -250,7 +250,7 @@ if (BUILD_SHARED_LIBS)
# tk is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
else()
message (STATUS "\nWarning: tkX.X subdir won't be copied during the installation process.")
message (STATUS "\nWarning: tkX.X subdir won't be copyied during the installation process.")
message (STATUS "Try seeking tk within another folder by changing 3RDPARTY_TK_DIR variable.")
endif()

View File

@@ -28,9 +28,6 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries")
set (BUILD_SOVERSION_NUMBERS_DESCR
"Version numbers to put into SONAME: 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance")
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
"Disables exceptions like Standard_OutOfRange in Release builds.
Defines No_Exception macros for Release builds when enabled (default).
@@ -41,9 +38,6 @@ set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
Corresponding environment variable (CSF_FPE) can be changed manually
in custom.bat/sh scripts without regeneration by CMake.")
set (BUILD_FORCE_RelWithDebInfo_DESCR
"Generate PDB files within normal Release build.")
set (BUILD_USE_PCH_DESCR
"Use precompiled headers to accelerate the build.
Precompiled headers are generated automatically by Cotire tool.")
@@ -161,18 +155,12 @@ set (3RDPARTY_DIR_DESCR
third-party product have been found - corresponding CMake variables will be specified
(VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)")
set (USE_TK_DESCR
"Indicates whether Tk product should be used by Draw Harness for user interface")
set (USE_FREETYPE_DESCR
"Indicates whether FreeType product should be used in OCCT for text rendering using external font files")
set (USE_FFMPEG_DESCR
"Indicates whether FFmpeg framework is used or not. FFmpeg stands for
multimedia data handling, open-source software libraries used for video encoding and decoding.")
set (USE_FREEIMAGE_DESCR
"Indicates whether FreeImage product should be used in OCCT visualization
"Indicates whether Freeimage product should be used in OCCT visualization
module for support of popular graphics image formats (PNG, BMP etc)")
set (USE_OPENVR_DESCR
@@ -182,17 +170,13 @@ set (USE_RAPIDJSON_DESCR
"Indicates whether RapidJSON product should be used in OCCT DataExchange
module for support of JSON-based formats like glTF")
set (USE_DRACO_DESCR
"Indicates whether Draco mesh decoding library should be used by glTF reader")
set (USE_EGL_DESCR
"Indicates whether EGL should be used in OCCT visualization
module instead of conventional OpenGL context creation APIs")
set (USE_OPENGL_DESCR
"Indicates whether OpenGL desktop should be used in OCCT visualization module")
set (USE_GLES2_DESCR
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization module")
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization
module instead of desktop OpenGL")
set (USE_TBB_DESCR
"Indicates whether TBB is used or not. TBB stands for Threading Building Blocks,
@@ -205,7 +189,7 @@ ToolKit, the technology of Kitware Inc intended for general-purpose scientific
visualization. OCCT comes with a bridge between CAD data representation and
VTK by means of its dedicated VIS component (VTK Integration Services).")
set (USE_XLIB_DESCR "Indicates whether X11 is used or not")
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")

View File

@@ -56,52 +56,36 @@ lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
set ::CONFIG "Release"
set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
# detect installed Visual Studio 2017+ instances by running vswhere.exe
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
lappend ::SYS_VC_LIST "vc141"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
lappend ::SYS_VC_LIST "vc141-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
lappend ::SYS_VC_LIST "vc142"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143)"
lappend ::SYS_VC_LIST "vc143"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143) UWP"
lappend ::SYS_VC_LIST "vc143-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
# detect installed Visual Studio instances from global environment
@@ -154,13 +138,6 @@ proc wokdep:gui:Close {} {
exit
}
proc wokdep:gui:configSuffix {} {
if { "$::CONFIG" == "Debug" } {
return "D"
}
return ""
}
proc wokdep:gui:SwitchConfig {} {
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
@@ -171,15 +148,16 @@ proc wokdep:gui:SwitchConfig {} {
set ::CSF_OPT_LIB64 {}
set ::CSF_OPT_BIN32 {}
set ::CSF_OPT_BIN64 {}
set ::CSF_OPT_LIB32D {}
set ::CSF_OPT_LIB64D {}
set ::CSF_OPT_BIN32D {}
set ::CSF_OPT_BIN64D {}
wokdep:gui:UpdateList
}
proc wokdep:gui:SwitchArch {} {
wokdep:gui:Show3264Bitness ::aRowIter
if { "$::ARCH" == "32" } {
wokdep:gui:Show32Bitness ::aRowIter
}
if { "$::ARCH" == "64" } {
wokdep:gui:Show64Bitness ::aRowIter
}
if { [llength [grid info .myFrame.mySave]] != 0 } {
grid forget .myFrame.mySave .myFrame.myClose
@@ -190,16 +168,6 @@ proc wokdep:gui:SwitchArch {} {
grid .myFrame.myClose -row $::aRowIter -column 6 -columnspan 2
}
# update label text and visibility
font create wokdep:gui:EmptyFont -size -1
proc wokdep:gui:SetLabelText {theLabel theText} {
set aFont TkDefaultFont
if { $theText == "" } {
set aFont wokdep:gui:EmptyFont
}
$theLabel configure -text $theText -font $aFont
}
proc wokdep:gui:UpdateList {} {
set anIncErrs {}
set anLib32Errs {}
@@ -207,9 +175,7 @@ proc wokdep:gui:UpdateList {} {
set anBin32Errs {}
set anBin64Errs {}
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_FREETYPE" == "true" } {
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchX11 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_GLES2" == "true" } {
wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
@@ -259,10 +225,6 @@ proc wokdep:gui:UpdateList {} {
if { "$::HAVE_RAPIDJSON" == "true" } {
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_DRACO" == "true" } {
set aDummy {}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs aDummy aDummy "draco" "draco/compression/decode.h" "draco" {"draco"}
}
if {"$::BUILD_Inspector" == "true" } {
set ::CHECK_QT "true"
@@ -276,28 +238,11 @@ proc wokdep:gui:UpdateList {} {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64_ErrLbl [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32D_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64D_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32D_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64D_ErrLbl [join $anBin64Errs "\n"]
# merge duplicates
set ::CSF_OPT_LIB32 [lsort -unique $::CSF_OPT_LIB32]
set ::CSF_OPT_LIB64 [lsort -unique $::CSF_OPT_LIB64]
set ::CSF_OPT_BIN32 [lsort -unique $::CSF_OPT_BIN32]
set ::CSF_OPT_BIN64 [lsort -unique $::CSF_OPT_BIN64]
set ::CSF_OPT_LIB32D [lsort -unique $::CSF_OPT_LIB32D]
set ::CSF_OPT_LIB64D [lsort -unique $::CSF_OPT_LIB64D]
set ::CSF_OPT_BIN32D [lsort -unique $::CSF_OPT_BIN32D]
set ::CSF_OPT_BIN64D [lsort -unique $::CSF_OPT_BIN64D]
.myFrame.myIncErrLbl configure -text [join $anIncErrs "\n"]
.myFrame.myLib32ErrLbl configure -text [join $anLib32Errs "\n"]
.myFrame.myLib64ErrLbl configure -text [join $anLib64Errs "\n"]
.myFrame.myBin32ErrLbl configure -text [join $anBin32Errs "\n"]
.myFrame.myBin64ErrLbl configure -text [join $anBin64Errs "\n"]
}
proc wokdep:gui:BrowseVcVars {} {
@@ -323,20 +268,34 @@ proc wokdep:gui:AddIncPath {} {
}
}
proc wokdep:gui:AddLibPath {} {
set aCfg [wokdep:gui:configSuffix]
proc wokdep:gui:AddLib32Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_LIB${::ARCH}${aCfg} "$aResult"
lappend ::CSF_OPT_LIB32 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBinPath {} {
set aCfg [wokdep:gui:configSuffix]
proc wokdep:gui:AddLib64Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN${::ARCH}${aCfg} "$aResult"
lappend ::CSF_OPT_LIB64 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBin32Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN32 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBin64Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN64 "$aResult"
wokdep:gui:UpdateList
}
}
@@ -349,20 +308,34 @@ proc wokdep:gui:RemoveIncPath {} {
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveLibPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myLib${::ARCH}${aCfg}_List curselection]
proc wokdep:gui:RemoveLib32Path {} {
set aSelIndices [.myFrame.myLib32List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myLib${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
.myFrame.myLib32List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBinPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myBin${::ARCH}${aCfg}_List curselection]
proc wokdep:gui:RemoveLib64Path {} {
set aSelIndices [.myFrame.myLib64List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
.myFrame.myLib64List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBin32Path {} {
set aSelIndices [.myFrame.myBin32List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin32List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBin64Path {} {
set aSelIndices [.myFrame.myBin64List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin64List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
@@ -372,73 +345,109 @@ proc wokdep:gui:ResetIncPath {} {
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetLibPath {} {
set ::CSF_OPT_LIB${::ARCH} {}
set ::CSF_OPT_LIB${::ARCH}D {}
set ::CSF_OPT_BIN${::ARCH} {}
set ::CSF_OPT_BIN${::ARCH}D {}
proc wokdep:gui:ResetLib32Path {} {
set ::CSF_OPT_LIB32 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:Show3264Bitness { theRowIter } {
proc wokdep:gui:ResetLib64Path {} {
set ::CSF_OPT_LIB64 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetBin32Path {} {
set ::CSF_OPT_BIN32 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetBin64Path {} {
set ::CSF_OPT_BIN64 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:Show32Bitness { theRowIter } {
upvar $theRowIter aRowIter
set aArchOld ""
set aCfg [wokdep:gui:configSuffix]
if { "$::ARCH" == "32" } {
set aArchOld "64"
} else {
set aArchOld "32"
if { [llength [grid info .myFrame.myLib64Lbl]] != 0 } {
grid forget .myFrame.myLib64Lbl .myFrame.myLib64List .myFrame.myLib64Scrl
grid forget .myFrame.myLib64Add .myFrame.myLib64Remove .myFrame.myLib64Clear .myFrame.myLib64ErrLbl
grid forget .myFrame.myBin64Lbl .myFrame.myBin64List .myFrame.myBin64Scrl
grid forget .myFrame.myBin64Add .myFrame.myBin64Remove .myFrame.myBin64Clear .myFrame.myBin64ErrLbl
}
set aCfgOld "D"
if { "$::CONFIG" == "Debug" } { set aCfgOld "" }
set aDelArch ${aArchOld}${aCfg}
if { [llength [grid info .myFrame.myLib${aDelArch}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelArch}_Lbl .myFrame.myLib${aDelArch}_List .myFrame.myLib${aDelArch}_Scrl
grid forget .myFrame.myLib${aDelArch}_Add .myFrame.myLib${aDelArch}_Remove .myFrame.myLib${aDelArch}_Clear .myFrame.myLib${aDelArch}_ErrLbl
grid forget .myFrame.myBin${aDelArch}_Lbl .myFrame.myBin${aDelArch}_List .myFrame.myBin${aDelArch}_Scrl
grid forget .myFrame.myBin${aDelArch}_Add .myFrame.myBin${aDelArch}_Remove .myFrame.myBin${aDelArch}_Clear .myFrame.myBin${aDelArch}_ErrLbl
}
set aDelCfg ${::ARCH}${aCfgOld}
if { [llength [grid info .myFrame.myLib${aDelCfg}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelCfg}_Lbl .myFrame.myLib${aDelCfg}_List .myFrame.myLib${aDelCfg}_Scrl
grid forget .myFrame.myLib${aDelCfg}_Add .myFrame.myLib${aDelCfg}_Remove .myFrame.myLib${aDelCfg}_Clear .myFrame.myLib${aDelCfg}_ErrLbl
grid forget .myFrame.myBin${aDelCfg}_Lbl .myFrame.myBin${aDelCfg}_List .myFrame.myBin${aDelCfg}_Scrl
grid forget .myFrame.myBin${aDelCfg}_Add .myFrame.myBin${aDelCfg}_Remove .myFrame.myBin${aDelCfg}_Clear .myFrame.myBin${aDelCfg}_ErrLbl
}
set aNewCfg ${::ARCH}${aCfg}
# Additional libraries search paths
grid .myFrame.myLib${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
# Additional libraries (32-bit) search paths
grid .myFrame.myLib32Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib${aNewCfg}_Add -row $aRowIter -column 6
grid .myFrame.myLib32List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib32Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib32Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib${aNewCfg}_Edit -row $aRowIter -column 6
#grid .myFrame.myLib32Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_Remove -row $aRowIter -column 6
grid .myFrame.myLib32Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_Clear -row $aRowIter -column 6
grid .myFrame.myLib32Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myLib32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables search paths
grid .myFrame.myBin${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
# Additional executables (32-bit) search paths
grid .myFrame.myBin32Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin${aNewCfg}_Add -row $aRowIter -column 6
grid .myFrame.myBin32List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin32Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin32Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin${aNewCfg}_Edit -row $aRowIter -column 6
#grid .myFrame.myBin32Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_Remove -row $aRowIter -column 6
grid .myFrame.myBin32Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_Clear -row $aRowIter -column 6
grid .myFrame.myBin32Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myBin32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
}
proc wokdep:gui:Show64Bitness { theRowIter } {
upvar $theRowIter aRowIter
if { [llength [grid info .myFrame.myLib32Lbl]] != 0 } {
grid forget .myFrame.myLib32Lbl .myFrame.myLib32List .myFrame.myLib32Scrl
grid forget .myFrame.myLib32Add .myFrame.myLib32Remove .myFrame.myLib32Clear .myFrame.myLib32ErrLbl
grid forget .myFrame.myBin32Lbl .myFrame.myBin32List .myFrame.myBin32Scrl
grid forget .myFrame.myBin32Add .myFrame.myBin32Remove .myFrame.myBin32Clear .myFrame.myBin32ErrLbl
}
# Additional libraries (64-bit) search paths
grid .myFrame.myLib64Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib64List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib64Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib64Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib64Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables (64-bit) search paths
grid .myFrame.myBin64Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin64List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin64Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin64Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin64Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
}
@@ -448,7 +457,6 @@ ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
ttk::combobox .myFrame.myVsFrame.myConfigCombo -values { {Release} {Debug} } -textvariable CONFIG -state readonly -width 6
entry .myFrame.myVcEntry -textvariable VCVER -width 10
entry .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
ttk::button .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
@@ -463,8 +471,6 @@ ttk::label .myFrame.myHxxChecks.myScutsLbl -text "Strategy for filling he
ttk::label .myFrame.mySrchLbl -text "3rd-parties search path:" -padding {5 5 80 5}
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH_INPUT -width 80
ttk::button .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
checkbutton .myFrame.myChecks.myFreeTypeCheck -offvalue "false" -onvalue "true" -variable HAVE_FREETYPE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFreeTypeLbl -text "Use FreeType"
checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
@@ -485,11 +491,9 @@ ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL"
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
checkbutton .myFrame.myChecks.myDracoCheck -offvalue "false" -onvalue "true" -variable HAVE_DRACO -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myDracoLbl -text "Use Draco"
checkbutton .myFrame.myChecks.myXLibCheck -offvalue "false" -onvalue "true" -variable HAVE_XLIB
ttk::label .myFrame.myChecks.myXLibLbl -text "Use X11 for windows drawing"
checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing"
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
checkbutton .myFrame.myChecks.myVtkCheck -offvalue "false" -onvalue "true" -variable HAVE_VTK -command wokdep:gui:UpdateList
@@ -521,84 +525,44 @@ ttk::button .myFrame.myIncClear -text "Reset" -command wokdep:gui:ResetIncP
ttk::label .myFrame.myIncErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (32-bit) search paths
ttk::label .myFrame.myLib32_Lbl -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32_Scrl -command ".myFrame.myLib32_List yview"
listbox .myFrame.myLib32_List -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32_Scrl set"
ttk::button .myFrame.myLib32_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32_Edit -text "Edit"
ttk::button .myFrame.myLib32_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (32-bit) search paths
ttk::label .myFrame.myLib32D_Lbl -text "Additional debug libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32D_Scrl -command ".myFrame.myLib32D_List yview"
listbox .myFrame.myLib32D_List -listvariable CSF_OPT_LIB32D -width 80 -height 5 -yscrollcommand ".myFrame.myLib32D_Scrl set"
ttk::button .myFrame.myLib32D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32D_Edit -text "Edit"
ttk::button .myFrame.myLib32D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myLib32Lbl -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32Scrl -command ".myFrame.myLib32List yview"
listbox .myFrame.myLib32List -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32Scrl set"
ttk::button .myFrame.myLib32Add -text "Add" -command wokdep:gui:AddLib32Path
ttk::button .myFrame.myLib32Edit -text "Edit"
ttk::button .myFrame.myLib32Remove -text "Remove" -command wokdep:gui:RemoveLib32Path
ttk::button .myFrame.myLib32Clear -text "Reset" -command wokdep:gui:ResetLib32Path
ttk::label .myFrame.myLib32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (64-bit) search paths
ttk::label .myFrame.myLib64_Lbl -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64_Scrl -command ".myFrame.myLib64_List yview"
listbox .myFrame.myLib64_List -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64_Scrl set"
ttk::button .myFrame.myLib64_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64_Edit -text "Edit"
ttk::button .myFrame.myLib64_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (64-bit) search paths
ttk::label .myFrame.myLib64D_Lbl -text "Additional debug libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64D_Scrl -command ".myFrame.myLib64D_List yview"
listbox .myFrame.myLib64D_List -listvariable CSF_OPT_LIB64D -width 80 -height 5 -yscrollcommand ".myFrame.myLib64D_Scrl set"
ttk::button .myFrame.myLib64D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64D_Edit -text "Edit"
ttk::button .myFrame.myLib64D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myLib64Lbl -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64Scrl -command ".myFrame.myLib64List yview"
listbox .myFrame.myLib64List -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64Scrl set"
ttk::button .myFrame.myLib64Add -text "Add" -command wokdep:gui:AddLib64Path
ttk::button .myFrame.myLib64Edit -text "Edit"
ttk::button .myFrame.myLib64Remove -text "Remove" -command wokdep:gui:RemoveLib64Path
ttk::button .myFrame.myLib64Clear -text "Reset" -command wokdep:gui:ResetLib64Path
ttk::label .myFrame.myLib64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (32-bit) search paths
ttk::label .myFrame.myBin32_Lbl -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32_Scrl -command ".myFrame.myBin32_List yview"
listbox .myFrame.myBin32_List -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32_Scrl set"
ttk::button .myFrame.myBin32_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32_Edit -text "Edit"
ttk::button .myFrame.myBin32_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (32-bit) search paths
ttk::label .myFrame.myBin32D_Lbl -text "Additional debug executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32D_Scrl -command ".myFrame.myBin32D_List yview"
listbox .myFrame.myBin32D_List -listvariable CSF_OPT_BIN32D -width 80 -height 5 -yscrollcommand ".myFrame.myBin32D_Scrl set"
ttk::button .myFrame.myBin32D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32D_Edit -text "Edit"
ttk::button .myFrame.myBin32D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myBin32Lbl -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32Scrl -command ".myFrame.myBin32List yview"
listbox .myFrame.myBin32List -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32Scrl set"
ttk::button .myFrame.myBin32Add -text "Add" -command wokdep:gui:AddBin32Path
ttk::button .myFrame.myBin32Edit -text "Edit"
ttk::button .myFrame.myBin32Remove -text "Remove" -command wokdep:gui:RemoveBin32Path
ttk::button .myFrame.myBin32Clear -text "Reset" -command wokdep:gui:ResetBin32Path
ttk::label .myFrame.myBin32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (64-bit) search paths
ttk::label .myFrame.myBin64_Lbl -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64_Scrl -command ".myFrame.myBin64_List yview"
listbox .myFrame.myBin64_List -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64_Scrl set"
ttk::button .myFrame.myBin64_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64_Edit -text "Edit"
ttk::button .myFrame.myBin64_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (64-bit) search paths
ttk::label .myFrame.myBin64D_Lbl -text "Additional debug executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64D_Scrl -command ".myFrame.myBin64D_List yview"
listbox .myFrame.myBin64D_List -listvariable CSF_OPT_BIN64D -width 80 -height 5 -yscrollcommand ".myFrame.myBin64D_Scrl set"
ttk::button .myFrame.myBin64D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64D_Edit -text "Edit"
ttk::button .myFrame.myBin64D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
ttk::label .myFrame.myBin64Lbl -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64Scrl -command ".myFrame.myBin64List yview"
listbox .myFrame.myBin64List -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64Scrl set"
ttk::button .myFrame.myBin64Add -text "Add" -command wokdep:gui:AddBin64Path
ttk::button .myFrame.myBin64Edit -text "Edit"
ttk::button .myFrame.myBin64Remove -text "Remove" -command wokdep:gui:RemoveBin64Path
ttk::button .myFrame.myBin64Clear -text "Reset" -command wokdep:gui:ResetBin64Path
ttk::label .myFrame.myBin64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Bottom
ttk::button .myFrame.mySave -text "Save" -command wokdep:SaveCustom
@@ -609,22 +573,17 @@ ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
grid .myFrame.myPrjFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myPrjFrame.myPrjLbl -row 0 -column 0
grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
incr aRowIter
if { "$tcl_platform(platform)" == "windows" } {
incr aRowIter
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
grid .myFrame.myVsFrame.myVsCombo -row 0 -column 1 -padx 5
grid .myFrame.myVsFrame.myArchCombo -row 0 -column 2
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 3
incr aRowIter
grid .myFrame.myVcEntry -row $aRowIter -column 0
grid .myFrame.myVcVarsEntry -row $aRowIter -column 1 -columnspan 4 -sticky w
grid .myFrame.myVcBrowseBtn -row $aRowIter -column 6
incr aRowIter
} else {
grid .myFrame.myVsFrame -row $aRowIter -column 4 -sticky w
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 0
incr aRowIter
}
#
@@ -645,10 +604,10 @@ incr aRowIter
grid .myFrame.myChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myChecks.myFreeTypeCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFreeTypeLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(os)" != "Darwin" } {
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 5 -sticky w
@@ -662,17 +621,16 @@ grid .myFrame.myChecks.myQtCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQtLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myDracoCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myDracoLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
} else {
grid .myFrame.myChecks.myXLibCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myXLibLbl -row $aCheckRowIter -column 5 -sticky w
} elseif { "$::tcl_platform(os)" == "Darwin" } {
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 5 -sticky w
}
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
@@ -680,10 +638,8 @@ grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myOpenVrCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myOpenVrLbl -row $aCheckRowIter -column 5 -sticky w
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
@@ -696,11 +652,6 @@ if { "$::tcl_platform(platform)" == "windows" } {
incr aCheckRowIter
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
# Additional headers search paths
grid .myFrame.myIncLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
@@ -717,8 +668,15 @@ incr aRowIter
grid .myFrame.myIncErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional search paths
wokdep:gui:Show3264Bitness aRowIter
# Additional 32-bit search paths
if { "$ARCH" == "32" } {
wokdep:gui:Show32Bitness aRowIter
}
# Additional 64-bit search paths
if { "$ARCH" == "64" } {
wokdep:gui:Show64Bitness aRowIter
}
# Bottom section
grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
@@ -734,9 +692,6 @@ bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
bind .myFrame.myVsFrame.myConfigCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
.myFrame.mySrchEntry configure -validate all -validatecommand {
set ::PRODUCTS_PATH [file normalize "$::PRODUCTS_PATH_INPUT"]

View File

@@ -52,10 +52,6 @@ set CSF_OPT_LIB32 [list]
set CSF_OPT_LIB64 [list]
set CSF_OPT_BIN32 [list]
set CSF_OPT_BIN64 [list]
set CSF_OPT_LIB32D [list]
set CSF_OPT_LIB64D [list]
set CSF_OPT_BIN32D [list]
set CSF_OPT_BIN64D [list]
if { "$tcl_platform(pointerSize)" == "4" } {
set ARCH "32"
@@ -72,15 +68,9 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
}
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
set THE_ENV_VARIABLES { HAVE_TK HAVE_FREETYPE HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK \
HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_DRACO HAVE_OPENVR HAVE_OPENCL \
CHECK_QT4 CHECK_JDK HAVE_XLIB \
HAVE_RelWithDebInfo BUILD_Inspector }
foreach anEnvIter $THE_ENV_VARIABLES { set ${anEnvIter} "false" }
set HAVE_TK "true"
set HAVE_FREETYPE "true"
if { "$tcl_platform(os)" != "Darwin" } { set HAVE_XLIB "true" }
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENVR HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo BUILD_Inspector}
foreach anEnvIter $THE_ENV_VARIABLES {
set ${anEnvIter} "false"
if { [info exists ::env(${anEnvIter})] } {
set ${anEnvIter} "$::env(${anEnvIter})"
}
@@ -88,12 +78,12 @@ foreach anEnvIter $THE_ENV_VARIABLES {
# do not export platform-specific variables
if { "$::tcl_platform(os)" == "Darwin" } {
set HAVE_GLES2 ""
} else {
set MACOSX_USE_GLX ""
}
if { "$tcl_platform(platform)" != "windows" } {
set HAVE_D3D ""
set HAVE_RelWithDebInfo ""
} else {
set HAVE_XLIB ""
}
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT } {
if { [info exists ::env(${anEnvIter})] } {
@@ -120,35 +110,6 @@ if { [info exists ::env(CSF_OPT_BIN64)] } {
set CSF_OPT_BIN64 [split "$::env(CSF_OPT_BIN64)" $::SYS_PATH_SPLITTER]
}
if { [info exists ::env(CSF_OPT_LIB32D)] } {
set CSF_OPT_LIB32D [split "$::env(CSF_OPT_LIB32D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_LIB32 {
set aPos [lsearch -exact $::CSF_OPT_LIB32D $aLibIter]
set ::CSF_OPT_LIB32D [lreplace $::CSF_OPT_LIB32D $aPos $aPos]
}
}
if { [info exists ::env(CSF_OPT_LIB64D)] } {
set CSF_OPT_LIB64D [split "$::env(CSF_OPT_LIB64D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_LIB64 {
set aPos [lsearch -exact $::CSF_OPT_LIB64D $aLibIter]
set ::CSF_OPT_LIB64D [lreplace $::CSF_OPT_LIB64D $aPos $aPos]
}
}
if { [info exists ::env(CSF_OPT_BIN32D)] } {
set CSF_OPT_BIN32D [split "$::env(CSF_OPT_BIN32D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_BIN32 {
set aPos [lsearch -exact $::CSF_OPT_BIN32D $aLibIter]
set ::CSF_OPT_BIN32D [lreplace $::CSF_OPT_BIN32D $aPos $aPos]
}
}
if { [info exists ::env(CSF_OPT_BIN64D)] } {
set CSF_OPT_BIN64D [split "$::env(CSF_OPT_BIN64D)" $::SYS_PATH_SPLITTER]
foreach aLibIter $::CSF_OPT_BIN64 {
set aPos [lsearch -exact $::CSF_OPT_BIN64D $aLibIter]
set ::CSF_OPT_BIN64D [lreplace $::CSF_OPT_BIN64D $aPos $aPos]
}
}
# Search header file in $::CSF_OPT_INC and standard paths
proc wokdep:SearchHeader {theHeader} {
# search in custom paths
@@ -349,12 +310,6 @@ proc wokdep:SearchStandardLibrary {theErrInc theErrLib32 theErrLib64 theErrBin32
lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
set hasLib true
set aLibDPath [wokdep:SearchLib "$theCheckLib" "$anArchIter" "$aPath/libd"]
if { "$aLibDPath" != "" } {
lappend ::CSF_OPT_LIB${anArchIter}D "$aPath/libd"
lappend ::CSF_OPT_BIN${anArchIter}D "$aPath/bind"
}
break
}
}
@@ -780,14 +735,14 @@ proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
}
}
if { "$::tcl_platform(platform)" == "windows" } {
set aTbbDllPath [wokdep:SearchBin "tbb12.dll" "$anArchIter"]
set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter"]
if { "$aTbbDllPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] $aVcLib "$anArchIter" ]
set aTbbDllPath [wokdep:SearchBin "tbb12.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
if { "$aTbbDllPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin/$aSubDir/$aVcLib"
} else {
lappend anErrBin$anArchIter "Error: 'tbb12.dll' not found (Intel TBB)"
lappend anErrBin$anArchIter "Error: 'tbb.dll' not found (Intel TBB)"
if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
}
}
@@ -1086,45 +1041,36 @@ proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
}
}
}
}
# Search binary path
if { "$::tcl_platform(platform)" == "windows" } {
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
if { "$aVtkBinPath" == "" } {
set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
set aPath [wokdep:Preferred $aPathList "$::VCVER" "$anArchIter" ]
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
# Try to find in lib path
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
foreach anArchIter {64 32} {
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
if { "$aVtkBinPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*] "$::VCVER" "$anArchIter" ]
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
} else {
# We didn't find preferred binary path => search through all available VTK directories
foreach anIt $aPathList {
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$anIt/bin"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$anIt/bin"
break
} else {
# Try to find in lib path
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$anIt/lib"]
if { "$aVtkBinPath" != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$anIt/lib"
}
}
}
if { "$aVtkBinPath" == "" } {
lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
set isFound "false"
}
set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib" }
}
}
}
# We didn't find preferred binary path => search through inc path or among all available VTK directories
if { "$aVtkBinPath" == "" } {
# Try to find in lib path
set aPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/bin"]
if { "$aPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/bin"
} elseif { [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/lib"] != "" } {
lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/lib"
} else {
lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
set isFound "false"
}
}
}
}
return "$isFound"
}
@@ -1247,17 +1193,17 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
upvar $theErrBin64 anErrBin64
set isFound "true"
if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::HAVE_XLIB" != "true" ) } {
if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::MACOSX_USE_GLX" != "true" ) } {
return "$isFound"
}
set aX11LibPath [wokdep:SearchLib "X11" "$::ARCH"]
if { "$aX11LibPath" == "" } {
set aX11LibPath [wokdep:SearchLib "X11" "$::ARCH" "/usr/X11/lib"]
if { "$aX11LibPath" != "" } {
set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH"]
if { "$aXmuLibPath" == "" } {
set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH" "/usr/X11/lib"]
if { "$aXmuLibPath" != "" } {
#lappend ::CSF_OPT_LIB$::ARCH "/usr/X11/lib"
} else {
lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}X11.${::SYS_LIB_SUFFIX}' not found (X11)"
lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}Xmu.${::SYS_LIB_SUFFIX}' not found (X11)"
set isFound "false"
}
}
@@ -1326,18 +1272,6 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional libraries (32-bit) search paths"
puts $aFile "set \"CSF_OPT_LIB32=$aStringLib32\""
set aStringLib32d [join $::CSF_OPT_LIB32D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib32d [regsub -all "$::PRODUCTS_PATH" $aStringLib32d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug libraries (32-bit) search paths"
if { "$aStringLib32d" != "" && "$aStringLib32" != "" } {
puts $aFile "set \"CSF_OPT_LIB32D=$aStringLib32d;%CSF_OPT_LIB32%\""
} else {
puts $aFile "set \"CSF_OPT_LIB32D=$aStringLib32d\""
}
set aStringLib64 [join $::CSF_OPT_LIB64 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib64 [regsub -all "$::PRODUCTS_PATH" $aStringLib64 "%PRODUCTS_PATH%"]
@@ -1346,18 +1280,6 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional libraries (64-bit) search paths"
puts $aFile "set \"CSF_OPT_LIB64=$aStringLib64\""
set aStringLib64d [join $::CSF_OPT_LIB64D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib64d [regsub -all "$::PRODUCTS_PATH" $aStringLib64d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug libraries (64-bit) search paths"
if { "$aStringLib64d" != "" && "$aStringLib64" != "" } {
puts $aFile "set \"CSF_OPT_LIB64D=$aStringLib64d;%CSF_OPT_LIB64%\""
} else {
puts $aFile "set \"CSF_OPT_LIB64D=$aStringLib64d\""
}
set aStringBin32 [join $::CSF_OPT_BIN32 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin32 [regsub -all "$::PRODUCTS_PATH" $aStringBin32 "%PRODUCTS_PATH%"]
@@ -1366,18 +1288,6 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional (32-bit) search paths"
puts $aFile "set \"CSF_OPT_BIN32=$aStringBin32\""
set aStringBin32d [join $::CSF_OPT_BIN32D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin32d [regsub -all "$::PRODUCTS_PATH" $aStringBin32d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug (32-bit) search paths"
if { "$aStringBin32d" != "" && "$aStringBin32" != "" } {
puts $aFile "set \"CSF_OPT_BIN32D=$aStringBin32d;%CSF_OPT_BIN32%\""
} else {
puts $aFile "set \"CSF_OPT_BIN32D=$aStringBin32d\""
}
set aStringBin64 [join $::CSF_OPT_BIN64 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin64 [regsub -all "$::PRODUCTS_PATH" $aStringBin64 "%PRODUCTS_PATH%"]
@@ -1386,18 +1296,6 @@ proc wokdep:SaveCustom {} {
puts $aFile "rem Additional (64-bit) search paths"
puts $aFile "set \"CSF_OPT_BIN64=$aStringBin64\""
set aStringBin64d [join $::CSF_OPT_BIN64D $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin64d [regsub -all "$::PRODUCTS_PATH" $aStringBin64d "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional debug (64-bit) search paths"
if { "$aStringBin64d" != "" && "$aStringBin64" != "" } {
puts $aFile "set \"CSF_OPT_BIN64D=$aStringBin64d;%CSF_OPT_BIN64%\""
} else {
puts $aFile "set \"CSF_OPT_BIN64D=$aStringBin64d\""
}
close $aFile
} else {
set aCustomFilePath "./custom.sh"
@@ -1439,18 +1337,6 @@ proc wokdep:SaveCustom {} {
puts $aFile "# Additional libraries ($::ARCH-bit) search paths"
puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib]\""
set aStringLibD [join [set ::CSF_OPT_LIB${::ARCH}D] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLibD [regsub -all "$::PRODUCTS_PATH" $aStringLibD "\${PRODUCTS_PATH}"]
}
puts $aFile ""
puts $aFile "# Additional debug libraries ($::ARCH-bit) search paths"
if { "$aStringLibD" != "" && "$aStringLib" != "" } {
puts $aFile "export CSF_OPT_LIB${::ARCH}D=\"[set aStringLibD]:\$CSF_OPT_LIB${::ARCH}\""
} else {
puts $aFile "export CSF_OPT_LIB${::ARCH}D=\"[set aStringLibD]\""
}
set aStringBin [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin [regsub -all "$::PRODUCTS_PATH" $aStringBin "\${PRODUCTS_PATH}"]
@@ -1459,18 +1345,6 @@ proc wokdep:SaveCustom {} {
puts $aFile "# Additional ($::ARCH-bit) search paths"
puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin]\""
set aStringBinD [join [set ::CSF_OPT_BIN${::ARCH}D] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBinD [regsub -all "$::PRODUCTS_PATH" $aStringBinD "\${PRODUCTS_PATH}"]
}
puts $aFile ""
puts $aFile "# Additional debug ($::ARCH-bit) search paths"
if { "$aStringBinD" != "" && "$aStringBin" != "" } {
puts $aFile "export CSF_OPT_BIN${::ARCH}D=\"[set aStringBinD]:\$CSF_OPT_BIN${::ARCH}\""
} else {
puts $aFile "export CSF_OPT_BIN${::ARCH}D=\"[set aStringBinD]\""
}
close $aFile
}
puts "Configuration saved to file '$aCustomFilePath'"
@@ -1508,27 +1382,6 @@ proc wokdep:SaveCustom {} {
puts $aFile "INCLUDEPATH += \"${anIncPath}\""
}
puts $aFile ""
puts $aFile "CONFIG(debug, debug|release) {"
puts $aFile " # Additional debug libraries search paths"
foreach aLibPath [set ::CSF_OPT_LIB${::ARCH}D] {
if { "$::PRODUCTS_PATH" != "" } {
set aLibPath [regsub -all "$::PRODUCTS_PATH" $aLibPath "\$\$\{PRODUCTS_PATH\}"]
}
puts $aFile " LIBS += -L\"${aLibPath}\""
}
if { "$::tcl_platform(platform)" == "windows" } {
puts $aFile ""
puts $aFile " # Additional debug DLLs search paths"
foreach aDllPath [set ::CSF_OPT_BIN${::ARCH}D] {
if { "$::PRODUCTS_PATH" != "" } {
set aDllPath [regsub -all "$::PRODUCTS_PATH" $aDllPath "\$\$\{PRODUCTS_PATH\}"]
}
puts $aFile " LIBS += -L\"${aDllPath}\""
}
}
puts $aFile "}"
puts $aFile ""
puts $aFile "# Additional libraries search paths"
foreach aLibPath [set ::CSF_OPT_LIB$::ARCH] {

View File

@@ -237,10 +237,8 @@ proc gendoc {args} {
}
} elseif {$arg_n == "s"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: search is not used with PDF and will be ignored."
continue
}
if {$args_values(s) != "NULL"} {
set SEARCH_MODE $args_values(s)
} else {
@@ -249,16 +247,16 @@ proc gendoc {args} {
}
} elseif {$arg_n == "mathjax"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: MathJax is not used with PDF and will be ignored."
}
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
} else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
}
} else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
puts "Warning: MathJax is not used with pdf and will be ignored."
}
} else {
puts "\nWrong argument: $arg_n"
@@ -688,17 +686,6 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
# Write specific options
if { $docType == "REFMAN" } {
# always include optional components
set aHaveD3dBack ""
set aHaveGlesBack ""
set aHaveVtkBack ""
if { [info exists ::env(HAVE_D3D)] } { set aHaveD3dBack "$::env(HAVE_D3D)" }
if { [info exists ::env(HAVE_GLES2)] } { set aHaveGlesBack "$::env(HAVE_GLES2)" }
if { [info exists ::env(HAVE_VTK)] } { set aHaveVtkBack "$::env(HAVE_VTK)" }
set ::env(HAVE_D3D) "true"
set ::env(HAVE_GLES2) "true"
set ::env(HAVE_VTK) "true"
# Load lists of modules scripts
if { $productsPath == "" } {
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
@@ -824,18 +811,12 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
puts $doxyFile ""
# restore environment variables
set ::env(HAVE_D3D) "$aHaveD3dBack"
set ::env(HAVE_GLES2) "$aHaveGlesBack"
set ::env(HAVE_VTK) "$aHaveVtkBack"
} elseif { $docType == "OVERVIEW" } {
# Add common options for generation of Overview and User Guides
puts $doxyFile "PROJECT_NUMBER = $occt_version"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png"
puts $doxyFile "EXAMPLE_PATH = [OCCDoc_GetSourceDir $productsPath]"
set PARAM_INPUT "INPUT ="
set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ "

View File

@@ -129,7 +129,7 @@ proc osutils:isEqualContent { theContent1 theContent2 } {
# Auxiliary function for writing new file content only if it has been actually changed
# (e.g. to preserve file timestamp on no change).
# Useful for automatically (re)generated files.
proc osutils:writeTextFile { theFile theContent {theEol lf} {theToBackup false} } {
proc osutils:writeTextFile { theFile theContent {theEol lf} } {
if {[file exists "${theFile}"]} {
set aFileOld [open "${theFile}" rb]
fconfigure $aFileOld -translation crlf
@@ -143,10 +143,6 @@ proc osutils:writeTextFile { theFile theContent {theEol lf} {theToBackup false}
return false
}
if { $theToBackup == true } {
puts "Warning: file ${theFile} is updated. Old content is saved to ${theFile}.bak"
file copy -force -- "${theFile}" "${theFile}.bak"
}
file delete -force "${theFile}"
}
@@ -260,7 +256,7 @@ proc genAllResources { theSrcDir } {
# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vc143" "vclang" "cbp" "xcd" "pro"}
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vclang" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -324,7 +320,6 @@ proc genproj {theFormat args} {
vc14 - Visual Studio 2015
vc141 - Visual Studio 2017
vc142 - Visual Studio 2019
vc143 - Visual Studio 2022
vclang - Visual Studio with ClangCL toolset
cbp - CodeBlocks
xcd - XCode
@@ -378,28 +373,29 @@ proc copy_with_warning {from to} {
# Generate auxiliary scripts for launching IDE.
proc genprojbat {theFormat thePlatform theSolution} {
set aTargetPlatformExt sh
set aTargetEol lf
if { $thePlatform == "wnt" || $thePlatform == "uwp" } {
set aTargetPlatformExt bat
set aTargetEol crlf
}
if { [file exists "$::path/src/OS/FoundationClasses.tcl"] || ![file exists "$::path/env.${aTargetPlatformExt}"] } {
# generate env.bat/sh
set anEnvTmplFilePath "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}"
set anEnvTmplFile [open "$anEnvTmplFilePath" "r"]
set anEnvTmpl [read $anEnvTmplFile]
close $anEnvTmplFile
if {"$theFormat" != "cmake"} {
# copy env.bat/sh only if not yet present
if { ! [file exists "$::path/env.${aTargetPlatformExt}"] } {
set anEnvTmplFile [open "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}" "r"]
set anEnvTmpl [read $anEnvTmplFile]
close $anEnvTmplFile
set aCasRoot ""
if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } {
set aCasRoot [relativePath "$::path" "$::THE_CASROOT"]
set aCasRoot ""
if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } {
set aCasRoot [relativePath "$::path" "$::THE_CASROOT"]
}
regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl
set anEnvFile [open "$::path/env.${aTargetPlatformExt}" "w"]
puts $anEnvFile $anEnvTmpl
close $anEnvFile
}
regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl
set aLineList [split $anEnvTmpl "\n"]
osutils:writeTextFile "$::path/env.${aTargetPlatformExt}" $aLineList $aTargetEol true
copy_with_warning "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
if { "$::BUILD_Inspector" == "true" } {
@@ -561,7 +557,6 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl theSolution }
"vc14" -
"vc141" -
"vc142" -
"vc143" -
"vclang" { OS:MKVC $anOutDir $aModules $aTools $theSolution $theFormat $isUWP}
"cbp" { OS:MKCBP $anOutDir $aModules $theSolution $thePlatform $theCmpl }
"xcd" {
@@ -764,7 +759,7 @@ proc osutils:tk:sort { tklm theSrcDir theSourceDirOther } {
return $lret
}
# close dependencies of ltk. (full work paths of toolkits)
# close dependencies of ltk. (full wok pathes of toolkits)
# The CURRENT WOK LOCATION MUST contains ALL TOOLKITS required.
# (locate not performed.)
proc osutils:tk:close { ltk theSrcDir theSourceDirOther } {
@@ -911,7 +906,7 @@ proc osutils:collectinc {theModules theSrcDir theIncPath} {
# relative anIncPath in connection with aCasRoot/$theSrcDir
set aFromBuildIncToSrcPath [relativePath "$anIncPath" "$aCasRoot/$theSrcDir"]
# create and copy shortcut header files
# create and copy short-cut header files
foreach anUnit $anUnits {
osutils:checksrcfiles ${anUnit} $theSrcDir
@@ -1016,8 +1011,8 @@ proc osutils:vcsolution:header { vcversion } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 2013\n"
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
"$vcversion" == "vc142" || "$vcversion" == "vc143" || "$vcversion" == "vclang" } {
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
"$vcversion" == "vc142" || "$vcversion" == "vclang" } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 14\n"
@@ -1233,11 +1228,28 @@ proc osutils:convertModules { theModules theSrcDir theSourceDirOther theProjects
lappend aProjectsInModule($aModule) $aToolKit
lappend aDependencies [LibToLink $aToolKit $theSrcDir $theSourceDirOther]
}
# executables
# executables, assume one project per cxx file...
foreach aUnit [OS:executable ${aModule}] {
lappend aProjects $aUnit
lappend aProjectsInModule($aModule) $aUnit
lappend aDependencies [LibToLink $aUnit $theSrcDir $theSourceDirOther]
set aUnitLoc $aUnit
set src_files [_get_used_files $aUnit $theSrcDir false]
set aSrcFiles {}
foreach s $src_files {
regexp {source ([^\s]+)} $s dummy name
lappend aSrcFiles $name
}
foreach aSrcFile $aSrcFiles {
set aFileExtension [file extension $aSrcFile]
if { $aFileExtension == ".cxx" } {
set aPrjName [file rootname $aSrcFile]
lappend aProjects $aPrjName
lappend aProjectsInModule($aModule) $aPrjName
if {[file isdirectory $path/$theSrcDir/$aUnitLoc]} {
lappend aDependencies [LibToLinkX $aUnitLoc [file rootname $aSrcFile] $theSrcDir $theSourceDirOther]
} else {
lappend aDependencies {}
}
}
}
}
}
}
@@ -1275,9 +1287,6 @@ proc osutils:vcproj:readtemplate {theVcVer isUWP isExec} {
} elseif { $theVcVer == "vc142" } {
set aVCRTVer "vc14"
set aToolset "v142"
} elseif { $theVcVer == "vc143" } {
set aVCRTVer "vc14"
set aToolset "v143"
} elseif { $theVcVer == "vclang" } {
set aVCRTVer "vc14"
set aToolset "ClangCL"
@@ -1400,13 +1409,9 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
unset theCsfLibsMap
unset theCsfFrmsMap
if { "$::HAVE_FREETYPE" == "true" } {
set aLibsMap(CSF_FREETYPE) "freetype"
}
set aLibsMap(CSF_FREETYPE) "freetype"
set aLibsMap(CSF_TclLibs) "tcl8.6"
if { "$::HAVE_TK" == "true" } {
set aLibsMap(CSF_TclTkLibs) "tk8.6"
}
set aLibsMap(CSF_TclTkLibs) "tk8.6"
if { "$::HAVE_FREEIMAGE" == "true" } {
if { "$theOS" == "wnt" } {
set aLibsMap(CSF_FreeImagePlus) "FreeImage"
@@ -1435,9 +1440,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
if { "$::HAVE_LIBLZMA" == "true" } {
set aLibsMap(CSF_LIBLZMA) "liblzma"
}
if { "$::HAVE_DRACO" == "true" } {
set aLibsMap(CSF_Draco) "draco"
}
if { "$::HAVE_OPENVR" == "true" } {
set aLibsMap(CSF_OpenVR) "openvr_api"
}
@@ -1459,15 +1461,15 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
set aLibsMap(CSF_netapi32) "netapi32"
set aLibsMap(CSF_winmm) "winmm"
set aLibsMap(CSF_OpenGlLibs) "opengl32"
set aLibsMap(CSF_OpenGlesLibs) "libEGL libGLESv2"
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
}
set aLibsMap(CSF_psapi) "Psapi"
set aLibsMap(CSF_d3d9) "d3d9"
# the naming is different on Windows
set aLibsMap(CSF_TclLibs) "tcl86"
if { "$::HAVE_TK" == "true" } {
set aLibsMap(CSF_TclTkLibs) "tk86"
}
set aLibsMap(CSF_TclTkLibs) "tk86"
if { "$theRelease" == "true" } {
set aLibsMap(CSF_QT) "Qt5Gui Qt5Widgets Qt5Xml Qt5Core"
} else {
@@ -1482,47 +1484,39 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
}
} else {
set aLibsMap(CSF_dl) "dl"
if { "$::HAVE_XLIB" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "GL"
} else {
set aLibsMap(CSF_OpenGlLibs) "GL EGL"
}
set aLibsMap(CSF_OpenGlesLibs) "EGL GLESv2"
if { "$theOS" == "mac" || "$theOS" == "ios" } {
set aLibsMap(CSF_objc) "objc"
set aLibsMap(CSF_OpenGlLibs) ""
set aLibsMap(CSF_OpenGlesLibs) ""
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
set aFrmsMap(CSF_OpenGlesLibs) "OpenGLES"
set aLibsMap(CSF_objc) "objc"
if { "$theOS" == "ios" } {
set aFrmsMap(CSF_Appkit) "UIKit"
set aFrmsMap(CSF_Appkit) "UIKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGLES"
} else {
set aFrmsMap(CSF_Appkit) "AppKit"
set aFrmsMap(CSF_Appkit) "AppKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
}
set aFrmsMap(CSF_IOKit) "IOKit"
set aLibsMap(CSF_TclLibs) ""
set aLibsMap(CSF_TclTkLibs) ""
set aFrmsMap(CSF_TclLibs) "Tcl"
if { "$::HAVE_TK" == "true" } {
set aFrmsMap(CSF_TclTkLibs) "Tk"
}
set aLibsMap(CSF_TclLibs) ""
set aFrmsMap(CSF_TclTkLibs) "Tk"
set aLibsMap(CSF_TclTkLibs) ""
set aLibsMap(CSF_QT) "QtCore QtGui"
} elseif { "$theOS" == "android" } {
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
set aLibsMap(CSF_androidlog) "log"
} else {
if { "$::HAVE_FREETYPE" == "true" } {
set aLibsMap(CSF_fontconfig) "fontconfig"
}
set aLibsMap(CSF_fontconfig) "fontconfig"
if { "$theOS" == "qnx" } {
# CSF_ThreadLibs - pthread API is part of libc on QNX
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
} else {
set aLibsMap(CSF_ThreadLibs) "pthread rt"
if { "$::HAVE_TK" == "true" } {
set aLibsMap(CSF_TclTkLibs) "tk8.6"
}
if { "$::HAVE_XLIB" == "true" } {
set aLibsMap(CSF_XwLibs) "X11"
}
set aLibsMap(CSF_OpenGlLibs) "GL"
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
set aLibsMap(CSF_MotifLibs) "X11"
}
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
}
}
}
@@ -1677,7 +1671,7 @@ proc wokUtils:EASY:bs1 { s } {
return $r
}
# Returns for a full path the liste of n last directory part
# Returs for a full path the liste of n last directory part
# n = 1 => tail
# n = 2 => dir/file.c
# n = 3 => sdir/dir/file.c
@@ -1791,14 +1785,9 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
global path
set aHasQtDep "false"
set aTkDefines ""
foreach aCsfElem [osutils:tk:csfInExternlib "$path/$theSrcDir/${theToolKit}/EXTERNLIB"] {
if { "$aCsfElem" == "CSF_QT" } {
set aHasQtDep "true"
} elseif { "$aCsfElem" == "CSF_OpenGlLibs" } {
set aTkDefines "$aTkDefines;HAVE_OPENGL"
} elseif { "$aCsfElem" == "CSF_OpenGlesLibs" } {
set aTkDefines "$aTkDefines;HAVE_GLES2"
}
}
set theProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 0]
@@ -1833,9 +1822,9 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
# depending on VC version
regsub -all -- {__TKDEP__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] theProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] theProjTmpl
regsub -all -- {__TKDEFINES__} $theProjTmpl $aTkDefines theProjTmpl
set anIncPaths "..\\..\\..\\inc"
# set aTKDefines ""
set aFilesSection ""
set aVcFilesCxx(units) ""
set aVcFilesHxx(units) ""
@@ -1896,7 +1885,7 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
set written([file tail $aSrcFile]) 1
append aFilesSection [osutils:vcxproj:cxxfile $aSrcFile $needparam 3]
} else {
puts "Warning : in vcproj more than one occurrences for [file tail $aSrcFile]"
puts "Warning : in vcproj more than one occurences for [file tail $aSrcFile]"
}
if { ! [info exists aVcFilesCxx($xlo)] } { lappend aVcFilesCxx(units) $xlo }
lappend aVcFilesCxx($xlo) $aSrcFile
@@ -1906,7 +1895,7 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
set written([file tail $aHxxFile]) 1
append aFilesSection [osutils:vcxproj:hxxfile $aHxxFile]
} else {
puts "Warning : in vcproj more than one occurrences for [file tail $aHxxFile]"
puts "Warning : in vcproj more than one occurences for [file tail $aHxxFile]"
}
if { ! [info exists aVcFilesHxx($xlo)] } { lappend aVcFilesHxx(units) $xlo }
lappend aVcFilesHxx($xlo) $aHxxFile
@@ -1916,7 +1905,7 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
set written([file tail $aGenFile]) 1
append aFilesSection [osutils:vcxproj:cxxfile $aGenFile $needparam 5]
} else {
puts "Warning : in vcproj more than one occurrences for [file tail $aGenFile]"
puts "Warning : in vcproj more than one occurences for [file tail $aGenFile]"
}
if { ! [info exists aVcFilesCxx($xlo)] } { lappend aVcFilesCxx(units) $xlo }
lappend aVcFilesCxx($xlo) $aGenFile
@@ -1930,7 +1919,7 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
set written([file tail $aSrcFile]) 1
append aFilesSection [osutils:vcproj:file $theVcVer $aSrcFile $needparam]
} else {
puts "Warning : in vcproj more than one occurrences for [file tail $aSrcFile]"
puts "Warning : in vcproj more than one occurences for [file tail $aSrcFile]"
}
}
append aFilesSection "\t\t\t</Filter>\n"
@@ -2093,106 +2082,97 @@ proc osutils:tk:execfiles { theFiles theOutDir theCommand thePrefix theExtension
# Generate Visual Studio project file for executable
proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir theSourceDirOther } {
set aVcFiles {}
set aProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 1]
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
set aProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 1]
set aProjName $theToolKit
set l_compilable [osutils:compilable wnt]
regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl
set aProjName [file rootname [file tail $f]]
set l_compilable [osutils:compilable wnt]
regsub -all -- {__XQTNAM__} $aProjTmpl $aProjName aProjTmpl
upvar $theGuidsMap aGuidsMap
if { ! [info exists aGuidsMap($aProjName)] } {
set aGuidsMap($aProjName) [OS:genGUID]
}
regsub -all -- {__PROJECT_GUID__} $aProjTmpl $aGuidsMap($aProjName) aProjTmpl
upvar $theGuidsMap aGuidsMap
if { ! [info exists aGuidsMap($aProjName)] } {
set aGuidsMap($aProjName) [OS:genGUID]
}
regsub -all -- {__PROJECT_GUID__} $aProjTmpl $aGuidsMap($aProjName) aProjTmpl
set aUsedLibs [list]
foreach tkx [osutils:commonUsedTK $theToolKit $theSrcDir $theSourceDirOther] {
lappend aUsedLibs "${tkx}.lib"
}
set aUsedLibs [list]
foreach tkx [osutils:commonUsedTK $theToolKit $theSrcDir $theSourceDirOther] {
lappend aUsedLibs "${tkx}.lib"
}
set anOsReleaseLibs {}
set anOsDebugLibs {}
osutils:usedOsLibs $theToolKit "wnt" anOsReleaseLibs aFrameworks $theSrcDir true
osutils:usedOsLibs $theToolKit "wnt" anOsDebugLibs aFrameworks $theSrcDir false
set anOsReleaseLibs {}
set anOsDebugLibs {}
osutils:usedOsLibs $theToolKit "wnt" anOsReleaseLibs aFrameworks $theSrcDir true
osutils:usedOsLibs $theToolKit "wnt" anOsDebugLibs aFrameworks $theSrcDir false
set aVCRTVer [string range $theVcVer 0 3]
regsub -all -- {__TKDEP__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEFINES__} $aProjTmpl "" aProjTmpl
set aVCRTVer [string range $theVcVer 0 3]
regsub -all -- {__TKDEP__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] aProjTmpl
set aFilesSection ""
set aVcFilesCxx(units) ""
set aVcFilesHxx(units) ""
set aFilesSection ""
set aVcFilesCxx(units) ""
set aVcFilesHxx(units) ""
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
if { ![info exists written([file tail $f])] } {
set written([file tail $f]) 1
if { ![info exists written([file tail $f])] } {
set written([file tail $f]) 1
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
append aFilesSection [osutils:vcxproj:cxxfile $f "" 3]
if { ! [info exists aVcFilesCxx($theToolKit)] } { lappend aVcFilesCxx(units) $theToolKit }
lappend aVcFilesCxx($theToolKit) $f
} else {
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
}
}
} else {
append aFilesSection "\t\t\t<Filter\n"
append aFilesSection "\t\t\t\tName=\"$theToolKit\"\n"
append aFilesSection "\t\t\t\t>\n"
foreach f [osutils:tk:cxxfiles $theToolKit wnt $theSrcDir] {
if { ![info exists written([file tail $f])] } {
set written([file tail $f]) 1
append aFilesSection "\t\t\t<Filter\n"
append aFilesSection "\t\t\t\tName=\"$theToolKit\"\n"
append aFilesSection "\t\t\t\t>\n"
append aFilesSection [osutils:vcproj:file $theVcVer $f ""]
} else {
puts "Warning : in vcproj there are more than one occurrences for [file tail $f]"
append aFilesSection "\t\t\t</Filter>"
}
} else {
puts "Warning : in vcproj there are more than one occurences for [file tail $f]"
}
append aFilesSection "\t\t\t</Filter>"
}
#puts "$aProjTmpl $aFilesSection"
set anIncPaths "..\\..\\..\\inc"
regsub -all -- {__TKINC__} $aProjTmpl $anIncPaths aProjTmpl
regsub -all -- {__FILES__} $aProjTmpl $aFilesSection aProjTmpl
regsub -all -- {__CONF__} $aProjTmpl Application aProjTmpl
#puts "$aProjTmpl $aFilesSection"
set anIncPaths "..\\..\\..\\inc"
regsub -all -- {__TKINC__} $aProjTmpl $anIncPaths aProjTmpl
regsub -all -- {__FILES__} $aProjTmpl $aFilesSection aProjTmpl
regsub -all -- {__CONF__} $aProjTmpl Application aProjTmpl
regsub -all -- {__XQTEXT__} $aProjTmpl "exe" aProjTmpl
regsub -all -- {__XQTEXT__} $aProjTmpl "exe" aProjTmpl
set aFile [open [set aVcFilePath [file join $theOutDir ${aProjName}.[osutils:vcproj:ext $theVcVer]]] w]
fconfigure $aFile -translation crlf
puts $aFile $aProjTmpl
close $aFile
set aCommonSettingsFile "$aVcFilePath.user"
lappend aVcFiles $aVcFilePath
# write filters file for vc10
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
lappend aVcFiles [osutils:vcxproj:filters $theOutDir $aProjName aVcFilesCxx aVcFilesHxx]
}
# write resource file
lappend aVcFiles [osutils:readtemplate:rc $theOutDir $aProjName]
set aCommonSettingsFileTmpl ""
if { "$theVcVer" == "vc7" || "$theVcVer" == "vc8" } {
# nothing
} elseif { "$theVcVer" == "vc9" } {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcproj.user.vc9x"]
} else {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcxproj.user.vc10x"]
}
if { "$aCommonSettingsFileTmpl" != "" } {
regsub -all -- {__VCVER__} $aCommonSettingsFileTmpl $aVCRTVer aCommonSettingsFileTmpl
set aFile [open [set aVcFilePath "$aCommonSettingsFile"] w]
set aFile [open [set aVcFilePath [file join $theOutDir ${aProjName}.[osutils:vcproj:ext $theVcVer]]] w]
fconfigure $aFile -translation crlf
puts $aFile $aCommonSettingsFileTmpl
puts $aFile $aProjTmpl
close $aFile
lappend aVcFiles "$aCommonSettingsFile"
}
set aCommonSettingsFile "$aVcFilePath.user"
lappend aVcFiles $aVcFilePath
# write filters file for vc10
if { "$theVcVer" != "vc7" && "$theVcVer" != "vc8" && "$theVcVer" != "vc9" } {
lappend aVcFiles [osutils:vcxproj:filters $theOutDir $aProjName aVcFilesCxx aVcFilesHxx]
}
# write resource file
lappend aVcFiles [osutils:readtemplate:rc $theOutDir $aProjName]
set aCommonSettingsFileTmpl ""
if { "$theVcVer" == "vc7" || "$theVcVer" == "vc8" } {
# nothing
} elseif { "$theVcVer" == "vc9" } {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcproj.user.vc9x"]
} else {
set aCommonSettingsFileTmpl [wokUtils:FILES:FileToString "$::THE_CASROOT/adm/templates/vcxproj.user.vc10x"]
}
if { "$aCommonSettingsFileTmpl" != "" } {
regsub -all -- {__VCVER__} $aCommonSettingsFileTmpl $aVCRTVer aCommonSettingsFileTmpl
set aFile [open [set aVcFilePath "$aCommonSettingsFile"] w]
fconfigure $aFile -translation crlf
puts $aFile $aCommonSettingsFileTmpl
close $aFile
lappend aVcFiles "$aCommonSettingsFile"
}
}
return $aVcFiles
}
@@ -2346,7 +2326,7 @@ proc osutils:cbptk { theCmpl theOutDir theToolKit thePlatform} {
set written([file tail $aSrcFile]) 1
lappend aTKSrcFiles "../../../[wokUtils:FILES:wtail $aSrcFile 3]"
} else {
puts "Warning : more than one occurrences for [file tail $aSrcFile]"
puts "Warning : more than one occurences for [file tail $aSrcFile]"
}
}
@@ -2466,7 +2446,7 @@ proc osutils:cbpx { theCmpl theOutDir theToolKit thePlatform } {
set written([file tail $aSrcFile]) 1
lappend aTKSrcFiles "../../../[wokUtils:FILES:wtail $aSrcFile 3]"
} else {
puts "Warning : in cbp there are more than one occurrences for [file tail $aSrcFile]"
puts "Warning : in cbp there are more than one occurences for [file tail $aSrcFile]"
}
# macros for correct DLL exports
@@ -2535,7 +2515,6 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
lappend aCmplFlags "-DOCC_CONVERT_SIGNALS"
}
lappend aCmplFlags "-Wall"
lappend aCmplFlags "-Wextra"
lappend aCmplFlags "-fexceptions"
}
lappend aCmplFlagsRelease "-DNDEBUG"
@@ -2967,7 +2946,7 @@ proc osutils:xcdtk:sources {theToolKit theTargetType theSrcFileRefSection theGro
append aSrcFileGuids "\t\t\t\t$aGuidsMap($aSrcFile) ,\n"
append aSrcFileRefGuids "\t\t\t\t$aGuidsMap($aSrcFileRef) ,\n"
} else {
puts "Warning : more than one occurrences for [file tail $aSrcFile]"
puts "Warning : more than one occurences for [file tail $aSrcFile]"
}
}
@@ -3029,26 +3008,26 @@ proc osutils:xcdtk { theOutDir theToolKit theGuidsMap theIsStatic thePlatform {t
set aUserDataDir "${aToolkitDir}/xcuserdata"
wokUtils:FILES:mkdir $aUserDataDir
if { ! [file exists $aUserDataDir] } {
puts stderr "Error: Could not create xcuserdata directory in \"$aToolkitDir\""
puts stderr "Error: Could not create xcuserdata directorty in \"$aToolkitDir\""
return
}
set aUserDataDir "${aUserDataDir}/${aUsername}.xcuserdatad"
wokUtils:FILES:mkdir $aUserDataDir
if { ! [file exists $aUserDataDir] } {
puts stderr "Error: Could not create ${aUsername}.xcuserdatad directory in \"$aToolkitDir\"/xcuserdata"
puts stderr "Error: Could not create ${aUsername}.xcuserdatad directorty in \"$aToolkitDir\"/xcuserdata"
return
}
set aSchemesDir "${aUserDataDir}/xcschemes"
wokUtils:FILES:mkdir $aSchemesDir
if { ! [file exists $aSchemesDir] } {
puts stderr "Error: Could not create xcschemes directory in \"$aUserDataDir\""
puts stderr "Error: Could not create xcschemes directorty in \"$aUserDataDir\""
return
}
# End of folders creation.
# Generating GUID for toolkit.
# Generating GUID for tookit.
upvar $theGuidsMap aGuidsMap
if { ! [info exists aGuidsMap($theToolKit)] } {
set aGuidsMap($theToolKit) [OS:genGUID "xcd"]
@@ -3481,26 +3460,26 @@ proc osutils:xcdx { theOutDir theExecutable theGuidsMap } {
set aUserDataDir "${anExecutableDir}/xcuserdata"
wokUtils:FILES:mkdir $aUserDataDir
if { ! [file exists $aUserDataDir] } {
puts stderr "Error: Could not create xcuserdata directory in \"$anExecutableDir\""
puts stderr "Error: Could not create xcuserdata directorty in \"$anExecutableDir\""
return
}
set aUserDataDir "${aUserDataDir}/${aUsername}.xcuserdatad"
wokUtils:FILES:mkdir $aUserDataDir
if { ! [file exists $aUserDataDir] } {
puts stderr "Error: Could not create ${aUsername}.xcuserdatad directory in \"$anExecutableDir\"/xcuserdata"
puts stderr "Error: Could not create ${aUsername}.xcuserdatad directorty in \"$anExecutableDir\"/xcuserdata"
return
}
set aSchemesDir "${aUserDataDir}/xcschemes"
wokUtils:FILES:mkdir $aSchemesDir
if { ! [file exists $aSchemesDir] } {
puts stderr "Error: Could not create xcschemes directory in \"$aUserDataDir\""
puts stderr "Error: Could not create xcschemes directorty in \"$aUserDataDir\""
return
}
# End folders creation.
# Generating GUID for toolkit.
# Generating GUID for tookit.
upvar $theGuidsMap aGuidsMap
if { ! [info exists aGuidsMap($theExecutable)] } {
set aGuidsMap($theExecutable) [OS:genGUID "xcd"]

View File

@@ -16,7 +16,7 @@
# commercial license or contractual agreement.
# =======================================================================
# This script contains auxiliary functions which can be used
# This script contains auxilary functions which can be used
# in documentation generation process
# =======================================================================
@@ -635,7 +635,7 @@ proc OCCDoc_MakeMainPage {outDir outFile modules {theProductsDir ""} } {
foreach mod $modules {
puts $fd "\\li \\subpage [string tolower $module_prefix$mod]"
}
# insert modules relationship diagram
# insert modules relationship diagramm
puts $fd "\\dotfile [OCCDoc_CreateModulesDependencyGraph $outDir/html schema_all_modules $modules $module_prefix]"
puts $fd "**/\n"
}

View File

@@ -13,8 +13,8 @@ OccGitRoot = $$_PRO_FILE_PWD_/../../../..
# Define compilation flags
CONFIG += warn_on
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
QMAKE_CXXFLAGS_WARN_ON = -Wall -Wextra
QMAKE_CFLAGS_WARN_ON = -Wall
QMAKE_CXXFLAGS_WARN_ON = -Wall
win32 {
QMAKE_CFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_WARN_ON = -W4
@@ -39,10 +39,6 @@ win32 {
DEFINES += _SCL_SECURE_NO_WARNINGS
} else {
CONFIG += c++11
clang {
QMAKE_CFLAGS_WARN_ON += -Wshorten-64-to-32
QMAKE_CXXFLAGS_WARN_ON += -Wshorten-64-to-32
}
QMAKE_CFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fvisibility=default
@@ -53,9 +49,6 @@ win32 {
} else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
}
} else:gcc {
# ask linker to report missing library dependencies
QMAKE_LFLAGS += -Wl,-z,defs
}
}
!CONFIG(debug, debug|release) {
@@ -119,8 +112,6 @@ android-g++ {
# VS2015, vc141
} else:equals(aMsvcVer, 16.0){
# VS2019, vc142
} else:equals(aMsvcVer, 17.0){
# VS2022, vc143
} else {
warning (Unknown msvc version. "$$MY_COMPILER" is used)
}
@@ -162,4 +153,5 @@ win32 {
}
}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}

View File

@@ -15,14 +15,8 @@ for (aModuleIter, aModuleList) {
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGl") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGlTest") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGles") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGlesTest") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHostTest") { toSkipToolkit = 1 }
equals (toSkipToolkit, 0) {
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)

View File

@@ -18,7 +18,7 @@ aHxxRoot = $$OccGitRoot/inc
INCLUDEPATH += $$aHxxRoot
# CSF variables
HAVE_FREETYPE { CSF_FREETYPE = -lfreetype }
CSF_FREETYPE = -lfreetype
CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
@@ -26,7 +26,6 @@ HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
HAVE_ZLIB { CSF_ZLIB = -lzlib }
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
HAVE_DRACO { CSF_Draco = -ldraco }
win32 {
CSF_kernel32 = -lkernel32
CSF_advapi32 = -ladvapi32
@@ -37,7 +36,7 @@ win32 {
CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32
CSF_OpenGlesLibs = -llibEGL -llibGLESv2
HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
CSF_psapi = -lPsapi
CSF_winmm = -lwinmm
CSF_d3d9 = -ld3d9
@@ -47,12 +46,12 @@ win32 {
} else:mac {
CSF_dl = -ldl
CSF_objc = -lobjc
CSF_OpenGlLibs = -framework OpenGL
CSF_OpenGlesLibs = -framework OpenGLES
iphoneos {
CSF_Appkit = -framework UIKit
CSF_OpenGlLibs = -framework OpenGLES
} else {
CSF_Appkit = -framework AppKit
CSF_OpenGlLibs = -framework OpenGL
}
CSF_IOKit = -framework IOKit
CSF_TclLibs = -framework Tcl
@@ -60,23 +59,18 @@ win32 {
} else {
CSF_dl = -ldl
CSF_ThreadLibs = -lpthread -lrt
CSF_OpenGlesLibs = -lEGL -lGLESv2
CSF_TclTkLibs = -ltk8.6
HAVE_XLIB {
CSF_OpenGlLibs = -lGL
CSF_XwLibs = -lX11
} else {
CSF_OpenGlLibs = -lGL -lEGL
}
HAVE_FREETYPE { CSF_fontconfig = -lfontconfig }
CSF_OpenGlLibs = -lGL
CSF_TclTkLibs = -lX11 -ltk8.6
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
CSF_MotifLibs = -lX11
CSF_fontconfig = -lfontconfig
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
}
for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_")
!equals(aCfgIter, "HAVE_GLES2") {
count(aRes, 1) {
DEFINES += $$aCfgIter
}
count(aRes, 1) {
DEFINES += $$aCfgIter
}
}
@@ -109,12 +103,6 @@ for (anExternLib, anExternLibs) {
count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n")
LIBS += $$aList
equals(anExternLib, "CSF_OpenGlLibs") {
DEFINES += "HAVE_OPENGL"
}
equals(anExternLib, "CSF_OpenGlesLibs") {
DEFINES += "HAVE_GLES2"
}
} else {
LIBS += -l$$anExternLib
}
@@ -132,31 +120,21 @@ for (aPackage, aPackages) {
}
}
# extend clean with versioned .so files
!win32 {
aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else {
mac {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.dylib.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .dylib files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else {
# override qmake soname versionong logic
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
# extend clean with versioned .so files
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}

View File

@@ -9,10 +9,6 @@
# - Open project in Qt Creator, and call "Run qmake".
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
# - "Run qmake" and perform Build.
#
# Within Debian-based Linux repository Qt Creator can be installed like this:
# > sudo apt-get install qtcreator qtbase5-dev
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 3.6.1, 2016-05-19T14:46:43. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">true</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">false</value>
<value type="bool" key="BindStarToLeftSpecifier">true</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">true</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">true</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">2</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">true</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="SpacesForTabs">true</value>
<value type="int" key="TabSize">2</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">occt</value>
</data>
</qtcreator>

View File

@@ -13,7 +13,6 @@ rem Paths to 3rd-party tools and libraries
set "anNdkPath="
set "aFreeType="
set "aRapidJson="
set "aDraco="
rem Build stages to perform
set "toCMake=1"
@@ -35,9 +34,7 @@ set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set USE_RAPIDJSON=OFF
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
@@ -57,11 +54,6 @@ if not exist "%anNdkPath%/sources/cxx-stl/gnu-libstdc++" (
set "aLibType=Shared"
if ["%isStatic%"] == ["1"] set "aLibType=Static"
set "aDestDir=%aBuildRoot%\android-%aCompiler%"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aDestDir%"
)
)
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
@@ -72,13 +64,6 @@ for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
for %%s in (%anNdkAbiList%) do (
call :cmakeGenerate "%anNdkApiLevel%" "%%s"
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
)
for /F "skip=1 delims=" %%F in ('
@@ -114,19 +99,9 @@ goto :eof
:cmakeGenerate
set "anApi=%~1"
set "anAbi=%~2"
if ["%anApi%"] == [""] (
set "anApi=21"
if ["%anAbi%"] == ["armeabi-v7a"] ( set "anApi=16" )
if ["%anAbi%"] == ["x86"] ( set "anApi=16" )
)
set "aPlatformAndCompiler=android-%anAbi%-%aCompiler%"
set "aWorkDir=%aBuildRoot%\%aPlatformAndCompiler%-make"
set "aLogFile=%aBuildRoot%\build-%aPlatformAndCompiler%.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
@@ -137,13 +112,10 @@ git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%, API level %anApi%>> %aLogFile%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
pushd "%aWorkDir%"
set "aFreeTypeLibName=libfreetype.so"
if exist "%aFreeType%/libs/%anAbi%/libfreetype.a" ( set "aFreeTypeLibName=libfreetype.a" )
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for Android %anAbi%, API level %anApi%...
@@ -168,19 +140,14 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/libs/%anAbi%" ^
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="%aFreeType%/libs/%anAbi%/%aFreeTypeLibName%" ^
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="%aFreeType%/libs/%anAbi%/libfreetype.so" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR_draco:PATH="%aDraco%/libs/%anAbi%" ^
"%aCasSrc%"
if errorlevel 1 (
@@ -189,7 +156,7 @@ if ["%toCMake%"] == ["1"] (
goto :eof
)
)
set "aTimeGEN=%TIME%"
set aTimeGEN=%TIME%
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
@@ -211,7 +178,7 @@ if ["%toMake%"] == ["1"] (
)
type "%aLogFile%"
)
set "aTimeBUILD=%TIME%"
set aTimeBUILD=%TIME%
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%

View File

@@ -6,7 +6,6 @@ rem set "PATH=c:\CMake\bin;%PATH%"
rem set "anNdkPath=c:/android-ndk-r12"
rem set "aFreeType=c:/freetype-2.7.1-android"
rem set "aRapidJson=c:/rapidjson-1.1.0"
rem set "aDraco=c:/draco-1.4.1-android"
rem Uncomment to customize building steps
rem set "aBuildRoot=%~dp0..\..\work"
@@ -29,5 +28,4 @@ rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem Optional 3rd-party libraries to enable
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"
rem set USE_RAPIDJSON=ON

View File

@@ -22,7 +22,6 @@ rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
rem set BUILD_WITH_DEBUG=OFF
rem set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
rem set BUILD_USE_PCH=OFF
rem set BUILD_FORCE_RelWithDebInfo=OFF
rem Use semicolon-separated list of toolkits if you want to disable all modules
rem and build only some toolkits.
@@ -43,6 +42,5 @@ rem set USE_FFMPEG=OFF
rem set USE_FREEIMAGE=OFF
rem set USE_GLES2=OFF
rem set USE_RAPIDJSON=OFF
rem set USE_DRACO=OFF
rem set USE_TBB=OFF
rem set USE_VTK=OFF

View File

@@ -35,7 +35,6 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
#USE_FREEIMAGE=OFF
#USE_GLES2=OFF
#USE_RAPIDJSON=OFF
#USE_DRACO=OFF
#USE_TBB=OFF
#USE_VTK=OFF

View File

@@ -12,7 +12,6 @@ set VS=14
set VSDATA=2015
set VSPLATFORM=Win64
set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "OCCT3RDPARTY="
set "INSTALL_DIR=%SrcRoot%\install"
set BUILD_ADDITIONAL_TOOLKITS=
@@ -24,7 +23,6 @@ set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
set BUILD_WITH_DEBUG=OFF
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
set BUILD_USE_PCH=OFF
set BUILD_FORCE_RelWithDebInfo=OFF
set BUILD_MODULE_ApplicationFramework=ON
set BUILD_MODULE_DataExchange=ON
@@ -38,7 +36,6 @@ set USE_FFMPEG=OFF
set USE_FREEIMAGE=OFF
set USE_GLES2=OFF
set USE_RAPIDJSON=OFF
set USE_DRACO=OFF
set USE_TBB=OFF
set USE_VTK=OFF
@@ -72,14 +69,12 @@ cmake -G "%arch_compile%" ^
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^
-D BUILD_USE_PCH:BOOL=%BUILD_USE_PCH% ^
-D BUILD_FORCE_RelWithDebInfo:BOOL=%BUILD_FORCE_RelWithDebInfo% ^
-D INSTALL_DIR:PATH="%INSTALL_DIR%" ^
-D USE_D3D:BOOL=%USE_D3D% ^
-D USE_FFMPEG:BOOL=%USE_FFMPEG% ^
-D USE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^
-D USE_GLES2:BOOL=%USE_GLES2% ^
-D USE_RAPIDJSON:BOOL=%USE_RAPIDJSON% ^
-D USE_DRACO:BOOL=%USE_DRACO% ^
-D USE_TBB:BOOL=%USE_TBB% ^
-D USE_VTK:BOOL=%USE_VTK% ^
"%SrcRoot%"

View File

@@ -40,7 +40,6 @@ USE_FFMPEG=OFF
USE_FREEIMAGE=OFF
USE_GLES2=OFF
USE_RAPIDJSON=OFF
USE_DRACO=OFF
USE_TBB=OFF
USE_VTK=OFF
AUX_ARGS=
@@ -80,7 +79,6 @@ cmake -G "Unix Makefiles" \
-D USE_FREEIMAGE:BOOL=$USE_FREEIMAGE \
-D USE_GLES2:BOOL=$USE_GLES2 \
-D USE_RAPIDJSON:BOOL=$USE_RAPIDJSON \
-D USE_DRACO:BOOL=$USE_DRACO \
-D USE_TBB:BOOL=$USE_TBB \
-D USE_VTK:BOOL=$USE_VTK \
$AUX_ARGS "$SrcRoot"

View File

@@ -1,267 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT for iOS platform.
# macos_custom.sh should be configured with paths to CMake and other 3rd-parties.
# FreeType should be specified as mandatory dependency.
aScriptDir=${BASH_SOURCE%/*}
if [ -d "$aScriptDir" ]; then cd "$aScriptDir"; fi
aScriptDir="$PWD"
aCasSrc=${aScriptDir}/../..
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
export aBuildRoot=work
# paths to pre-built 3rd-parties
export aFreeType=
export aFreeImage=
export aRapidJson=
export aDraco=
# build stages to perform
export isStatic=1
export toCMake=1
export toClean=1
export toMake=1
export toInstall=1
export toPack=0
export toPackFat=0
export toDebug=0
export BUILD_ModelingData=ON
export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export USE_FREETYPE=ON
export USE_FREEIMAGE=OFF
export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export IPHONEOS_DEPLOYMENT_TARGET=8.0
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
export anAbiList="iPhoneOS|arm64"
if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
source "${aScriptDir}/ios_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
set -o pipefail
aBuildType="Release"
aBuildTypePrefix=
if [[ $toDebug == 1 ]]; then
aBuildType="Debug"
aBuildTypePrefix="-debug"
fi
aLibType="Shared"
if [[ $isStatic == 1 ]]; then
aLibType="Static"
fi
function buildArch {
anAbi=$1
aPlatformSdk=$2
aPlatformAndCompiler=${aPlatformSdk}-${anAbi}${aBuildTypePrefix}-clang
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
fi
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
pushd "$aWorkDir"
aTimeZERO=$SECONDS
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
fi
}
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/${aPlatformSdk}.platform/Developer/SDKs/${aPlatformSdk}.sdk"
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for iOS...
cmake -G "Unix Makefiles" \
-D CMAKE_SYSTEM_NAME="iOS" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING="$IPHONEOS_DEPLOYMENT_TARGET" \
-D CMAKE_OSX_SYSROOT:PATH="$aSysRoot" \
-D CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
-D BUILD_LIBRARY_TYPE:STRING="$aLibType" \
-D INSTALL_DIR:PATH="$aDestDir" \
-D INSTALL_DIR_INCLUDE:STRING="inc" \
-D INSTALL_DIR_LIB:STRING="lib" \
-D INSTALL_DIR_RESOURCE:STRING="src" \
-D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \
-D USE_FREETYPE:BOOL="$USE_FREETYPE" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="$aFreeType/lib" \
-D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \
-D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \
-D USE_DRACO:BOOL="$USE_DRACO" \
-D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \
-D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \
-D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \
-D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="$aFreeImage/lib" \
-D 3RDPARTY_FREEIMAGE_LIBRARY:FILEPATH="$aFreeImage/lib/libfreeimage.a" \
-D BUILD_MODULE_FoundationClasses:BOOL="ON" \
-D BUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-D BUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_Draw:BOOL="OFF" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
echo Platform: ${aPlatformSdk} ABI: ${anAbi} Build: ${aBuildType} IPHONEOS_DEPLOYMENT_TARGET: ${IPHONEOS_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd
}
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
echo Platform: ${aPlatform} ABI: ${anArch} Build: ${aBuildType}
buildArch $anArch $aPlatform
done
# create a FAT archive
if [[ $toPackFat == 1 ]]; then
for aPlatIter in iPhoneOS iPhoneSimulator
do
aSuffixFat=${aPlatIter}${aBuildTypePrefix}-clang
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
# merge per-arch builds into fat builds
hasPlatform=0
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
if [[ $aPlatIter != ${aPlatform} ]]; then
continue
fi
aSuffixThin=${aPlatform}-${anArch}${aBuildTypePrefix}-clang
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
if [[ $hasPlatform == 0 ]]; then
hasPlatform=1
echo Packing FAT archive for platform: ${aPlatform}
rm -r -f "$aFatDir"
mkdir -p "$aFatDir"
rsync -r --exclude '*.a' "$anArchDir/" "$aFatDir"
rm -f "$aFatDir/build_target.txt"
for aLibIter in $anArchDir/lib/*.a; do
aLibName=`basename $aLibIter`
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
done
else
for aLibIter in $aFatDir/lib/*.a; do
aLibName=`basename $aLibIter`
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
#lipo -info "$aFatDir/lib/$aLibName"
done
fi
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
done
# create an archive
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
if [[ $aPlatIter != ${aPlatform} ]]; then
continue
fi
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aFatDir}/../${anArchName} &>/dev/null
pushd "$aFatDir"
tar -jcf ${aFatDir}/../${anArchName} *
popd
break
done
done
fi

View File

@@ -1,30 +0,0 @@
# environment configuration template for ios_build.sh (to be renamed as ios_custom_env.sh)
export PATH=/Applications/CMake.app/Contents/bin:$PATH
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-ios"
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-ios"
export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
# Uncomment to customize building steps
#export isStatic=0
#export toCMake=1
#export toClean=1
#export toMake=1
#export toInstall=1
#export toPack=0
#export toPackFat=1
#export toDebug=0
#export BUILD_ModelingData=ON
#export BUILD_ModelingAlgorithms=ON
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON
#export USE_FREEIMAGE=ON
#export IPHONEOS_DEPLOYMENT_TARGET=8.0
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
#export anAbiList="iPhoneOS|arm64"

View File

@@ -1,268 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT for macOS platform.
# macos_custom.sh should be configured with paths to CMake and other 3rd-parties.
# FreeType should be specified as mandatory dependency.
aScriptDir=${BASH_SOURCE%/*}
if [ -d "$aScriptDir" ]; then cd "$aScriptDir"; fi
aScriptDir="$PWD"
aCasSrc=${aScriptDir}/../..
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
export aBuildRoot=work
# paths to pre-built 3rd-parties
export aFreeType=
export aFreeImage=
export aRapidJson=
export aDraco=
# build stages to perform
export isStatic=0
export toCMake=1
export toClean=1
export toMake=1
export toInstall=1
export toPack=0
export toPackFat=0
export toDebug=0
export BUILD_ModelingData=ON
export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_Draw=ON
export USE_FREETYPE=ON
export USE_FREEIMAGE=ON
export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export MACOSX_DEPLOYMENT_TARGET=10.10
#export anAbiList="arm64 x86_64"
export anAbiList="x86_64"
aPlatform="macos"
if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
source "${aScriptDir}/macos_custom.sh"
fi
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
set -o pipefail
aBuildType="Release"
aBuildTypePrefix=
if [[ $toDebug == 1 ]]; then
aBuildType="Debug"
aBuildTypePrefix="-debug"
fi
aLibType="Shared"
aLibExt="dylib"
if [[ $isStatic == 1 ]]; then
aLibType="Static"
aLibExt="a"
fi
function buildArch {
anAbi=$1
aPlatformAndCompiler=${aPlatform}-${anAbi}${aBuildTypePrefix}-clang
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
fi
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
pushd "$aWorkDir"
aTimeZERO=$SECONDS
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
fi
}
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for macOS...
cmake -G "Unix Makefiles" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
-D BUILD_LIBRARY_TYPE:STRING="$aLibType" \
-D INSTALL_DIR:PATH="$aDestDir" \
-D INSTALL_DIR_INCLUDE:STRING="inc" \
-D INSTALL_DIR_LIB:STRING="lib" \
-D INSTALL_DIR_RESOURCE:STRING="src" \
-D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \
-D USE_FREETYPE:BOOL="$USE_FREETYPE" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="$aFreeType/lib" \
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="$aFreeType/lib/libfreetype.dylib" \
-D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \
-D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \
-D USE_DRACO:BOOL="$USE_DRACO" \
-D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \
-D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \
-D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \
-D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="$aFreeImage/lib" \
-D 3RDPARTY_FREEIMAGE_LIBRARY:FILEPATH="$aFreeImage/lib/libfreeimage.a" \
-D BUILD_MODULE_FoundationClasses:BOOL="ON" \
-D BUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-D BUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building OCCT...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
echo Platform: macOS ABI: ${anAbi} Build: ${aBuildType} MACOSX_DEPLOYMENT_TARGET: ${MACOSX_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd
}
for anArchIter in $anAbiList
do
echo Platform: macOS ABI: ${anArchIter} Build: ${aBuildType}
buildArch $anArchIter
done
# create a FAT archive
if [[ $toPackFat == 1 ]]; then
aSuffixFat=${aPlatform}${aBuildTypePrefix}-clang
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
# merge per-arch builds into fat builds
hasPlatform=0
for anArchIter in $anAbiList
do
aSuffixThin=${aPlatform}-${anArchIter}${aBuildTypePrefix}-clang
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
if [[ $hasPlatform == 0 ]]; then
hasPlatform=1
echo Packing FAT archive
rm -r -f "$aFatDir"
mkdir -p "$aFatDir"
if [[ $isStatic == 1 ]]; then
rsync -r -l --exclude '*.a' "$anArchDir/" "$aFatDir"
else
rsync -r -l --exclude '*.dylib' "$anArchDir/" "$aFatDir"
fi
rm -f "$aFatDir/build_target.txt"
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
rm $aFatDir/bin/$aDrawExe
lipo "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
fi
for aLibIter in $anArchDir/lib/*.$aLibExt; do
aLibName=`basename $aLibIter`
if [[ -L "$anArchDir/lib/$aLibName" ]]; then
cp -a "$anArchDir/lib/$aLibName" "$aFatDir/lib/"
else
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
fi
done
else
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
lipo "$aFatDir/bin/$aDrawExe" "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
fi
for aLibIter in $aFatDir/lib/*.$aLibExt; do
aLibName=`basename $aLibIter`
if [[ ! -L "$anArchDir/lib/$aLibName" ]]; then
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
#lipo -info "$aFatDir/lib/$aLibName"
fi
done
fi
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
done
# create an archive
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aFatDir}/../${anArchName} &>/dev/null
pushd "$aFatDir"
tar -jcf ${aFatDir}/../${anArchName} *
popd
fi

View File

@@ -1,31 +0,0 @@
# environment configuration template for macos_build.sh (to be renamed as macos_custom_env.sh)
export PATH=/Applications/CMake.app/Contents/bin:$PATH
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-macos"
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-macos"
export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
# Uncomment to customize building steps
#export aBuildRoot=work
#export toCMake=1
#export toClean=1
#export toMake=1
#export toInstall=1
#export toPack=1
#export toPackFat=1
#export BUILD_ModelingData=ON
#export BUILD_ModelingAlgorithms=ON
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_Draw=ON
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON
#export USE_FREEIMAGE=ON
#export MACOSX_DEPLOYMENT_TARGET=10.10
#export anAbiList=arm64
#export anAbiList=x86_64
#export anAbiList="arm64 x86_64"

View File

@@ -1,267 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of OCCT for Mingw-w64 platform.
rem mingw_custom.bat should be configured with paths to CMake, 3rd-parties and MinGW.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aMingwVars="
set "aFreeType="
set "aFreeImage="
set "aRapidJson="
set "aDraco="
set "aTclTk="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=0"
set "toDebug=0"
set "isStatic=0"
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_Draw=ON"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_FREEIMAGE=ON"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0mingw_custom.bat" call "%~dp0mingw_custom.bat"
if not ["%aMingwVars%"] == [""] ( call "%aMingwVars%" )
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "aLibType=Shared"
if ["%isStatic%"] == ["1"] set "aLibType=Static"
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-mingw64%aBuildTypePrefix%"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
echo Copying dependencies...
for %%i in (libstdc++-6.dll libwinpthread-1.dll libgcc_s_seh-1.dll) do (
if "%%~$PATH:i" == "" (
echo "Error: could not find %%i"
) else (
xcopy /Y "%%~$PATH:i" "%aTarget%\win64\gcc\bin"
)
)
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=mingw64%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
rmdir /S /Q %aDestDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
pushd "%aWorkDir%"
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for MinGW-w64...
cmake -G "MinGW Makefiles" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D BUILD_LIBRARY_TYPE:STRING="%aLibType%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
-D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
-D 3RDPARTY_TCL_DLL_DIR:PATH="%aTclTk%/bin" ^
-D 3RDPARTY_TK_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TK_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
-D 3RDPARTY_TK_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
-D 3RDPARTY_TK_DLL_DIR:PATH="%aTclTk%/bin" ^
-D USE_D3D:BOOL="ON" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/lib" ^
-D USE_FREEIMAGE:BOOL="%USE_FREEIMAGE%" ^
-D 3RDPARTY_FREEIMAGE_DIR:PATH="%aFreeImage%" ^
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="%aFreeImage%/include" ^
-D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="%aFreeImage%/lib" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^
"%aCasSrc%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
)
set "aTimeGEN=%TIME%"
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set "aTimeBUILD=%TIME%"
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
goto :eof
:computeDuration
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
rem convert hours:minutes:seconds:ms into duration
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
set /A aDurHH=%aDurTotalSec% / 360000
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
goto :eof

View File

@@ -1,29 +0,0 @@
rem Environment configuration template for mingw_build.bat (to be renamed as mingw_custom.bat)
set "aCmakeBin=%ProgramW6432%\CMake\bin"
set "aFreeType=%aCasSrc%/../3rdparty/freetype-2.6.3-mingw-64"
set "aTclTk=%aCasSrc%/../3rdparty/tcltk-8.6.4-mingw-64"
set "aFreeImage=%aCasSrc%/../3rdparty/freeimage-3.17-0-mingw-64"
set "aRapidJson=%aCasSrc%/../3rdparty/rapidjson-1.1.0"
set "aDraco=%aCasSrc%/../3rdparty/draco-1.4-1-mingw-64"
set "aMingwVars=c:\mingw-8.3.0-msys2\mingwvars.bat"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=1"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "toDebug=0"
rem set "BUILD_ModelingData=ON"
rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_Draw=ON"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"
rem set "USE_FREEIMAGE=ON"

View File

@@ -4,110 +4,36 @@ rem Auxiliary script for semi-automated building of OCCT for WASM platform.
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
rem FreeType should be specified as mandatory dependency.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set "aSrcRoot=%~dp0..\.."
set "aBuildRoot=work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aFreeType="
set "aRapidJson="
set "aDraco="
set "aTcl="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=0"
set "toDebug=0"
set "toBuildSample=0"
set "sourceMapBase="
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_Draw=OFF"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_PTHREADS=OFF"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aSrcRoot%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-wasm32%aBuildTypePrefix%"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
if ["%toBuildSample%"] == ["1"] (
if not exist "%aTarget%\sample" ( mkdir "%aTarget%\sample" )
xcopy /S /Y "%aDestDirSmpl%\*" "%aTarget%\sample\"
)
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
@@ -115,34 +41,13 @@ if not ["%1"] == ["-nopause"] (
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
rmdir /S /Q %aDestDir%"
)
)
set "aPlatformAndCompiler=wasm"
set "aWorkDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%-make"
set "aDestDir=%aSrcRoot%\%aBuildRoot%\%aPlatformAndCompiler%"
set "aLogFile=%aSrcRoot%\%aBuildRoot%\build-%aPlatformAndCompiler%.log"
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toBuildSample%"] == ["1"] (
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDirSmpl%"
rmdir /S /Q %aDestDirSmpl%"
)
)
if not exist "%aWorkDirSmpl%" ( mkdir "%aWorkDirSmpl%" )
if exist "%aLogFileSmpl%" ( del "%aLogFileSmpl%" )
)
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
@@ -152,49 +57,30 @@ echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
echo --->> %aLogFile%
call emcc --version >> %aLogFile%
echo --->> %aLogFile%
pushd "%aWorkDir%"
set "aTimeZERO=%TIME%"
set aTimeZERO=%TIME%
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for WASM...
echo "Configuring OCCT for WASM..."
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^
-D 3RDPARTY_DRACO_LIBRARY:FILEPATH="%aDraco%/lib/libdraco.a" ^
-D USE_TK:BOOL="OFF" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTcl%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:PATH="%aTcl%/include" ^
-D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTcl%/lib" ^
-D 3RDPARTY_TCL_LIBRARY:FILEPATH="%aTcl%/lib/libtcl.a" ^
"%aCasSrc%"
"%aSrcRoot%"
if errorlevel 1 (
popd
@@ -202,115 +88,61 @@ if ["%toCMake%"] == ["1"] (
goto :eof
)
)
set "aTimeGEN=%TIME%"
set aTimeGEN=%TIME%
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if ["%toClean%"] == ["1"] (
if "%toClean%"=="1" (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
if "%toMake%"=="1" (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set "aTimeBUILD=%TIME%"
set aTimeBUILD=%TIME%
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
if "%toMake%"=="1" (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
if "%toMake%"=="1" (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
if "%toInstall%"=="1" (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
set aTimeINSTALL=%TIME%
call :computeDuration %aTimeBUILD% %aTimeINSTALL%
if "%toInstall%"=="1" (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
call :computeDuration %aTimeZERO% %aTimeINSTALL%
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
if ["%toBuildSample%"] == ["0"] (
goto :eof
)
pushd "%aWorkDirSmpl%"
if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDir%/lib/cmake/opencascade" ^
-D freetype_DIR:PATH="%aFreeType%/lib/cmake/freetype" ^
"%aSrcRootSmpl%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
type "%aLogFileSmpl%"
)
if ["%toInstall%"] == ["1"] (
mingw32-make install 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
)
popd
goto :eof
:computeDuration
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
set aTimeFrom=%1
set aTimeEnd=%2
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"

View File

@@ -1,29 +1,16 @@
rem Environment configuration template for wasm_build.bat (to be renamed as wasm_custom.bat)
set "EMSDK_ROOT=%aCasSrc%\..\emsdk"
set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm32"
rem set "aRapidJson=%aCasSrc%\..\3rdparty\rapidjson-1.1.0"
rem set "aDraco=%aCasSrc%\..\3rdparty\draco-1.4.1-wasm32"
rem set "aCmakeBin=%ProgramW6432%\CMake\bin"
rem Environment configuration template for occ_build_wasm.bat (to be renamed as wasm_custom_env.bat)
set "aFreeType=%aSrcRoot%\..\3rdparty\freetype-2.7.1-wasm"
set "EMSDK_ROOT=%aSrcRoot%\..\emsdk"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=1"
rem set "toClean=0"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "toDebug=1"
rem set "toBuildSample=1"
rem Source map base (should point to server where C++ sources will be copied)
rem enables -g4 debug building option for WebGL sample and allows navigating C++ source code within JavaScript debugger.
rem set "sourceMapBase=http://localhost:9090/"
rem set "BUILD_ModelingData=ON"
rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"
rem set "USE_PTHREADS=ON"

View File

@@ -1,117 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of WebGL sample.
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
rem FreeType should be specified as mandatory dependency.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aFreeType="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toDebug=0"
set "sourceMapBase="
set "USE_PTHREADS=OFF"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aDestDirOcct=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDirSmpl%"
rmdir /S /Q %aDestDirSmpl%"
)
)
if not exist "%aWorkDirSmpl%" ( mkdir "%aWorkDirSmpl%" )
if exist "%aLogFileSmpl%" ( del "%aLogFileSmpl%" )
pushd "%aWorkDirSmpl%"
if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDirOcct%/lib/cmake/opencascade" ^
-D freetype_DIR:PATH="%aFreeType%/lib/cmake/freetype" ^
"%aSrcRootSmpl%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
type "%aLogFileSmpl%"
)
if ["%toInstall%"] == ["1"] (
mingw32-make install 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
)
popd
goto :eof

View File

@@ -23,8 +23,6 @@ if "%VCVER%" == "vc8" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc143" (
call "%VS143COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B

View File

@@ -40,7 +40,7 @@ if /I "%VCVER%" == "@COMPILER@" (
set "CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests"
set "CSF_OCCTDocPath=@CMAKE_SOURCE_DIR@/doc"
rem for compatibility with external application using CASROOT
rem for compatability with external application using CASROOT
set "CASROOT=@CMAKE_SOURCE_DIR@"
)
)

View File

@@ -29,7 +29,7 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export CSF_OCCTTestsPath="@CMAKE_SOURCE_DIR@/tests"
export CSF_OCCTDocPath="@CMAKE_SOURCE_DIR@/doc"
# for compatibility with external application using CASROOT
# for compatability with external application using CASROOT
export CASROOT="@CMAKE_SOURCE_DIR@"
fi
fi

View File

@@ -17,8 +17,6 @@ set "ARCH=64"
set "VCVARS="
set "HAVE_TBB=false"
set "HAVE_OPENCL=false"
set "HAVE_TK=true"
set "HAVE_FREETYPE=true"
set "HAVE_FREEIMAGE=false"
set "HAVE_FFMPEG=false"
set "HAVE_VTK=false"
@@ -27,7 +25,6 @@ set "HAVE_D3D=false"
set "HAVE_ZLIB=false"
set "HAVE_LIBLZMA=false"
set "HAVE_RAPIDJSON=false"
set "HAVE_DRACO=false"
set "HAVE_OPENVR=false"
set "HAVE_E57=false"
set "CSF_OPT_INC="
@@ -35,14 +32,6 @@ set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
set "CSF_OPT_BIN32="
set "CSF_OPT_BIN64="
set "CSF_OPT_LIB32D="
set "CSF_OPT_LIB64D="
set "CSF_OPT_BIN32D="
set "CSF_OPT_BIN64D="
set "CSF_OPT_LIB32I="
set "CSF_OPT_LIB64I="
set "CSF_OPT_BIN32I="
set "CSF_OPT_BIN64I="
set "CSF_DEFINES=%CSF_DEFINES_EXTRA%"
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
@@ -67,9 +56,9 @@ rem Decode VCVER variable and define related ones:
rem
rem VCFMT - "vc" followed by full version number of Visual Studio toolset
rem (same as VCVER without optional suffix "-uwp")
rem VCLIB - name of folder containing binaries
rem VCLIB - name of folder contining binaries
rem (same as VCVER except without third version in number)
rem VCPROP - name of required Visual Studio Workload (starting with VS 2017)
rem VCPROP - name of required Visual Studion Workload (starting with VS 2017)
rem
rem Note that for VS before 2015 (vc14) always
rem VCFMT=VCLIB=VCVER and VCPROP=NativeDesktop
@@ -121,12 +110,8 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
@@ -141,7 +126,6 @@ if not "%DevEnvDir%" == "" (
echo vc14 = VS 2015
echo vc141 = VS 2017
echo vc142 = VS 2019
echo vc143 = VS 2022
echo vclang = VS 2019 with ClangCL toolset
exit /B
)
@@ -172,15 +156,10 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v143"
) else if /I "%VCFMT%" == "vclang" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=ClangCL"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
@@ -189,31 +168,28 @@ if /I "%VCFMT%" == "vc9" (
exit /B
)
if ["%CSF_OPT_LIB32D%"] == [""] set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%"
if ["%CSF_OPT_LIB64D%"] == [""] set "CSF_OPT_LIB64D=%CSF_OPT_LIB64%"
if ["%CSF_OPT_BIN32D%"] == [""] set "CSF_OPT_BIN32D=%CSF_OPT_BIN32%"
if ["%CSF_OPT_BIN64D%"] == [""] set "CSF_OPT_BIN64D=%CSF_OPT_BIN64%"
if ["%CSF_OPT_LIB32I%"] == [""] set "CSF_OPT_LIB32I=%CSF_OPT_LIB32%"
if ["%CSF_OPT_LIB64I%"] == [""] set "CSF_OPT_LIB64I=%CSF_OPT_LIB64%"
if ["%CSF_OPT_BIN32I%"] == [""] set "CSF_OPT_BIN32I=%CSF_OPT_BIN32%"
if ["%CSF_OPT_BIN64I%"] == [""] set "CSF_OPT_BIN64I=%CSF_OPT_BIN64%"
set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%"
set "CSF_OPT_LIB64D=%CSF_OPT_LIB64%"
set "CSF_OPT_BIN32D=%CSF_OPT_BIN32%"
set "CSF_OPT_BIN64D=%CSF_OPT_BIN64%"
set "CSF_OPT_LIB32I=%CSF_OPT_LIB32%"
set "CSF_OPT_LIB64I=%CSF_OPT_LIB64%"
set "CSF_OPT_BIN32I=%CSF_OPT_BIN32%"
set "CSF_OPT_BIN64I=%CSF_OPT_BIN64%"
rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
set "CSF_OPT_CMPL="
set "PRODUCTS_DEFINES="
if ["%HAVE_TBB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB" & set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL" & set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
if ["%HAVE_TK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TK" & set "CSF_DEFINES=HAVE_TK;%CSF_DEFINES%"
if ["%HAVE_FREETYPE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREETYPE;%CSF_DEFINES%"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
if ["%HAVE_FFMPEG%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FFMPEG" & set "CSF_DEFINES=HAVE_FFMPEG;%CSF_DEFINES%"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK" & set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2_EXT" & set "CSF_DEFINES=HAVE_GLES2_EXT;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2" & set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D" & set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
if ["%HAVE_RAPIDJSON%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_RAPIDJSON" & set "CSF_DEFINES=HAVE_RAPIDJSON;%CSF_DEFINES%"
if ["%HAVE_DRACO%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_DRACO" & set "CSF_DEFINES=HAVE_DRACO;%CSF_DEFINES%"
if ["%HAVE_OPENVR%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENVR" & set "CSF_DEFINES=HAVE_OPENVR;%CSF_DEFINES%"
if ["%HAVE_E57%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_E57" & set "CSF_DEFINES=HAVE_E57;%CSF_DEFINES%"
@@ -223,20 +199,20 @@ if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
if not ["%PRODUCTS_DEFINES%"] == [""] set "CSF_OPT_CMPL=%CSF_OPT_CMPL% %PRODUCTS_DEFINES%"
rem ----- Collect 3rd-parties additional include paths into compiler options -----
rem ----- Colect 3rd-parties additional include paths into compiler options -----
for %%a in ("%CSF_OPT_INC:;=";"%") do (
set "anItem=%%~a"
if not ["%%~a"] == [""] call :concatCmplInc %%~a
)
rem ----- Collect 3rd-parties additional library paths (32-bit) into linker options -----
rem ----- Colect 3rd-parties additional library paths (32-bit) into linker options -----
set "OPT_LIB32="
for %%a in ("%CSF_OPT_LIB32:;=";"%") do (
set "anItem=%%~a"
if not ["%%~a"] == [""] call :concatLib32 %%~a
)
rem ----- Collect 3rd-parties additional library paths (64-bit) into linker options -----
rem ----- Colect 3rd-parties additional library paths (64-bit) into linker options -----
set "OPT_LIB64="
for %%a in ("%CSF_OPT_LIB64:;=";"%") do (
set "anItem=%%~a"
@@ -268,7 +244,7 @@ if ["%CASDEB%"] == ["d"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64D%;%PAT
if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32I%;%PATH%"
if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64I%;%PATH%"
rem ----- Set environment variables used by OCCT -----
rem ----- Set envoronment variables used by OCCT -----
set CSF_LANGUAGE=us
set MMGT_CLEAR=1
set "CSF_SHMessage=%CSF_OCCTResourcePath%\SHMessage"

View File

@@ -74,10 +74,6 @@ if not "%DevEnvDir%" == "" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -111,11 +107,6 @@ if /I "%VCFMT%" == "vc9" (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "vc143" (
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[17.0,17.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
@@ -124,7 +115,7 @@ if /I "%VCFMT%" == "vc9" (
exit
)
rem ----- For compatibility with external application using CASROOT -----
rem ----- For compatability with external application using CASROOT -----
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
rem ----- Define path to 3rdparty products -----
@@ -135,16 +126,11 @@ if ["%ARCH%"] == ["64"] set VCARCH=amd64
if /I ["%1"] == ["vc141"] set "VCVER=vc14"
if /I ["%1"] == ["vc142"] set "VCVER=vc14"
if /I ["%1"] == ["vc143"] set "VCVER=vc14"
if exist "%CASROOT%\custom.bat" (
call "%CASROOT%\custom.bat" %VCVER% %ARCH% %CASDEB%
)
if not ["%QTDIR%"] == [""] (
set "PATH=%QTDIR%/bin;%PATH%"
set "QT_PLUGIN_PATH=%QTDIR%/plugins"
)
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
@@ -155,6 +141,10 @@ if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
if not ["%FFMPEG_DIR%"] == [""] set "PATH=%FFMPEG_DIR%;%PATH%"
if not ["%OPENVR_DIR%"] == [""] set "PATH=%OPENVR_DIR%;%PATH%"
if not ["%QTDIR%"] == [""] (
set "PATH=%QTDIR%/bin;%PATH%"
set "QT_PLUGIN_PATH=%QTDIR%/plugins"
)
rem ----- Set path to 3rd party and OCCT libraries -----
if not "%CSF_OCCTBinPath%" == "" (

View File

@@ -2,7 +2,7 @@
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
# ----- For compatibility with external application using CASROOT -----
# ----- For compatability with external application using CASROOT -----
if [ "${CASROOT}" == "" ]; then
export CASROOT="${aScriptPath}"
fi

View File

@@ -2,7 +2,7 @@
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
# ----- For compatibility with external application using CASROOT -----
# ----- For compatability with external application using CASROOT -----
if [ "${CASROOT}" == "" ]; then
export CASROOT="@INSTALL_DIR@"
fi

View File

@@ -7,7 +7,6 @@ if exist "%~dp0custom.bat" (
call "@INSTALL_DIR_ABSOLUTE@\@INSTALL_DIR_SCRIPT@\env.bat" %1 %2 %3
if /I ["%1"] == ["vc141"] set "VCVER=vc141"
if /I ["%1"] == ["vc142"] set "VCVER=vc142"
if /I ["%1"] == ["vc143"] set "VCVER=vc143"
set "BIN_DIR=win%ARCH%\%VCVER%\bind"
set "LIB_DIR=win%ARCH%\%VCVER%\libd"

View File

@@ -3,16 +3,12 @@
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
aSystem=`uname -s`
# Reset values
export CASROOT="__CASROOT__"
export CASDEB=""
export PRJFMT="";
export HAVE_TBB="false";
export HAVE_OPENCL="false";
export HAVE_TK="true";
export HAVE_FREETYPE="true";
export HAVE_FREEIMAGE="false";
export HAVE_FFMPEG="false";
export HAVE_VTK="false";
@@ -20,13 +16,9 @@ export HAVE_GLES2="false";
export HAVE_ZLIB="false";
export HAVE_LIBLZMA="false";
export HAVE_RAPIDJSON="false";
export HAVE_DRACO="false";
export HAVE_OPENVR="false";
export HAVE_E57="false";
export HAVE_XLIB="true";
if [ "$aSystem" == "Darwin" ]; then
export HAVE_XLIB="false";
fi
export MACOSX_USE_GLX="false";
export CSF_OPT_INC=""
export CSF_OPT_LIB32=""
export CSF_OPT_LIB64=""
@@ -66,6 +58,7 @@ else
export ARCH="64";
fi
aSystem=`uname -s`
if [ "$aSystem" == "Darwin" ]; then
export WOKSTATION="mac";
export ARCH="64";
@@ -107,19 +100,17 @@ export CSF_OPT_CMPL=""
# Optiona 3rd-parties should be enabled by HAVE macros
if [ "$HAVE_TBB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"; fi
if [ "$HAVE_OPENCL" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
if [ "$HAVE_TK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TK"; fi
if [ "$HAVE_FREETYPE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREETYPE"; fi
if [ "$HAVE_FREEIMAGE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"; fi
if [ "$HAVE_FFMPEG" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FFMPEG"; fi
if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2_EXT"; fi
if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"; fi
if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
if [ "$HAVE_RAPIDJSON" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_RAPIDJSON"; fi
if [ "$HAVE_DRACO" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_DRACO"; fi
if [ "$HAVE_OPENVR" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENVR"; fi
if [ "$HAVE_E57" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_E57"; fi
if [ "$HAVE_XLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_XLIB"; fi
# Option to compile OCCT with X11 libs on Mac OS X
if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
# To split string into array
aDelimBack=$IFS

View File

@@ -23,8 +23,6 @@ if "%VCVER%" == "vc8" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc143" (
call "%VS143COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B

View File

@@ -90,7 +90,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -100,14 +100,14 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL32__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -138,7 +138,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
@@ -148,7 +148,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@@ -156,7 +156,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
@@ -186,7 +186,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -196,14 +196,14 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__TKNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
__VCMPL64__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -234,7 +234,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
@@ -244,7 +244,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@@ -252,7 +252,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>

View File

@@ -85,7 +85,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -95,12 +95,12 @@
<ProgramDataBaseFileName>.\..\..\..\win32\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -130,7 +130,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
@@ -140,13 +140,13 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL32__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
@@ -175,7 +175,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -185,12 +185,12 @@
<ProgramDataBaseFileName>.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -219,7 +219,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
@@ -229,13 +229,13 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>26812</DisableSpecificWarnings>
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<FloatingPointModel>Precise</FloatingPointModel>__VCMPL64__
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>

View File

@@ -72,29 +72,6 @@ BOPCol_Box2DBndTreeSelector BOPTools_BoxSelector<Bnd_Box2d>
BiTgte_DataMapOfShapeBox TopTools_DataMapOfShapeBox
CDM_MessageDriver Message_Messenger
Message_ProgressSentry Message_ProgressScope
Adaptor2d_HCurve2d Adaptor2d_Curve2d
Adaptor2d_HLine2d Adaptor2d_Line2d
Adaptor2d_HOffsetCurve Adaptor2d_OffsetCurve
Adaptor3d_HCurve Adaptor3d_Curve
Adaptor3d_HCurveOnSurface Adaptor3d_CurveOnSurface
Adaptor3d_HIsoCurve Adaptor3d_IsoCurve
Adaptor3d_HSurface Adaptor3d_Surface
BRepAdaptor_HCompCurve BRepAdaptor_CompCurve
BRepAdaptor_HCurve BRepAdaptor_Curve
BRepAdaptor_HCurve2d BRepAdaptor_Curve2d
BRepAdaptor_HSurface BRepAdaptor_Surface
BiTgte_HCurveOnEdge BiTgte_CurveOnEdge
BiTgte_HCurveOnVertex BiTgte_CurveOnVertex
ChFiDS_HElSpine ChFiDS_ElSpine
Geom2dAdaptor_GHCurve Geom2dAdaptor_Curve
Geom2dAdaptor_HCurve Geom2dAdaptor_Curve
GeomAdaptor_GHCurve GeomAdaptor_Curve
GeomAdaptor_GHSurface GeomAdaptor_Surface
GeomAdaptor_HCurve GeomAdaptor_Curve
GeomAdaptor_HSurface GeomAdaptor_Surface
GeomAdaptor_HSurfaceOfLinearExtrusion GeomAdaptor_SurfaceOfLinearExtrusion
GeomAdaptor_HSurfaceOfRevolution GeomAdaptor_SurfaceOfRevolution
PrsMgr_PresentationManager3d PrsMgr_PresentationManager
[tcollection]
AdvApp2Var_SequenceOfNode

View File

@@ -52,7 +52,7 @@ proc HelpInformation {} {
loginfo " -$ArgName(Rename) - apply renaming of classes"
loginfo ""
loginfo "Advanced options:"
loginfo " -$ArgName(CompatibleMode) - preserve old RTTI macros for compatibility with OCCT 6.x"
loginfo " -$ArgName(CompatibleMode) - preserve old RTTI macros for compatability with OCCT 6.x"
loginfo " -$ArgName(CheckOnly) - do check only, no modifications will be made"
loginfo " -$ArgName(WLog) - show gui log of upgrade process"
loginfo " -$ArgName(Log)=<file path> - put the log into a file"
@@ -370,7 +370,7 @@ proc upgrade {args} {
}
}
# search and rename the indices (old names) of @theNewNames with their values (new ones)
# search and rename the indeces (old names) of @theNewNames with their values (new ones)
# processes files that have @theExtensions only in @thePath folder
proc Rename {thePath theExtensions theNewNames theCheckMode} {
upvar $theNewNames aNewNames

View File

@@ -43,7 +43,6 @@ configure_file ("${OCCT_OVERVIEW_RESOURCE_DIR}/occt_ug_html.doxyfile" "${OCCT_CO
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}")
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nOUTPUT_DIRECTORY = ${OCCT_GENERATED_OVERVIEW_DIR}/.")
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_LOGO = ${OCCT_OVERVIEW_DIR}/resources/occ_logo.png")
file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nEXAMPLE_PATH = ${CMAKE_SOURCE_DIR}/src")
set (OCCT_ARTICLE_PARAM_INPUT "INPUT =")
set (OCCT_ARTICLE_PARAM_IMAGEPATH "IMAGE_PATH = ${OCCT_OVERVIEW_DIR}/resources/ ")

View File

@@ -12,19 +12,14 @@ samples/samples.md
../samples/CSharp/ReadMe.md
../samples/CSharp/ReadMe_D3D.md
../samples/qt/AndroidQt/ReadMe.md
../samples/qt/IESample/ReadMe.md
../samples/qt/OCCTOverview/ReadMe.md
../samples/qt/Tutorial/ReadMe.md
../samples/java/jniviewer/ReadMe.md
../samples/ios/UIKitSample/ReadMe.md
../samples/webgl/ReadMe.md
../samples/glfw/readme.md
samples/ocaf.md
samples/ocaf_func.md
samples/draw_scripts.md
samples/ais_object.md
samples/novice_guide.md
tutorial/tutorial.md
build/build_upgrade.md

View File

@@ -6,8 +6,6 @@
tutorial/tutorial.md
samples/novice_guide.md
upgrade/upgrade.md
user_guides/foundation_classes/foundation_classes.md

View File

@@ -2,48 +2,60 @@
==============================================
@tableofcontents
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://dev.opencascade.org/resources/download/3rd-party-components.
On Linux and macOS, it is recommended to use the version installed in the system natively.
On Windows, the easiest way to install third-party libraries is to download archive with pre-built binaries from https://opencascade.com/content/3rd-party-components.
On Linux and OS X, it is recommended to use the version installed in the system natively.
@section dev_guides__building_3rdparty_win_1 Windows
This section presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform.
It is assumed that you are already familiar with MS Visual Studio / Visual C++.
This document presents guidelines for building third-party products used by Open CASCADE Technology (OCCT) and samples on Windows platform. It is assumed that you are already familiar with MS Visual Studio / Visual C++.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of runtime binaries.
You need to use the same version of MS Visual Studio for building all third-party products and OCCT itself, in order to receive a consistent set of run-time binaries.
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, `c:/occ3rdparty`).
Further in this document, this folder is referred to as `3rdparty`.
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
There are two types of third-party products used by OCCT:
* Mandatory products:
* Tcl/Tk 8.5 -- 8.6;
* FreeType 2.4.10 -- 2.5.3.
* Optional products:
* TBB 3.x -- 4.x;
* FreeImage 3.14.1 -- 3.16.0;
* VTK 6.1.0.
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, *c:\\occ3rdparty*).
Further in this document, this folder is referred to as *3rdparty*.
@subsection dev_guides__building_3rdparty_win_2 Tcl/Tk
Tcl/Tk is required for DRAW test harness.
**Installation from sources: Tcl**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. In the `win` sub-directory, edit file `buildall.vc.bat`:
1. In the *win* sub-directory, edit file *buildall.vc.bat*:
* Edit the line `"call ... vcvars32.bat"` to have correct path to the version of Visual Studio to be used for building, for instance:
* Edit the line "call ... vcvars32.bat" to have correct path to the version of Visual Studio to be used for building, for instance:
call "%VS80COMNTOOLS%\vsvars32.bat"
If you are building 64-bit version, set environment accordingly, e.g.:
call "%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
* Define variable `INSTALLDIR` pointing to directory where Tcl/Tk will be installed, e.g.:
* Define variable *INSTALLDIR* pointing to directory where Tcl/Tk will be installed, e.g.:
set INSTALLDIR=D:\OCCT\3rdparty\tcltk-86-32
* Add option `install` to the first command line calling `nmake`:
* Add option *install* to the first command line calling *nmake*:
nmake -nologo -f makefile.vc release htmlhelp install %1
* Remove second call to `nmake` (building statically linked executable)
* Remove second call to *nmake* (building statically linked executable)
2. Edit file `rules.vc` replacing line
2. Edit file *rules.vc* replacing line
SUFX = tsgx
@@ -53,18 +65,21 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
This is to avoid extra prefix 't' in the library name, which is not recognized by default by OCCT build tools.
3. By default, Tcl uses dynamic version of run-time library (MSVCRT), which must be installed on the system where Tcl will be used.
You may wish to link Tcl library with static version of run-time to avoid this dependency.
For that:
* Edit file `makefile.vc` replacing strings `"crt = -MD"` by `"crt = -MT"`
* Edit file *makefile.vc* replacing strings "crt = -MD" by "crt = -MT"
* Edit source file `tclMain.c` (located in folder `generic`) commenting out forward declaration of function `isatty()`.
* Edit source file *tclMain.c* (located in folder *generic*) commenting out forward declaration of function *isatty()*.
4. In the command prompt, run `buildall.vc.bat`<br>
You might need to run this script twice to have `tclsh` executable installed; check subfolder `bin` of specified installation path to verify this.
5. For convenience of use, we recommend making a copy of `tclsh` executable created in subfolder `bin` of `INSTALLDIR` and named with Tcl version number suffix, as `tclsh.exe` (with no suffix)
4. In the command prompt, run *buildall.vc.bat*
You might need to run this script twice to have *tclsh* executable installed; check subfolder *bin* of specified installation path to verify this.
5. For convenience of use, we recommend making a copy of *tclsh* executable created in subfolder *bin* of *INSTALLDIR* and named with Tcl version number suffix, as *tclsh.exe* (with no suffix)
> cd D:\OCCT\3rdparty\tcltk-86-32\bin
> cp tclsh86.exe tclsh.exe
@@ -72,304 +87,327 @@ Download the necessary archive from https://www.tcl.tk/software/tcltk/download.h
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
Apply the same steps as described for building Tcl above, with the same `INSTALLDIR`.
Note that Tk produces its own executable, called `wish`.
You might need to edit default value of `TCLDIR` variable defined in `buildall.vc.bat` (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
Apply the same steps as described for building Tcl above, with the same INSTALLDIR.
Note that Tk produces its own executable, called *wish*.
You might need to edit default value of *TCLDIR* variable defined in *buildall.vc.bat* (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
@subsection dev_guides__building_3rdparty_win_2_2 FreeType
FreeType is required for text display in a 3D viewer.
You can download its sources from https://freetype.org/
FreeType is required for text display in a 3D viewer. You can download its sources from https://sourceforge.net/projects/freetype/files/
1. Unpack the downloaded archive of FreeType product into the `3rdparty` folder.
As a result, you will get a folder named, for example, `3rdparty/freetype-2.4.10`.
Further in this document, this folder is referred to as `freetype`.
### The building procedure
2. Open the solution file `freetype/builds/win32/vc20xx/freetype.sln` in Visual Studio.
Here `vc20xx` stands for your version of Visual Studio.
1. Unpack the downloaded archive of FreeType product into the *3rdparty* folder. As a result, you will get a folder named, for example, *3rdparty\\freetype-2.4.10*. Further in this document, this folder is referred to as *freetype*.
2. Open the solution file *freetype\\builds\\win32\\vc20xx\\freetype.sln* in Visual Studio. Here *vc20xx* stands for your version of Visual Studio.
3. Select the configuration to build: either `Debug` or `Release`.
3. Select the configuration to build: either Debug or Release.
4. Build the `freetype` project.<br>
As a result, you will get a `freetype` import library (`.lib`) in the `freetype/obj/win32/vc20xx` folder.
4. Build the *freetype* project.
5. If you build FreeType for a 64 bit platform, select in the main menu `Build - Configuration Manager`
and add `x64` platform to the solution configuration by copying the settings from `Win32` platform:
As a result, you will get a freetype import library (.lib) in the *freetype\\obj\\win32\\vc20xx* folder.
5. If you build FreeType for a 64 bit platform, select in the main menu **Build - Configuration Manager** and add *x64* platform to the solution configuration by copying the settings from Win32 platform:
@figure{/build/build_3rdparty/images/3rdparty_image001.png}
Update the value of the Output File for `x64` configuration:
Update the value of the Output File for x64 configuration:
@figure{/build/build_3rdparty/images/3rdparty_image003.png}
Build the `freetype` project.<br>
As a result, you will obtain a 64 bit import library (`.lib`) file in the `freetype/x64/vc20xx` folder.
To build FreeType as a dynamic library (`.dll`) follow steps 6, 7 and 8 of this procedure.
Build the *freetype* project.
6. Open menu Project-> Properties-> Configuration Properties-> General and change option `Configuration Type` to `Dynamic Library (.dll)`.
7. Edit file `freetype/include/freetype/config/ftoption.h`:<br>
in line 255, uncomment the definition of macro `FT_EXPORT` and change it as follows:
As a result, you will obtain a 64 bit import library (.lib) file in the *freetype\\x64\\vc20xx* folder.
#define FT_EXPORT(x) __declspec(dllexport) x
To build FreeType as a dynamic library (.dll) follow steps 6, 7 and 8 of this procedure.
8. Build the `freetype` project.<br>
As a result, you will obtain the files of the import library (`.lib`) and the dynamic library (`.dll`) in folders `freetype/objs/release` or `freetype/objs/debug`.
If you build for a 64 bit platform, follow step 5 of the procedure.
6. Open menu Project-> Properties-> Configuration Properties-> General and change option **Configuration Type** to *Dynamic Library (.dll)*.
7. Edit file *freetype\\include\\freetype\\config\\ftoption.h*:
in line 255, uncomment the definition of macro *FT_EXPORT* and change it as follows:
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures,
it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern `freetype-compiler-bitness-building mode`, where:
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
* `bitness` is `32` or `64`;
* `building mode` is `opt` (for `Release`) or `deb` (for `Debug`).
#define FT_EXPORT(x) __declspec(dllexport) x
8. Build the *freetype* project.
As a result, you will obtain the files of the import library (.lib) and the dynamic library (.dll) in folders <i>freetype \\objs\\release</i> or <i>\\objs\\debug </i>.
If you build for a 64 bit platform, follow step 5 of the procedure.
To facilitate the use of FreeType libraries in OCCT with minimal adjustment of build procedures, it is recommended to copy the include files and libraries of FreeType into a separate folder, named according to the pattern: *freetype-compiler-bitness-building mode*, where:
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
* **bitness** is *32* or *64*;
* **building mode** is *opt* (for Release) or *deb* (for Debug).
The *include* subfolder should be copied as is, while libraries should be renamed to *freetype.lib* and *freetype.dll* (suffixes removed) and placed to subdirectories *lib *and *bin*, respectively. If the Debug configuration is built, the Debug libraries should be put into subdirectories *libd* and *bind*.
The `include` subfolder should be copied as is, while libraries should be renamed to `freetype.lib` and `freetype.dll` (suffixes removed) and placed to subdirectories `lib` and `bin`, respectively.
If the `Debug` configuration is built, the Debug libraries should be put into subdirectories `libd` and `bind`.
@subsection dev_guides__building_3rdparty_win_3_1 TBB
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Windows platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-win.zip`)
This third-party product is installed with binaries
from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*) and pick the archive for Windows platform.
Unpack the downloaded archive of TBB product into the `3rdparty` folder.
Unpack the downloaded archive of TBB product into the *3rdparty* folder.
Further in this document, this folder is referred to as `tbb`.
Further in this document, this folder is referred to as *tbb*.
@subsection dev_guides__building_3rdparty_win_3_3 FreeImage
This third-party product should be built as a dynamically loadable library (`.dll` file).
You can download its sources from
This third-party product should be built as a dynamically loadable library (.dll file).
You can download its sources from
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
1. Unpack the downloaded archive of FreeImage product into `3rdparty` folder.<br>
As a result, you should have a folder named `3rdparty/FreeImage`.
Rename it according to the rule: `freeimage-platform-compiler-building mode`, where
### The building procedure:
* `platform` is `win32` or `win64`;
* `compiler` is `vc8` or `vc9` or `vc10` or `vc11`;
* `building mode` is *opt* (for release) or `deb` (for debug)
1. Unpack the downloaded archive of FreeImage product into *3rdparty* folder.
As a result, you should have a folder named *3rdparty\\FreeImage*.
Rename it according to the rule: *freeimage-platform-compiler-building mode*, where
* **platform** is *win32* or *win64*;
* **compiler** is *vc8* or *vc9* or *vc10* or *vc11*;
* **building mode** is *opt* (for release) or *deb* (for debug)
Further in this document, this folder is referred to as `freeimage`.
Further in this document, this folder is referred to as *freeimage*.
2. Open the solution file `freeimage/FreeImage.*.sln` in your Visual Studio.<br>
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
Such conversion should be suggested automatically by Visual Studio.
2. Open the solution file *freeimage\\FreeImage.*.sln* in your Visual Studio.
If you use a Visual Studio version higher than VC++ 2008, apply conversion of the workspace.
Such conversion should be suggested automatically by Visual Studio.
3. Select a configuration to build.
3. Select a configuration to build.
- Choose `Release` if you are building Release binaries.
- Choose `Debug` if you are building Debug binaries.
- Choose **Release** if you are building Release binaries.
- Choose **Debug** if you are building Debug binaries.
*Note:*
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage projects:
*Note:*
If you want to build a debug version of FreeImage binaries then you need to rename the following files in FreeImage and FreeimagePlus projects:
Project -> Properties -> Configuration Properties -> Linker -> General -> Output File
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.dll to FreeImage.dll
FreeImagePlus*d*.dll to FreeImagePlus.dll
Project -> Properties -> Configuration Properties -> Linker -> Debugging-> Generate Program Database File
FreeImage*d*.pdb to FreeImage.pdb
FreeImage*d*.pdb to FreeImage.pdb
FreeImagePlus*d*.pdb to FreeImagePlus.pdb
Project -> Properties -> Configuration Properties -> Linker -> Advanced-Import Library
FreeImage*d*.lib to FreeImage.lib
FreeImage*d*.lib to FreeImage.lib
FreeImagePlus*d*.lib to FreeImagePlus.lib
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
Project -> Properties -> Configuration Properties -> Build Events -> Post -> Build Event -> Command Line
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.lib to FreeImage.lib
FreeImage*d*.dll to FreeImage.dll
FreeImage*d*.lib to FreeImage.lib
FreeImagePlus*d*.dll to FreeImagePlus.dll
FreeImagePlus*d*.lib to FreeImagePlus.lib
Additionally, rename in project FreeImagePlus
Additionally, rename in project FreeImagePlus
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies
from FreeImage*d*.lib to FreeImage.lib
from FreeImage*d*.lib to FreeImage.lib
4. Select a platform to build.
4. Select a platform to build.
- Choose `Win32` if you are building for a 32 bit platform.
- Choose `x64` if you are building for a 64 bit platform.
- Choose *Win32* if you are building for a 32 bit platform.
- Choose *x64* if you are building for a 64 bit platform.
5. Start the building process.<br>
As a result, you should have the library files of FreeImage product in `freeimage/Dist` folder (`FreeImage.dll` and `FreeImage.lib`).
5. Start the building process.
As a result, you should have the library files of FreeImage product in *freeimage\\Dist* folder (*FreeImage.dll* and *FreeImage.lib*) and in *freeimage\\Wrapper\\FreeImagePlus\\dist* folder (*FreeImagePlus.dll* and *FreeImagePlus.lib*).
@subsection dev_guides__building_3rdparty_win_3_4 VTK
VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
VTK is an open-source, freely available software system for 3D computer graphics, image processing and visualization. VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into `3rdparty` folder.<br>
As a result, you will get a folder named, for example, `3rdparty/VTK-6.1.0`.
Further in this document, this folder is referred to as `VTK`.
### The building procedure:
1. Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it into *3rdparty* folder.
As a result, you will get a folder named, for example, <i>3rdparty\VTK-6.1.0.</i>
Further in this document, this folder is referred to as *VTK*.
2. Use CMake to generate VS projects for building the library:
- Start CMake-GUI and select `VTK` folder as source path, and the folder of your choice for VS project and intermediate build data.
- Start CMake-GUI and select VTK folder as source path, and the folder of your choice for VS project and intermediate build data.
- Click **Configure**.
- Select the VS version to be used from the ones you have installed (we recommend using VS 2015) and the architecture (32 or 64-bit).
- Generate VS projects with default CMake options. The open solution `VTK.sln` will be generated in the build folder.
- Select the VS version to be used from the ones you have installed (we recommend using VS 2010) and the architecture (32 or 64-bit).
- Generate VS projects with default CMake options. The open solution *VTK.sln* will be generated in the build folder.
3. Build project VTK in Release mode.
@section build_3rdparty_linux Linux
This section presents additional guidelines for building third-party products used by Open CASCADE Technology and samples on Linux platform.
This document presents additional guidelines for building third-party
products used by Open CASCADE Technology and samples on Linux platform.
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
The links for downloading the third-party products are available on the web site at
https://opencascade.com/content/3rd-party-components.
**Debian-based distributives**
There are two types of third-party products, which are necessary to build OCCT:
* Mandatory products:
* Tcl/Tk 8.5 - 8.6;  
* FreeType 2.4.10 - 2.5.3;
* Optional products:
* TBB 3.x - 4.x;
* FreeImage 3.14.1 - 3.16.0;
* VTK 6.1.0.
All 3rd-party products required for building of OCCT could be installed from official repositories.
You may install them from console using apt-get utility:
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libx11-dev libgl1-mesa-dev libfreeimage-dev
sudo apt-get install rapidjson-dev libdraco-dev
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
Building is possible with C++ compliant compiler:
sudo apt-get install g++
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
Tcl/Tk is required for DRAW test harness.
Tcl/Tk is required for DRAW test harness.
**Installation from sources: Tcl**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `unix` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
cd TCL_SRC_DIR/unix
2. Run the `configure` command:
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
3. If the configure command has finished successfully, start the building process:
make
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`
make install
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `unix` sub-directory of the directory where the Tk source files are located (`TK_SRC_DIR`)
1. Enter the unix sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
cd TK_SRC_DIR/unix
cd TCL_SRC_DIR/unix
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`.
2. Run the *configure* command:
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the configure command has finished successfully, start the building process:
make
3. If the configure command has finished successfully, start the building process:
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*
make
make install
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied
to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`)
**Installation from sources: Tk**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the unix sub-directory of the directory where the Tk source files are located <i>(TK_SRC_DIR)</i>
make install
cd TK_SRC_DIR/unix
2. Run the configure command, where <i>TCL_LIB_DIR</i> is *TCL_INSTALL_DIR/lib*.
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the configure command has finished successfully, start the building process:
make
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied
to the directory defined by *TK_INSTALL_DIR* (usually it is *TCL_INSTALL_DIR*)
make install
@subsection dev_guides__building_3rdparty_linux_2_2 FreeType
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://freetype.org/ and unpack it.
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
cd FREETYPE_SRC_DIR
2. Run the `configure` command:
2. Run the *configure* command:
configure --prefix=FREETYPE_INSTALL_DIR
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
3. If the *configure* command has finished successfully, start the building process:
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
make
3. If the `configure` command has finished successfully, start the building process:
make
4. If the building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`
make install
4. If the building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*
make install
@subsection dev_guides__building_3rdparty_linux_3_1 TBB
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Linux platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-lin.tgz`).
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
To install, unpack the downloaded archive of TBB product.
@subsection dev_guides__building_3rdparty_linux_3_3 FreeImage
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/ and unpack it.
The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
Download the necessary archive from https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
1. Modify *FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h*:
In line 60 insert the following:
1. Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h`:<br>
In line 60 insert the following:
#include string.h
#include string.h
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
cd FREEIMAGE_SRC_DIR
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
3. Run the building process
make
cd FREEIMAGE_SRC_DIR
4. Run the installation process
3. Run the building process
make
4. Run the installation process
a. If you have the permission to write into directories `/usr/include` and `/usr/lib`, run the following command:
make install
b. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.gnu`:
a. If you have the permission to write into directories <i>/usr/include</i> and <i>/usr/lib</i>, run the following command:
make install
b. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.gnu*:
Change lines 7-9 from:
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Change lines 65-67 from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Change lines 65-67 from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
Change line 70 from:
Change line 70 from: 
ldconfig
to:
\#ldconfig
\#ldconfig
Then run the installation process by the following command:
Then run the installation process by the following command:
make DESTDIR=FREEIMAGE_INSTALL_DIR install
make DESTDIR=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
@@ -377,180 +415,219 @@ The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DI
@subsection dev_guides__building_3rdparty_linux_3_4 VTK
You can download VTK sources from https://www.vtk.org/VTK/resources/software.html
### The building procedure:
Download the necessary archive from https://www.vtk.org/VTK/resources/software.html and unpack it.
1. Install or build `cmake` product from the source file.
2. Start `cmake` in GUI mode with the directory where the source files of *VTK* are located:
1. Install or build *cmake* product from the source file.
2. Start *cmake* in GUI mode with the directory where the source files of *VTK* are located:
ccmake VTK_SRC_DIR
* Press `[c]` to make the initial configuration
* Define the necessary options in `VTK_INSTALL_PREFIX`
* Press `[c]` to make the final configuration
* Press `[g]` to generate `Makefile` and exit
* Press <i>[c]</i> to make the initial configuration
* Define the necessary options in *VTK_INSTALL_PREFIX*
* Press <i>[c]</i> to make the final configuration
* Press <i>[g]</i> to generate Makefile and exit
3. Start the building of VTK:
make
4. Start the installation of VTK. Binaries will be installed according to the `VTK_INSTALL_PREFIX` option.
4. Start the installation of VTK. Binaries will be installed according to the *VTK_INSTALL_PREFIX* option.
make install
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
**Debian-based distributives**
All 3rd-party products required for building of OCCT could be installed
from official repositories. You may install them from console using apt-get utility:
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libxt-dev libxmu-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libfreeimage-dev libtbb-dev
To launch binaries built with WOK you need to install C shell and 32-bit libraries on x86_64 distributives:
# you may need to add i386 if not done already by command "dpkg --add-architecture i386"
sudo apt-get install csh libstdc++6:i386 libxt6:i386 libxext6:i386 libxmu6:i386
Building is possible with C++ compliant compiler:
sudo apt-get install g++
@section build_3rdparty_macos Mac OS X
This section presents additional guidelines for building third-party products
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
This document presents additional guidelines for building third-party products
used by Open CASCADE Technology and samples on Mac OS X platform (10.6.4 and later).
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk
The links for downloading the third-party products are available at https://opencascade.com/content/3rd-party-components.
Tcl/Tk is required for DRAW test harness.
There are two types of third-party products, which are necessary to build OCCT:
* Mandatory products:
* Tcl/Tk 8.5 - 8.6;
* FreeType 2.4.10 - 2.5.3.
* Optional products:
* TBB 3.x - 4.x;
* FreeImage 3.14.1 - 3.16.0
**Installation from sources: Tcl**
@subsection dev_guides__building_3rdparty_osx_2_1 Tcl/Tk 8.5
Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
**Installation from sources: Tcl 8.5**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `macosx` sub-directory of the directory where the Tcl source files are located (`TCL_SRC_DIR`).
1. Enter the *macosx* sub-directory of the directory where the Tcl source files are located <i>(TCL_SRC_DIR)</i>.
cd TCL_SRC_DIR/macosx
cd TCL_SRC_DIR/macosx
2. Run the `configure` command
2. Run the *configure* command
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --prefix=TCL_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the `configure` command has finished successfully, start the building process
3. If the *configure* command has finished successfully, start the building process
make
make
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by *TCL_INSTALL_DIR*.
4. If building is finished successfully, start the installation of Tcl.
All binary and service files of the product will be copied to the directory defined by `TCL_INSTALL_DIR`.
make install
make install
**Installation from sources: Tk**
**Installation from sources: Tk 8.5**
Download the necessary archive from https://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the `macosx` sub-directory of the directory where the source files of Tk are located (`TK_SRC_DIR`).
1. Enter the *macosx* sub-directory of the directory where the source files of Tk are located <i>(TK_SRC_DIR)</i>.
cd TK_SRC_DIR/macosx
cd TK_SRC_DIR/macosx
2. Run the `configure` command, where `TCL_LIB_DIR` is `TCL_INSTALL_DIR/lib`
2. Run the *configure* command, where TCL_LIB_DIR is TCL_INSTALL_DIR/lib
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
configure --enable-gcc --enable-shared --enable-threads --with-tcl=TCL_LIB_DIR --prefix=TK_INSTALL_DIR
For a 64 bit platform also add `--enable-64bit` option to the command line.
For a 64 bit platform also add <i>--enable-64bit</i> option to the command line.
3. If the `configure` command has finished successfully, start the building process:
3. If the *configure* command has finished successfully, start the building process:
make
make
4. If the building has finished successfully, start the installation of Tk.
All binary and service files of the product will be copied to the directory defined by `TK_INSTALL_DIR` (usually it is `TCL_INSTALL_DIR`).
4. If the building has finished successfully, start the installation of Tk. All binary and service files of the product will be copied to the directory defined by *TK_INSTALL_DIR* (usually it is TCL_INSTALL_DIR)
make install
make install
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType
@subsection dev_guides__building_3rdparty_osx_2_2 FreeType 2.4.10
FreeType is required for text display in the 3D viewer.
FreeType is required for text display in the 3D viewer.
Download the necessary archive from https://freetype.org/ and unpack it.
Download the necessary archive from https://sourceforge.net/projects/freetype/files/ and unpack it.
1. Enter the directory where the source files of FreeType are located (`FREETYPE_SRC_DIR`).
1. Enter the directory where the source files of FreeType are located <i>(FREETYPE_SRC_DIR)</i>.
cd FREETYPE_SRC_DIR
cd FREETYPE_SRC_DIR
2. Run the `configure` command
2. Run the *configure* command
configure --prefix=FREETYPE_INSTALL_DIR
configure --prefix=FREETYPE_INSTALL_DIR
For a 64 bit platform also add <i>CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'</i> option to the command line.
For a 64 bit platform also add `CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'` option to the command line.
3. If the *configure* command has finished successfully, start the building process
3. If the `configure` command has finished successfully, start the building process
make
make
4. If building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by *FREETYPE_INSTALL_DIR*.
4. If building has finished successfully, start the installation of FreeType.
All binary and service files of the product will be copied to the directory defined by `FREETYPE_INSTALL_DIR`.
make install
@subsection dev_guides__building_3rdparty_osx_3_1 TBB 3.x or 4.x
make install
This third-party product is installed with binaries from the archive
that can be downloaded from https://github.com/intel/tbb.
Go to the **Download** page, find the release version you need (e.g. *tbb30_018oss*)
and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB 3.0 product (*tbb30_018oss_osx.tgz*).
@subsection dev_guides__building_3rdparty_osx_3_1 TBB
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage 3.14.1 or 3.15.x
This third-party product is installed with binaries from the archive that can be downloaded from https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0.
Go to the **Download** page, find the release version you need (e.g. `oneTBB 2021.5.0`) and pick the archive for Mac OS X platform.
To install, unpack the downloaded archive of TBB product (`oneapi-tbb-2021.5.0-mac.tgz`).
@subsection dev_guides__building_3rdparty_osx_3_3 FreeImage
Download the necessary archive from
Download the necessary archive from
https://sourceforge.net/projects/freeimage/files/Source%20Distribution/
and unpack it. The directory with unpacked sources is further referred to as `FREEIMAGE_SRC_DIR`.
and unpack it. The directory with unpacked sources is further referred to as *FREEIMAGE_SRC_DIR*.
Note that for building FreeImage on Mac OS X 10.7 you should replace `Makefile.osx`
in `FREEIMAGE_SRC_DIR` by the corrected file, which you can find in attachment to issue [`#22811`](https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug) in OCCT Mantis bug tracker.
Note that for building FreeImage on Mac OS X 10.7 you should replace *Makefile.osx*
in *FREEIMAGE_SRC_DIR* by the corrected file, which you can find in attachment to issue #22811 in OCCT Mantis bug tracker
(https://tracker.dev.opencascade.org/file_download.php?file_id=6937&type=bug).
1. If you build FreeImage 3.15.x you can skip this step.
1. If you build FreeImage 3.15.x you can skip this step.
Modify <i>FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:</i>
In line 60 insert the following:
Modify `FREEIMAGE_SRC_DIR/Source/OpenEXR/Imath/ImathMatrix.h:`<br>
In line 60 insert the following:
#include string.h
#include string.h
Modify <i>FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp:</i>
In line 320 replace:
Modify `FREEIMAGE_SRC_DIR/Source/FreeImage/PluginTARGA.cpp`:<br>
In line 320 replace:
SwapShort(value);
SwapShort(value);
with:
with:
SwapShort(&value);
SwapShort(&value);
2. Enter the directory where the source files of FreeImage are located <i>(FREEIMAGE_SRC_DIR)</i>.
2. Enter the directory where the source files of FreeImage are located (`FREEIMAGE_SRC_DIR`).
cd FREEIMAGE_SRC_DIR
cd FREEIMAGE_SRC_DIR
3. Run the building process
make
make
4. Run the installation process
4. Run the installation process
1. If you have the permission to write into <i>/usr/local/include</i> and <i>/usr/local/lib</i> directories, run the following command:
1. If you have the permission to write into `/usr/local/include` and `/usr/local/lib` directories, run the following command:
make install
make install
2. If you do not have this permission, you need to modify file *FREEIMAGE_SRC_DIR/Makefile.osx*:
2. If you do not have this permission, you need to modify file `FREEIMAGE_SRC_DIR/Makefile.osx`:<br>
Change line 49 from:
Change line 49 from:   
PREFIX ?= /usr/local
to:
PREFIX ?= $(PREFIX)
PREFIX ?= $(PREFIX)
  Change lines 65-69 from:
  Change lines 65-69 from:
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
to:
install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
ranlib -sf $(INSTALLDIR)/$(STATICLIB)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
to:
install -d $(INCDIR) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
install -d $(INCDIR) $(INSTALLDIR)
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
Then run the installation process by the following command:
make PREFIX=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
make clean
Then run the installation process by the following command:
make PREFIX=FREEIMAGE_INSTALL_DIR install
5. Clean temporary files
make clean

View File

@@ -3,25 +3,31 @@ Build OCCT {#build_upgrade__building_occt}
@tableofcontents
Before building OCCT, make sure to have all required third-party libraries installed.
@note Before building OCCT, make sure to have all required third-party libraries installed.
The list of required libraries depends on what OCCT modules will be used, and your preferences.
The typical minimum is **FreeType** (necessary for Visualization) and **Tcl/Tk** (for DRAW).
The typical minimum is **Freetype** (necessary for Visualization) and **Tcl/Tk** (for DRAW).
See @ref intro_req "requirements on 3rdparty libraries" for a full list.
On OS X we recommend to use native libraries.
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to your target configuration,
from [Development Portal](https://dev.opencascade.org/resources/download/3rd-party-components).
You can also build third-party libraries from their sources, see @ref build_upgrade_building_3rdparty for instructions.
@section build_occt_windows Windows
On Linux and macOS we recommend to use libraries maintained by distributive developers, when possible.
@subsection build_occt_win_cmake Building with CMake tool
@section build_occt_win_cmake Building with CMake tool
This article describes the **CMake**-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 2.8.12 or later*.
This chapter describes the [CMake](https://cmake.org/download/)-based build process, which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources.
OCCT requires CMake version 3.1 or later.
@note Compared to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.x has a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool, which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive, which is a significant advantage over the legacy WOK utilities.
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
However, CMake is cross-platform and can be used to build OCCT on Linux and OS X in essentially the same way.
@note Before you start, make sure to have installed all 3-rd party products that you are going to use with OCCT; see @ref build_upgrade.
@subsubsection build_cmake_start Start CMake
CMake is a tool that generates the actual project files for the selected target build system (e.g. Unix makefiles) or IDE (e.g. Visual Studio 2010).
Here we describe the build procedure on the example of Windows platform with Visual Studio 2010.
However, CMake is cross-platform and can be used to build OCCT on Linux and macOS in essentially the same way.
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
CMake deals with three directories: source, build or binary and installation.
@@ -32,287 +38,271 @@ CMake deals with three directories: source, build or binary and installation.
The good practice is not to use the source directory as a build one.
Different configurations should be built in different build directories to avoid conflicts.
It is however possible to choose one installation directory for several configurations of OCCT (differentiated by platform, bitness, compiler and build type), for example:
d:/occt/ -- the source directory
d:/tmp/occt-build-vc10-x64 -- the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install -- the installation directory that is
able to contain several OCCT configurations
d:/occt/ - the source directory
d:/tmp/occt-build-vc10-x64 - the build directory with the generated
solution and other intermediate files created during a CMake tool working
d:/occt-install - the installation directory that is
able to contain several OCCT configurations
@subsubsection build_cmake_conf Configuration process
@subsection build_cmake_conf Configuration process
For unexperienced users we recommend to start with *cmake-gui* -- a cross-platform GUI tool provided by CMake on Windows, Mac and Linux.
A command-line alternative, *ccmake* can also be used.
If the command-line tool is used, run the tool from the build directory with a single argument indicating the source (relative or absolute path) directory, and press *c* to configure:
If the command-line tool is used, run the tool from the build directory with a single argument indicating the source (relative or absolute path) directory:
cd d:/tmp/occt-build-vc10-x64
ccmake d:/occt
@figure{/build/build_occt/images/cmake_image000.png}
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**:
Press *c* to configure.
All actions required in the configuration process with the GUI tool will be described below.
If the GUI tool is used, run this tool without additional arguments and after that specify the source directory by clicking **Browse Source** and the build (binary) one by clicking **Browse Build**.
@figure{/build/build_occt/images/cmake_image001.png}
@note Each configuration of the project should be built in its own directory.
When building multiple configurations it is suggested to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i>).
**Note**: Each configuration of the project should be built in its own directory. When building multiple configurations it is recommended to indicate in the name of build directories the system, bitness and compiler (e.g., <i>d:/occt/build/win32-vc10</i> ).
Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process.
It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
Once the source and build directories are selected, "Configure" button should be pressed in order to start manual configuration process. It begins with selection of a target configurator. It is "Visual Studio 10 2010 Win64" in our example.
@figure{/build/build_occt/images/cmake_image002.png}
@note To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
Alternatively, if you are using CMake from the command line add options `-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0`.
Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015".
File `CASROOT/samples/xaml/ReadMe.md` describes the building procedure of XAML (UWP) sample.
To build OCCT for **Universal Windows Platform (UWP)** specify the path to toolchain file for cross-compiling <i>d:/occt/adm/templates/uwp.toolchain.config.cmake</i>.
Once "Finish" button is pressed, the first pass of the configuration process is executed.
At the end of the process, CMake outputs the list of environment variables, which have to be properly specified for successful configuration.
Alternatively, if you are using CMake from the command line add options -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 .
**Note**: Universal Windows Platform (UWP) is supported only on "Visual Studio 14 2015". File <i>d:/occt/samples/xaml/ReadMe.md</i> describes the building procedure of XAML (UWP) sample.
Once "Finish" button is pressed, the first pass of the configuration process is executed. At the end of the process, CMake outputs the list of environment variables, which have to be properly specified for successful configuration.
@figure{/build/build_occt/images/cmake_image003.png}
The error message provides some information about these variables.
This message will appear after each pass of the process until all required variables are specified correctly.
The error message provides some information about these variables. This message will appear after each pass of the process until all required variables are specified correctly.
The change of the state of some variables can lead to the appearance of new variables.
The new variables appeared after the pass of the configuration process are highlighted with red color by CMake GUI tool.
The change of the state of some variables can lead to the appearance of new variables. The new variables appeared after the pass of the configuration process are highlighted with red color by CMake GUI tool.
@note There is "grouped" option, which groups variables with a common prefix.
Note: There is "grouped" option, which groups variables with a common prefix.
The following table gives the full list of environment variables used at the configuration stage:
| Variable | Type | Purpose |
|----------|------|---------|
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREETYPE | Boolean | Indicates whether FreeType product should be used in OCCT for text rendering |
| USE_FREEIMAGE | Boolean | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_OPENVR | Boolean | Indicates whether OpenVR product should be used in OCCT visualization module for support of Virtual Reality |
| USE_OPENGL | Boolean | Indicates whether TKOpenGl graphic driver using OpenGL library (desktop) should be built within OCCT visualization module |
| USE_GLES2 | Boolean | Indicates whether TKOpenGles graphic driver using OpenGL ES library (embedded OpenGL) should be built within OCCT visualization module |
| USE_RAPIDJSON | Boolean | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
| USE_DRACO | Boolean | Indicates whether Draco product should be used in OCCT Data Exchange module for support of Draco compression in glTF mesh file format |
| USE_TK | Boolean | Indicates whether Tcl/Tk product should be used in OCCT Draw Harness module for user interface (in addition to Tcl, which is mandatory for Draw Harness) |
| USE_TBB | Boolean | Indicates whether TBB (Threading Building Blocks) 3rd party is used or not. Note that OCCT remains parallel even without TBB product |
| USE_VTK | Boolean | Indicates whether VTK 3rd party is used or not. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| CMAKE_BUILD_TYPE | String | Specifies the build type on single-configuration generators (such as make). Possible values are Debug, Release and RelWithDebInfo |
| USE_FREEIMAGE | Boolean flag | Indicates whether FreeImage product should be used in OCCT visualization module for support of popular graphics image formats (PNG, BMP, etc.) |
| USE_RAPIDJSON | Boolean flag | Indicates whether RapidJSON product should be used in OCCT Data Exchange module for support of glTF mesh file format |
| USE_TBB | Boolean flag | Indicates whether TBB 3rd party is used or not. TBB stands for Threading Building Blocks, the technology of Intel Corp, which comes with different mechanisms and patterns for injecting parallelism into your application. OCCT remains parallel even without TBB product |
| USE_VTK | Boolean flag | Indicates whether VTK 3rd party is used or not. VTK stands for Visualization ToolKit, the technology of Kitware Inc intended for general-purpose scientific visualization. OCCT comes with a bridge between CAD data representation and VTK by means of its dedicated VIS component (VTK Integration Services). You may skip this 3rd party unless you are planning to use VTK visualization for OCCT geometry. See the official documentation @ref occt_user_guides__vis for the details on VIS |
| 3RDPARTY_DIR | Path | Defines the root directory where all required 3rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
| 3RDPARTY_FREETYPE_* | Path | Path to FreeType binaries |
| 3RDPARTY_FREETYPE_* | Path | Path to Freetype binaries |
| 3RDPARTY_TCL_* 3RDPARTY_TK_* | Path | Path to Tcl/Tk binaries |
| 3RDPARTY_FREEIMAGE* | Path | Path to FreeImage binaries |
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_FREEIMAGE* | Path | Path to Freeimage binaries |
| 3RDPARTY_TBB* | Path | Path to TBB binaries |
| 3RDPARTY_VTK_* | Path | Path to VTK binaries |
| BUILD_MODULE_<MODULE>| Boolean | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_MODULE_<MODULE>| Boolean flag | Indicates whether the corresponding OCCT module should be built or not. It should be noted that some toolkits of a module can be built even if this module is not checked (this happens if some other modules depend on these toolkits). The main modules and their descriptions can be found in @ref user_guides |
| BUILD_LIBRARY_TYPE | String | Specifies the type of library to be created. "Shared" libraries are linked dynamically and loaded at runtime. "Static" libraries are archives of object files used when linking other targets. Note that Draw Harness plugin system is incompatible with "Static" builds, and therefore it is disabled for these builds.|
| BUILD_ADDITIONAL_TOOLKITS | String | Semicolon-separated individual toolkits to include into build process. If you want to build some particular libraries (toolkits) only, then you may uncheck all modules in the corresponding *BUILD_MODUE_\<MODULE\>* options and provide the list of necessary libraries here. Of course, all dependencies will be resolved automatically |
| BUILD_YACCLEX | Boolean | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_SAMPLES_MFC | Boolean | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
| BUILD_SAMPLES_QT | Boolean | Indicates whether QT samples should be built together with OCCT. |
| BUILD_Inspector | Boolean | Indicates whether Inspector should be built together with OCCT. |
| BUILD_DOC_Overview | Boolean | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
| BUILD_YACCLEX | Boolean flag | Enables Flex/Bison lexical analyzers. OCCT source files relating to STEP reader and ExprIntrp functionality are generated automatically with Flex/Bison. Checking this option leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files |
| BUILD_SAMPLES_MFC | Boolean flag | Indicates whether MFC samples should be built together with OCCT. This option is only relevant to Windows platforms |
| BUILD_SAMPLES_QT | Boolean flag | Indicates whether QT samples should be built together with OCCT. |
| BUILD_Inspector | Boolean flag | Indicates whether Inspector should be built together with OCCT. |
| BUILD_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
| BUILD_PATCH | Path | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
| BUILD_WITH_DEBUG | Boolean | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| BUILD_CPP_STANDARD | String | Employ corresponding c++ standard (C++11, C++14, ..C++23) for building OCCT |
| BUILD_WITH_DEBUG | Boolean flag | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean flag | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
| CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
| INSTALL_DIR_SCRIPT | Path | Relative path to the scripts installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}) |
| INSTALL_DIR_LIB | Path | Relative path to the libraries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_LIB}) |
| INSTALL_DIR_INCLUDE | Path | Relative path to the includes installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}) |
| INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
| INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |
| INSTALL_DIR_SCRIPT | Path | Relative path to the scripts installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}) |
| INSTALL_DIR_LIB | Path | Relative path to the libraries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_LIB}) |
| INSTALL_DIR_INCLUDE | Path | Relative path to the includes installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}) |
| INSTALL_DIR_RESOURCE | Path | Relative path to the resources installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}) |
| INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables |
| INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) |
| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) |
| INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) |
| INSTALL_DIR_DOC | Path | Relative path to the documentation installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DOC}) |
| INSTALL_FREETYPE | Boolean | Indicates whether FreeType binaries should be installed into the installation directory |
| INSTALL_FREEIMAGE | Boolean | Indicates whether FreeImage binaries should be installed into the installation directory |
| INSTALL_TBB | Boolean | Indicates whether TBB binaries should be installed into the installation directory |
| INSTALL_VTK | Boolean | Indicates whether VTK binaries should be installed into the installation directory |
| INSTALL_TCL | Boolean | Indicates whether TCL binaries should be installed into the installation directory |
| INSTALL_TEST_CASES | Boolean | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_DOC_Overview | Boolean | Indicates whether OCCT overview documentation should be installed into the installation directory |
| INSTALL_DIR_LAYOUT | String | Defines the structure of OCCT files (binaries, resources, headers, etc.) for the install directory. Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout). If needed, the layout can be customized with INSTALL_DIR_* variables |
| INSTALL_DIR_DATA | Path | Relative path to the data files installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DATA}) |
| INSTALL_DIR_SAMPLES | Path | Relative path to the samples installation directory. Note that only "samples/tcl" folder will be installed. (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}) |
| INSTALL_DIR_TESTS | Path | Relative path to the tests installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_TESTS}) |
| INSTALL_DIR_DOC | Path | Relative path to the documentation installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_DOC}) |
| INSTALL_FREETYPE | Boolean flag | Indicates whether Freetype binaries should be installed into the installation directory |
| INSTALL_FREEIMAGE* | Boolean flag | Indicates whether Freeimage binaries should be installed into the installation directory |
| INSTALL_TBB | Boolean flag | Indicates whether TBB binaries should be installed into the installation directory |
| INSTALL_VTK | Boolean flag | Indicates whether VTK binaries should be installed into the installation directory |
| INSTALL_TCL | Boolean flag | Indicates whether TCL binaries should be installed into the installation directory |
| INSTALL_TEST_CASES | Boolean flag | Indicates whether non-regression OCCT test scripts should be installed into the installation directory |
| INSTALL_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation should be installed into the installation directory |
@note Only the forward slashes ("/") are acceptable in the CMake options defining paths.
**Note:** Only the forward slashes ("/") are acceptable in the CMake options defining paths.
@subsubsection build_cmake_3rdparty 3rd party search mechanism
If `3RDPARTY_DIR` directory is defined, then required 3rd party binaries are sought in it, and default system folders are ignored.
If *3RDPARTY_DIR* directory is defined, then required 3rd party binaries are sought in it, and default system folders are ignored.
The procedure expects to find binary and header files of each 3rd party product in its own sub-directory: *bin*, *lib* and *include*.
The results of the search (achieved on the next pass of the configuration process) are recorded in the corresponding variables:
* `3RDPARTY_<PRODUCT>_DIR` -- path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>);
* `3RDPARTY_<PRODUCT>_LIBRARY_DIR` -- path to the directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>);
* `3RDPARTY_<PRODUCT>_INCLUDE_DIR` -- path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>);
* `3RDPARTY_<PRODUCT>_DLL_DIR` -- path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms.
* *3RDPARTY_\<PRODUCT\>_DIR* -- path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>)
* *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR* -- path to the directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>).
* *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* -- path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>)
* *3RDPARTY_\<PRODUCT\>_DLL_DIR* -- path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is only relevant to Windows platforms.
@note Each library and include directory should be children of the product directory if the last one is defined.
Note: each library and include directory should be children of the product directory if the last one is defined.
The search process is as follows:
1. Common path: `3RDPARTY_DIR`
2. Path to a particular 3rd-party library: `3RDPARTY_<PRODUCT>_DIR`
1. Common path: *3RDPARTY_DIR*
2. Path to a particular 3rd-party library: *3RDPARTY_\<PRODUCT\>_DIR*
3. Paths to headers and binaries:
1. `3RDPARTY_<PRODUCT>_INCLUDE_DIR`
2. `3RDPARTY_<PRODUCT>_LIBRARY_DIR`
3. `3RDPARTY_<PRODUCT>_DLL_DIR`
1. *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR*
2. *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR*
3. *3RDPARTY_\<PRODUCT\>_DLL_DIR*
If a variable of any level is not defined (empty or `<variable name>-NOTFOUND`) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step.
If the search process at level 3 does not find the required files, it seeks in default places.
If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>) and the upper level variable is defined, the content of the non-defined variable will be sought at the next configuration step. If the search process at level 3 does not find the required files, it seeks in default places.
If a search result (include path, or library path, or dll path) does not meet your expectations, you can change `3RDPARTY_<PRODUCT>_*_DIR` variable,
clear (if they are not empty) `3RDPARTY_<PRODUCT>_DLL_DIR`, `3RDPARTY_<PRODUCT>_INCLUDE_DIR` and `3RDPARTY_<PRODUCT>_LIBRARY_DIR` variables (or clear one of them) and run the configuration process again.
If a search result (include path, or library path, or dll path) does not meet your expectations, you can change *3RDPARTY_\<PRODUCT\>_*_DIR variable*, clear (if they are not empty) *3RDPARTY_\<PRODUCT\>_DLL_DIR, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* and 3RDPARTY_\<PRODUCT\>_LIBRARY_DIR variables (or clear one of them) and run the configuration process again.
At this time the search will be performed in the newly identified directory and the result will be recorded to corresponding variables (replace old value if it is necessary).
For example, `3RDPARTY_FREETYPE_DIR` variable
At this time the search will be performed in the newly identified directory
and the result will be recorded to corresponding variables (replace old value if it is necessary).
For example, *3RDPARTY_FREETYPE_DIR* variable
d:/3rdparty/freetype-2.4.10
can be changed to
can be changed to
d:/3rdparty/freetype-2.5.3
During the configuration process the related variables (`3RDPARTY_FREETYPE_DLL_DIR`, `3RDPARTY_FREETYPE_INCLUDE_DIR` and `3RDPARTY_FREETYPE_LIBRARY_DIR`) will be filled with new found values.
During the configuration process the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values.
@note The names of searched libraries and header files are hard-coded.
If there is the need to change their names, change appropriate CMake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration:
`3RDPARTY_<PRODUCT>_INCLUDE` for include, `3RDPARTY_<PRODUCT>_LIB` for library and `3RDPARTY_<PRODUCT>_DLL` for shared library.
**Note**: The names of searched libraries and header files are hard-coded. If there is the need to change their names, change appropriate cmake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration: *3RDPARTY_\<PRODUCT\>_INCLUDE* for include, *3RDPARTY_\<PRODUCT\>_LIB* for library and *3RDPARTY_\<PRODUCT\>_DLL* for shared library.
@subsection build_cmake_gen Projects generation
@subsubsection build_cmake_gen Projects generation
Once the configuration process is done, the "Generate" button is used to prepare project files for the target IDE.
In our exercise the Visual Studio solution will be automatically created in the build directory.
Once the configuration process is done, the "Generate" button is used to prepare project files for the target IDE. In our exercise the Visual Studio solution will be automatically created in the buid directory.
@subsection build_cmake_build Building
@subsubsection build_cmake_build Building
Go to the build folder, start the Visual Studio solution *OCCT.sln* and build it by clicking **Build -> Build Solution**.
@figure{/build/build_occt/images/cmake_image004.png}
By default, the build solution process skips the building of the INSTALL and Overview projects.
By default the build solution process skips the building of the INSTALL and Overview project.
When the building process is finished build:
* *Overview* project to generate OCCT overview documentation (if `BUILD_DOC_Overview` variable is checked)
* the *INSTALL* project to run the **installation process**
* Overview project to generate OCCT overview documentation (if BUILD_DOC_Overview variable is checked)
* the *INSTALL* project to run **the installation process**
For this, right-click on the *Overview/INSTALL* project and select **Project Only -> Build Only** -> *Overview/INSTALL* in the solution explorer.
For this, right-click on the *Overview/INSTALL* project and select **Project Only -> Build Only** -> *Overview/INSTALL* in the solution explorer.
@subsection build_cmake_install Installation
@subsubsection build_cmake_install Installation
Installation is a process of extracting redistributable resources (binaries, include files etc) from the build directory into the installation one.
The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Installation is a process of extracting redistributable resources (binaries, include files etc) from the build directory into the installation one. The installation directory will be free of project files, intermediate object files and any other information related to the build routines.
Normally you use the installation directory of OCCT to link against your specific application.
Normally you use the installation directory of OCCT to link against your specific application.
The directory structure is as follows:
data -- data files for OCCT (brep, iges, stp)
doc -- OCCT overview documentation in HTML format
inc -- header files
samples -- samples
src -- all required source files for OCCT
tests -- OCCT test suite
win32\vc10\bind -- binary files (installed 3rdparties and occt)
\libd -- libraries (installed 3rdparties and occt)
data - data files for OCCT (brep, iges, stp)
doc - OCCT overview documentation in HTML format
inc - header files
samples - samples
src - all required source files for OCCT
tests - OCCT test suite
win32\vc10\bind - binary files (installed 3rdparties and occt)
\libd - libraries (installed 3rdparties and occt)
@note The above example is given for debug configuration.
However, it is generally safe to use the same installation directory for the release build.
In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration.
In particular, the binaries directory win64 will be expanded as follows:
**Note:** The above example is given for debug configuration. However, it is generally safe to use the same installation directory for the release build. In the latter case the contents of install directory will be enriched with subdirectories and files related to the release configuration. In particular, the binaries directory win64 will be expanded as
follows:
\win32\vc10\bind
\libd
\bin
\lib
If CMake installation flags are enabled for the 3rd party products (e.g. `INSTALL_FREETYPE`), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT.
Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories).
If CMake installation flags are enabled for the 3rd party products (e.g. INSTALL_FREETYPE), then the corresponding binaries will be copied to the same bin(d) and lib(d) directories together with the native binaries of OCCT. Such organization of libraries can be especially helpful if your OCCT-based software does not use itself the 3rd parties of Open CASCADE Technology (thus, there is no sense to pack them into dedicated directories).
The installation folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*), samples (if they were installed) and overview.html (short-cut for installed OCCT overview documentation).
@subsection build_occt_crossplatform_cmake Cross-compiling (Android)
@subsection build_occt_win_codeblocks Building with Code::Blocks
This section describes the steps to build OCCT libraries for Android from a complete source package with GNU make (makefiles).
The steps on Windows 7 and Ubuntu 15.10 are similar. There is the only one difference: makefiles are built with mingw32-make on Windows and native GNU make on Ubuntu.
This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using project files generated by OCCT legacy tool **genproj**.
It can be used as an alternative to CMake build system (see @ref build_occt_win_cmake) for all supported platforms.
Required tools (download and install if it is required):
- CMake 3.0+
- [Cross-compilation toolchain for CMake](https://github.com/taka-no-me/android-cmake)
- [Android NDK r12+](https://developer.android.com/ndk/downloads)
- GNU Make: MinGW v4.82+ for [Windows](https://www.mingw-w64.org/), GNU Make 4.0 for Ubuntu.
@subsubsection build_codeblocks_3rdparty Third-party libraries
Run GUI tool provided by CMake and:
- Specify the root folder of OCCT (`$CASROOT`, which contains *CMakelists.txt* file) by clicking **Browse Source**.
- Specify the location (build folder) for CMake generated project files by clicking **Browse Build**.
Before building OCCT, make sure to have all the needed third-party libraries installed, see @ref build_upgrade.
@figure{/build/build_occt/images/android_image001.png}
@subsubsection build_codeblocks_conf Configuration
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling", and click "Next".
@figure{/build/build_occt/images/android_image002.png}
Before building it is necessary to set up build environment.
- Specify a toolchain file at the next dialog to `android.toolchain.cmake`, and click "Finish".
@figure{/build/build_occt/images/android_image003.png}
The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited directly:
If `ANDROID_NDK` environment variable is not defined in current OS, add cache entry `ANDROID_NDK` (entry type is `PATH`) -- path to the NDK folder ("Add Entry" button):
@figure{/build/build_occt/images/android_image004.png}
If on Windows the message is appeared:
"CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles" CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.",
specify `CMAKE_MAKE_PROGRAM` to mingw32-make executable.
@figure{/build/build_occt/images/android_image005.png}
How to configure OCCT, see @ref build_cmake_conf "Configure" section taking into account the specific configuration variables for Android:
- `ANDROID_ABI` = `armeabi-v7a`
- `ANDROID_NATIVE_API_LEVEL` = `15`
- `ANDROID_NDK_LAYOUT` is equal to `CMAKE_BUILD_TYPE` variable
- `BUILD_MODULE_Draw` = `OFF`
@figure{/build/build_occt/images/android_image006.png}
Click **Generate** button and wait until the generation process is finished.
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process:
> mingw32-make
or
> make
Parallel building can be started with using `-jN` argument of "mingw32-make/make", where `N` is the number of building threads:
> mingw32-make -j4
or
> make -j4
Type "mingw32-make/make" with argument "install" to place the libraries to the install folder:
> mingw32-make install
or
> make install
@section build_occt_genproj Building with Genproj tool
**genproj** is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code::Blocks, Qt Creator (qmake), and XCode project files for building Open CASCADE Technology.
These project files are placed inside OCCT directory (in *adm* subfolder) and use relative paths, thus can be moved together with sources.
The project files included in official distribution of OCCT are generated by this tool.
@note If you have official distribution with project files included, you can use them directly without a need to call **genproj**.
**genproj** is a less flexible alternative to use of CMake build system (see @ref build_occt_win_cmake), but still has some small features useful for OCCT development.
@subsection build_genproj Configuration process
The environment is defined in the file *custom.sh* (on Linux and macOS) or *custom.bat* (on Windows) which can be edited directly:
* `ARCH` -- architecture (32 or 64), affects only `PATH` variable for execution
* `HAVE_*` -- flags to enable or disable use of optional third-party products
* `CSF_OPT_*` -- paths to search for includes and binaries of all used third-party products
* `SHORTCUT_HEADERS` -- defines method for population of folder *inc* by header files. Supported methods are:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC*.
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* *HardLink* - hard links to headers located in *src* will be created.
* `VCVER` -- specification of format of project files, defining also version of Visual Studio to be used, and default name of the sub-folder for binaries:
* Add paths to includes of used third-party libraries in variable `CSF_OPT_INC`.
* Add paths to their binary libraries in variable `CSF_OPT_LIB64`.
* For optional third-party libraries, set corresponding environment variable `HAVE_<LIBRARY_NAME>` to either *false*, e.g. `export HAVE_FREEIMAGE=false`.
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~~
export HAVE_FREEIMAGE=false
~~~~~
Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure environment interactively:
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
@subsubsection build_codeblocks_gen Projects generation
Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files:
~~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj cbp
~~~~~
The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
@subsubsection build_codeblocks_build Building
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~~
./draw.sh cbp [d]
~~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@subsection build_occt_genproj Building with Genproj tool
This page describes steps to build OCCT libraries from a complete source archive on Windows with <b>MS Visual C++</b> using projects generated by **genproj** tool.
It is an alternative to use of CMake build system (see @ref build_occt_win_cmake).
**genproj** is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code.Blocks, and XCode project files used for building Open CASCADE Technology.
These project files are placed inside OCCT directory (in *adm* subfolder) and use relative paths, thus can be moved together with sources.
The project files included in official distribution of OCCT are generated by this tool.
If you have official distribution with project files included, you can use them directly without a need to call **genproj**.
@subsubsection build_msvc_3rdparty Third-party libraries
Before building OCCT, make sure to have all the required third-party libraries installed.
The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to version of Visual Studio you are using, from https://opencascade.com/content/3rd-party-components.
You can also build third-party libraries from their sources, see @ref build_upgrade_building_3rdparty for instructions.
@subsubsection build_msvc_conf Configuration
If you have Visual Studio projects already available (pre-installed or generated), you can edit file *custom.bat* manually to adjust the environment:
* *VCVER* -- specification of format of project files, defining also version of Visual Studio to be used, and default name of the sub-folder for binaries:
| VCVER | Visual Studio version | Windows Platform | Binaries folder name |
|-----------|-----------------------|----------------------------------|----------------------|
@@ -325,87 +315,268 @@ The environment is defined in the file *custom.sh* (on Linux and macOS) or *cust
| vc141-uwp | 2017 (15) | UWP (Universal Windows Platform) | vc14-uwp |
| vc142 | 2019 (16) | Desktop (Windows API) | vc14 |
| vc142-uwp | 2019 (16) | UWP (Universal Windows Platform) | vc14-uwp |
| vc143 | 2022 (17) | Desktop (Windows API) | vc14 |
* *ARCH* -- architecture (32 or 64), affects only *PATH* variable for execution
* <i>HAVE_*</i> -- flags to enable or disable use of optional third-party products
* <i>CSF_OPT_*</i> -- paths to search for includes and binaries of all used third-party products
* *SHORTCUT_HEADERS* -- defines method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
Alternatively, you can launch **genconf**, a GUI tool allowing to configure build options interactively.
That tool will analyze your environment and propose you to choose available options:
* Type and version of project files to generate (from the list of installed ones, detected by presence of environment variables like `VS100COMNTOOLS` on Windows platform).
* Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like *VS100COMNTOOLS*).
* Method to populate folder *inc* (short-cuts by default).
* Location of third-party libraries (usually downloaded from OCCT web site, see above).
* Path to common directory where third-party libraries are located (optional).
* Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
* Generation of PDB files within Release build ("Release with Debug info", false by default).
Below are screenshots of **genconf** tool on various platforms (Windows and Linux):
@figure{/build/build_occt/images/genconf_windows.png}
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.bat* (Windows) or *custom.sh* (other systems) file.
@subsection build_genproj_generate Projects generation
Click "Save" to store the specified configuration in *custom.bat* file.
@subsubsection build_msvc_generate Projects generation
Launch **genproj** to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by `PATH`.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
If Tcl is not found, the tool may prompt you to enter the path to directory where Tcl can be found.
~~~~
~~~~~
$ genproj.bat
~~~~
~~~~~
Note that if *custom.bat* is not present, **genproj** will start **genconf** to configure environment.
@subsection build_genproj_build Building
@subsubsection build_msvc_build Visual Studio
@subsubsection build_msvc_build Building
Launch *msvc.bat* to start Visual Studio with all necessary environment variables defined, and build the whole solution or required toolkits.
The MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
Note: the MSVC project files are located in folders <i>adm\\msvc\\vc...</i>.
Binaries are produced in *win32* or *win64* folders.
To start DRAW, launch *draw.bat*.
@subsubsection build_codeblocks_build Code::Blocks
@section build_occt_linux Linux
Code::Blocks is a cross-platform IDE which can be used for building OCCT on Linux, macOS and Windows platforms.
The generated Code::Blocks project could be found within subfolder *adm/&lt;OS&gt;/cbp*.
You may choose one of the following ways to generate, configure and build OCCT sources on Linux just keeping in mind
this platform specific:
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
* @ref build_occt_win_cmake "Configuration, generation and building OCCT on Windows using CMake tool"
* @ref build_occt_code_blocks "Building on Mac OS X with Code::Blocks IDE"
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~
./draw.sh cbp [d]
~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@section build_occt_crossplatform_cmake Android (cross-compiling)
@subsubsection build_occt_macos_xcode XCode
This article describes the steps to build OCCT libraries for Android from a complete source package
with GNU make (makefiles). The steps on Windows 7 and Ubuntu 15.10 are similar. There is the only one difference:
makefiles are built with mingw32-make
on Windows and native GNU make on Ubuntu.
XCode is an IDE for development on macOS platform and targeting macOS and iOS platforms.
**genproj** tool comes with a legacy XCode project files generator, but CMake is a preferred way for building OCCT on macOS platform.
Required tools (download and install if it is required):
- CMake v3.0+ http://www.cmake.org/cmake/resources/software.html
- Cross-compilation toolchain for CMake https://github.com/taka-no-me/android-cmake
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
- GNU Make: MinGW v4.82+ for Windows (http://sourceforge.net/projects/mingw/files/), GNU Make 4.0 for Ubuntu.
To start **XCode**, launch script *xcode.sh*.
To build a certain toolkit, select it in **Scheme** drop-down list in XCode toolbar, press **Product** in the menu and click **Build** button.
Run GUI tool provided by CMake.
@subsection build_occt_crossplatform_cmake_config Configuration
**Configure Tools**
- Specify the root folder of OCCT (<i>$CASROOT</i>, which contains *CMakelists.txt* file) by clicking **Browse Source**.
- Specify the location (build folder) for Cmake generated project files by clicking **Browse Build**.
@figure{/build/build_occt/images/android_image001.png}
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project.
Select "MinGW MakeFiles" item from the list
- Choose "Specify toolchain file for cross-compiling"
- Click "Next"
@figure{/build/build_occt/images/android_image002.png}
- Specify a toolchain file at the next dialog by android.toolchain.cmake . It is contained by cross-compilation
toolchain for CMake
- Click "Finish"
@figure{/build/build_occt/images/android_image003.png}
If ANDROID_NDK environment variable is not defined in current OS, add cache entry ANDROID_NDK (entry type is PATH) --
path to the NDK folder ("Add Entry" button)
@figure{/build/build_occt/images/android_image004.png}
If on Windows the message is appeared: "CMake Error: CMake was unable to find a build program corresponding
to "MinGW Makefiles"
CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.",
specify **CMAKE_MAKE_PROGRAM** to mingw32-make executable.
@figure{/build/build_occt/images/android_image005.png}
**Configure OCCT**
How to configure OCCT, see "OCCT Configuration" section of @ref build_occt_win_cmake
"Configure, Generate, Build using CMake tool" taking into account the specific configuration variables for android:
- ANDROID_ABI = armeabi-v7a
- ANDROID_NATIVE_API_LEVEL = 15
- ANDROID_NDK_LAYOUT is equal to CMAKE_BUILD_TYPE variable
- **BUILD_MODULE_Draw = OFF**
@figure{/build/build_occt/images/android_image006.png}
@subsection build_occt_crossplatform_cmake_generation Generate Makefiles
Click **Generate** button and wait until the generation process is finished.
Then makefiles will appear in the build folder (e.g. <i> D:/tmp/occt-android </i>).
@subsection build_occt_crossplatform_cmake_building Build Makefiles
Open console and go to the build folder. Type "mingw32-make" (Windows) or "make" (Ubuntu) to start build process.
> mingw32-make
or
> make
Parallel building can be started with using **"-jN"** argument of "mingw32-make/make", where N is the number of
building threads.
> mingw32-make -j4
or
> make -j4
@subsection build_occt_crossplatform_cmake_install Install OCCT Libraries
Type "mingw32-make/make" with argument "install" to place the libraries to the install folder
> mingw32-make install
or
> make install
@section build_occt_macos Mac OS X
@subsection build_occt_macos_xcode Building with Xcode
This file describes steps to build OCCT libraries from sources on Mac OS X with **Xcode** projects, generated by OCCT legacy tool **genproj**.
<h2>Configuration</h2>
Before building it is necessary to set up build environment.
The environment is defined in the file *custom.sh* which can be edited directly:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC* (use colon ":" as path separator).
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~~
export HAVE_GL2PS=false
~~~~~
Alternatively, or when *custom.sh* does not exist, you can launch *genconf.sh* to configure environment interactively:
@figure{/build/build_occt/images/genconf_osx.png}
Click "Save" to store the specified configuration in *custom.sh* file.
<h2>Projects generation</h2>
Launch **genproj** tool to update content of *inc* folder and generate project files after changes in OCCT code affecting layout or composition of source files.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
For instance, in Terminal application:
~~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj
~~~~~
<h2>Building</h2>
To start **Xcode**, launch script *xcode.sh*.
To build a certain toolkit, select it in **Scheme** drop-down list in Xcode toolbar, press **Product** in the menu and click **Build** button.
To build the entire OCCT:
* Create a new empty project (select **File -> New -> Project -> Empty project** in the menu; input the project name, e.g. *OCCT*; then click **Next** and **Create**).
* Drag and drop the *OCCT* folder in the created *OCCT* project in the Project navigator.
* Select **File -> New -> Target -> Aggregate** in the menu.
* Enter the project name (e.g. *OCCT*) and click **Finish**. The **Build Phases** tab will open.
* Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing **Command+A** combination.
* Enter the project name (e.g. *OCCT*) and click **Finish**. The **Build Phases** tab will open.
* Click "+" button to add the necessary toolkits to the target project. It is possible to select all toolkits by pressing **Command+A** combination.
To start *DRAWEXE*, which has been built with XCode on Mac OS X, perform the following steps:
<h2>Launching DRAW</h2>
To start *DRAWEXE*, which has been built with Xcode on Mac OS X, perform the following steps:
1.Open Terminal application
2.Enter `<OCCT_ROOT_DIR>`:
~~~~
2.Enter <i>\<OCCT_ROOT_DIR\></i>:
~~~~~
cd \<OCCT_ROOT_DIR\>
~~~~
~~~~~
3.Run the script
~~~~
./draw.sh xcd [d]
~~~~
~~~~~
./draw_cbp.sh xcd [d]
~~~~~
Option *d* is used if OCCT has been built in **Debug** mode.
@subsection build_occt_code_blocks Building with Code::Blocks
This file describes steps to build OCCT libraries from sources using **Code::Blocks**, a cross-platform IDE, using
project files generated by OCCT legacy tool **genproj**.
<h2>Configure</h2>
Before building it is necessary to set up build environment.
The environment is defined in the file *custom.sh* (on Linux and OS X) or *custom.bat* (on Windows) which can be edited
directly:
* Add paths to includes of used third-party libraries in variable *CSF_OPT_INC*.
* Add paths to their binary libraries in variable *CSF_OPT_LIB64*.
* Set variable *SHORTCUT_HEADERS* to specify a method for population of folder *inc* by header files. Supported methods are:
* *Copy* - headers will be copied from *src*;
* *ShortCut* - short-cut header files will be created, redirecting to same-named header located in *src*;
* "HardLink* - hard links to headers located in *src* will be created.
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
~~~~~
export HAVE_GL2PS=false
~~~~~
Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure
environment interactively:
@figure{/build/build_occt/images/genconf_linux.png}
Click "Save" to store the specified configuration in *custom.sh* or *custom.bat* file.
<h2>Generate Projects</h2>
Launch **genproj** tool with option *cbp* to update content of *inc* folder and generate project files after changes in
OCCT code affecting layout or composition of source files:
~~~~~
$ cd /dev/OCCT/opencascade-7.0.0
$ ./genproj cbp
~~~~~
The generated Code::Blocks project are placed into subfolder *adm/&lt;OS&gt;/cbp*.
@note To use **genproj** and **genconf** tools you need to have Tcl installed and accessible by PATH.
<h2>Build</h2>
To start **Code::Blocks**, launch script *codeblocks.sh*.
To build all toolkits, click **Build->Build workspace** in the menu bar.
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
~~~~~
./draw_cbp.sh cbp [d]
~~~~~
Option *d* is used if OCCT has been built in **Debug** mode.

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

View File

@@ -1,7 +1,7 @@
Build, Debug and Upgrade {#build_upgrade}
=================
This chapter contains the detailed information about building, debugging and upgrade procedures:
This chapter contains the detailed infomation about building, debugging and upgrade procedures:
* @subpage build_upgrade__building_occt
* @subpage build_upgrade_building_3rdparty

View File

@@ -48,11 +48,11 @@ For example, method *GetCoord* returns a triple of real values and is defined fo
Camel Case style is preferred for names.
For example:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer awidthofbox; // this is bad
Standard_Integer width_of_box; // this is bad
Standard_Integer aWidthOfBox; // this is OK
~~~~
~~~~~
@subsection occt_coding_rules_2_2 Names of development units
@@ -80,9 +80,9 @@ Toolkit names are prefixed by *TK*, followed by a meaningful part of the name ex
Names of public classes and other types (structures, enums, typedefs) should match the common pattern: name of the package followed by underscore and suffix (the own name of the type):
~~~~{.cpp}
~~~~~
<package-name>_<class-name>
~~~~
~~~~~
Static methods related to the whole package are defined in the class with the same name as package (without suffix).
@@ -95,9 +95,9 @@ This rule also applies to complex types constructed by instantiation of template
Such types should be given own names using *typedef* statement, located in same-named header file.
For example, see definition in the file *TColStd_IndexedDataMapOfStringString.hxx*:
~~~~{.cpp}
~~~~~
typedef NCollection_IndexedDataMap<TCollection_AsciiString,TCollection_AsciiString,TCollection_AsciiString> TColStd_IndexedDataMapOfStringString;
~~~~
~~~~~
### Names of functions
@@ -109,7 +109,7 @@ The term **function** here is defined as:
It is preferred to start names of public methods from an upper case character and to start names of protected and private methods from a lower case character.
~~~~{.cpp}
~~~~~{.cpp}
class MyPackage_MyClass
{
@@ -123,7 +123,7 @@ private:
void setIntegerValue (const Standard_Integer theValue);
};
~~~~
~~~~~
@subsection occt_coding_rules_2_3 Names of variables
@@ -137,13 +137,13 @@ The name of a variable should not start with an underscore.
See the following examples:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer Elapsed_Time = 0; // this is bad - possible class name
Standard_Integer gp = 0; // this is bad - existing package name
Standard_Integer aGp = 0; // this is OK
Standard_Integer _KERNEL = 0; // this is bad
Standard_Integer THE_KERNEL = 0; // this is OK
~~~~
~~~~~
### Names of function parameters
@@ -151,11 +151,11 @@ The name of a function (procedure, class method) parameter should start with pre
See the following examples:
~~~~{.cpp}
~~~~~{.cpp}
void Package_MyClass::MyFunction (const gp_Pnt& p); // this is bad
void Package_MyClass::MyFunction (const gp_Pnt& theP); // this is OK
void Package_MyClass::MyFunction (const gp_Pnt& thePoint); // this is preferred
~~~~
~~~~~
### Names of class member variables
@@ -163,11 +163,11 @@ The name of a class member variable should start with prefix *my* followed by th
See the following examples:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer counter; // This is bad
Standard_Integer myC; // This is OK
Standard_Integer myCounter; // This is preferred
~~~~
~~~~~
### Names of global variables
@@ -176,18 +176,18 @@ However, as soon as a global variable is necessary, its name should be prefixed
See the following examples:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer MyPackage_myGlobalVariable = 0;
Standard_Integer MyPackage_MyClass_myGlobalVariable = 0;
~~~~
~~~~~
Static constants within the file should be written in upper-case and begin with prefix *THE_*:
~~~~{.cpp}
~~~~~{.cpp}
namespace
{
static const Standard_Real THE_CONSTANT_COEF = 3.14;
};
~~~~
~~~~~
### Names of local variables
@@ -197,12 +197,12 @@ It is preferred to prefix local variable names with *a* and *an* (or *is*, *to*
See the following example:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer theI; // this is bad
Standard_Integer i; // this is bad
Standard_Integer index; // this is bad
Standard_Integer anIndex; // this is OK
~~~~
~~~~~
### Avoid dummy names
Avoid dummy names, such as <i>i, j, k</i>. Such names are meaningless and easy to mix up.
@@ -211,7 +211,7 @@ The code becomes more and more complicated when such dummy names are used there
See the following examples for preferred style:
~~~~{.cpp}
~~~~~{.cpp}
void Average (const Standard_Real** theArray,
Standard_Integer theRowsNb,
Standard_Integer theRowLen,
@@ -227,7 +227,7 @@ void Average (const Standard_Real** theArray,
theResult /= Standard_Real(aRowsNb * aRowLen);
}
}
~~~~
~~~~~
@section occt_coding_rules_3 Formatting rules
@@ -262,7 +262,7 @@ Punctuation rules follow the rules of the English language.
* For better readability it is also recommended to surround conventional operators by a space character.
Examples:
~~~~{.cpp}
~~~~~{.cpp}
while (true) // NOT: while( true ) ...
{
DoSomething (theA, theB, theC, theD); // NOT: DoSomething(theA,theB,theC,theD);
@@ -271,7 +271,7 @@ for (anIter = 0; anIter < 10; ++anIter) // NOT: for (anIter=0;anIter<10;++anIter
{
theA = (theB + theC) * theD; // NOT: theA=(theB+theC)*theD
}
~~~~
~~~~~
### Declaration of pointers and references
@@ -281,7 +281,7 @@ Since declaration of several variables with mixed pointer types contrudicts this
Examples:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer *theVariable; // not recommended
Standard_Integer * theVariable; // not recommended
Standard_Integer* theVariable; // this is OK
@@ -295,7 +295,7 @@ Standard_Integer ** theVariable; // not recommended
Standard_Integer** theVariable; // this is OK
Standard_Integer *theA, theB, **theC; // not recommended (declare each variable independently)
~~~~
~~~~~
### Separate logical blocks
@@ -303,7 +303,7 @@ Separate logical blocks of code with one blank line and comments.
See the following example:
~~~~{.cpp}
~~~~~{.cpp}
// check arguments
Standard_Integer anArgsNb = argCount();
if (anArgsNb < 3 || isSmthInvalid)
@@ -318,7 +318,7 @@ if (anArgsNb < 3 || isSmthInvalid)
// do our job
...
...
~~~~
~~~~~
Notice that multiple blank lines should be avoided.
@@ -329,7 +329,7 @@ Each descriptive block should contain at least a function name and purpose descr
See the following example:
~~~~{.cpp}
~~~~~{.cpp}
// =======================================================================
// function : TellMeSmthGood
// purpose : Gives me good news
@@ -347,19 +347,19 @@ void TellMeSmthBad()
{
...
}
~~~~
~~~~~
### Block layout [MANDATORY]
Figure brackets <i>{ }</i> and each operator <i>(for, if, else, try, catch)</i> should be written on a dedicated line.
In general, the layout should be as follows:
~~~~{.cpp}
~~~~~{.cpp}
while (expression)
{
...
}
~~~~
~~~~~
Entering a block increases and leaving a block decreases the indentation by one tabulation.
@@ -367,7 +367,7 @@ Entering a block increases and leaving a block decreases the indentation by one
Single-line conditional operators <i>(if, while, for,</i> etc.) can be written without brackets on the following line.
~~~~{.cpp}
~~~~~{.cpp}
if (!myIsInit) return Standard_False; // bad
if (thePtr == NULL) // OK
@@ -377,7 +377,7 @@ if (!theAlgo.IsNull()) // preferred
{
DoSomething();
}
~~~~
~~~~~
Having all code in the same line is less convenient for debugging.
@@ -386,7 +386,7 @@ Having all code in the same line is less convenient for debugging.
In comparisons, put the variable (in the current context) on the left side and constant on the right side of expression.
That is, the so called "Yoda style" is to be avoided.
~~~~{.cpp}
~~~~~{.cpp}
if (NULL != thePointer) // Yoda style, not recommended
if (thePointer != NULL) // OK
@@ -398,13 +398,13 @@ if (anIter <= theNbValues) // OK
if (THE_LIMIT == theValue) // bad style (global constant vs. variable)
if (theValue == THE_LIMIT) // OK
~~~~
~~~~~
### Alignment
Use alignment wherever it enhances the readability. See the following example:
~~~~{.cpp}
~~~~~{.cpp}
MyPackage_MyClass anObject;
Standard_Real aMinimum = 0.0;
Standard_Integer aVal = theVal;
@@ -415,7 +415,7 @@ switch (aVal)
case 3:
default: computeSomethingElseYet(); break;
}
~~~~
~~~~~
### Indentation of comments
@@ -425,7 +425,7 @@ The text of the comment should be separated from the slash character by a single
See the following example:
~~~~{.cpp}
~~~~~{.cpp}
while (expression) //bad comment
{
// this is a long multi-line comment
@@ -433,7 +433,7 @@ while (expression) //bad comment
DoSomething(); // maybe, enough
DoSomethingMore(); // again
}
~~~~
~~~~~
### Early return statement
@@ -441,7 +441,7 @@ Use an early return condition rather than collect indentations.
Write like this:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer ComputeSumm (const Standard_Integer* theArray,
const Standard_Size theSize)
{
@@ -454,11 +454,11 @@ Standard_Integer ComputeSumm (const Standard_Integer* theArray,
... computing summ ...
return aSumm;
}
~~~~
~~~~~
Rather than:
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer ComputeSumm (const Standard_Integer* theArray,
const Standard_Size theSize)
{
@@ -469,7 +469,7 @@ Standard_Integer ComputeSumm (const Standard_Integer* theArray,
}
return aSumm;
}
~~~~
~~~~~
This helps to improve readability and reduce the unnecessary indentation depth.
@@ -490,7 +490,7 @@ An exception to the rule is ordering system headers generating a macros declarat
The source or header file should include only minimal set of headers necessary for compilation, without duplicates (considering nested includes).
~~~~{.cpp}
~~~~~{.cpp}
// the header file of implemented class
#include <PackageName_ClassName.hxx>
@@ -506,7 +506,7 @@ The source or header file should include only minimal set of headers necessary f
// system headers
#include <iostream>
#include <windows.h>
~~~~
~~~~~
@section occt_coding_rules_4 Documentation rules
@@ -623,7 +623,7 @@ A class with virtual function(s) ought to have a virtual destructor.
Declaration of overriding method should contains specifiers "virtual" and "override"
(using Standard_OVERRIDE alias for compatibility with old compilers).
~~~~{.cpp}
~~~~~{.cpp}
class MyPackage_BaseClass
{
@@ -641,7 +641,7 @@ public:
Standard_EXPORT virtual Standard_Boolean Perform() Standard_OVERRIDE;
};
~~~~
~~~~~
This makes class definition more clear (virtual methods become highlighted).
@@ -667,20 +667,20 @@ Avoid *goto* statement unless it is really needed.
Declare a cycle variable in the header of the *for()* statement if not used out of cycle.
~~~~{.cpp}
~~~~~{.cpp}
Standard_Real aMinDist = Precision::Infinite();
for (NCollection_Sequence<gp_Pnt>::Iterator aPntIter (theSequence);
aPntIter.More(); aPntIter.Next())
{
aMinDist = Min (aMinDist, theOrigin.Distance (aPntIter.Value()));
}
~~~~
~~~~~
### Condition statements within zero
Avoid usage of C-style comparison for non-boolean variables:
~~~~{.cpp}
~~~~~{.cpp}
void Function (Standard_Integer theValue,
Standard_Real* thePointer)
{
@@ -699,7 +699,7 @@ void Function (Standard_Integer theValue,
DoSome2();
}
}
~~~~
~~~~~
@section occt_coding_rules_7 Portability issues
@@ -791,11 +791,11 @@ In C++ use *new* and *delete* operators instead of *malloc()* and *free()*. Try
Use the same form of new and delete.
~~~~{.cpp}
~~~~~{.cpp}
aPtr1 = new TypeA[n]; ... ; delete[] aPtr1;
aPtr2 = new TypeB(); ... ; delete aPtr2;
aPtr3 = Standard::Allocate (4096); ... ; Standard::Free (aPtr3);
~~~~
~~~~~
### Methods managing dynamical allocation [MANDATORY]
@@ -805,10 +805,10 @@ Define a destructor, a copy constructor and an assignment operator for classes w
Every variable should be initialized.
~~~~{.cpp}
~~~~~{.cpp}
Standard_Integer aTmpVar1; // bad
Standard_Integer aTmpVar2 = 0; // OK
~~~~
~~~~~
Uninitialized variables might be kept only within performance-sensitive code blocks and only when their initialization is guaranteed by subsequent code.
@@ -824,12 +824,12 @@ In *operator=()* assign to all data members and check for assignment to self.
Don't check floats for equality or non-equality; check for GT, GE, LT or LE.
~~~~{.cpp}
~~~~~{.cpp}
if (Abs (theFloat1 - theFloat2) < theTolerance)
{
DoSome();
}
~~~~
~~~~~
Package *Precision* provides standard values for SI units and widely adopted by existing modeling algorithms:
@@ -872,7 +872,7 @@ Generally, try to reduce misaligned accesses since they impact the performance (
List class data members in the constructor's initialization list in the order they are declared.
~~~~{.cpp}
~~~~~{.cpp}
class MyPackage_MyClass
{
@@ -892,19 +892,19 @@ private:
Standard_Integer myPropertyB;
};
~~~~
~~~~~
### Initialization over assignment
Prefer initialization over assignment in class constructors.
~~~~{.cpp}
~~~~~{.cpp}
MyPackage_MyClass()
: myPropertyA (1) // preferred
{
myPropertyB = 2; // not recommended
}
~~~~
~~~~~
### Optimize caching
@@ -912,23 +912,23 @@ When programming procedures with extensive memory access, try to optimize them i
On x86 this code
~~~~{.cpp}
~~~~~{.cpp}
Standard_Real anArray[4096][2];
for (Standard_Integer anIter = 0; anIter < 4096; ++anIter)
{
anArray[anIter][0] = anArray[anIter][1];
}
~~~~
~~~~~
is more efficient then
~~~~{.cpp}
~~~~~{.cpp}
Standard_Real anArray[2][4096];
for (Standard_Integer anIter = 0; anIter < 4096; ++anIter)
{
anArray[0][anIter] = anArray[1][anIter];
}
~~~~
~~~~~
since linear access does not invalidate cache too often.
@@ -952,7 +952,7 @@ Command arguments should be validated before usage. The user should see a human-
Command should warn the user about unknown arguments, including cases when extra parameters have been pushed for the command with a fixed number of arguments.
~~~~{.cpp}
~~~~~{.cpp}
if (theArgsNb != 3)
{
std::cout << "Syntax error - wrong number of arguments!\n";
@@ -971,7 +971,7 @@ Command should warn the user about unknown arguments, including cases when extra
}
DBRep::Set (aResName, aFaceShape);
return 0;
~~~~
~~~~~
### Message printing
@@ -984,9 +984,9 @@ Information printed into Draw Interpreter should be well-structured to allow usa
Any command with a long list of obligatory parameters should be considered as ill-formed by design.
Optional parameters should start with flag name (with '-' prefix) and followed by its values:
~~~~{.php}
~~~~~{.tcl}
myCommand -flag1 value1 value2 -flag2 value3
~~~~
~~~~~
### Arguments parser
@@ -996,7 +996,7 @@ myCommand -flag1 value1 value2 -flag2 value3
Functions *Draw::Atof()* and *Draw::Atoi()* support expressions and read values in C-locale.
~~~~{.cpp}
~~~~~{.cpp}
Standard_Real aPosition[3] = {0.0, 0.0, 0.0};
for (Standard_Integer anArgIter = 1; anArgIter < theArgsNb; ++anArgIter)
{
@@ -1020,7 +1020,7 @@ Functions *Draw::Atof()* and *Draw::Atoi()* support expressions and read values
return 1;
}
}
~~~~
~~~~~
@section occt_coding_rules_11 Examples
@@ -1051,7 +1051,7 @@ private: //! \@name private fields
@endverbatim
~~~~{.cpp}
~~~~~
#include <Package_Class.hxx>
// ==========================================================
// function : Square
@@ -1071,11 +1071,11 @@ void Package_Class::increment()
{
++myCounter;
}
~~~~
~~~~~
### TCL script for Draw Harness
~~~~{.tcl}
~~~~~{.tcl}
# show fragments (solids) in shading with different colors
proc DisplayColored {theShape} {
set aSolids [uplevel #0 explode $theShape so]
@@ -1106,10 +1106,10 @@ vzbufftrihedron
DisplayColored c
vfit
vdump $imagedir/${casename}.png 512 512
~~~~
~~~~~
### GLSL program:
~~~~{.cpp}
~~~~~{.fs}
vec3 Ambient; //!< Ambient contribution of light sources
vec3 Diffuse; //!< Diffuse contribution of light sources
vec3 Specular; //!< Specular contribution of light sources
@@ -1149,4 +1149,4 @@ void main()
normalize (View),
Position);
}
~~~~
~~~~~

View File

@@ -1,7 +1,7 @@
Contribution {#contribution}
============
This chapter contains the detailed information about contribution procedure:
This chapter contains the detailed infomation about contribution procedure:
* @subpage occt_contribution__contribution_workflow
* @subpage occt_contribution__git_guide

View File

@@ -148,8 +148,7 @@ The changes should comply with the OCCT @ref occt_contribution__coding_rules "Co
It is especially important to comment the code properly so that other people can understand it easier.
The modification should be tested by running OCCT tests (on the platform and scope available to **Developer**) and ensuring absence of regressions.
In case if modification affects results of some existing test case and the new result is correct,
such test case should be updated to report OK (or BAD), as described in @ref testmanual_details_results "Automated Test System / Interpretation of Test Results".
In case if modification affects results of some existing test case and the new result is correct, such test case should be updated to report OK (or BAD), as descibed in @ref testmanual_details_results "Automated Test System / Interpretation of Test Results".
@subsubsection occt_contribution_workflow_fix_test Providing a test case

View File

@@ -152,11 +152,11 @@ The official repository contains:
Make sure to configure Git so that the user name is equal to your username
on the OCCT development portal, and set SafeCrLf option to true:
~~~~
~~~~~
> git config --global user.name "Your User Name"
> git config --global user.email your@mail.address
> git config --global your@mail.address
~~~~
~~~~~
@section occt_gitguide_3 Getting access to the repository
@@ -213,9 +213,9 @@ The official repository contains:
On Windows, you might need to start **Git Bash** command prompt window.
Use the following command to generate SSH keys:
~~~~
~~~~~
> ssh-keygen -t rsa -C "your@mail.address"
~~~~
~~~~~
The last argument is an optional comment, which can be included with the public key and used to distinguish between different keys (if you have many). The common practice is to put here your mail address or workstation name.
@@ -290,9 +290,9 @@ Click **Save** to input the key to the system.
* From command line by command:
~~~~
~~~~~
> git clone gitolite@git.dev.opencascade.org:occt <path>
~~~~
~~~~~
where <i>\<path\></i> is the path to the new folder which will be created for the repository.
@@ -314,9 +314,9 @@ Click **Save** to input the key to the system.
In the console:
~~~~
~~~~~
> git checkout -b CR12345 origin/master
~~~~
~~~~~
In TortoiseGit:
* Go to the local copy of the repository.
@@ -332,9 +332,9 @@ In TortoiseGit:
If you need to switch to another branch, use Git command checkout for that.
In the console:
~~~~
~~~~~
> git checkout CR12345
~~~~
~~~~~
In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Switch/Checkout**.
@@ -351,11 +351,11 @@ In TortoiseGit:
* In the console:
~~~~
~~~~~
> git diff
> git commit -a -m "Write meaningful commit message here"
~~~~
~~~~~
Option -a tells the command to automatically include (stage) files
that have been modified or deleted, but it will omit the new files that might have been added by you.
@@ -363,12 +363,12 @@ In TortoiseGit:
To find new unstaged files and them to commit, use commands:
~~~~
~~~~~
> git status -s
?? file1.hxx
?? file2.cxx
> git add file1.hxx file2.cxx
~~~~
~~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu <b>Git Commit -> CR…</b>:
@@ -384,9 +384,9 @@ In TortoiseGit:
* In the console:
~~~~
~~~~~
> git push "origin" CR12345:CR12345
~~~~
~~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu, TortoiseGit -> **Push**
@@ -410,9 +410,9 @@ Note that Git forbids pushing a branch if the corresponding remote branch alread
Use Git command *fetch* with option *prune* to get the update of all branches from the remote repository and to clean your local repository from the remote branches that have been deleted.
* In the console:
~~~~
~~~~~
> git fetch --prune
~~~~
~~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Fetch**. Check in **Prune** check-box.
@@ -423,9 +423,9 @@ Note that Git forbids pushing a branch if the corresponding remote branch alread
This operation is required in particular to update your local master branch when the remote master changes.
* In console:
~~~~
~~~~~
> git pull
~~~~
~~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Pull**.
@@ -436,9 +436,9 @@ Note that the local branches of your repository are the primary place, where you
Remove the local branches that you do not need any more. Note that you cannot delete the current branch. It means that you need to switch to another one (e.g. master) if the branch you are going to delete is the current one.
* In the console:
~~~~
~~~~~
> git branch -d CR12345
~~~~
~~~~~
* In TortoiseGit: right-click in the explorer window and select in the context menu **TortoiseGit** -> **Git Show Log**.

File diff suppressed because it is too large Load Diff

View File

@@ -49,34 +49,34 @@ Open CASCADE Test Harness or @ref occt_user_guides__test_harness "DRAW" provides
In some cases the objects to be inspected are available in DRAW as results of DRAW commands. In other cases, however, it is necessary to inspect intermediate objects created by the debugged algorithm. To support this, DRAW provides a set of commands allowing the developer to store intermediate objects directly from the debugger stopped at some point during the program execution (usually at a breakpoint).
~~~~{.php}
~~~~~
const char* Draw_Eval (const char *theCommandStr)
~~~~
~~~~~
Evaluates a DRAW command or script.
A command is passed as a string parameter.
~~~~{.php}
~~~~~
const char* DBRep_Set (const char* theNameStr, void* theShapePtr)
~~~~
~~~~~
Sets the specified shape as a value of DRAW interpreter variable with the given name.
- *theNameStr* -- the DRAW interpreter variable name to set.
- *theShapePtr* -- a pointer to *TopoDS_Shape* variable.
~~~~{.php}
~~~~~
const char* DBRep_SetComp (const char* theNameStr, void* theListPtr)
~~~~
~~~~~
Makes a compound from the specified list of shapes and sets it as a value of DRAW interpreter variable with the given name.
- *theNameStr* -- the DRAW interpreter variable name to set.
- *theListPtr* -- a pointer to *TopTools_ListOfShape* variable.
~~~~{.php}
~~~~~
const char* DrawTrSurf_Set (const char* theNameStr, void* theHandlePtr)
const char* DrawTrSurf_SetPnt (const char* theNameStr, void* thePntPtr)
const char* DrawTrSurf_SetPnt2d (const char* theNameStr, void* thePnt2dPtr)
~~~~
~~~~~
Sets the specified geometric object as a value of DRAW interpreter variable with the given name.
- *theNameStr* -- the DRAW interpreter variable name to set.
@@ -90,27 +90,27 @@ All these functions are defined in *TKDraw* toolkit and return a string indicati
The following functions are provided by *TKBRep* toolkit and can be used from debugger prompt:
~~~~{.php}
~~~~~
const char* BRepTools_Write (const char* theFileNameStr, void* theShapePtr)
~~~~
~~~~~
Saves the specified shape to a file with the given name.
- *theFileNameStr* -- the name of the file where the shape is saved.
- *theShapePtr* -- a pointer to *TopoDS_Shape* variable.
~~~~{.php}
~~~~~
const char* BRepTools_Dump (void* theShapePtr)
const char* BRepTools_DumpLoc (void* theShapePtr)
~~~~
~~~~~
Dumps shape or its location to cout.
- *theShapePtr* -- a pointer to *TopoDS_Shape* variable.
The following function is provided by *TKMesh* toolkit:
~~~~{.php}
~~~~~
const char* BRepMesh_Dump (void* theMeshHandlePtr, const char* theFileNameStr)
~~~~
~~~~~
Stores mesh produced in parametric space to BREP file.
- *theMeshHandlePtr* -- a pointer to *Handle(BRepMesh_DataStructureOfDelaun)* variable.
@@ -118,10 +118,10 @@ Stores mesh produced in parametric space to BREP file.
The following functions are provided by *TKTopTest* toolkit:
~~~~{.php}
~~~~~
const char* MeshTest_DrawLinks(const char* theNameStr, void* theFaceAttr)
const char* MeshTest_DrawTriangles(const char* theNameStr, void* theFaceAttr)
~~~~
~~~~~
Sets the edges or triangles from mesh data structure of type *Handle(BRepMesh_FaceAttribute)* as DRAW interpreter variables, assigning a unique name in the form "<theNameStr>_<index>" to each object.
- *theNameStr* -- the prefix to use in names of objects.
@@ -129,9 +129,9 @@ Sets the edges or triangles from mesh data structure of type *Handle(BRepMesh_Fa
The following additional function is provided by *TKGeomBase* toolkit:
~~~~{.php}
~~~~~
const char* GeomTools_Dump (void* theHandlePtr)
~~~~
~~~~~
Dump geometric object to cout.
- *theHandlePtr* -- a pointer to the geometric variable (<i>Handle</i> to *Geom_Geometry* or *Geom2d_Curve* or descendant) to be set.
@@ -174,7 +174,7 @@ It is implemented in 'vaspect' and 'boundingbox' commands.
Json output for Bnd_OBB (using command 'bounding v -obb -dumpJson'):
~~~~{.java}
~~~~~
"Bnd_OBB": {
"Center": {
"gp_XYZ": [1, 2, 3]
@@ -193,7 +193,7 @@ Json output for Bnd_OBB (using command 'bounding v -obb -dumpJson'):
"HDims[2]": 0,
"IsAABox": 1,
}
~~~~
~~~~~
@section occt_debug_vstudio Using Visual Studio debugger
@@ -206,18 +206,18 @@ When the execution is interrupted by a breakpoint, you can use this window to ca
For example, assume that you are debugging a function, where local variable *TopoDS_Edge* *anEdge1* is of interest.
The following set of commands in the Command window will save this edge to file *edge1.brep*, then put it to DRAW variable *e1* and show it maximized in the axonometric DRAW view:
~~~~{.php}
~~~~~
>? ({,,TKBRep.dll}BRepTools_Write)("d:/edge1.brep",(void*)&anEdge1)
0x04a2f234 "d:/edge1.brep"
>? ({,,TKDraw.dll}DBRep_Set)("e1",(void*)&anEdge1)
0x0369eba8 "e1"
>? ({,,TKDraw.dll}Draw_Eval)("donly e1; axo; fit")
0x029a48f0 ""
~~~~
~~~~~
For convenience it is possible to define aliases to commands in this window, for instance (here ">" is prompt provided by the command window; in the Immediate window this symbol should be entered manually):
~~~~{.php}
~~~~~
>alias deval ? ({,,TKDraw}Draw_Eval)
>alias dsetshape ? ({,,TKDraw}DBRep_Set)
>alias dsetcomp ? ({,,TKDraw}DBRep_SetComp)
@@ -229,18 +229,18 @@ For convenience it is possible to define aliases to commands in this window, for
>alias dumploc ? ({,,TKBRep}BRepTools_DumpLoc)
>alias dumpmesh ? ({,,TKMesh}BRepMesh_Dump)
>alias dumpgeom ? ({,,TKGeomBase}GeomTools_Dump)
~~~~
~~~~~
Note that aliases are stored in the Visual Studio user's preferences and it is sufficient to define them once on a workstation. With these aliases, the above example can be reproduced easier (note the space symbol after alias name!):
~~~~{.php}
~~~~~
>saveshape ("d:/edge1.brep",(void*)&anEdge1)
0x04a2f234 "d:/edge1.brep"
>dsetshape ("e1",(void*)&anEdge1)
0x0369eba8 "e1"
>deval ("donly e1; axo; fit")
0x029a48f0 ""
~~~~
~~~~~
Note that there is no guarantee that the call will succeed and will not affect the program execution, thus use this feature at your own risk. In particular, the commands interacting with window system (such as *axo*, *vinit*, etc.) are known to cause application crash when the program is built in 64-bit mode. To avoid this, it is recommended to prepare all necessary view windows in advance, and arrange these windows to avoid overlapping with the Visual Studio window, to ensure that they are visible during debug.
@@ -252,7 +252,7 @@ In Visual Studio 2005-2010 the rules for this display are defined in file *autoe
### \[AutoExpand\] section
~~~~{.cpp}
~~~~~
; Open CASCADE classes
Standard_Transient=<,t> count=<count,d>
Handle_Standard_Transient=<entity,x> count=<entity->count,d> <,t>
@@ -260,6 +260,12 @@ TCollection_AsciiString=<mylength,d> <mystring,s>
TCollection_HAsciiString=<myString.mylength,d> <myString.mystring,s>
TCollection_ExtendedString=<mylength,d> <mystring,su>
TCollection_HExtendedString=<myString.mylength,d> <myString.mystring,su>
TCollection_BaseSequence=size=<Size,d> curr=<CurrentIndex,d>
TCollection_BasicMap=size=<mySize,d>
NCollection_BaseSequence=size=<mySize,d> curr=<myCurrentIndex,d>
NCollection_BaseList=length=<myLength,d>
NCollection_BaseMap=size=<mySize,d> buckets=<myNbBuckets>
NCollection_BaseVector=length=<myLength,d>
TDF_Label=<myLabelNode,x> tag=<myLabelNode->myTag>
TDF_LabelNode=tag=<myTag,d>
TDocStd_Document=format=<myStorageFormat.mystring,su> count=<count,d> <,t>
@@ -274,11 +280,11 @@ gp_Dir2d=<coord.x,g>, <coord.y,g>
gp_Vec2d=<coord.x,g>, <coord.y,g>
gp_Mat2d={<matrix[0][0],g>,<matrix[0][1],g>}, {<matrix[1][0],g>,<matrix[1][1],g>}
gp_Ax1=loc={<loc.coord.x,g>, <loc.coord.y,g>, <loc.coord.z,g>} vdir={<vdir.coord.x,g>, <vdir.coord.y,g>, <vdir.coord.z,g>}
~~~~
~~~~~
### \[Visualizer\] section
~~~~{.cpp}
~~~~~
; Open CASCADE classes
NCollection_Handle<*> {
@@ -342,7 +348,7 @@ Handle_TCollection_HAsciiString {
#array( expr: ((TCollection_HAsciiString*)$e.entity)->myString.mystring[$i],
size: ((TCollection_HAsciiString*)$e.entity)->myString.mylength) ) )
}
~~~~
~~~~~
In Visual Studio 2012 and later, visualizers can be put in a separate file in subdirectory *Visualizers*. See file *occt.natvis* for example.
@@ -403,10 +409,7 @@ Example of configuration steps for Ubuntu:
7. Run DRAW and perform tests as usual, keeping in mind that running with sanitizer is much heavier than normal build:
> ./draw.sh relwithdeb <br>
~~~~{.php}
Draw[]> testgrid -parallel 0
~~~~
> Draw[]> testgrid -parallel 0
Note that when running tests under sanitizers, behavior may be different.
Known problems (as of CLang 6.0) are:

View File

@@ -77,6 +77,13 @@
<Type Name="TCollection_HExtendedString">
<DisplayString>{myString.mylength}: {(wchar_t *)myString.mystring,su}</DisplayString>
</Type>
<Type Name="TCollection_BaseSequence">
<DisplayString>TCollection_Sequence [{Size}], curr={CurrentIndex}</DisplayString>
</Type>
<Type Name="TCollection_BasicMap">
<AlternativeType Name="NCollection_BaseMap"/>
<DisplayString>TCollection_Map [{mySize}]</DisplayString>
</Type>
<Type Name="TColStd_PackedMapOfInteger">
<DisplayString>TColStd_PackedMapOfInteger [{myExtent}]</DisplayString>
</Type>

View File

@@ -234,7 +234,7 @@ This module handles various problems of interoperability between CAD systems, ca
* @ref occt_user_guides__step "STEP" (AP203: Mechanical Design, this covers General 3D CAD; AP214: Automotive Design; AP242).
* @ref occt_iges_1 "IGES" (up to 5.3).
* **glTF** 2.0 reader and writer.
* **OBJ** mesh file reader and writer.
* **OBJ** mesh file reader.
* **VRML** converter translates Open CASCADE shapes to VRML 1.0 files (Virtual Reality Modeling Language).
* **STL** converter translates Open CASCADE shapes to STL files.
STL (STtereoLithography) format is widely used for rapid prototyping (3D printing).
@@ -332,19 +332,23 @@ For more details, see @ref occt_user_guides__test_harness "Draw Test Harness Man
@section intro_req Requirements
Open CASCADE Technology is designed to be highly portable and is known to work on wide range of platforms.
Current version is officially certified on Windows (x86-64), Linux (x86-64), OS X / macOS (x86-64, arm64), Android (arm64), and iOS (arm64) platforms.
Open CASCADE Technology is designed to be highly portable and is known to
work on wide range of platforms.
Current version is officially certified on Windows (IA-32 and x86-64),
Linux (x86-64), OS X / macOS (x86-64), Android (armv7 and x86), and
iOS (armv7, arm64) platforms.
The tables below describe the recommended software configurations for which OCCT is certified to work.
The tables below describe the recommended software configurations
for which OCCT is certified to work.
@subsection intro_req_cpp C++ Compiler / IDE
| OS | Compiler |
| --------- | ----------- |
| Windows | Microsoft Visual Studio: 2015 Update 3, 2017 <sup>1</sup>, 2019, 2022 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
| OS X / macOS | XCode 6 or newer |
| Android | NDK r12, GNU gcc 4.9 or newer |
| Android | NDK r10, GNU gcc 4.8 or newer |
| Web | Emscripten SDK 1.39 or newer (CLang) |
1) VC++ 141 64-bit is used for regular testing and for building binary package of official release of OCCT on Windows.
@@ -352,42 +356,42 @@ The tables below describe the recommended software configurations for which OCCT
@subsection intro_req_libs Third-party libraries and tools
The following third-party libraries and tools are not included in OCCT sources but are either required or can be optionally used for the indicated components of OCCT.
They are not needed if relevant component is not needed - it is possible building core OCCT modules without additional dependencies.
They are not needed if relevant component is not needed.
Note that pre-built packages of many of the listed libraries are available at
https://dev.opencascade.org/resources/download/3rd-party-components
https://www.opencascade.com/content/3rd-party-components
| Component | Where to find | Used for | Purpose |
| Component | Where to find | Used for | Required or optional |
| --------- | ------------- | -------- | -------------------- |
| CMake 3.1+ | https://cmake.org/ | Configuration | Build from sources |
| Intel oneTBB 2021.5.0 | https://github.com/oneapi-src/oneTBB/releases/tag/v2021.5.0 | All | Parallelization of algorithms (alternative to built-in thread pool) |
| OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required for using 3D Viewer |
| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | VR (Virtual Reality) support in 3D Viewer |
| FreeType 2.4+ | https://www.freetype.org/download.html | Visualization | Text rendering in 3D Viewer |
| FreeImage 3.17+ | https://sourceforge.net/projects/freeimage/files | Visualization | Reading/writing image files |
| FFmpeg 3.1+ | https://www.ffmpeg.org/download.html | Visualization | Video recording |
| VTK 6.1+ | https://www.vtk.org/download/ | IVtk | VTK integration module |
| Flex 2.6.4+ and Bison 3.7.1+ | https://sourceforge.net/projects/winflexbison/ | Data Exchange | Updating STEP and ExprIntrp parsers |
| RapidJSON 1.1+ | https://rapidjson.org/ | Data Exchange | Reading glTF files |
| Draco 1.4.1+ | https://github.com/google/draco | Data Exchange | Reading compressed glTF files |
| Tcl/Tk 8.6.3+ | https://www.tcl.tk/software/tcltk/download.html | DRAW Test Harness | Tcl interpretor in Draw module |
| Qt 5.3.2+ | https://www.qt.io/download/ | Inspector and Samples | Inspector Qt samples and |
| Doxygen 1.8.5+ | https://www.doxygen.nl/download.html | Documentation | (Re)generating documentation |
| Graphviz 2.38+ | https://graphviz.org/ | Documentation | Generating dependency graphs |
| CMake 2.8+ | https://cmake.org/ | Build from sources | Optional |
| Intel TBB 4.x or later | https://www.threadingbuildingblocks.org/ | All | Optional (advanced parallelization of algorithms) |
| OpenGL 3.3+, OpenGL ES 2.0+ | System | Visualization | Required |
| OpenVR 1.10+ | https://github.com/ValveSoftware/openvr | Visualization | Optional (VR support) |
| Direct3D 9 | Windows | Visualization | Optional (integration with GUI using Direct3D) |
| FreeType 2.4.11-2.7.1 | https://sourceforge.net/projects/freetype/files/ | Visualization | Required |
| FreeImage 3.17.0+ | https://sourceforge.net/projects/freeimage/files | Visualization | Optional (support of common 2D graphic formats) |
| FFmpeg 3.1+ | https://www.ffmpeg.org/download.html | Visualization | Optional (video recording) |
| VTK 6.1+ | https://www.vtk.org/download/ | Visualization | Optional (VTK integration) |
| Flex 2.6.4+ and Bison 3.7.1+ | https://sourceforge.net/projects/winflexbison/ | Data Exchange | Optional (update of STEP and ExprIntrp parsers) |
| RapidJSON 1.1+ | https://rapidjson.org/ | Data Exchange | Optional (reading glTF files) |
| Tcl/Tk 8.6.3+ <br> or ActiveTcl 8.6 | https://www.tcl.tk/software/tcltk/download.html <br> https://www.activestate.com/activetcl/downloads | DRAW Test Harness | Required |
| Qt Desktop: Qt 4.8.6+ <br> Android: Qt 5.3.2+ | https://www.qt.io/download/ | Samples and demos | Optional (Qt samples) |
| Doxygen 1.8.5+ | https://www.doxygen.nl/download.html | Documentation | Required |
| Graphviz 2.38+ | https://graphviz.org/ | Documentation | Optional (dependency graphs) |
@subsection intro_req_hw Hardware
| Component | Requirement |
| --------- | ----------- |
| Minimum memory | 512 MB, 1 GB recommended |
| Free disk space (complete installation) | 1,5 GB approx. |
| Free disk space (complete installation) | 600 MB approx. |
On desktop, 3D viewer for optimal performance requires graphics processing unit (GPU) supporting OpenGL 3.3 or above.
Ray tracing requires OpenGL 4.0+ or OpenGL 3.3+ with *GL_ARB_texture_buffer_object_rgb32* extension.
Textures within ray tracing will be available only when *GL_ARB_bindless_texture extension* is provided by driver.
On mobile platforms, OpenGL ES 2.0+ is required for 3D viewer (OpenGL ES 3.1+ is recommended).
Ray tracing requires OpenGL ES 3.2.
The ray tracing is not yet available on mobile platforms.
Some old hardware might be unable to execute complex GLSL programs (e.g. with high number of light sources, clipping planes).
OCCT 3D Viewer, in general, supports wide range of graphics hardware - from very old to new.
@@ -397,7 +401,7 @@ Don't forget to report these bugs to vendors.
@section intro_install Download and Installation
OCCT can be downloaded from https://dev.opencascade.org/release
OCCT can be downloaded from https://www.opencascade.com/content/latest-release
In most cases you would want to rebuild OCCT from sources on your platform (OS, compiler) before
using it in your project, to ensure binary compatibility and appropriate configuration of the library.
@@ -431,7 +435,7 @@ The contents of the OCCT-7.4.0 directory (called further "OCCT root", or $CASROO
* **adm** This folder contains administration files, which allow rebuilding OCCT;
* **adm/cmake** This folder contains files of CMake building procedure;
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2013, 2015, 2017, 2019 and 2022 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2010, 2012, 2013, 2015, 2017 and 2019 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
* **adm/scripts** This folder contains auxiliary scripts for semi-automated building and packaging of OCCT for different platforms;
* **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionality;
* **doc** This folder contains OCCT documentation in HTML and PDF format;
@@ -441,7 +445,7 @@ The contents of the OCCT-7.4.0 directory (called further "OCCT root", or $CASROO
* **src** This folder contains OCCT source files. They are organized in folders, one per development unit;
* **tests** This folder contains scripts for OCCT testing.
* **tools** This folder contains sources of Inspector tool.
* **win64/vc14** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2015;
* **win64/vc10** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2010;
@subsection intro_install_linux Linux
@@ -462,7 +466,7 @@ To run any Open CASCADE Technology application you need to set the environment v
You can define the environment variables with env.bat script located in the
$CASROOT folder. This script accepts two arguments to be used:
the version of Visual Studio (vc12 -- vc143) and the architecture (win32 or win64).
the version of Visual Studio (vc10 -- vc142) and the architecture (win32 or win64).
The additional environment settings necessary for compiling OCCT libraries and samples
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
@@ -501,12 +505,12 @@ The scripts are located in the OCCT root folder.
they will be allocated in the C heap by malloc();
* **CSF_LANGUAGE** (optional) defines default language of messages;
* **CSF_DEBUG** (optional, Windows only): if defined then a diagnostic message is displayed in case of an exception;
* **CSF_DEBUG_BOP** (optional): if defined then it should specify directory where diagnostic data on problems occurred in Boolean operations will be saved;
* **CSF_DEBUG_BOP** (optional): if defined then it should specify directory where diagnostic data on problems occured in Boolean operations will be saved;
* **CSF_MDTVTexturesDirectory** defines the directory for available textures when using texture mapping;
* **CSF_ShadersDirectory** (optional) defines the directory for GLSL programs for Ray Tracing renderer (embedded resources are used when variable is undefined);
* **CSF_SHMessage** (optional) defines the path to the messages file for *ShapeHealing*;
* **CSF_XSMessage** (optional) defines the path to the messages file for **STEP** and **IGES** translators;
* **CSF_StandardDefaults**, **CSF_StandardLiteDefaults**, **CSF_XCAFDefaults**, and **CSF_PluginDefaults** define paths to directory where configuration files for OCAF persistence are located (required for open/save operations with OCAF documents);
* **CSF_StandardDefaults**, **CSF_StandardLiteDefaults*, **CSF_XCAFDefaults**, and **CSF_PluginDefaults** define paths to directory where configuration files for OCAF persistence are located (required for open/save operations with OCAF documents);
* **CSF_IGESDefaults** and **CSF_STEPDefaults** (optional) define paths to directory where resource files of **IGES** and **STEP** translators are located;
* **CSF_XmlOcafResource** is required in order to set the path to **XSD** resources, which defines XML grammar.
* **CSF_MIGRATION_TYPES** is required in order to read documents that contain old data types, such as *TDataStd_Shape*;
@@ -531,7 +535,7 @@ At minimum the following should be considered:
the application should be provided separately in a modifiable form, with all materials needed for the user to be able to run the application with a modified version of OCCT.
If you want to use Open CASCADE Technology without being bound by LGPL requirements,
please <a href="https://dev.opencascade.org/webform/contact_us">contact Open CASCADE company</a> for a commercial license.
please <a href="https://www.opencascade.com/contact">contact Open CASCADE company</a> for a commercial license.
Note that Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and
@@ -572,7 +576,8 @@ FreeType 2 is released under two open-source licenses: BSD-like FreeType License
It is a library that helps you to take advantage of multi-core processor performance without having to be a threading expert.
Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that
abstracts platform details and threading mechanisms for scalability and performance.
Intel oneTBB 2021.5.0 is available under Apache 2.0 license (https://www.threadingbuildingblocks.org).
TBB version 2017 is available under Apache 2.0 license, while older versions
until 4.4 are available under GPLv2 license with the runtime exception (https://www.threadingbuildingblocks.org).
**OpenGL** is an industry standard API for 3D graphics used by OCCT for
implementation of 3D viewer. OpenGL specification is developed by the
@@ -591,10 +596,10 @@ If you need further information on VTK, refer to VTK Homepage https://www.vtk.or
**Doxygen** developed by Dimitri van Heesch is open source documentation system for
C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology
for automatic creation of Technical Documentation from C++ header files.
If you need further information on Doxygen, refer to https://www.doxygen.nl/index.html.
If you need further information on Doxygen, refer to https://www.stack.nl/~dimitri/doxygen/index.html.
**Graphviz** is open source graph visualization software developed by John Ellson, Emden Gansner, Yifan Hu and Arif Bilgin.
Graph visualization is representation of structured information as diagrams of abstract graphs and networks.
Graph visualization is representiation of structured information as diagrams of abstract graphs and networks.
This product is used together with Doxygen in Open CASCADE Technology for automatic creation of Technical Documentation
(generation of dependency graphs). Current versions of Graphviz are licensed on an open source
basis under The Eclipse Public License (EPL) (https://www.graphviz.org/license/).
@@ -641,10 +646,6 @@ on this tool.
**RapidJSON** is an Open Source JSON parser and generator for C++.
RapidJSON is optionally used by OCCT for reading glTF files (https://rapidjson.org/).
**Draco** is an Open Source JSON parser and generator for C++.
Draco is optionally used by OCCT for reading glTF files using KHR_draco_mesh_compression extension (https://github.com/google/draco).
Draco is available under Apache 2.0 license.
**DejaVu** fonts are a font family based on the Vera Fonts under a permissive license (MIT-like, https://dejavu-fonts.github.io/License.html).
DejaVu Sans (basic Latin sub-set) is used by OCCT as fallback font when no system font is available.

View File

@@ -21,6 +21,7 @@ FILE_PATTERNS = *.md *.dox
RECURSIVE = YES
SOURCE_BROWSER = NO
INLINE_SOURCES = YES
COLS_IN_ALPHA_INDEX = 5
GENERATE_DOCSET = NO
GENERATE_CHI = NO
GENERATE_QHP = NO

View File

@@ -21,6 +21,7 @@ FILE_PATTERNS = *.md *.dox
RECURSIVE = YES
SOURCE_BROWSER = NO
INLINE_SOURCES = YES
COLS_IN_ALPHA_INDEX = 5
GENERATE_DOCSET = NO
GENERATE_CHI = NO
GENERATE_QHP = NO

View File

@@ -1,911 +0,0 @@
AIS: Custom Presentation {#tutorials__ais_object}
========
@tableofcontents
@section intro Getting Started
OCCT provides a strong set of built-in Interactive Objects for rapid application development,
but the real power and flexibility of **Application Interactive Services** (@c AIS) could be revealed by subclassing and implementing custom presentations.
In this tutorial we will focus on the development of a custom @c AIS_InteractiveObject and show the basics step by step.
Let's start from the very beginning and try subclassing @c AIS_InteractiveObject object:
~~~~{.cpp}
class MyAisObject : public AIS_InteractiveObject
{
DEFINE_STANDARD_RTTI_INLINE(MyAisObject, AIS_InteractiveObject)
public:
MyAisObject() {}
public:
virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode) override {}
virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode) override {}
virtual bool AcceptDisplayMode (const Standard_Integer theMode) const override
{ return true; }
};
~~~~
@c DEFINE_STANDARD_RTTI_INLINE() macro will register the new class within the OCCT Run-Time Type Information (RTTI) system.
This step is optional (you may skip it if you are not going to use methods like @c Standard_Transient::DynamicType() in application code), but it is a common practice while subclassing OCCT classes.
The @c AIS_InteractiveObject interface defines only a couple of pure virtual methods - @c @::Compute() defining an object presentation and @c @::ComputeSelection() defining a selectable (pickable) volume.
Selection and presentation are two independent mechanisms in **AIS**. Presentation rendering is done with help of OpenGL or a similar low-level graphics library, while selection doesn't depend on a graphic driver at all.
Providing an empty implementation of these two methods would be enough for adding the object to @c AIS_InteractiveContext (@c @::Display()), but obviously nothing will appear on the screen.
@section prs_builders Presentation builders
To go ahead, we need to define some presentation of our object.
OCCT provides a set of presentation building tools for common elements like arrows, shapes, boxes, etc.
These tools could be found within @c Prs3d, @c StdPrs and @c DsgPrs packages:
- **Prs3d**
provides builders for simple geometric elements.
- @c Prs3d_Arrow, @c Prs3d_BndBox, @c Prs3d_Point, @c Prs3d_Text, @c Prs3d_ToolCylinder, @c Prs3d_ToolDisk, @c Prs3d_ToolSector, @c Prs3d_ToolSphere, @c Prs3d_ToolTorus
- **StdPrs**
provides builders for analytical geometry and B-Rep shapes (@c TopoDS_Shape).
- @c StdPrs_WFShape, @c StdPrs_ShadedShape, @c StdPrs_BRepTextBuilder
- **DsgPrs**
provides builders for datums, dimensions and relations.
Presentation builders are reusable bricks for constructing @c AIS objects.
Standard OCCT interactive objects highly rely on them, so that you may easily replicate @c AIS_Shape presentation for displaying a shape with just a couple of lines calling @c StdPrs_ShadedShape:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
}
...
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, true);
~~~~
@figure{ais_object_step1_shaded.png,"@c StdPrs_ShadedShape presentation builder.",409} height=409px
@c PrsMgr_PresentableObject::Compute() method takes three arguments:
- **Presentation Manager** (@c PrsMgr_PresentationManager).
Rarely used parameter, but might be necessary for some advanced use cases.
- **Presentation** (@c Prs3d_Presentation or @c Graphic3d_Structure).
Defines the structure to fill in with presentation elements.
- **Display Mode** (integer number).
Specifies the display mode to compute.
**0** is a default display mode, if not overridden by @c AIS_InteractiveObject::SetDisplayMode() or by @c AIS_InteractiveContext::Display().
For each supported display mode, the **Presentation Manager** creates a dedicated @c Prs3d_Presentation and stores it within the object itself as a list of presentations @c PrsMgr_PresentableObject::Presentations().
It is a good practice to reject unsupported display modes within @c @::Compute() method:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
if (theMode != 0) { return; } // reject non-zero display modes
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
}
~~~~
This wouldn't, however, prevent application from displaying the object with another display mode like this:
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, 100, -1, true);
~~~~
The code above will display @c MyAisObject with display mode equal to 100, and after @c @::Compute() modifications nothing will be displayed on the screen.
@c AIS will still create a presentation with specified display mode, but it will be empty - method @c @::AcceptDisplayMode() could be overridden to disallow even creation of an empty presentation:
~~~~{.cpp}
bool MyAisObject::AcceptDisplayMode (const Standard_Integer theMode) const
{
return theMode == 0; // reject non-zero display modes
}
~~~~
@c AIS_InteractiveContext::Display() checks if requested display mode is actually supported by the object, and uses default display mode (_**0**_) if it is not.
@c StdPrs_ShadedShape prepares a shaded (triangulated) presentation of a shape, while @c StdPrs_WFShape creates a wireframe presentation with B-Rep wire boundaries:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
if (!AcceptDisplayMode (theMode)) { return; }
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer); // add shading
StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
}
~~~~
@figure{ais_object_step1_shaded_wf.png,"Result of @c StdPrs_ShadedShape + @c StdPrs_WFShape presentation builders.",409} height=409px
Presentation builders take the @c Prs3d_Drawer object defining various attributes - material of shaded shape, number of isolines in wireframe mode, tessellation quality, line colors and many others.
@c PrsMgr_PresentableObject defines @c myDrawer property with default attributes.
@c StdPrs makes it easy to display topological shapes.
With the help of @c Prs3d tools we may display elements like arrows, boxes or text labels.
Let's extend our presentation with a second **display mode 1** showing a bounding box using @c Prs3d_BndBox builder:
~~~~{.cpp}
bool MyAisObject::AcceptDisplayMode (const Standard_Integer theMode) const
{
return theMode == 0 || theMode == 1;
}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (100.0, 100.0);
if (theMode == 0)
{
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
}
else if (theMode == 1)
{
Bnd_Box aBox;
BRepBndLib::Add (aShape, aBox);
Prs3d_BndBox::Add (thePrs, aBox, myDrawer);
}
}
~~~~
Now, displaying an object with **display mode 1** will show a box:
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, 1, 0, true);
~~~~
@figure{ais_object_step1_bndbox.png,"@c Prs3d_BndBox presentation builder.",409} height=409px
@c AIS disallows activating multiple display modes at the same time, so that these presentation modes should be alternatives to each other.
But @c AIS may use non-active display mode for highlighting purposes - like wireframe (@c AIS_Wireframe) presentation displayed on top of shaded (@c AIS_Shaded) presentation for selected @c AIS_Shape objects.
Let's define a dedicated enumeration for display modes supported by our interactive object and setup the 1st (@c MyDispMode_Highlight) display mode for highlighting with help of @c PrsMgr_PresentableObject::SetHilightMode():
~~~~{.cpp}
class MyAisObject : public AIS_InteractiveObject
{
public:
enum MyDispMode { MyDispMode_Main = 0, MyDispMode_Highlight = 1 };
...
MyAisObject::MyAisObject()
{
SetDisplayMode (MyDispMode_Main); // main (active) display mode
SetHilightMode (MyDispMode_Highlight); // auxiliary (highlighting) mode
}
...
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
theCtx->HilightWithColor (aPrs, aPrs->HilightAttributes(), false);
theCtx->CurrentViewer()->Redraw();
~~~~
@figure{ais_object_step1_highlight.png,"Highlighting by color (left) and highlighting by another display mode (right).",818} height=409px
In this particular use case we've used the method @c AIS_InteractiveContext::HilightWithColor() instead of @c @::SetSelected() - just because our object is not selectable yet and @c @::SetSelected() wouldn't work.
Highlighted presentation appears on the screen with modulated color (see left screenshot above).
Using a dedicated display mode for highlighting (right screenshot above) allows customizing presentation in selected / highlighted states.
@section prim_arrays Primitive arrays
@c Prs3d_Presentation might be filled in by the following **primitives**:
- **Triangles**
- @c Graphic3d_ArrayOfTriangles
- @c Graphic3d_ArrayOfTriangleFans
- @c Graphic3d_ArrayOfTriangleStrips
- **Lines**
- @c Graphic3d_ArrayOfSegments
- @c Graphic3d_ArrayOfPolylines
- **Points** or **Markers**
- @c Graphic3d_ArrayOfPoints
This triplet of primitives is what graphics hardware is capable of rendering, so that it could be transferred directly to low-level graphics libraries in the form of *Vertex Buffer Objects* (VBO).
Each **primitive array** consists of an array of vertex attributes (_**position**, **normal**, **texture coordinates**, **vertex colors**_, etc.) and optional **array of indices**.
The latter one avoids duplicating vertices shared between connected elements (triangles, polylines) in attributes array.
@c Graphic3d_ArrayOfPrimitives and it's subclasses provide a convenient interface for filling in primitive arrays:
- Constructor takes a number of vertices, number of edges (indices) and a bitmask of optional vertex attributes.
- @c Graphic3d_ArrayOfPrimitives::AddVertex() appends a vertex with specified attributes to the end of the array (within the range specified at construction time).
- @c Graphic3d_ArrayOfPrimitives::AddEdges() appends indices, starting with 1.
Each line segment is defined by two consequential edges, each triangle is defined by three consequential edges.
Let's extend our sample and display a cylinder section contour defined by array of indexed segments (e.g. a polyline of four vertices):
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
if (theMode == MyDispMode_Main)
{
StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer);
//StdPrs_WFShape::Add (thePrs, aShape, myDrawer);
Handle(Graphic3d_ArrayOfSegments) aSegs = new Graphic3d_ArrayOfSegments (4, 4 * 2, Graphic3d_ArrayFlags_None);
aSegs->AddVertex (gp_Pnt (0.0, -aRadius, 0.0));
aSegs->AddVertex (gp_Pnt (0.0, -aRadius, aHeight));
aSegs->AddVertex (gp_Pnt (0.0, aRadius, aHeight));
aSegs->AddVertex (gp_Pnt (0.0, aRadius, 0.0));
aSegs->AddEdges (1, 2);
aSegs->AddEdges (2, 3);
aSegs->AddEdges (3, 4);
aSegs->AddEdges (4, 1);
Handle(Graphic3d_Group) aGroupSegs = thePrs->NewGroup();
aGroupSegs->SetGroupPrimitivesAspect (myDrawer->WireAspect()->Aspect());
aGroupSegs->AddPrimitiveArray (aSegs);
}
else if (theMode == MyDispMode_Highlight) { ... }
}
~~~~
@figure{ais_object_step2_segments.png,"Displaying @c Graphic3d_ArrayOfSegments.",409} height=409px
The process is quite straightforward:
- Create a new @c Graphic3d_Group using @c Prs3d_Presentation::NewGroup();
- Specify presentation aspects using @c Graphic3d_Group::SetGroupPrimitivesAspect();
- Create and add an array of primitives using @c Graphic3d_Group::AddPrimitiveArray().
Standard presentation builders like @c StdPrs_ShadedShape / @c StdPrs_WFShape internally do exactly the same thing - a tessellated representation of a shape is added to presentation in form of triangles (shaded),
line segments (wireframe and free edges) and markers (free shape vertices).
A single @c Graphic3d_Group normally defines just a single primitive array, but it is technically possible adding more arrays to the same group @c Graphic3d_Group::AddPrimitiveArray()
and with different aspects @c Graphic3d_Group::SetPrimitivesAspect(), which might be considered in advanced scenarios.
Method @c Graphic3d_Group::AddText() allows adding text labels to a presentation.
Internally, text labels are rendered as an array of textured triangles using texture atlas created from a font, but this complex logic is hidden from the user.
@section prim_aspects Primitive aspects
@c Graphic3d_Aspects is a class defining **display properties** of a primitive array (@c Graphic3d_Group::SetGroupPrimitivesAspect()) -
_**material**, **shading model**, **color**, **texture maps**, **blending mode**, **line width**_ and others.
There are also subclasses @c Graphic3d_AspectFillArea3d (triangles), @c Graphic3d_AspectLine3d (lines), @c Graphic3d_AspectMarker3d (markers)
and @c Graphic3d_AspectText3d (text labels) defined as specializations for a specific primitive array type.
These subclasses exist for historical reasons and are treated by renderers in exactly the same way.
It is technically possible to create transient aspects directly within @c @::Compute() method like this:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
Handle(Graphic3d_Aspects) anAspects = new Graphic3d_Aspects();
anAspects->SetShadingModel (Graphic3d_TypeOfShadingModel_Unlit);
anAspects->SetColor (Quantity_NOC_RED);
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (anAspects);
...
}
~~~~
While this code would work as expected, but prevents further dynamic updates of presentation aspects without recomputing entire presentation.
Instead, it is preferred taking attributes from @c PrsMgr_PresentableObject::myDrawer / @c @::Attributes() or storing custom attributes as class fields.
@c Prs3d_Drawer defines a set of attributes used by @c AIS presentation builders, but the same parameters might be used by a custom builder as well.
It is also preferred preallocating attributes in the class constructor.
This would allow changing attributes without recomputing the entire presentation - just by calling @c PrsMgr_PresentableObject::SynchronizeAspects() after modifications.
Our custom object uses @c myDrawer->ShadingAspect() and @c myDrawer->WireAspect() aspects, so let's initialize them explicitly - assign silver material for shading and green color to line segments:
~~~~{.cpp}
MyAisObject::MyAisObject()
{
SetHilightMode (MyDispMode_Highlight);
myDrawer->SetupOwnShadingAspect();
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Silver);
myDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 2.0));
}
~~~~
@section quadric_builders Quadric builders
Previously, we've used @c StdPrs_ShadedShape for displaying cylinder geometry.
The @c Prs3d package provides a simpler way for displaying geometry like cylinders, spheres and toruses - based on the @c Prs3d_ToolQuadric interface.
This interface allows bypassing creation of a complex B-Rep (@c TopoDS_Shape) definition of a simple geometry, and to avoid using general-purpose tessellators like @c BRepMesh.
> This difference could be negligible for a small number of such objects, but might become considerable for larger amounts.
> The B-Rep definition of a valid cylinder includes 2 unique @c TopoDS_Vertex, 3 @c TopoDS_Edge, 3 @c TopoDS_Wire, 3 @c TopoDS_Face, 1 @c TopoDS_Shell and 1 @c TopoDS_Solid.
> Internally each @c TopoDS_Edge also defines curves (@c Geom_Curve as well as 2D parametric @c Geom2d_Curve) and each @c TopoDS_Face defines analytical surface (@c Geom_Surface).
> Meshing such geometry with the help of @c BRepMesh is much more complicated than one may think.
> A plenty of data structures (memory!) and computations (time!) for displaying a geometry that could be triangulated by a simple for loop.
@c Prs3d_ToolQuadric solves this problem by creating a triangulation for such kinds of shapes in a straight-forward way.
Let's try using @c Prs3d_ToolCylinder in our sample:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
if (theMode == MyDispMode_Main)
{
//StdPrs_ShadedShape::Add (thePrs, aShape, myDrawer); // add shading
//StdPrs_WFShape::Add (thePrs, aShape, myDrawer); // add wireframe
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 10, 10, gp_Trsf());
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroupTris->AddPrimitiveArray (aTris);
...
}
...
}
~~~~
@figure{ais_object_step3_quadrics_10.png,"@c Prs3d_ToolCylinder (10 slices).",409} height=409px
Well... that looks a little bit edgy.
Quadric builder creates a triangulation taking the following parameters:
- Geometry parameters.
(in case of a cylinder - base radius, top radius and height).
- Number of subdivisions along U (slices) and V (stacks) parameters.
In some cases only one parametric scope matters.
- Transformation @c gp_Trsf to apply
(original geometry is defined within some reference coordinate system).
Let's increase number of subdivisions from _10_ to _25_:
~~~~{.cpp}
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 25, 25, gp_Trsf());
~~~~
@figure{ais_object_step3_quadrics_25.png,"@c Prs3d_ToolCylinder (25 slices).",409} height=409px
It looks much better now! Note that @c Prs3d_ToolCylinder could be used for building both cones and cylinders depending on top/bottom radius definition.
There is one issue though - our cylinder doesn't have top and bottom anymore!
To fix this problem we will use one more quadric builder @c Prs3d_ToolDisk:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
if (theMode == MyDispMode_Main)
{
Prs3d_ToolCylinder aCyl (aRadius, aRadius, aHeight, 25, 25);
Prs3d_ToolDisk aDisk (0.0, aRadius, 25, 1);
Handle(Graphic3d_ArrayOfTriangles) aTris =
new Graphic3d_ArrayOfTriangles (aCyl.VerticesNb() + 2 * aDisk.VerticesNb(),
3 * (aCyl.TrianglesNb() + 2 * aDisk.TrianglesNb()),
Graphic3d_ArrayFlags_VertexNormal);
aCyl .FillArray (aTris, gp_Trsf());
aDisk.FillArray (aTris, gp_Trsf());
gp_Trsf aDisk2Trsf;
aDisk2Trsf.SetTransformation (gp_Ax3 (gp_Pnt (0.0, 0.0, aHeight), -gp::DZ(), gp::DX()), gp::XOY());
aDisk.FillArray (aTris, aDisk2Trsf);
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroupTris->AddPrimitiveArray (aTris);
aGroupTris->SetClosed (true);
...
}
}
~~~~
Now our cylinder looks solid! The sample above merges two triangulations into a single one instead of appending each primitive array individually.
This looks like a minor difference, but it might have a _dramatic impact on performance_ in case of a large scene,
as each `Graphic3d_ArrayOfPrimitives` is mapped into a dedicated draw call at graphic driver (OpenGL) level.
@figure{ais_object_step3_quadrics_fin.png,"@c Prs3d_ToolCylinder + @c Prs3d_ToolDisk.",409} height=409px
As an exercise, let's try computing a triangulation for cylinder disk without help of @c Prs3d_ToolDisk builder:
~~~~{.cpp}
void MyAisObject::Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
if (theMode == MyDispMode_Main)
{
const int aNbSlices = 25;
Prs3d_ToolCylinder aCyl (aRadius, aRadius, aHeight, aNbSlices, aNbSlices);
Handle(Graphic3d_ArrayOfTriangles) aTris =
new Graphic3d_ArrayOfTriangles (aCyl.VerticesNb(),
3 * (aCyl.TrianglesNb()),
Graphic3d_ArrayFlags_VertexNormal);
aCyl.FillArray (aTris, gp_Trsf());
Handle(Graphic3d_ArrayOfTriangles) aTris2 =
new Graphic3d_ArrayOfTriangles (aNbSlices + 1, aNbSlices * 3, Graphic3d_ArrayFlags_VertexNormal);
aTris2->AddVertex (gp_Pnt (0.0, 0.0, aHeight), -gp::DZ());
for (int aSliceIter = 0; aSliceIter < aNbSlices; ++aSliceIter)
{
double anAngle = M_PI * 2.0 * double(aSliceIter) / double(aNbSlices);
aTris2->AddVertex (gp_Pnt (Cos (anAngle) * aRadius, Sin (anAngle) * aRadius, aHeight), -gp::DZ());
}
for (int aSliceIter = 0; aSliceIter < aNbSlices; ++aSliceIter)
{
aTris2->AddEdges (1, aSliceIter + 2, aSliceIter + 1 < aNbSlices ? (aSliceIter + 3) : 2);
}
Handle(Graphic3d_Group) aGroupTris = thePrs->NewGroup();
aGroupTris->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroupTris->AddPrimitiveArray (aTris);
aGroupTris->AddPrimitiveArray (aTris2);
...
}
}
~~~~
@figure{ais_object_step3_quadrics_disk.png,"Manually triangulated disk.",409} height=409px
The disk is here, but it has a strange color - like it is not affected by lighting.
This happens when vertex normals are defined incorrectly.
In our case we defined disk normal as @c -DZ (see the second argument of @c Graphic3d_ArrayOfTriangles::AddVertex()),
but normal direction should be also aligned to triangulation winding rule.
Graphic driver defines the front side of triangle using clockwise order of triangle nodes, and normal should be defined for a front side of triangle - e.g. it should be @c gp::DZ() in our case.
After reversing vertex normal direction, cylinder looks exactly like when @c Prs3d_ToolDisk was used.
Front / back face orientation might be displayed using different material based on @c Graphic3d_Aspects::SetDistinguish() flag and @c @::FrontMaterial() / @c @::BackMaterial() setup.
@section ais_selection Computing selection
In the first part of the tutorial we have created a custom @c AIS object @c MyAisObject computing presentation by implementing the @c PrsMgr_PresentableObject::Compute() interface.
In this part we will extend our object with interactive capabilities and make it selectable through implementing @c SelectMgr_SelectableObject interface.
Let's do the first step and put into @c @::ComputeSelection() method some logic.
This method should fill in the @c SelectMgr_Selection argument with @c SelectMgr_SensitiveEntity entities defining selectable elements - triangulations, polylines, points and their composition.
@c Select3D_SensitiveBox is probably the simplest way to define selectable volume - by it's bounding box:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
Bnd_Box aBox;
BRepBndLib::Add (aShape, aBox);
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
Handle(Select3D_SensitiveBox) aSensBox = new Select3D_SensitiveBox (anOwner, aBox);
theSel->Add (aSensBox);
}
~~~~
@c SelectMgr_EntityOwner is a key object in selection logic - it serves as an identifier of a pickable object or it's part.
You may see this object in methods like @c AIS_InteractiveContext::DetectedOwner(), **Owners** are stored within the list of selection objects @c AIS_Selection
and it received by methods like @c AIS_InteractiveContext::SetSelected() and @c AIS_InteractiveContext::AddOrRemoveSelected().
From the Selector's point of view, @c AIS_InteractiveObject is just a drawer for @c SelectMgr_EntityOwner.
The _**0th selection mode**_ normally defines a single Owner of the entire object.
To make a composite object selectable as whole, we add to Selection as many SensitiveEntity as necessary referring to the same Owner.
It might look confusing from first glance, that @c SelectMgr_SensitiveEntity stores @c SelectMgr_EntityOwner as a class field, and not in the opposite way
(@c SelectMgr_EntityOwner doesn't store the list of @c SelectMgr_SensitiveEntity defining it's picking volume).
For local selection (selection of object parts) we create individual Owners for each part and add SensitiveEntity to Selection in the same way.
Owner may store an additional identifier as a class field, like @c StdSelect_BRepOwner stores @c TopoDS_Shape as an identifier of picked sub-shape with @c AIS_Shape object.
In a similar way as @c StdPrs_ShadedShape is a **presentation builder** for @c TopoDS_Shape, the @c StdSelect_BRepSelectionTool can be seen as a standard **selection builder** for shapes:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
TopoDS_Shape aShape = BRepPrimAPI_MakeCylinder (aRadius, aHeight);
Standard_Real aDefl = StdPrs_ToolTriangulatedShape::GetDeflection (aShape, myDrawer);
StdSelect_BRepSelectionTool::Load (theSel, this, aShape, TopAbs_SHAPE, aDefl,
myDrawer->DeviationAngle(),
myDrawer->IsAutoTriangulation());
}
~~~~
Internally, @c StdSelect_BRepSelectionTool iterates over sub-shapes and appends to the Selection (@c theSel) entities like @c Select3D_SensitiveTriangulation (for faces) and @c Select3D_SensitiveCurve (for edges).
Previously, we have used @c Prs3d_ToolCylinder to triangulate a cylinder, so let's try to construct @c Select3D_SensitivePrimitiveArray from the same triangulation:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_ToolCylinder::Create (aRadius, aRadius, aHeight, 25, 25, gp_Trsf());
Handle(Select3D_SensitivePrimitiveArray) aSensTri =
new Select3D_SensitivePrimitiveArray (anOwner);
aSensTri->InitTriangulation (aTris->Attributes(), aTris->Indices(),
TopLoc_Location());
theSel->Add (aSensTri);
}
~~~~
Selection is computed independently from presentation, so that they don't have to match each other.
But inconsistency between presentation and selection might confuse a user, when he will not be able to pick an object clearly displayed under the mouse cursor.
These issues might happen, for example, when selection uses tessellated representation of the same geometry computed with different parameters (different number of subdivisions, or different deflection parameters).
As in case of @c @::Compute(), it makes sense defining some enumeration of **selection modes** supported by specific object and reject unsupported ones to avoid unexpected behavior:
~~~~{.cpp}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
if (theMode != 0) { return; }
...
}
~~~~
Unlike display modes, @c AIS_InteractiveContext allows activating an arbitrary combination of selection modes.
A user should be careful to activate only the modes that actually make sense and may work together.
Selection mode to activate could be specified while displaying the object (passing _**-1**_ instead of _**0**_ would display an object with deactivated selection):
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(MyAisObject) aPrs = new MyAisObject();
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
~~~~
Later on @c AIS_InteractiveContext::SetSelectionModeActive(), or it's wrappers @c AIS_InteractiveContext::Activate() and @c AIS_InteractiveContext::Deactivate(),
could be used to enable or disable desired selection modes one by one.
@section sel_owner_highlight Highlighting selection owner
As has been mentioned in the previous section, @c SelectMgr_EntityOwner is a key object which can be used as an identifier of selectable part(s).
Naturally, you might want to subclass it to put some application-specific ids for identification of selected parts.
But there are more things you may do with the Owner class like customized highlighting.
Let's start from the beginning and define a custom Owner class:
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
DEFINE_STANDARD_RTTI_INLINE(MyAisOwner, SelectMgr_EntityOwner)
public:
MyAisOwner (const Handle(MyAisObject)& theObj, int thePriority = 0)
: SelectMgr_EntityOwner (theObj, thePriority) {}
virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode) override
{ base_type::HilightWithColor (thePrsMgr, theStyle, theMode); }
virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Standard_Integer theMode) override
{ base_type::Unhilight (thePrsMgr, theMode); }
protected:
Handle(Prs3d_Presentation) myPrs;
};
~~~~
@c SelectMgr_EntityOwner doesn't define any pure virtual methods, and can be instanced straight ahead, like it was done within @c MyAisObject::ComputeSelection() implementation above.
Let's revert usage of a dedicated display mode for highlighting (remove @c SetHilightMode() in @c MyAisObject constructor) and use our new class @c MyAisOwner within @c @::ComputeSelection():
~~~~{.cpp}
MyAisObject::MyAisObject()
{
//SetHilightMode (MyDispMode_Highlight);
myDrawer->SetupOwnShadingAspect();
...
}
void MyAisObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
const double aRadius = 100.0, aHeight = 100.0;
Handle(MyAisOwner) anOwner = new MyAisOwner (this);
...
}
~~~~
The further logic creating sensitive entities and filling in Selection could be left as is.
Substitution of @c SelectMgr_EntityOwner with @c MyAisOwner currently doesn't change behavior and we see highlighting of the entire object through color modulation.
This is because default implementation of @c SelectMgr_EntityOwner for highlighting logic looks like this (simplified):
~~~~{.cpp}
void SelectMgr_EntityOwner::HilightWithColor (
const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
const Graphic3d_ZLayerId aHiLayer =
theStyle->ZLayer() != Graphic3d_ZLayerId_UNKNOWN
? theStyle->ZLayer()
: mySelectable->ZLayer();
thePrsMgr->Color (mySelectable, theStyle, theMode, NULL, aHiLayer);
}
~~~~
@figure{ais_object_step4_highlight1.png,"Default behavior of @c SelectMgr_EntityOwner::HilightWithColor().",409} height=409px
Now, let's override the @c SelectMgr_EntityOwner::HilightWithColor() method and display a bounding box presentation:
~~~~{.cpp}
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
if (myPrs.IsNull())
{
myPrs = new Prs3d_Presentation (thePrsMgr->StructureManager());
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
anObj->Compute (thePrsMgr, myPrs, MyAisObject::MyDispMode_Highlight);
}
if (!thePrsMgr->IsImmediateModeOn())
{
myPrs->Display();
}
}
~~~~
@c SelectMgr_EntityOwner::HilightWithColor() doesn't receive a presentation to fill in as an argument; highlight presentation should be manually created and even explicitly displayed on the screen.
To avoid code duplication, the code above reuses @c MyAisObject::Compute() already implementing computation of highlight presentation.
@figure{ais_object_step4_highlight2.png,"Result of custom implementation @c MyAisOwner::HilightWithColor().",409} height=409px
The visual result of the selected object looks exactly the same as when we've used a dedicated highlight mode.
One thing became broken, though - highlighting remains displayed even after clearing selection.
To fix this issue, we need implementing @c SelectMgr_EntityOwner::Unhilight() and hide our custom presentation explicitly:
~~~~{.cpp}
void MyAisOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Standard_Integer theMode)
{
if (!myPrs.IsNull()) { myPrs->Erase(); }
}
~~~~
Another problem is that the object is no longer dynamically highlighted.
To fix that we need to handle @c PrsMgr_PresentationManager::IsImmediateModeOn() specifically.
Within this mode turned ON, presentation should be displayed on the screen with help of @c PrsMgr_PresentationManager::AddToImmediateList() method
(it will be cleared from the screen automatically on the next mouse movement):
~~~~{.cpp}
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
if (myPrs.IsNull())
{
myPrs = new Prs3d_Presentation (thePrsMgr->StructureManager());
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
anObj->Compute (thePrsMgr, myPrs, MyAisObject::MyDispMode_Highlight);
}
if (thePrsMgr->IsImmediateModeOn())
{
Handle(Prs3d_PresentationShadow) aShadow =
new Prs3d_PresentationShadow (thePrsMgr->StructureManager(), myPrs);
aShadow->SetZLayer (Graphic3d_ZLayerId_Top);
aShadow->Highlight (theStyle);
thePrsMgr->AddToImmediateList (aShadow);
}
else
{
myPrs->Display();
}
}
~~~~
We may create two dedicated presentations for dynamic highlighting or reuse existing one for both cases with help of a transient object @c Prs3d_PresentationShadow.
Let's go further and make dynamic highlighting a little bit more interesting - by drawing a surface normal at the point where mouse picked the object:
~~~~{.cpp}
void MyAisOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode)
{
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
if (thePrsMgr->IsImmediateModeOn())
{
Handle(StdSelect_ViewerSelector) aSelector =
anObj->InteractiveContext()->MainSelector();
SelectMgr_SortCriterion aPickPnt;
for (int aPickIter = 1; aPickIter <= aSelector->NbPicked(); ++aPickIter)
{
if (aSelector->Picked (aPickIter) == this)
{
aPickPnt = aSelector->PickedData (aPickIter);
break;
}
}
Handle(Prs3d_Presentation) aPrs = mySelectable->GetHilightPresentation (thePrsMgr);
aPrs->SetZLayer (Graphic3d_ZLayerId_Top);
aPrs->Clear();
Handle(Graphic3d_Group) aGroup = aPrs->NewGroup();
aGroupPnt->SetGroupPrimitivesAspect (theStyle->ArrowAspect()->Aspect());
gp_Trsf aTrsfInv = mySelectable->LocalTransformation().Inverted();
gp_Dir aNorm (aPickPnt.Normal.x(), aPickPnt.Normal.y(), aPickPnt.Normal.z());
Handle(Graphic3d_ArrayOfTriangles) aTris =
Prs3d_Arrow::DrawShaded (gp_Ax1(aPickPnt.Point, aNorm).Transformed (aTrsfInv),
1.0, 15.0,
3.0, 4.0, 10);
aGroupPnt->AddPrimitiveArray (aTris);
thePrsMgr->AddToImmediateList (aPrs);
}
}
~~~~
Code above does not store our new highlight presentation as a property of @c MyAisOwner, and instead uses @c SelectMgr_SelectableObject::GetHilightPresentation() method
to create a presentation stored directly inside of our interactive object.
Next trick is passing through the last picking results in @c StdSelect_ViewerSelector.
Dynamic highlighting is expected to be called right after picking, so that highlighted Owner should be always found in picking results.
@c StdSelect_ViewerSelector::Picked() returns entities in the descending order of their distance from picking ray origin (mouse cursor);
normally our Owner should be the very first one in this list when no selection filters are assigned to @c AIS_InteractiveContext.
@c SelectMgr_SortCriterion provides us useful information like 3D point on detected object lying on the picking ray, and surface normal direction at this point (actually, it would be a normal to a picked triangle),
which we display as an arrow with help of @c Prs3d_Arrow presentation builder.
@figure{ais_object_step4_highlight3.png,"Surface normal on mouse over.",409} height=409px
Result looks pretty nice on the screenshot, but has interaction problems - once displayed, an arrow is no longer updated with further mouse movements.
But this behavior is not a bug - @c AIS calls @c MyAisOwner::HilightWithColor() only when picking Owner changes to avoid unnecessary Viewer updates.
To override this behavior, we may override @c SelectMgr_EntityOwner::IsForcedHilight() option:
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
...
virtual bool IsForcedHilight() const override { return true; }
};
~~~~
This solves the problem within our specific use case.
Keep in mind that most objects don't need updating highlight presentation on every mouse move;
overriding this flag everywhere would be a waste of resources and may cause performance issues - use it sparingly.
@section highlight_apporaches Highlighting approaches
@c AIS provides one more alternative to handle presentation highlighting, which is managed by option @c SelectMgr_SelectableObject::IsAutoHilight().
By default, this option is turned ON and redirects highlighting logic to @c SelectMgr_EntityOwner::HilightWithColor() demonstrated in the previous section.
Turning this option OFF redirects highlighting logic to the interactive object itself @c SelectMgr_SelectableObject::HilightSelected().
Apart from moving the logic from Owner to Interactive Object, this approach allows handling highlighting of all selected Owners within the same Object at once and sharing a common presentation
instead of per-Owner presentation - improving performance and reducing memory utilization in case of a large number of small selectable elements, like mesh nodes in @c MeshVS_Mesh object.
The further optimization of such a scenario would be using a single Owner for the entire Object
storing the list of selected elements within the Owner itself - as utilized by @c AIS_PointCloud object for highlighting individual points.
We wouldn't describe these advanced techniques here in detail - let's just summarize main highlighting approaches available in @c AIS:
- Highlighting of a main presentation of Interactive Object (active display mode)
filled in by @c PrsMgr_PresentableObject::Compute()
and displayed with color modulation by @c AIS logic.
- Example: @c AIS_TextLabel.
- Highlighting of a secondary presentation of Interactive Object
filled in by @c PrsMgr_PresentableObject::Compute()
and displayed with color modulation by @c AIS logic.
- Example: @c AIS_Shape, displayed in @c AIS_Shaded display mode and highlighted using @c AIS_Wireframe display mode (default behavior).
See also @c PrsMgr_PresentableObject::SetHilightMode().
- Highlight presentation stored within a custom @c SelectMgr_EntityOwner
and managed by @c SelectMgr_EntityOwner::HilightWithColor().
- Example: @c StdSelect_BRepOwner for selection of sub-shapes.
- Custom highlight presentation stored within Interactive Object itself
(see @c SelectMgr_SelectableObject::GetHilightPresentation() / @c @::GetSelectPresentation() methods).
- Filled in by @c SelectMgr_EntityOwner::HilightWithColor()
with @c SelectMgr_SelectableObject::IsAutoHilight() turned ON.<br>
Example: @c AIS_PointCloud.
- Filled in by @c SelectMgr_SelectableObject::HilightSelected()
with @c SelectMgr_SelectableObject::IsAutoHilight() turned OFF.<br>
Example: @c MeshVS_Mesh.
- Main presentation of Interactive Object (active display mode)
filled in by @c PrsMgr_PresentableObject::Compute()
and manually updated (recomputed or modified aspects) on highlight events.
- Example: @c AIS_Manipulator.
The number of options looks overwhelming but in general, it is better to stick to the simplest approach working for you and consider alternatives only when you have to.
@section mouse_click Mouse click
Dynamic highlighting is only one of scenarios where @c SelectMgr_EntityOwner could be useful.
Another feature is an interface for handling a mouse click @c SelectMgr_EntityOwner @c @::HandleMouseClick().
This interface is useful for defining some user interface elements like buttons, and most likely your application will use a more comprehensive GUI framework for this purpose instead of @c AIS.
But let's have some fun and make our object to change a color on each mouse click:
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
...
virtual bool HandleMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick) override;
};
bool MyAisOwner::HandleMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick)
{
static math_BullardGenerator aRandGen;
Quantity_Color aRandColor (float(aRandGen.NextInt() % 256) / 255.0f,
float(aRandGen.NextInt() % 256) / 255.0f,
float(aRandGen.NextInt() % 256) / 255.0f,
Quantity_TOC_sRGB);
mySelectable->Attributes()->ShadingAspect()->SetColor(aRandColor);
mySelectable->SynchronizeAspects();
return true;
}
~~~~
Looks pretty simple. Now let's make things more interesting and launch some simple object animation on each click.
We use a couple of global (@c static) variables in our sample for simplicity - don't do that in a real production code.
~~~~{.cpp}
class MyAisOwner : public SelectMgr_EntityOwner
{
...
void SetAnimation (const Handle(AIS_Animation)& theAnim)
{ myAnim = theAnim; }
...
Handle(AIS_Animation) myAnim;
};
bool MyAisOwner::HandleMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick)
{
static bool isFirst = true;
isFirst = !isFirst;
MyAisObject* anObj = dynamic_cast<MyAisObject*> (mySelectable);
gp_Trsf aTrsfTo;
aTrsfTo.SetRotation (gp_Ax1 (gp::Origin(), gp::DX()),
isFirst ? M_PI * 0.5 : -M_PI * 0.5);
gp_Trsf aTrsfFrom = anObj->LocalTransformation();
Handle(AIS_AnimationObject) anAnim =
new AIS_AnimationObject ("MyAnim", anObj->InteractiveContext(),
anObj, aTrsfFrom, aTrsfTo);
anAnim->SetOwnDuration (2.0);
myAnim->Clear();
myAnim->Add (anAnim);
myAnim->StartTimer (0.0, 1.0, true);
return true;
}
~~~~
Animation is a complex topic that is worth a dedicated article - let's not go too deep in detail here.
To perform animation in a non-interrupted way, it should be handled by some class like @c AIS_ViewController, which is responsible for managing user input events and for 3D viewer updates.
To utilize it, you need adding a custom object animation to @c AIS_ViewController::ObjectsAnimation() or adding custom view animation to @c AIS_ViewController::ViewAnimation().
Somewhere in application this might look like this:
~~~~{.cpp}
Handle(AIS_InteractiveContext) theCtx;
Handle(AIS_ViewController) theViewCtrl;
Handle(MyAisObject) aPrs = new MyAisObject();
aPrs->SetAnimation (theViewCtrl->ObjectsAnimation());
theCtx->Display (aPrs, MyAisObject::MyDispMode_Main, 0, false);
~~~~
@section final Final result
The final sample could be seen by calling @c QATutorialAisObject command from Draw Harness plugin @c QAcommands (@c TKQADraw toolkit):
~~~~
pload VISUALIZATION QAcommands
vinit View1
QATutorialAisObject p
vfit
~~~~
You may also take a look onto source code of this command at @c src/QADraw/QADraw_Tutorials.cxx if you have some problems following the tutorial.

View File

@@ -1,4 +1,4 @@
Draw: Demo Scripts {#samples__draw_scripts}
Draw Demo Scripts {#samples__draw_scripts}
================
All demo scripts are provided with OCCT sources and locate in <i>CASROOT/samples/tcl</i>. To play around them please

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Some files were not shown because too many files have changed in this diff Show More