1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

Configuration - CMake extension with PCH and symlink #90

Removed cotire PCH
Integrated native PCH by CMake with the same BUILD_USE_PCH flag
Added new option to avoid extra files in 'build/include' folder and replace it by symlink
  Symlink creates link to the origin file, it has some benefits from debug and build side.
The CMake parameter for symlink is 'BUILD_INCLUDE_SYMLINK'
This commit is contained in:
dpasukhi 2024-10-07 22:04:51 +00:00
parent 55527ad756
commit 1b5fc7f980
40 changed files with 555 additions and 4747 deletions

View File

@ -31,6 +31,8 @@ jobs:
cmake -G "Unix Makefiles" \ cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=clang \ -D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++ \ -D CMAKE_CXX_COMPILER=clang++ \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D USE_FREETYPE=OFF \ -D USE_FREETYPE=OFF \
-D CMAKE_BUILD_TYPE=Release .. -D CMAKE_BUILD_TYPE=Release ..

View File

@ -32,6 +32,8 @@ jobs:
-D CMAKE_C_COMPILER=gcc \ -D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \ -D CMAKE_CXX_COMPILER=g++ \
-D USE_FREETYPE=OFF \ -D USE_FREETYPE=OFF \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D CMAKE_BUILD_TYPE=Release \ -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_FLAGS="-Werror -Wno-clobbered -Wmaybe-uninitialized -Wodr -Wno-alloc-size-larger-than" \ -D CMAKE_C_FLAGS="-Werror -Wno-clobbered -Wmaybe-uninitialized -Wodr -Wno-alloc-size-larger-than" \
-D CMAKE_CXX_FLAGS="-Werror -Wno-clobbered -Wno-dangling-pointer" .. -D CMAKE_CXX_FLAGS="-Werror -Wno-clobbered -Wno-dangling-pointer" ..

View File

@ -35,6 +35,8 @@ jobs:
-D CMAKE_C_COMPILER=clang \ -D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++ \ -D CMAKE_CXX_COMPILER=clang++ \
-D USE_FREETYPE=OFF \ -D USE_FREETYPE=OFF \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D CMAKE_BUILD_TYPE=Release .. -D CMAKE_BUILD_TYPE=Release ..
- name: Build OCCT - name: Build OCCT

View File

@ -36,7 +36,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake -T host=x64 -D USE_FREETYPE=OFF -D BUILD_MODULE_Draw=OFF -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_FLAGS="/WX" -D CMAKE_CXX_FLAGS="/WX" .. cmake -T host=x64 -D USE_FREETYPE=OFF -D BUILD_USE_PCH=ON -D BUILD_INCLUDE_SYMLINK=ON -D BUILD_MODULE_Draw=OFF -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_FLAGS="/WX" -D CMAKE_CXX_FLAGS="/WX" ..
- name: Build OCCT - name: Build OCCT
run: | run: |

View File

@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.1 FATAL_ERROR) cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake") set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
@ -148,24 +148,16 @@ if (NOT DEFINED BUILD_USE_PCH)
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}") set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")
endif() endif()
if (BUILD_USE_PCH) if (CMAKE_VERSION VERSION_LESS "3.16")
OCCT_CHECK_AND_UNSET (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()
if (NOT DEFINED BUILD_INCLUDE_SYMLINK)
set (BUILD_INCLUDE_SYMLINK OFF CACHE BOOL "${BUILD_INCLUDE_SYMLINK_DESCR}")
endif()
if (CMAKE_VERSION VERSION_LESS "3.14")
OCCT_CHECK_AND_UNSET (BUILD_INCLUDE_SYMLINK)
endif() endif()
# copy samples to install directory # copy samples to install directory
@ -503,12 +495,16 @@ endforeach()
# accumulate all used toolkits # accumulate all used toolkits
list (REMOVE_DUPLICATES BUILD_TOOLKITS) list (REMOVE_DUPLICATES BUILD_TOOLKITS)
set (RAW_BUILD_TOOLKITS) set (RAW_BUILD_TOOLKITS)
set (OCCT_FULL_LIST_OF_INCLUDES)
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS}) foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS) EXCTRACT_TOOLKIT_FULL_DEPS ("src" ${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS TOOLKIT_INCLUDES)
list (APPEND OCCT_FULL_LIST_OF_INCLUDES ${TOOLKIT_INCLUDES})
list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS}) list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS})
endforeach() endforeach()
list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS) list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS)
list (REMOVE_DUPLICATES OCCT_FULL_LIST_OF_INCLUDES)
set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS}) set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS})
# include the patched or original list of definitions and flags # include the patched or original list of definitions and flags
@ -875,6 +871,9 @@ if (3RDPARTY_INCLUDE_DIRS)
include_directories (${3RDPARTY_INCLUDE_DIRS}) include_directories (${3RDPARTY_INCLUDE_DIRS})
endif() endif()
# Ensure the include directory exists
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}")
# include <cmake binary folder>/inc # include <cmake binary folder>/inc
include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}) include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})
@ -932,7 +931,7 @@ string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...") 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 all the headers to <binary dir>/inc folder
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "${CMAKE_SOURCE_DIR}/src" "${INSTALL_DIR_INCLUDE}") COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "src" "${INSTALL_DIR_INCLUDE}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S") string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting") message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
@ -964,7 +963,7 @@ if (BUILD_Inspector)
# collect all the headers to <binary dir>/inc/inspector folder # collect all the headers to <binary dir>/inc/inspector folder
string(TIMESTAMP CURRENT_TIME "%H:%M:%S") 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 ...") 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") COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "tools" "${INSTALL_DIR_INCLUDE}/inspector")
endif() endif()
# OCCT samples # OCCT samples

View File

@ -363,3 +363,25 @@ macro (COMPLIANCE_PRODUCT_CONSISTENCY LIBNAME)
endif() endif()
endif() endif()
endmacro() endmacro()
macro(CONFIGURE_DRACO_DEPS)
if (USE_DRACO)
set (USED_LIB_RELEASE ${3RDPARTY_DRACO_LIBRARY})
if (WIN32)
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY_DEBUG})
else()
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY})
endif()
set (USED_LIB_CONF)
if (EXISTS ${USED_LIB_DEBUG})
set (USED_LIB_CONF "$<$<CONFIG:DEBUG>:${USED_LIB_DEBUG}>;${USED_LIB_CONF}")
endif()
if (EXISTS ${USED_LIB_RELEASE})
set (USED_LIB_CONF "$<$<CONFIG:RELEASE>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
set (USED_LIB_CONF "$<$<CONFIG:RELWITHDEBINFO>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
endif()
if (DEFINED USED_LIB_CONF)
set_property (TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_LIBRARIES "${USED_LIB_CONF}")
endif()
endif()
endmacro()

File diff suppressed because it is too large Load Diff

View File

@ -31,3 +31,13 @@ find_package (FLEX 2.6.4)
if (NOT FLEX_FOUND OR NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h") 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) list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_INCLUDE_DIR)
endif() endif()
# remove old general version of FlexLexer
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h")
file(REMOVE ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h)
endif()
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()

View File

@ -32,6 +32,27 @@ macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS)
OCCT_CHECK_AND_UNSET (INSTALL_DIR_DOC) OCCT_CHECK_AND_UNSET (INSTALL_DIR_DOC)
endmacro() endmacro()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
function(FIND_FOLDER_OR_FILE FILE_OR_FOLDER_NAME RESULT_PATH)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
else()
set (${RESULT_PATH} "" PARENT_SCOPE)
endif()
endfunction()
# COMPILER_BITNESS variable # COMPILER_BITNESS variable
macro (OCCT_MAKE_COMPILER_BITNESS) macro (OCCT_MAKE_COMPILER_BITNESS)
math (EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)") math (EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
@ -225,7 +246,148 @@ macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME
install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME}) install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
endmacro() endmacro()
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS OCCT_COLLECT_SOURCE_DIR OCCT_INSTALL_DIR_PREFIX) function (EXTRACT_TOOLKIT_PACKAGES RELATIVE_PATH OCCT_TOOLKIT RESULT_PACKAGES)
set (OCCT_TOOLKIT_PACKAGES "")
get_property(OCCT_TOOLKIT_PACKAGES GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_PACKAGES)
if (OCCT_TOOLKIT_PACKAGES)
set (${RESULT_PACKAGES} ${OCCT_TOOLKIT_PACKAGES} PARENT_SCOPE)
return()
endif()
FILE_TO_LIST ("${RELATIVE_PATH}/${OCCT_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
set (${RESULT_PACKAGES} ${OCCT_TOOLKIT_PACKAGES} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_PACKAGES "${OCCT_TOOLKIT_PACKAGES}")
endfunction()
function(EXTRACT_TOOLKIT_EXTERNLIB RELATIVE_PATH OCCT_TOOLKIT RESULT_LIBS)
set (OCCT_TOOLKIT_LIBS "")
get_property(OCCT_TOOLKIT_LIBS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_LIBS)
if (OCCT_TOOLKIT_LIBS)
set (${RESULT_LIBS} ${OCCT_TOOLKIT_LIBS} PARENT_SCOPE)
return()
endif()
FILE_TO_LIST ("${RELATIVE_PATH}/${OCCT_TOOLKIT}/EXTERNLIB" OCCT_TOOLKIT_LIBS)
set (${RESULT_LIBS} ${OCCT_TOOLKIT_LIBS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_LIBS "${OCCT_TOOLKIT_LIBS}")
endfunction()
function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_INCLUDE_FOLDER)
set (OCCT_PACKAGE_FILES "")
get_property(OCCT_PACKAGE_FILES GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_FILES)
get_property(OCCT_PACKAGE_INCLUDE_DIR GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_INCLUDE_DIR)
if (OCCT_PACKAGE_FILES)
set (${RESULT_FILES} ${OCCT_PACKAGE_FILES} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
return()
endif()
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
set (OCCT_PACKAGE_INCLUDE_DIR "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
set (OCCT_PACKAGE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
# collect and searach for the files in the package directory or patached one
# FILE contains inly filename that must to be inside package or patched directory
set (FILE_PATH_LIST)
foreach (OCCT_FILE ${OCCT_PACKAGE_FILES})
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE "${OCCT_FILE}")
FIND_FOLDER_OR_FILE ("${RELATIVE_PATH}/${OCCT_PACKAGE}/${OCCT_FILE}" CUSTOM_FILE_PATH)
if (CUSTOM_FILE_PATH)
list (APPEND FILE_PATH_LIST "${CUSTOM_FILE_PATH}")
endif()
endforeach()
if (NOT FILE_PATH_LIST)
if(BUILD_PATH)
message (WARNING "FILES has not been found in ${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
else()
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
endif()
set (${RESULT_FILES} ${FILE_PATH_LIST} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_FILES "${FILE_PATH_LIST}")
set_property(GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_INCLUDE_DIR "${OCCT_PACKAGE_INCLUDE_DIR}")
endfunction()
function(EXCTRACT_TOOLKIT_DEPS RELATIVE_PATH OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS)
get_property(OCCT_TOOLKIT_INCLUDE_FOLDERS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_INCLUDE_FOLDERS)
if (OCCT_TOOLKIT_DEPS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
return()
endif()
set (EXTERNAL_LIBS)
EXTRACT_TOOLKIT_EXTERNLIB (${RELATIVE_PATH} ${OCCT_TOOLKIT} EXTERNAL_LIBS)
foreach (EXTERNAL_LIB ${EXTERNAL_LIBS})
string (REGEX MATCH "^TK" TK_FOUND ${EXTERNAL_LIB})
if (TK_FOUND)
list (APPEND OCCT_TOOLKIT_DEPS ${EXTERNAL_LIB})
endif()
endforeach()
set (OCCT_TOOLKIT_PACKAGES)
EXTRACT_TOOLKIT_PACKAGES (${RELATIVE_PATH} ${OCCT_TOOLKIT} OCCT_TOOLKIT_PACKAGES)
foreach(OCCT_PACKAGE ${OCCT_TOOLKIT_PACKAGES})
EXTRACT_PACKAGE_FILES (${RELATIVE_PATH} ${OCCT_PACKAGE} OCCT_PACKAGE_FILES OCCT_PACKAGE_INCLUDE_DIR)
list (APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_PACKAGE_INCLUDE_DIR})
endforeach()
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS "${OCCT_TOOLKIT_DEPS}")
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_INCLUDE_FOLDERS "${OCCT_TOOLKIT_INCLUDE_FOLDERS}")
endfunction()
function(EXCTRACT_TOOLKIT_FULL_DEPS RELATIVE_PATH OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS)
get_property(OCCT_TOOLKIT_INCLUDE_FOLDERS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_INCLUDE_FOLDERS)
if (OCCT_TOOLKIT_DEPS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
return()
endif()
EXCTRACT_TOOLKIT_DEPS(${RELATIVE_PATH} ${OCCT_TOOLKIT} OCCT_TOOLKIT_DEPS OCCT_TOOLKIT_INCLUDE_DIR)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${OCCT_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_TOOLKIT_INCLUDE_DIR})
foreach(DEP ${OCCT_TOOLKIT_DEPS})
EXCTRACT_TOOLKIT_FULL_DEPS(${RELATIVE_PATH} ${DEP} DEP_TOOLKIT_DEPS DEP_INCLUDE_DIRS)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${DEP_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${DEP_INCLUDE_DIRS})
endforeach()
list(REMOVE_DUPLICATES OCCT_TOOLKIT_FULL_DEPS)
list(REMOVE_DUPLICATES OCCT_TOOLKIT_INCLUDE_FOLDERS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_FULL_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS "${OCCT_TOOLKIT_FULL_DEPS}")
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_INCLUDE_FOLDERS "${OCCT_TOOLKIT_INCLUDE_FOLDERS}")
endfunction()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCCT_BUILD_TOOLKITS THE_RELATIVE_PATH THE_OCCT_INSTALL_DIR_PREFIX)
set (OCCT_USED_PACKAGES) set (OCCT_USED_PACKAGES)
# consider patched header.in template # consider patched header.in template
@ -234,145 +396,37 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in") set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in")
endif() endif()
set (ROOT_OCCT_DIR ${CMAKE_SOURCE_DIR})
foreach (OCCT_USED_TOOLKIT ${OCCT_BUILD_TOOLKITS})
# append all required package folders
set (OCCT_TOOLKIT_PACKAGES)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
endif()
list (APPEND OCCT_USED_PACKAGES ${OCCT_TOOLKIT_PACKAGES})
endforeach()
list (REMOVE_DUPLICATES OCCT_USED_PACKAGES)
set (OCCT_HEADER_FILES_COMPLETE) set (OCCT_HEADER_FILES_COMPLETE)
set (OCCT_HEADER_FILE_NAMES_NOT_IN_FILES) foreach(OCCT_TOOLKIT ${THE_OCCT_BUILD_TOOLKITS})
set (OCCT_HEADER_FILE_WITH_PROPER_NAMES) # parse PACKAGES file
EXTRACT_TOOLKIT_PACKAGES (${THE_RELATIVE_PATH} ${OCCT_TOOLKIT} USED_PACKAGES)
string(TIMESTAMP CURRENT_TIME "%H:%M:%S") foreach(OCCT_PACKAGE ${USED_PACKAGES})
message (STATUS "Info: \(${CURRENT_TIME}\) Compare FILES with files in package directories...") EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_PACKAGE} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES}) list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|lxx|gxx)")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES") list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
file (STRINGS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
else()
message (WARNING "FILES has not been found in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}")
continue()
endif()
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
# emit warnings if there are unprocessed headers
file (GLOB OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/*.*")
file (GLOB OCCT_ALL_FILES_IN_PATCH_DIR "${BUILD_PATCH}/src/${OCCT_PACKAGE}/*.*")
# use patched header files
foreach (OCCT_FILE_IN_PATCH_DIR ${OCCT_ALL_FILES_IN_PATCH_DIR})
get_filename_component (OCCT_FILE_IN_PATCH_DIR_NAME ${OCCT_FILE_IN_PATCH_DIR} NAME)
list (REMOVE_ITEM OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/${OCCT_FILE_IN_PATCH_DIR_NAME}")
list (APPEND OCCT_ALL_FILES_IN_DIR "${OCCT_FILE_IN_PATCH_DIR}")
endforeach()
foreach (OCCT_FILE_IN_DIR ${OCCT_ALL_FILES_IN_DIR})
get_filename_component (OCCT_FILE_IN_DIR_NAME ${OCCT_FILE_IN_DIR} NAME)
set (OCCT_FILE_IN_DIR_STATUS OFF)
if (${ALL_FILES_NB} LESS 0)
break()
endif()
foreach (FILE_INDEX RANGE ${ALL_FILES_NB})
list (GET OCCT_ALL_FILE_NAMES ${FILE_INDEX} OCCT_FILE_NAME)
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE_NAME "${OCCT_FILE_NAME}")
if ("${OCCT_FILE_IN_DIR_NAME}" STREQUAL "${OCCT_FILE_NAME}")
set (OCCT_FILE_IN_DIR_STATUS ON)
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
# collect header files with name that does not contain its package one
string (REGEX MATCH "^${OCCT_PACKAGE}[_.]" IS_HEADER_MATHCING_PACKAGE "${OCCT_FILE_NAME}")
if (NOT IS_HEADER_MATHCING_PACKAGE)
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
endif()
endif()
# remove found element from list
list (REMOVE_AT OCCT_ALL_FILE_NAMES ${FILE_INDEX})
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" ) # decrement number
break()
endif()
endforeach()
if (NOT OCCT_FILE_IN_DIR_STATUS)
message (STATUS "Warning. File ${OCCT_FILE_IN_DIR} is not listed in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${OCCT_FILE_NAME})
endif()
endif()
endforeach() endforeach()
endforeach() endforeach()
# create new file including found header
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Create header-links in inc folder...")
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE}) foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME) get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
if (BUILD_INCLUDE_SYMLINK)
file (CREATE_LINK "${OCCT_HEADER_FILE}" "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" SYMBOLIC)
else()
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"") set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY) configure_file ("${TEMPLATE_HEADER_PATH}" "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY)
endforeach()
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${OCCT_INSTALL_DIR_PREFIX}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")
file (GLOB OCCT_HEADER_FILES_OLD "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/*")
foreach (OCCT_HEADER_FILE_OLD ${OCCT_HEADER_FILES_OLD})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE_OLD} NAME)
string (REGEX MATCH "^[a-zA-Z0-9]+" PACKAGE_NAME "${HEADER_FILE_NAME}")
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
if (NOT EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not present in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
else()
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is present in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif()
else()
set (IS_HEADER_FOUND -1)
if (NOT "${OCCT_HEADER_FILE_WITH_PROPER_NAMES}" STREQUAL "")
list (FIND OCCT_HEADER_FILE_WITH_PROPER_NAMES ${HEADER_FILE_NAME} IS_HEADER_FOUND)
endif()
if (${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. \(${PACKAGE_NAME}\) ${OCCT_HEADER_FILE_OLD} is not used and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif() endif()
endforeach() endforeach()
endmacro()
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
endfunction()
function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER)
if (NOT BUILD_USE_PCH)
return()
endif()
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
endfunction()
macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH) macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
# first of all, copy original files # first of all, copy original files
@ -411,11 +465,8 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
message(STATUS "Warning: the list of being used toolkits is empty") message(STATUS "Warning: the list of being used toolkits is empty")
else() else()
foreach (USED_TOOLKIT ${BUILD_TOOLKITS}) foreach (USED_TOOLKIT ${BUILD_TOOLKITS})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${USED_TOOLKIT}/EXTERNLIB") set (FILE_CONTENT)
file (READ "${BUILD_PATCH}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT) EXTRACT_TOOLKIT_EXTERNLIB ("src" ${USED_TOOLKIT} FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
file (READ "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
endif()
string (REGEX MATCH "${CSF_VAR_NAME}" DOES_FILE_CONTAIN "${FILE_CONTENT}") string (REGEX MATCH "${CSF_VAR_NAME}" DOES_FILE_CONTAIN "${FILE_CONTENT}")
@ -427,17 +478,6 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
endif() endif()
endfunction() endfunction()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
# Function to determine if TOOLKIT is OCCT toolkit # Function to determine if TOOLKIT is OCCT toolkit
function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND) function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
set (${IS_TOOLKIT_FOUND} OFF PARENT_SCOPE) set (${IS_TOOLKIT_FOUND} OFF PARENT_SCOPE)
@ -451,58 +491,6 @@ function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
endforeach(MODULE) endforeach(MODULE)
endfunction() endfunction()
# TOOLKIT_DEPS is defined with dependencies from file src/TOOLKIT_NAME/EXTERNLIB.
# CSF_ variables are ignored
function (OCCT_TOOLKIT_DEP TOOLKIT_NAME TOOLKIT_DEPS)
FILE_TO_LIST ("src/${TOOLKIT_NAME}/EXTERNLIB" FILE_CONTENT)
#list (APPEND LOCAL_TOOLKIT_DEPS ${TOOLKIT_NAME})
set (LOCAL_TOOLKIT_DEPS)
foreach (FILE_CONTENT_LINE ${FILE_CONTENT})
string (REGEX MATCH "^TK" TK_FOUND ${FILE_CONTENT_LINE})
if ("x${FILE_CONTENT_LINE}" STREQUAL "xDRAWEXE" OR NOT "${TK_FOUND}" STREQUAL "")
list (APPEND LOCAL_TOOLKIT_DEPS ${FILE_CONTENT_LINE})
endif()
endforeach()
set (${TOOLKIT_DEPS} ${LOCAL_TOOLKIT_DEPS} PARENT_SCOPE)
endfunction()
# TOOLKIT_FULL_DEPS is defined with complete dependencies (all levels)
function (OCCT_TOOLKIT_FULL_DEP TOOLKIT_NAME TOOLKIT_FULL_DEPS)
# first level dependencies are stored in LOCAL_TOOLKIT_FULL_DEPS
OCCT_TOOLKIT_DEP (${TOOLKIT_NAME} LOCAL_TOOLKIT_FULL_DEPS)
list (LENGTH LOCAL_TOOLKIT_FULL_DEPS LIST_LENGTH)
set (LIST_INDEX 0)
while (LIST_INDEX LESS LIST_LENGTH)
list (GET LOCAL_TOOLKIT_FULL_DEPS ${LIST_INDEX} CURRENT_TOOLKIT)
OCCT_TOOLKIT_DEP (${CURRENT_TOOLKIT} CURRENT_TOOLKIT_DEPS)
# append toolkits are not contained
foreach (CURRENT_TOOLKIT_DEP ${CURRENT_TOOLKIT_DEPS})
set (CURRENT_TOOLKIT_DEP_FOUND OFF)
foreach (LOCAL_TOOLKIT_FULL_DEP ${LOCAL_TOOLKIT_FULL_DEPS})
if ("${CURRENT_TOOLKIT_DEP}" STREQUAL "${LOCAL_TOOLKIT_FULL_DEP}")
set (CURRENT_TOOLKIT_DEP_FOUND ON)
break()
endif()
endforeach()
if ("${CURRENT_TOOLKIT_DEP_FOUND}" STREQUAL "OFF")
list (APPEND LOCAL_TOOLKIT_FULL_DEPS ${CURRENT_TOOLKIT_DEP})
endif()
endforeach()
# increment the list index
MATH(EXPR LIST_INDEX "${LIST_INDEX}+1")
# calculate new length
list (LENGTH LOCAL_TOOLKIT_FULL_DEPS LIST_LENGTH)
endwhile()
set (${TOOLKIT_FULL_DEPS} ${LOCAL_TOOLKIT_FULL_DEPS} PARENT_SCOPE)
endfunction()
# Function to get list of modules/toolkits/samples from file adm/${FILE_NAME}. # Function to get list of modules/toolkits/samples from file adm/${FILE_NAME}.
# Creates list <$MODULE_LIST> to store list of MODULES and # Creates list <$MODULE_LIST> to store list of MODULES and
# <NAME_OF_MODULE>_TOOLKITS foreach module to store its toolkits, where "TOOLKITS" is defined by TOOLKITS_NAME_SUFFIX. # <NAME_OF_MODULE>_TOOLKITS foreach module to store its toolkits, where "TOOLKITS" is defined by TOOLKITS_NAME_SUFFIX.
@ -579,6 +567,74 @@ macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME
endmacro() endmacro()
macro (FLEX_AND_BISON_TARGET_APPLY THE_PACKAGE_NAME RELATIVE_SOURCES_DIR)
# Generate Flex and Bison files
if (NOT ${BUILD_YACCLEX})
return()
endif()
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (NOT (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0))
message(FATAL_ERROR "Error: number of FLEX and BISON files is not equal for ${THE_PACKAGE_NAME}")
endif()
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (NOT (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL}))
continue()
endif()
# Note: files are generated in original source directory (not in patch!)
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}")
# choose appropriate 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")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
if (CXX_BISON_LANGUAGE_FOUND)
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
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})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
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}"
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
endforeach()
endmacro()
# Adds OCCT_INSTALL_BIN_LETTER variable ("" for Release, "d" for Debug and # Adds OCCT_INSTALL_BIN_LETTER variable ("" for Release, "d" for Debug and
# "i" for RelWithDebInfo) in OpenCASCADETargets-*.cmake files during # "i" for RelWithDebInfo) in OpenCASCADETargets-*.cmake files during
# installation process. # installation process.

View File

@ -23,7 +23,7 @@ if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
endif() endif()
# parse PACKAGES file # parse PACKAGES file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES) EXTRACT_TOOLKIT_PACKAGES (${RELATIVE_SOURCES_DIR} ${PROJECT_NAME} USED_PACKAGES)
if ("${USED_PACKAGES}" STREQUAL "") if ("${USED_PACKAGES}" STREQUAL "")
set (USED_PACKAGES ${PROJECT_NAME}) set (USED_PACKAGES ${PROJECT_NAME})
endif() endif()
@ -47,7 +47,6 @@ endif()
# Get all used packages from toolkit # Get all used packages from toolkit
UNSET(RESOURCE_FILES) UNSET(RESOURCE_FILES)
foreach (OCCT_PACKAGE ${USED_PACKAGES}) foreach (OCCT_PACKAGE ${USED_PACKAGES})
#remove part after "/" in the OCCT_PACKAGE variable if exists #remove part after "/" in the OCCT_PACKAGE variable if exists
string (FIND "${OCCT_PACKAGE}" "/" _index) string (FIND "${OCCT_PACKAGE}" "/" _index)
if (_index GREATER -1) if (_index GREATER -1)
@ -64,142 +63,27 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (SOURCE_FILES) set (SOURCE_FILES)
set (HEADER_FILES) set (HEADER_FILES)
# Generate Flex and Bison files EXTRACT_PACKAGE_FILES (${RELATIVE_SOURCES_DIR} ${OCCT_PACKAGE} ALL_FILES INCLUDE_FOLDER)
if (${BUILD_YACCLEX})
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
# remove old general version of FlexLexer set (HEADER_FILES_FILTERING ${ALL_FILES})
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h) set (SOURCE_FILES_FILTERING ${ALL_FILES})
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h")
file(REMOVE ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
endif()
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()
# bison files list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|lxx|gxx)")
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
# 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
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
if (CXX_BISON_LANGUAGE_FOUND)
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
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})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
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}"
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
endif()
endforeach()
endif()
endif()
# header files
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE) if(APPLE)
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm") list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|mm)")
endif()
else() else()
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h") list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c)")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
endif() endif()
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX}) list (APPEND HEADER_FILES ${HEADER_FILES_FILTERING})
list (APPEND SOURCE_FILES ${SOURCE_FILES_C}) list (APPEND SOURCE_FILES ${SOURCE_FILES_FILTERING})
if(APPLE)
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
endif()
foreach(HEADER_FILE ${HEADER_FILES}) SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${HEADER_FILES_FILTERING}")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}") SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${SOURCE_FILES_FILTERING}")
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
list (APPEND USED_INCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
else()
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
endif()
endforeach()
foreach(SOURCE_FILE ${SOURCE_FILES}) list (APPEND USED_INCFILES ${HEADER_FILES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}") list (APPEND USED_SRCFILES ${SOURCE_FILES})
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
list (APPEND USED_SRCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
else()
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
endif()
endforeach()
if (USE_QT) if (USE_QT)
FIND_AND_INSTALL_QT_RESOURCES (${OCCT_PACKAGE} RESOURCE_FILES) FIND_AND_INSTALL_QT_RESOURCES (${OCCT_PACKAGE} RESOURCE_FILES)
@ -245,18 +129,6 @@ endif (USE_QT)
if (EXECUTABLE_PROJECT) if (EXECUTABLE_PROJECT)
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES}) 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} install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}") DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
@ -266,18 +138,6 @@ if (EXECUTABLE_PROJECT)
else() else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES}) 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 (MSVC)
if (BUILD_FORCE_RelWithDebInfo) if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release") set (aReleasePdbConf "Release")
@ -343,43 +203,47 @@ set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_D
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}") VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (USED_TOOLKITS_BY_CURRENT_PROJECT) set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT) set (USED_EXTERNLIB_AND_TOOLKITS)
# parse EXTERNLIB file # SOME EXECUTABLE PROJECTS MAY USE CUSTOM TOOLKITS AND EXTERNAL LIBRARIES
if (CUSTOM_EXTERNLIB) if (CUSTOM_EXTERNLIB)
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB}) set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
else() foreach (EXTERNAL_LIB ${CUSTOM_EXTERNLIB})
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS) string (REGEX MATCH "^TK" TK_FOUND ${EXTERNAL_LIB})
if (TK_FOUND)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${EXTERNAL_LIB})
endif() endif()
endforeach()
else()
EXTRACT_TOOLKIT_EXTERNLIB ("${RELATIVE_SOURCES_DIR}" "${PROJECT_NAME}" USED_EXTERNLIB_AND_TOOLKITS)
EXCTRACT_TOOLKIT_DEPS ("${RELATIVE_SOURCES_DIR}" "${PROJECT_NAME}" USED_TOOLKITS_BY_CURRENT_PROJECT _)
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT ${PROJECT_NAME})
endif()
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS}) foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM}) string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
if (NOT COMMENT_FOUND) if (COMMENT_FOUND)
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM}) continue()
endif()
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM}) string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK) if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
OCCT_INSTALL_VTK(${USED_ITEM}) OCCT_INSTALL_VTK(${USED_ITEM})
continue()
endif() endif()
else() # Search for 3rd-party libraries as a dependency
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
if ("${CSF_FOUND}" STREQUAL "")
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}}) set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x") if ("x${CURRENT_CSF}" STREQUAL "x")
continue()
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}") if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
add_definitions (-DHAVE_OPENGL) add_definitions (-DHAVE_OPENGL)
endif() endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}") if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
add_definitions (-DHAVE_GLES2) add_definitions (-DHAVE_GLES2)
endif() endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_Draco}")
set (CURRENT_CSF "")
set (USED_DRACO 1)
endif()
set (LIBRARY_FROM_CACHE 0) set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF) separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF}) foreach (CSF_LIBRARY ${CURRENT_CSF})
@ -391,7 +255,6 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES}) foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}}) set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE) string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}") if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}") string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}")
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}") string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
@ -406,40 +269,13 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
endif() endif()
endforeach() endforeach()
endforeach() endforeach()
if (NOT ${LIBRARY_FROM_CACHE} AND NOT "${CURRENT_CSF}" STREQUAL "") if (NOT ${LIBRARY_FROM_CACHE} AND NOT "${CURRENT_CSF}" STREQUAL "")
# prepare a list from a string with whitespaces # prepare a list from a string with whitespaces
separate_arguments (CURRENT_CSF) separate_arguments (CURRENT_CSF)
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF}) list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
endif() endif()
endif()
endif()
endif()
endif()
endforeach() endforeach()
if (USE_DRACO)
if (USED_DRACO)
set (USED_LIB_RELEASE ${3RDPARTY_DRACO_LIBRARY})
if (WIN32)
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY_DEBUG})
else()
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY})
endif()
set (USED_LIB_CONF)
if (EXISTS ${USED_LIB_DEBUG})
set (USED_LIB_CONF "$<$<CONFIG:DEBUG>:${USED_LIB_DEBUG}>;${USED_LIB_CONF}")
endif()
if (EXISTS ${USED_LIB_RELEASE})
set (USED_LIB_CONF "$<$<CONFIG:RELEASE>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
set (USED_LIB_CONF "$<$<CONFIG:RELWITHDEBINFO>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
endif()
if (DEFINED USED_LIB_CONF)
set_property (TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_LIBRARIES "${USED_LIB_CONF}")
endif()
endif()
endif()
if (APPLE) if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND) list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1) if (NOT ${IS_X11_FOUND} EQUAL -1)
@ -498,35 +334,3 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used") message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
endif() endif()
endif() endif()
# use Cotire to accelerate build via usage of precompiled headers
if (BUILD_USE_PCH)
if (WIN32)
# prevent definition of min and max macros through inclusion of Windows.h
# (for cotire builds)
add_definitions("-DNOMINMAX")
# avoid warnings on deprecated names from standard C library (see strsafe.h)
add_definitions("-DSTRSAFE_NO_DEPRECATE")
# avoid "std::Equal1" warning in QANCollection_Stl.cxx in debug mode
# suggesting using msvc "Checked Iterators"
add_definitions("-D_SCL_SECURE_NO_WARNINGS")
endif()
# Exclude system-provided glext.h.
# These macros are already defined within OpenGl_GlFunctions.hxx,
# however we have to duplicate them here for building TKOpenGl with PCH.
add_definitions("-DGL_GLEXT_LEGACY")
add_definitions("-DGLX_GLXEXT_LEGACY")
# workaround for old gcc
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions("-D__STDC_CONSTANT_MACROS")
add_definitions("-D__STDC_FORMAT_MACROS")
endif()
# unity builds are not used since they do not add speed but cause conflicts
# in TKV3d
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${PROJECT_NAME})
endif()

View File

@ -48,6 +48,11 @@ set (BUILD_USE_PCH_DESCR
"Use precompiled headers to accelerate the build. "Use precompiled headers to accelerate the build.
Precompiled headers are generated automatically by Cotire tool.") Precompiled headers are generated automatically by Cotire tool.")
set (BUILD_INCLUDE_SYMLINK_DESCR
"Include symbolic links to the source files in the build directory.
OFF - using a reference file with direct include to the origin,
ON - symbolic link to the origin file are created")
# install variables # install variables
set (INSTALL_DIR_DESCR set (INSTALL_DIR_DESCR
"The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable), "The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),

View File

@ -629,11 +629,6 @@ CMake is used to control the software compilation process using simple platform
OCCT uses CMake as a build system. CMake is available under BSD 3-Clause license. OCCT uses CMake as a build system. CMake is available under BSD 3-Clause license.
See more at https://cmake.org/ See more at https://cmake.org/
**Cotire** (compile time reducer) is a CMake module that speeds up the build process of CMake based build systems
by fully automating techniques as precompiled header usage and single compilation unit builds for C and C++.
Cotire is included in OCCT repository and used optionally by OCCT CMake scripts to accelerate builds by use of precompiled headers.
Cotire is licensed under the MIT license (https://github.com/sakra/cotire/blob/master/license).
**MikTEX** is up-to-date implementation of TeX/LaTeX and related programs for Windows. It is used **MikTEX** is up-to-date implementation of TeX/LaTeX and related programs for Windows. It is used
for generation of User and Developer Guides in PDF format. See https://miktex.org for information for generation of User and Developer Guides in PDF format. See https://miktex.org for information
on this tool. on this tool.

View File

@ -27,6 +27,10 @@ OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
unset (EXECUTABLE_PROJECT) unset (EXECUTABLE_PROJECT)
unset (CUSTOM_EXTERNLIB) unset (CUSTOM_EXTERNLIB)
if (NOT BUILD_SHARED_LIBS)
CONFIGURE_DRACO_DEPS()
endif()
if (EMSCRIPTEN) if (EMSCRIPTEN)
# Look for Tcl version string from file tcl.h # Look for Tcl version string from file tcl.h
set (TCL_MAJOR_VERSION 8) set (TCL_MAJOR_VERSION 8)

View File

@ -1,3 +1,6 @@
project(TKBRep) project(TKBRep)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKBRep "${CMAKE_CURRENT_SOURCE_DIR}/TKBRep_pch.hxx")

33
src/TKBRep/TKBRep_pch.hxx Normal file
View File

@ -0,0 +1,33 @@
#ifndef TKBRep_HXX
#define TKBRep_HXX
// Windows-specific headers (for MSVC)
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h> // For Windows API functions like WideCharToMultiByte
#include <tchar.h> // For Unicode/MBCS mappings
#ifdef GetObject
#undef GetObject
#endif
#endif
#include <TopoDS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_CompSolid.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Builder.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#endif // TKBRep_HXX

View File

@ -1,3 +1,5 @@
project(TKDEGLTF) project(TKDEGLTF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
CONFIGURE_DRACO_DEPS()

View File

@ -1,3 +1,5 @@
project(TKDESTEP) project(TKDESTEP)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
FLEX_AND_BISON_TARGET_APPLY ("StepFile" src)

View File

@ -1,3 +1,7 @@
project(TKDraw) project(TKDraw)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
if (APPLE AND BUILD_USE_PCH)
set_target_properties(TKDraw PROPERTIES DISABLE_PRECOMPILE_HEADERS ON)
endif()

View File

@ -1,3 +1,6 @@
project(TKMath) project(TKMath)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKMath "${CMAKE_CURRENT_SOURCE_DIR}/TKMath_pch.hxx")

View File

@ -4,7 +4,6 @@ ElSLib
BSplCLib BSplCLib
BSplSLib BSplSLib
PLib PLib
Precision
GeomAbs GeomAbs
Poly Poly
CSLib CSLib

29
src/TKMath/TKMath_pch.hxx Normal file
View File

@ -0,0 +1,29 @@
#ifndef TKMATH_PCH_H
#define TKMATH_PCH_H
// Standard library headers
#include <type_traits>
// Windows-specific headers (for MSVC)
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h> // For Windows API functions like WideCharToMultiByte
#include <tchar.h> // For Unicode/MBCS mappings
#ifdef GetObject
#undef GetObject
#endif
#endif
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <gp_Trsf.hxx>
#include <gp_Quaternion.hxx>
#include <TopLoc_Location.hxx>
#endif // TKMATH_PCH_H

View File

@ -1,5 +1,7 @@
project(TKOpenGl) project(TKOpenGl)
set (TKOpenGl_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
if (APPLE AND BUILD_USE_PCH)
set_target_properties(TKOpenGl PROPERTIES DISABLE_PRECOMPILE_HEADERS ON)
endif()

View File

@ -1,6 +1,7 @@
project(TKOpenGles) project(TKOpenGles)
set (TKOpenGles_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
#add_definitions("-DOCCT_OPENGL")
if (APPLE AND BUILD_USE_PCH)
set_target_properties(TKOpenGles PROPERTIES DISABLE_PRECOMPILE_HEADERS ON)
endif()

View File

@ -1,3 +1,5 @@
project(TKRWMesh) project(TKRWMesh)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
CONFIGURE_DRACO_DEPS()

View File

@ -1,5 +1,7 @@
project(TKService) project(TKService)
set (TKService_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
if (APPLE AND BUILD_USE_PCH)
set_target_properties(TKService PROPERTIES DISABLE_PRECOMPILE_HEADERS ON)
endif()

View File

@ -1,3 +1,7 @@
project(TKViewerTest) project(TKViewerTest)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
if (APPLE AND BUILD_USE_PCH)
set_target_properties(TKViewerTest PROPERTIES DISABLE_PRECOMPILE_HEADERS ON)
endif()

View File

@ -1,5 +1,3 @@
project(TKXCAF) project(TKXCAF)
set (TKXCAF_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)

View File

@ -1,5 +1,3 @@
project(TKXDEDRAW) project(TKXDEDRAW)
set (TKXDEDRAW_DISABLE_COTIRE ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)

View File

@ -12,3 +12,6 @@ elseif ("${USE_MMGR_TYPE}" STREQUAL "JEMALLOC")
else () else ()
message (STATUS "Info: Used native memory manager") message (STATUS "Info: Used native memory manager")
endif() endif()
# Add the precompiled header
ADD_PRECOMPILED_HEADER(TKernel "${CMAKE_CURRENT_SOURCE_DIR}/TKernel_pch.hxx")

View File

@ -15,3 +15,4 @@ UnitsMethods
NCollection NCollection
Message Message
FlexLexer FlexLexer
Precision

View File

@ -0,0 +1,51 @@
#ifndef TKERNEL_PCH_H
#define TKERNEL_PCH_H
// Standard library headers
#include <type_traits>
// Windows-specific headers (for MSVC)
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h> // For Windows API functions like WideCharToMultiByte
#include <tchar.h> // For Unicode/MBCS mappings
#ifdef GetObject
#undef GetObject
#endif
#endif
// TKernel headers
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_DefineHandle.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Stream.hxx>
#include <Standard_GUID.hxx>
#include <Precision.hxx>
#include <Quantity_Color.hxx>
#include <Quantity_ColorRGBA.hxx>
#include <Quantity_HArray1OfColor.hxx>
#include <Quantity_TypeOfColor.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TCollection_HExtendedString.hxx>
#include <NCollection_BaseAllocator.hxx>
#include <NCollection_Array1.hxx>
#include <NCollection_Array2.hxx>
#include <NCollection_Map.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_List.hxx>
#include <NCollection_Sequence.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <NCollection_IndexedMap.hxx>
#endif // TKERNEL_PCH_H

View File

@ -337,7 +337,6 @@ endif()
# include the patched or original list of tools # include the patched or original list of tools
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits # list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
# list <OCCT_TOOLS> will contain all tools # list <OCCT_TOOLS> will contain all tools
#if (BUILD_Inspector)
OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS) OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
foreach (OCCT_TOOL ${OCCT_TOOLS}) foreach (OCCT_TOOL ${OCCT_TOOLS})
list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS}) list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
@ -346,8 +345,7 @@ endif()
# collect all the headers to <binary dir>/inc/inspector folder # collect all the headers to <binary dir>/inc/inspector folder
string(TIMESTAMP CURRENT_TIME "%H:%M:%S") 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 ...") 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") COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "tools" "${INSTALL_DIR_INCLUDE}/inspector")
#endif()
# include <cmake binary folder>/inc # include <cmake binary folder>/inc
include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}) include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})

View File

@ -1,7 +1,5 @@
project(TKDFBrowser) project(TKDFBrowser)
set (TKDFBrowser_DISABLE_COTIRE OFF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -1,7 +1,5 @@
project(TKMessageModel) project(TKMessageModel)
set (TKMessageModel_DISABLE_COTIRE OFF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -1,7 +1,5 @@
project(TKMessageView) project(TKMessageView)
set (TKMessageView_DISABLE_COTIRE OFF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -1,7 +1,5 @@
project(TKShapeView) project(TKShapeView)
set (TKShapeView_DISABLE_COTIRE OFF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -1,7 +1,5 @@
project(TKTInspector) project(TKTInspector)
set (TKTInspector_DISABLE_COTIRE OFF)
set (INSTALL_API ON) set (INSTALL_API ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -1,7 +1,5 @@
project(TKTreeModel) project(TKTreeModel)
set (TKTreeModel_DISABLE_COTIRE OFF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -1,7 +1,5 @@
project(TKVInspector) project(TKVInspector)
set (TKVInspector_DISABLE_COTIRE OFF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)

View File

@ -1,7 +1,5 @@
project(TKView) project(TKView)
set (TKView_DISABLE_COTIRE OFF)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_tool)