cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
+set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
+
set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
endif()
else()
unset (BUILD_SHARED_LIBS)
- message (STATUS "Info: Only 3rdparty's header files are used for building of static OCCT libraries")
unset (BUILD_SHARED_LIBRARY_NAME_POSTFIX)
endif()
# single-configuration generator
set (SINGLE_GENERATOR OFF)
-if (CMAKE_BUILD_TYPE)
+if (DEFINED CMAKE_BUILD_TYPE)
set (SINGLE_GENERATOR ON)
endif()
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
endif()
+# option disabling OCCT exceptions in Release builds (No_Exception)
+if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
+ set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
+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}")
+endif()
+
+if (BUILD_USE_PCH)
+
+ # Load Cotire tool for accelerating build procedure
+ include(cotire)
+
+ # Set Cotire to ignore lxx, pxx, gxx
+ set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS "lxx;pxx;gxx" CACHE STRING "Set Cotire to ignore OCCT specific files that can be #included" FORCE)
+
+ # Set priority for inclusion of system headers in PCH to reduce problems
+ # due to incomplete inclusion or wrong order.
+ if (WIN32)
+ # on Windows, assume that SDK (windows.h) is in default location
+ set(ProgramFilesX86 "ProgramFiles(x86)")
+ file(TO_CMAKE_PATH "$ENV{${ProgramFilesX86}}" ProgramFilesX86)
+ set_property (DIRECTORY PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH "${ProgramFilesX86}")
+ unset(ProgramFilesX86)
+ endif()
+
+endif()
+
# copy samples to install directory
set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}")
separate_arguments (BUILD_ADDITIONAL_TOOLKITS)
if (MSVC)
- set (BUILD_MODULE_MfcSamples OFF CACHE BOOL "${BUILD_MODULE_MfcSamples_DESCR}")
+ set (BUILD_SAMPLES_MFC OFF CACHE BOOL "${BUILD_SAMPLES_MFC_DESCR}")
endif()
+set (BUILD_SAMPLES_QT OFF CACHE BOOL "${BUILD_SAMPLES_QT_DESCR}")
+
+set (BUILD_Inspector OFF CACHE BOOL "${BUILD_Inspector_DESCR}")
# uwp sample
if (MSVC)
# include the patched or original list of modules
# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
# list <OCCT_MODULES> will contain all modules
-OCCT_MODULES_AND_TOOLKITS (OCCT_MODULES)
+OCCT_MODULES_AND_TOOLKITS (MODULES "TOOLKITS" OCCT_MODULES)
foreach (OCCT_MODULE ${OCCT_MODULES})
BUILD_MODULE (${OCCT_MODULE})
set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
endif()
-# search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit
+# search for CSF variable in EXTERNLIB of each being used toolkit
+OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
+OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
+OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_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")
if (USE_TCL)
message (STATUS "Info: TCL is used by OCCT")
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
endif()
-# search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
-OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
-
if (USE_FREETYPE)
message (STATUS "Info: Freetype is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
# VTK
if (USE_VTK)
add_definitions (-DHAVE_VTK)
+ set (OCCT_VTK_USED_TARGETS "" CACHE INTERNAL "" FORCE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
endif()
# FREEIMAGE
-# search for CSF_FREEIMAGE variable in EXTERNLIB of each being used toolkit
-OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
if (CAN_USE_FREEIMAGE)
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
endif()
+# FFmpeg
+# search for CSF_FFmpeg variable in EXTERNLIB of each being used toolkit
+OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
+
+if (CAN_USE_FFMPEG)
+ set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
+
+ if (USE_FFMPEG)
+ add_definitions (-DHAVE_FFMPEG)
+ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
+ else()
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
+ OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
+ endif()
+else()
+ OCCT_CHECK_AND_UNSET ("USE_FFMPEG")
+
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
+ OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
+endif()
+
# OpenGL ES 2.0
-OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
-if (WIN32 AND CAN_USE_GLES2)
+if (CAN_USE_GLES2)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_GLES2 ON)
else()
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
endif()
-# GL2PS
-# search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit
-OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS)
-
-if (NOT DEFINED ANDROID AND CAN_USE_GL2PS)
- set (USE_GL2PS OFF CACHE BOOL "${USE_GL2PS_DESCR}")
-
- if (USE_GL2PS)
- add_definitions (-DHAVE_GL2PS)
- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps")
- else()
- OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
- OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS")
- endif()
-else()
- OCCT_CHECK_AND_UNSET ("USE_GL2PS")
-
- OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
- OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS")
-endif()
-
# TBB
-# search for CSF_TBB variable in EXTERNLIB of each being used toolkit
-OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
-
if (NOT DEFINED ANDROID AND CAN_USE_TBB)
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
endif()
-# EIGEN
-# search for CSF_EIGEN variable in EXTERNLIB of each being used toolkit
-OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
+# RapidJSON
+# 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")
+ else()
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_RAPIDJSON")
+ OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
+ endif()
+else()
+ OCCT_CHECK_AND_UNSET ("USE_RAPIDJSON")
+
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_RAPIDJSON")
+ OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
+endif()
+
+# EIGEN
if (CAN_USE_EIGEN)
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
+ OCCT_CHECK_AND_UNSET ("INSTALL_EIGEN")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_EIGEN")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
+ OCCT_CHECK_AND_UNSET ("INSTALL_EIGEN")
endif()
# Doxygen
OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
endif()
-string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
+# qt for inspector and samples
+if (BUILD_Inspector OR BUILD_SAMPLES_QT)
+ # check qt 3rdparty path
+ add_definitions (-DHAVE_QT)
+ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
+ message (STATUS "Info: Qt is used by OCCT")
+else()
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
+ OCCT_CHECK_AND_UNSET ("INSTALL_QT")
+endif()
-# check all 3rdparty paths
+# check all 3rdparty include paths
+string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
if (3RDPARTY_NOT_INCLUDED)
- message (FATAL_ERROR "NOT FOUND: ${3RDPARTY_NOT_INCLUDED}" )
+ message (FATAL_ERROR "Could not find headers of used third-party products: ${3RDPARTY_NOT_INCLUDED}" )
endif()
if (3RDPARTY_INCLUDE_DIRS)
endif()
# include <cmake binary folder>/inc
-include_directories (${CMAKE_BINARY_DIR}/inc)
+include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})
-if (3RDPARTY_LIBRARY_DIRS AND BUILD_SHARED_LIBS)
+# check all 3rdparty library paths
+string (REGEX REPLACE ";" " " 3RDPARTY_NO_LIBS "${3RDPARTY_NO_LIBS}")
+if (3RDPARTY_NO_LIBS)
+ if (BUILD_SHARED_LIBS)
+ message (SEND_ERROR "Could not find libraries of used third-party products: ${3RDPARTY_NO_LIBS}" )
+ else()
+ message (WARNING "Could not find libraries of used third-party products: ${3RDPARTY_NO_LIBS}" )
+ endif()
+endif()
+if (3RDPARTY_LIBRARY_DIRS)
list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
message (STATUS "Info: The directories of 3rdparty libraries: \n\t${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
link_directories (${3RDPARTY_LIBRARY_DIRS})
endif()
+# report not found 3rdparty dll paths
+string (REGEX REPLACE ";" " " 3RDPARTY_NO_DLLS "${3RDPARTY_NO_DLLS}")
+if (3RDPARTY_NO_DLLS)
+ message (WARNING "Could not find DLLs of used third-party products: ${3RDPARTY_NO_DLLS}" )
+endif()
+
# build directories
if (SINGLE_GENERATOR)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
# collect all the headers to <binary dir>/inc folder
-COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}")
+COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "${CMAKE_SOURCE_DIR}/src" "${INSTALL_DIR_INCLUDE}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
set (SCRIPT_EXT sh)
endif()
+# OCCT tools
+# include the patched or original list of tools
+# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
+# list <OCCT_TOOLS> will contain all tools
+if (BUILD_Inspector)
+ add_definitions (-DHAVE_Inspector)
+
+ OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
+ foreach (OCCT_TOOL ${OCCT_TOOLS})
+ list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
+ endforeach()
+
+ # collect all the headers to <binary dir>/inc/inspector folder
+ string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
+ message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...")
+ COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "${CMAKE_SOURCE_DIR}/tools" "${INSTALL_DIR_INCLUDE}/inspector")
+endif()
+
# OCCT samples
# get absolute path from INSTALL_DIR
set (INSTALL_DIR_ABSOLUTE "${INSTALL_DIR}")
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}")
endif()
+if (WIN32)
+ set (THIRDPARTY_DIR_REPLACE "%THIRDPARTY_DIR%")
+else()
+ set (THIRDPARTY_DIR_REPLACE "\${THIRDPARTY_DIR}")
+endif()
+get_cmake_property(USED_3RDPARTY_CACHE_VARIABLES VARIABLES)
+string (REGEX MATCHALL "(^|;)USED_3RDPARTY_[^;]+_DIR[^;]*" USED_3RDPARTY_CACHE_VARIABLES "${USED_3RDPARTY_CACHE_VARIABLES}")
+file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
+foreach (USED_3RDPARTY_CACHE_VARIABLE ${USED_3RDPARTY_CACHE_VARIABLES})
+ file (TO_CMAKE_PATH "${${USED_3RDPARTY_CACHE_VARIABLE}}" ${USED_3RDPARTY_CACHE_VARIABLE})
+ string (REPLACE "${3RDPARTY_DIR}" "${THIRDPARTY_DIR_REPLACE}" ${USED_3RDPARTY_CACHE_VARIABLE} "${${USED_3RDPARTY_CACHE_VARIABLE}}")
+ if (NOT WIN32)
+ string (REGEX REPLACE ";" ":" ${USED_3RDPARTY_CACHE_VARIABLE} "${${USED_3RDPARTY_CACHE_VARIABLE}}")
+ endif()
+endforeach()
+
# write current custom.bat/sh (for install directory)
set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR_SCRIPT}")
# write current custom.bat/sh (for build directory)
OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}")
-if (BUILD_MODULE_MfcSamples)
- OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR_SCRIPT}")
- OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.bat" "${CMAKE_BINARY_DIR}")
+if (BUILD_SAMPLES_MFC OR BUILD_SAMPLES_QT)
+ OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}")
+ OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
endif()
-# env script for draw in building environment
-OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
-
-# install env script
-install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}")
+if (WIN32)
+ # env script for draw in building environment
+ OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
+ # install env script
+ install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}")
+else()
+ set (SUB_ENV_NAME "env.${SCRIPT_EXT}")
+ set (SUB_ENV_BUILD_NAME "env.install.${SCRIPT_EXT}")
+ # install env script
+ OCCT_CONFIGURE_AND_INSTALL ("adm/templates/env.install.${SCRIPT_EXT}.in" "${SUB_ENV_BUILD_NAME}" "${SUB_ENV_NAME}" "${INSTALL_DIR_SCRIPT}")
+ # env script for draw in building environment
+ OCCT_CONFIGURE ("adm/templates/env.build.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
+endif()
# copy DrawAppliInit from OCCT source to build directory
if (NOT EXISTS "${CMAKE_BINARY_DIR}/DrawAppliInit")
endif()
endforeach()
+if (BUILD_SAMPLES_QT)
+ FILE_TO_LIST ("adm/SAMPLES_RESOURCES" SAMPLES_RESOURCES)
+ foreach(RESOURCE ${SAMPLES_RESOURCES})
+ OCCT_INSTALL_FILE_OR_DIR ("samples/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/samples")
+ #message("Copy Sample resources: samples/${RESOURCE} into ${INSTALL_DIR_RESOURCE}/samples")
+ endforeach()
+endif()
+
+
# patch installed DrawDefault file if BUILD_SHARED_LIBRARY_NAME_POSTFIX is changed
if (NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
OCCT_UPDATE_DRAW_DEFAULT_FILE()
endif()
-# define CSF variable
-OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
-
# include patched toolkit projects or original ones
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
OCCT_ADD_SUBDIRECTORY ("src/${BUILD_TOOLKIT}")
endif()
endif()
+# include patched toolkit projects or original ones
+if (BUILD_TOOL_TOOLKITS)
+ foreach (BUILD_TOOL_TOOLKIT ${BUILD_TOOL_TOOLKITS})
+ OCCT_ADD_SUBDIRECTORY ("tools/${BUILD_TOOL_TOOLKIT}")
+ endforeach()
+endif()
+
+message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed")
# samples do not support patch usage
-if (BUILD_MODULE_MfcSamples)
+if (BUILD_SAMPLES_MFC OR BUILD_SAMPLES_QT)
set (OCCT_ROOT ${CMAKE_SOURCE_DIR})
+endif()
+if (BUILD_SAMPLES_MFC)
set (MFC_STANDARD_SAMPLES_DIR ${OCCT_ROOT}/samples/mfc/standard)
set (COMMON_WINMAIN_FILE ${MFC_STANDARD_SAMPLES_DIR}/Common/Winmain.cpp)
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()
+
+OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES)
+
+if (BUILD_Inspector OR BUILD_SAMPLES_QT)
+ if (BUILD_SAMPLES_QT)
+ if (NOT Qt5_FOUND OR "${Qt5Gui_EGL_INCLUDE_DIRS}" STREQUAL "" OR NOT WIN32)
+ list (REMOVE_ITEM qt_SAMPLES_TOOLKITS AndroidQt)
+ message (STATUS "Info: AndroidQt sample excluded due to OS is not Windows or Qt is configured without ANGLE")
+ endif()
+ else()
+ list (REMOVE_ITEM OCCT_SAMPLES qt)
+ message (STATUS "Info: qt samples excluded due to BUILD_SAMPLES_QT is disabled")
+ endif()
+
+ foreach (OCCT_SAMPLE ${OCCT_SAMPLES})
+ list (APPEND BUILD_SAMPLE_TOOLKITS ${${OCCT_SAMPLE}_SAMPLES_TOOLKITS})
+
+ # collect all the headers to <binary dir>/inc/samples folder
+ string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
+ message (STATUS "Info: \(${CURRENT_TIME}\) ${OCCT_SAMPLE} Sample projects added")
+
+ # include patched toolkit projects or original ones
+ foreach (BUILD_SAMPLE_TOOLKIT ${${OCCT_SAMPLE}_SAMPLES_TOOLKITS})
+ OCCT_ADD_SUBDIRECTORY ("samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}")
+ endforeach()
+ endforeach()
endif()
if (BUILD_MODULE_UwpSample)
add_subdirectory(samples/xaml)
endif()
+if (BUILD_TOOL_TOOLKITS)
+ # copy tinspector script to install script folder
+ if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}")
+ install (FILES "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
+ else()
+ install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
+ endif()
+
+ set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
+ # patch TInspectorEXE
+ OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/tools/TInspectorEXE/TInspectorEXE.vcxproj.user")
+endif()
+
# Prepare variables for configuration of OpenCASCADE cmake config file
set (OCCT_MODULES_ENABLED)
set (OCCT_LIBRARIES)
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_GLX})")
endif()
-if (NOT SINGLE_GENERATOR)
- OCCT_INSERT_CODE_FOR_TARGET()
-endif()
-
# Configure and install cmake config file
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADEConfig.cmake.in" "OpenCASCADEConfig.cmake" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfig.cmake" DESTINATION "${INSTALL_DIR_CMAKE}")
# Update generated OpenCASCADETargets-*.cmake files
# to have correct paths to libraries depending on the configuration
OCCT_UPDATE_TARGET_FILE ()
+
+message (STATUS "Info: \(${CURRENT_TIME}\) OCCT configuration files prepared")