mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0027290: CMake configuration files for OCCT
CMake scripts are improved to install CMake configuration files for OpenCASCADE product.
This commit is contained in:
@@ -5,15 +5,15 @@ if(FLAGS_ALREADY_INCLUDED)
|
||||
endif()
|
||||
set(FLAGS_ALREADY_INCLUDED 1)
|
||||
|
||||
# force option -fp:precise for Visual Studio projects.
|
||||
# force option /fp:precise for Visual Studio projects.
|
||||
#
|
||||
# Note that while this option is default for MSVC compiler, Visual Studio
|
||||
# project can be switched later to use Intel Compiler (ICC).
|
||||
# Enforcing -fp:precise ensures that in such case ICC will use correct
|
||||
# option instead of its default -fp:fast which is harmful for OCCT.
|
||||
if (MSVC)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp:precise")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp:precise")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:precise")
|
||||
endif()
|
||||
|
||||
# set compiler short name and choose SSE2 option for appropriate MSVC compilers
|
||||
@@ -38,7 +38,7 @@ string (REGEX MATCH "EHsc" ISFLAG "${CMAKE_CXX_FLAGS}")
|
||||
if (ISFLAG)
|
||||
string (REGEX REPLACE "EHsc" "EHa" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
elseif (MSVC)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -EHa")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")
|
||||
endif()
|
||||
|
||||
# remove _WINDOWS flag if it exists
|
||||
@@ -83,7 +83,7 @@ if (IS_DEBUG_C)
|
||||
endif()
|
||||
# enable parallel compilation on MSVC 9 and above
|
||||
if (MSVC AND NOT MSVC70 AND NOT MSVC80)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
endif()
|
||||
|
||||
# generate a single response file which enlist all of the object files
|
||||
|
@@ -54,6 +54,9 @@ set (INSTALL_DIR_TESTS_DESCR
|
||||
"Subdirectory of INSTALL_DIR where test scripts will be installed")
|
||||
set (INSTALL_DIR_SCRIPT_DESCR
|
||||
"Subdirectory of INSTALL_DIR where scripts will be installed")
|
||||
set (INSTALL_DIR_CMAKE_DESCR
|
||||
"Subdirectory of INSTALL_DIR where CMake configuration files will be installed.
|
||||
Must be three levels below INSTALL_DIR")
|
||||
|
||||
macro (INSTALL_MESSAGE INSTALL_TARGET_VARIABLE INSTALL_TARGET_STRING)
|
||||
set (${INSTALL_TARGET_VARIABLE}_DESCR
|
||||
@@ -110,8 +113,8 @@ to generate the documentation in HTML format. The documentation will be availabl
|
||||
installation directory (overview.bat script) if INSTALL_DOC_Overview variable is checked")
|
||||
|
||||
set (3RDPARTY_DIR_DESCR
|
||||
"The root directory where all required 3-rd party products will be searched. If a
|
||||
3-rd party product have been found - corresponding CMake variables will be specified
|
||||
"The root directory where all required third-party products will be searched. If a
|
||||
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_FREEIMAGE_DESCR
|
||||
@@ -123,12 +126,12 @@ set (USE_GL2PS_DESCR
|
||||
module for support of vector image formats (PS, EPS etc)")
|
||||
|
||||
set (USE_TBB_DESCR
|
||||
"Indicates whether TBB 3-rd party is used or not. TBB stands for Threading Building Blocks,
|
||||
"Indicates whether TBB 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")
|
||||
|
||||
set (USE_VTK_DESCR
|
||||
"Indicates whether VTK 3-rd party is used or not. VTK stands for Visualization
|
||||
"Indicates whether VTK 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).")
|
||||
|
55
adm/templates/OpenCASCADEConfig.cmake.in
Normal file
55
adm/templates/OpenCASCADEConfig.cmake.in
Normal file
@@ -0,0 +1,55 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# OpenCASCADEConfig.cmake - OpenCASCADE CMake configuration file for external projects.
|
||||
#
|
||||
# This file is configured by OpenCASCADE.
|
||||
#
|
||||
|
||||
# The OpenCASCADE version number
|
||||
set (OpenCASCADE_MAJOR_VERSION "@OCC_VERSION_MAJOR@")
|
||||
set (OpenCASCADE_MINOR_VERSION "@OCC_VERSION_MINOR@")
|
||||
set (OpenCASCADE_MAINTENANCE_VERSION "@OCC_VERSION_MAINTENANCE@")
|
||||
set (OpenCASCADE_DEVELOPMENT_VERSION "@OCC_VERSION_DEVELOPMENT@")
|
||||
|
||||
# Compute the installation prefix from this OpenCASCADEConfig.cmake file location.
|
||||
# This file should be always installed three levels below install dir:
|
||||
# - in UNIX style: lib/cmake/opencascade-<version>
|
||||
# - in Windows style: win64/vc10/lib
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
|
||||
# Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data
|
||||
set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_BIN@")
|
||||
set (OpenCASCADE_LIBRARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_LIB@")
|
||||
set (OpenCASCADE_SCRIPT_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_SCRIPT@")
|
||||
set (OpenCASCADE_INCLUDE_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_INCLUDE@")
|
||||
set (OpenCASCADE_RESOURCE_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_RESOURCE@")
|
||||
|
||||
# The C and C++ flags added by OpenCASCADE to the cmake-configured flags.
|
||||
set (OpenCASCADE_C_FLAGS "@CMAKE_C_FLAGS@")
|
||||
set (OpenCASCADE_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
|
||||
@SET_OpenCASCADE_LINKER_FLAGS@
|
||||
|
||||
# List of available OpenCASCADE modules.
|
||||
set (OpenCASCADE_MODULES @OCCT_MODULES_ENABLED@)
|
||||
|
||||
# List of available OpenCASCADE libraries.
|
||||
set (OpenCASCADE_LIBRARIES @OCCT_LIBRARIES@)
|
||||
|
||||
# OpenCASCADE global configuration options.
|
||||
set (OpenCASCADE_COMPILER "@COMPILER@")
|
||||
set (OpenCASCADE_BUILD_WITH_DEBUG @BUILD_WITH_DEBUG@)
|
||||
set (OpenCASCADE_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
||||
@SET_OpenCASCADE_BUILD_TYPE@
|
||||
|
||||
# Use of third-party libraries
|
||||
set (OpenCASCADE_WITH_TCL @USE_TCL@)
|
||||
set (OpenCASCADE_WITH_FREETYPE @USE_FREETYPE@)
|
||||
set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
|
||||
set (OpenCASCADE_WITH_GL2PS @USE_GL2PS@)
|
||||
set (OpenCASCADE_WITH_TBB @USE_TBB@)
|
||||
set (OpenCASCADE_WITH_VTK @USE_VTK@)
|
||||
@SET_OpenCASCADE_WITH_D3D@
|
||||
@SET_OpenCASCADE_WITH_GLX@
|
Reference in New Issue
Block a user