0031087: Configuration - make FreeType dependency optional [part 2]
[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
eca6e7c5 24# - in Android style: $INSTALL_DIR/libs/$CMAKE_ANDROID_ARCH_ABI/cmake/opencascade-<version>
2e48c1cb 25get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
26get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
ada9ef40 27if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$")
28 get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
29endif()
30if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$")
31 get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
32endif()
eca6e7c5 33if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$")
34 get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
35 get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
36endif()
2e48c1cb 37
38# Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data
39set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_BIN@")
40set (OpenCASCADE_LIBRARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_LIB@")
41set (OpenCASCADE_SCRIPT_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_SCRIPT@")
42set (OpenCASCADE_INCLUDE_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_INCLUDE@")
43set (OpenCASCADE_RESOURCE_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_RESOURCE@")
44
45# The C and C++ flags added by OpenCASCADE to the cmake-configured flags.
46set (OpenCASCADE_C_FLAGS "@CMAKE_C_FLAGS@")
47set (OpenCASCADE_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
48@SET_OpenCASCADE_LINKER_FLAGS@
49
50# List of available OpenCASCADE modules.
51set (OpenCASCADE_MODULES @OCCT_MODULES_ENABLED@)
ada9ef40 52@SET_OpenCASCADE_MODULES_TOOLKITS@
2e48c1cb 53# List of available OpenCASCADE libraries.
54set (OpenCASCADE_LIBRARIES @OCCT_LIBRARIES@)
55
56# OpenCASCADE global configuration options.
57set (OpenCASCADE_COMPILER "@COMPILER@")
58set (OpenCASCADE_BUILD_WITH_DEBUG @BUILD_WITH_DEBUG@)
59set (OpenCASCADE_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
60@SET_OpenCASCADE_BUILD_TYPE@
61
a3d2cb24 62# Use of third-party libraries.
2e48c1cb 63set (OpenCASCADE_WITH_TCL @USE_TCL@)
64set (OpenCASCADE_WITH_FREETYPE @USE_FREETYPE@)
65set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
2e48c1cb 66set (OpenCASCADE_WITH_TBB @USE_TBB@)
67set (OpenCASCADE_WITH_VTK @USE_VTK@)
08f8a185 68set (OpenCASCADE_WITH_FFMPEG @USE_FFMPEG@)
1ce0716b 69set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
2e48c1cb 70@SET_OpenCASCADE_WITH_D3D@
71@SET_OpenCASCADE_WITH_GLX@
ada9ef40 72
a3d2cb24 73# Import OpenCASCADE compile definitions, C and C++ flags for each installed configuration.
74file(GLOB CONFIG_FILES "${CMAKE_CURRENT_LIST_DIR}/OpenCASCADECompileDefinitionsAndFlags-*.cmake")
75foreach(f ${CONFIG_FILES})
76 include(${f})
77endforeach()
78
ada9ef40 79if (NOT OpenCASCADE_FIND_COMPONENTS)
80 set (OpenCASCADE_FIND_COMPONENTS ${OpenCASCADE_MODULES})
81endif ()
82
83# Import OpenCASCADE targets.
84foreach(_comp ${OpenCASCADE_FIND_COMPONENTS})
85 if (NOT ";${OpenCASCADE_MODULES};" MATCHES "${_comp}")
86 set(OpenCASCADE_FOUND False)
87 set(OpenCASCADE_NOTFOUND_MESSAGE "Specified unsupported component: ${_comp}")
88 if (NOT OpenCASCADE_FIND_QUIETLY)
89 message (ERROR ": ${OpenCASCADE_NOTFOUND_MESSAGE}")
90 endif()
91 else()
92 include("${CMAKE_CURRENT_LIST_DIR}/OpenCASCADE${_comp}Targets.cmake")
93 endif()
94endforeach()