0029520: Visualization - drop deprecated V3d_View::Export() functionality and depende...
[occt.git] / adm / templates / OpenCASCADEConfig.cmake.in
CommitLineData
2e48c1cb 1#-----------------------------------------------------------------------------
2#
3# OpenCASCADEConfig.cmake - OpenCASCADE CMake configuration file for external projects.
4#
5# This file is configured by OpenCASCADE.
6#
7
ada9ef40 8if(OpenCASCADE_ALREADY_INCLUDED)
9 return()
10endif()
11set(OpenCASCADE_ALREADY_INCLUDED 1)
12
2e48c1cb 13# The OpenCASCADE version number
14set (OpenCASCADE_MAJOR_VERSION "@OCC_VERSION_MAJOR@")
15set (OpenCASCADE_MINOR_VERSION "@OCC_VERSION_MINOR@")
16set (OpenCASCADE_MAINTENANCE_VERSION "@OCC_VERSION_MAINTENANCE@")
17set (OpenCASCADE_DEVELOPMENT_VERSION "@OCC_VERSION_DEVELOPMENT@")
18
ada9ef40 19# Compute the installation prefix from this OpenCASCADEConfig.cmake file
20# location, by going up one level + one level if "cmake" + one level if "lib".
21# This is made to support different locations of CMake files:
22# - in UNIX style: $INSTALL_DIR/lib/cmake/opencascade-<version>
23# - in Windows style: $INSTALL_DIR/cmake
2e48c1cb 24get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
25get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
ada9ef40 26if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$")
27 get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
28endif()
29if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$")
30 get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
31endif()
2e48c1cb 32
33# Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data
34set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_BIN@")
35set (OpenCASCADE_LIBRARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_LIB@")
36set (OpenCASCADE_SCRIPT_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_SCRIPT@")
37set (OpenCASCADE_INCLUDE_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_INCLUDE@")
38set (OpenCASCADE_RESOURCE_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_RESOURCE@")
39
40# The C and C++ flags added by OpenCASCADE to the cmake-configured flags.
41set (OpenCASCADE_C_FLAGS "@CMAKE_C_FLAGS@")
42set (OpenCASCADE_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
43@SET_OpenCASCADE_LINKER_FLAGS@
44
45# List of available OpenCASCADE modules.
46set (OpenCASCADE_MODULES @OCCT_MODULES_ENABLED@)
ada9ef40 47@SET_OpenCASCADE_MODULES_TOOLKITS@
2e48c1cb 48# List of available OpenCASCADE libraries.
49set (OpenCASCADE_LIBRARIES @OCCT_LIBRARIES@)
50
51# OpenCASCADE global configuration options.
52set (OpenCASCADE_COMPILER "@COMPILER@")
53set (OpenCASCADE_BUILD_WITH_DEBUG @BUILD_WITH_DEBUG@)
54set (OpenCASCADE_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
55@SET_OpenCASCADE_BUILD_TYPE@
56
a3d2cb24 57# Use of third-party libraries.
2e48c1cb 58set (OpenCASCADE_WITH_TCL @USE_TCL@)
59set (OpenCASCADE_WITH_FREETYPE @USE_FREETYPE@)
60set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
2e48c1cb 61set (OpenCASCADE_WITH_TBB @USE_TBB@)
62set (OpenCASCADE_WITH_VTK @USE_VTK@)
08f8a185 63set (OpenCASCADE_WITH_FFMPEG @USE_FFMPEG@)
1ce0716b 64set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
2e48c1cb 65@SET_OpenCASCADE_WITH_D3D@
66@SET_OpenCASCADE_WITH_GLX@
ada9ef40 67
a3d2cb24 68# Import OpenCASCADE compile definitions, C and C++ flags for each installed configuration.
69file(GLOB CONFIG_FILES "${CMAKE_CURRENT_LIST_DIR}/OpenCASCADECompileDefinitionsAndFlags-*.cmake")
70foreach(f ${CONFIG_FILES})
71 include(${f})
72endforeach()
73
ada9ef40 74if (NOT OpenCASCADE_FIND_COMPONENTS)
75 set (OpenCASCADE_FIND_COMPONENTS ${OpenCASCADE_MODULES})
76endif ()
77
78# Import OpenCASCADE targets.
79foreach(_comp ${OpenCASCADE_FIND_COMPONENTS})
80 if (NOT ";${OpenCASCADE_MODULES};" MATCHES "${_comp}")
81 set(OpenCASCADE_FOUND False)
82 set(OpenCASCADE_NOTFOUND_MESSAGE "Specified unsupported component: ${_comp}")
83 if (NOT OpenCASCADE_FIND_QUIETLY)
84 message (ERROR ": ${OpenCASCADE_NOTFOUND_MESSAGE}")
85 endif()
86 else()
87 include("${CMAKE_CURRENT_LIST_DIR}/OpenCASCADE${_comp}Targets.cmake")
88 endif()
89endforeach()