mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0027344: Configuration, CMake: bugs with detecting third-party products
Information messages for TCL/TK search are corrected. Compile definitions were added to OpenCASCADEConfig.cmake file
This commit is contained in:
parent
4b445d1848
commit
a3d2cb2425
@ -804,6 +804,8 @@ endif()
|
|||||||
set (OCCT_MODULES_ENABLED)
|
set (OCCT_MODULES_ENABLED)
|
||||||
set (OCCT_LIBRARIES)
|
set (OCCT_LIBRARIES)
|
||||||
set (SET_OpenCASCADE_MODULES_TOOLKITS "\n# List of available OpenCASCADE libraries for each module\n")
|
set (SET_OpenCASCADE_MODULES_TOOLKITS "\n# List of available OpenCASCADE libraries for each module\n")
|
||||||
|
set (OCCT_COMPILE_DEFINITIONS)
|
||||||
|
|
||||||
foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
|
foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
|
||||||
if (TARGET ${OCCT_TOOLKIT})
|
if (TARGET ${OCCT_TOOLKIT})
|
||||||
|
|
||||||
@ -816,10 +818,33 @@ foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
|
|||||||
get_target_property (${OCCT_TOOLKIT}_MODULE ${OCCT_TOOLKIT} "MODULE")
|
get_target_property (${OCCT_TOOLKIT}_MODULE ${OCCT_TOOLKIT} "MODULE")
|
||||||
list (APPEND OCCT_MODULES_ENABLED ${${OCCT_TOOLKIT}_MODULE})
|
list (APPEND OCCT_MODULES_ENABLED ${${OCCT_TOOLKIT}_MODULE})
|
||||||
list (APPEND OpenCASCADE_${${OCCT_TOOLKIT}_MODULE}_TOOLKITS ${OCCT_TOOLKIT})
|
list (APPEND OpenCASCADE_${${OCCT_TOOLKIT}_MODULE}_TOOLKITS ${OCCT_TOOLKIT})
|
||||||
|
|
||||||
|
# get compile definitions of target directory
|
||||||
|
get_directory_property (COMPILE_DEFINITIONS DIRECTORY "${${OCCT_TOOLKIT}_SOURCE_DIR}" "COMPILE_DEFINITIONS")
|
||||||
|
list (APPEND OCCT_COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
|
list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
|
||||||
|
list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS)
|
||||||
|
|
||||||
|
# export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files
|
||||||
|
foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
|
||||||
|
set (SET_OpenCASCADE_COMPILE_DEFINITIONS)
|
||||||
|
string (TOUPPER "${OCCT_CONFIGURATION}" OCCT_CONFIGURATION_UPPER)
|
||||||
|
string (TOLOWER "${OCCT_CONFIGURATION}" OCCT_CONFIGURATION_LOWER)
|
||||||
|
foreach(COMPILE_DEFINITION ${OCCT_COMPILE_DEFINITIONS})
|
||||||
|
string(REPLACE "(" "\\(" COMPILE_DEFINITION "${COMPILE_DEFINITION}")
|
||||||
|
string(REPLACE ")" "\\)" COMPILE_DEFINITION "${COMPILE_DEFINITION}")
|
||||||
|
set (SET_OpenCASCADE_COMPILE_DEFINITIONS "${SET_OpenCASCADE_COMPILE_DEFINITIONS}set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${OCCT_CONFIGURATION}>:${COMPILE_DEFINITION}>)\n")
|
||||||
|
endforeach()
|
||||||
|
set (SET_OpenCASCADE_CMAKE_C_FLAGS "${CMAKE_C_FLAGS_${OCCT_CONFIGURATION_UPPER}}")
|
||||||
|
set (SET_OpenCASCADE_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_${OCCT_CONFIGURATION_UPPER}}")
|
||||||
|
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADECompileDefinitionsAndFlags.cmake.in" "OpenCASCADECompileDefinitionsAndFlags-${OCCT_CONFIGURATION_LOWER}.cmake" @ONLY)
|
||||||
|
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 "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})
|
foreach (OCCT_MODULE ${OCCT_MODULES})
|
||||||
if (BUILD_MODULE_${OCCT_MODULE})
|
if (BUILD_MODULE_${OCCT_MODULE})
|
||||||
|
@ -55,7 +55,7 @@ endif()
|
|||||||
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
|
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
|
||||||
|
|
||||||
# use default (CMake) TCL search
|
# use default (CMake) TCL search
|
||||||
find_package(TCL)
|
find_package(TCL QUIET)
|
||||||
|
|
||||||
# tcl include dir
|
# tcl include dir
|
||||||
if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
|
if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
|
||||||
|
@ -59,7 +59,7 @@ endif()
|
|||||||
COMPLIANCE_PRODUCT_CONSISTENCY(TK)
|
COMPLIANCE_PRODUCT_CONSISTENCY(TK)
|
||||||
|
|
||||||
# use default (CMake) TCL search
|
# use default (CMake) TCL search
|
||||||
find_package(TCL)
|
find_package(TCL QUIET)
|
||||||
|
|
||||||
# tk include dir
|
# tk include dir
|
||||||
if (NOT 3RDPARTY_TK_INCLUDE_DIR)
|
if (NOT 3RDPARTY_TK_INCLUDE_DIR)
|
||||||
|
14
adm/templates/OpenCASCADECompileDefinitionsAndFlags.cmake.in
Normal file
14
adm/templates/OpenCASCADECompileDefinitionsAndFlags.cmake.in
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# OpenCASCADECompileDefinitionsAndFlags-@OCCT_CONFIGURATION_LOWER@.cmake - OpenCASCADE CMake file
|
||||||
|
# with compile definitions and C/C++ flags for @OCCT_CONFIGURATION@ configuration.
|
||||||
|
#
|
||||||
|
# This file is configured by OpenCASCADE.
|
||||||
|
#
|
||||||
|
|
||||||
|
# The C and C++ flags added by OpenCASCADE to the cmake-configured flags.
|
||||||
|
set (OpenCASCADE_C_FLAGS_@OCCT_CONFIGURATION_UPPER@ "@SET_OpenCASCADE_CMAKE_C_FLAGS@")
|
||||||
|
set (OpenCASCADE_CXX_FLAGS_@OCCT_CONFIGURATION_UPPER@ "@SET_OpenCASCADE_CMAKE_CXX_FLAGS@")
|
||||||
|
|
||||||
|
# The compile definitions used by OpenCASCADE.
|
||||||
|
@SET_OpenCASCADE_COMPILE_DEFINITIONS@
|
@ -54,7 +54,7 @@ set (OpenCASCADE_BUILD_WITH_DEBUG @BUILD_WITH_DEBUG@)
|
|||||||
set (OpenCASCADE_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
set (OpenCASCADE_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
||||||
@SET_OpenCASCADE_BUILD_TYPE@
|
@SET_OpenCASCADE_BUILD_TYPE@
|
||||||
|
|
||||||
# Use of third-party libraries
|
# Use of third-party libraries.
|
||||||
set (OpenCASCADE_WITH_TCL @USE_TCL@)
|
set (OpenCASCADE_WITH_TCL @USE_TCL@)
|
||||||
set (OpenCASCADE_WITH_FREETYPE @USE_FREETYPE@)
|
set (OpenCASCADE_WITH_FREETYPE @USE_FREETYPE@)
|
||||||
set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
|
set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
|
||||||
@ -64,6 +64,12 @@ set (OpenCASCADE_WITH_VTK @USE_VTK@)
|
|||||||
@SET_OpenCASCADE_WITH_D3D@
|
@SET_OpenCASCADE_WITH_D3D@
|
||||||
@SET_OpenCASCADE_WITH_GLX@
|
@SET_OpenCASCADE_WITH_GLX@
|
||||||
|
|
||||||
|
# Import OpenCASCADE compile definitions, C and C++ flags for each installed configuration.
|
||||||
|
file(GLOB CONFIG_FILES "${CMAKE_CURRENT_LIST_DIR}/OpenCASCADECompileDefinitionsAndFlags-*.cmake")
|
||||||
|
foreach(f ${CONFIG_FILES})
|
||||||
|
include(${f})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if (NOT OpenCASCADE_FIND_COMPONENTS)
|
if (NOT OpenCASCADE_FIND_COMPONENTS)
|
||||||
set (OpenCASCADE_FIND_COMPONENTS ${OpenCASCADE_MODULES})
|
set (OpenCASCADE_FIND_COMPONENTS ${OpenCASCADE_MODULES})
|
||||||
endif ()
|
endif ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user