1 # Copyright (C) 2013-2024 CEA, EDF, OPEN CASCADE
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 # Author: Adrien Bruneton
22 # OpenCascade detection for Salome
24 # !! Please read the generic detection procedure in SalomeMacros.cmake !!
27 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(CAS CAS_INCLUDE_DIRS 1)
29 SET(OCCT_MINIMUM_VERSION "7.2")
30 IF(CAS_VERSION_STR VERSION_LESS ${OCCT_MINIMUM_VERSION})
31 MESSAGE(FATAL_ERROR "SALOME requires Open CASCADE Technology ${OCCT_MINIMUM_VERSION} or newer.")
34 MARK_AS_ADVANCED(CAS_INCLUDE_DIRS)
107 SET(CAS_STDPLUGIN TKStd)
108 SET(CAS_BINPLUGIN TKBin)
110 # Workaround: detect and add freetype to CAS_INCLUDE_DIRS
111 # It will be suppressed after migration OCCT detection procedure to CONFIG mode
112 # and the correction of the several bugs in the OCCT CMake configuration.
113 SET(Freetype_DIR $ENV{FREETYPE_ROOT_DIR})
114 FIND_PACKAGE(Freetype)
116 # Standard CMake Findfreetype.cmake doesn't find ft2build.h, do it manually:
117 # 1. Find custom freetype
118 FIND_PATH( FREETYPE_INCLUDE_DIR_ft2build ft2build.h
119 PATHS $ENV{FREETYPE_ROOT_DIR}
120 PATH_SUFFIXES include/freetype2 include freetype2
123 # 2. Find native freetype, if custom doesn't found:
124 IF(NOT FREETYPE_INCLUDE_DIR_ft2build)
125 FIND_PATH( FREETYPE_INCLUDE_DIR_ft2build ft2build.h
126 PATH_SUFFIXES include/freetype2 include freetype2 )
128 SET(CAS_INCLUDE_DIRS ${CAS_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIR_freetype2} ${FREETYPE_INCLUDE_DIR_ft2build})
132 SALOME_ACCUMULATE_HEADERS(CAS_INCLUDE_DIRS)
133 SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CAS_TKernel})