1 # Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
\r
3 # This library is free software; you can redistribute it and/or
\r
4 # modify it under the terms of the GNU Lesser General Public
\r
5 # License as published by the Free Software Foundation; either
\r
6 # version 2.1 of the License, or (at your option) any later version.
\r
8 # This library is distributed in the hope that it will be useful,
\r
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
11 # Lesser General Public License for more details.
\r
13 # You should have received a copy of the GNU Lesser General Public
\r
14 # License along with this library; if not, write to the Free Software
\r
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
\r
20 IF(NOT CAS_FIND_QUIETLY)
\r
21 MESSAGE(STATUS "Looking for Open CASCADE Technology ...")
\r
24 SET(_CAS_VERSION_FILE_NAME Standard_Version.hxx)
\r
26 # Include directories:
\r
27 FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include/opencascade)
\r
28 FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include/opencascade)
\r
29 IF(CAS_INCLUDE_DIRS)
\r
32 FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include inc)
\r
33 FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include inc)
\r
35 MARK_AS_ADVANCED(CAS_VERSION_FILE)
\r
37 SET(CAS_VERSION_DEVELOPMENT 0)
\r
38 IF(CAS_VERSION_FILE)
\r
39 # Check if this is a development version:
\r
40 FILE(STRINGS ${CAS_VERSION_FILE} CAS_VERSION_DEVELOPMENT_STR
\r
41 REGEX "^ *#define OCC_VERSION_DEVELOPMENT")
\r
42 IF(CAS_VERSION_DEVELOPMENT_STR)
\r
43 SET(CAS_VERSION_DEVELOPMENT 1)
\r
44 ENDIF(CAS_VERSION_DEVELOPMENT_STR)
\r
46 # Extract actual version number:
\r
47 FILE(STRINGS ${CAS_VERSION_FILE} _tmp
\r
48 REGEX "^ *#define OCC_VERSION_COMPLETE *\"[^\"]*\".*$")
\r
49 STRING(REGEX REPLACE ".*\"([^\"]*)\".*" "\\1" CAS_VERSION_STR "${_tmp}")
\r
52 # Win specific stuff:
\r
54 IF(CMAKE_BUILD_TYPE STREQUAL Debug)
\r
55 SET(CMAKE_LIBRARY_PATH ${CAS_ROOT_DIR}/win32/libd ${CAS_ROOT_DIR}/win64/lib/vc10)
\r
57 SET(CMAKE_LIBRARY_PATH ${CAS_ROOT_DIR}/win32/lib ${CAS_ROOT_DIR}/win64/lib/vc10)
\r
62 SET(CAS_DEFINITIONS "-DLIN -DLINTEL -DCSFDB")
\r
63 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DNo_exception")
\r
65 # Check config.h file
\r
66 FIND_FILE(CAS_CONFIG_H config.h PATHS ${CAS_INCLUDE_DIRS} NO_DEFAULT_PATH)
\r
68 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H")
\r
71 # Test for 64 bit machine:
\r
72 IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
\r
73 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -D_OCC64")
\r
76 # Find Xmu library (X11 widgets?)
\r
78 FIND_LIBRARY(CAS_Xmu Xmu)
\r
80 SET(CAS_LDPATH ${Xmu})
\r
84 IF(CAS_VERSION_STR VERSION_LESS "7.0.1")
\r
85 FIND_LIBRARY(CAS_FWOSPlugin FWOSPlugin PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
87 FIND_LIBRARY(CAS_TKStd TKStd PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
89 FIND_LIBRARY(CAS_TKBin TKBin PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
90 FIND_LIBRARY(CAS_TKBinL TKBinL PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
91 FIND_LIBRARY(CAS_TKBinTObj TKBinTObj PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
92 FIND_LIBRARY(CAS_TKBinXCAF TKBinXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
93 FIND_LIBRARY(CAS_TKBO TKBO PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
94 FIND_LIBRARY(CAS_TKBool TKBool PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
95 FIND_LIBRARY(CAS_TKBRep TKBRep PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
96 FIND_LIBRARY(CAS_TKCAF TKCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
97 FIND_LIBRARY(CAS_TKCDF TKCDF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
98 FIND_LIBRARY(CAS_TKernel TKernel PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
99 FIND_LIBRARY(CAS_TKFeat TKFeat PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
100 FIND_LIBRARY(CAS_TKFillet TKFillet PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
101 FIND_LIBRARY(CAS_TKG2d TKG2d PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
102 FIND_LIBRARY(CAS_TKG3d TKG3d PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
103 FIND_LIBRARY(CAS_TKGeomAlgo TKGeomAlgo PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
104 FIND_LIBRARY(CAS_TKGeomBase TKGeomBase PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
105 FIND_LIBRARY(CAS_TKHLR TKHLR PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
106 FIND_LIBRARY(CAS_TKIGES TKIGES PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
107 FIND_LIBRARY(CAS_TKLCAF TKLCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
108 FIND_LIBRARY(CAS_TKMath TKMath PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
109 FIND_LIBRARY(CAS_TKMesh TKMesh PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
110 FIND_LIBRARY(CAS_TKMeshVS TKMeshVS PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
111 IF(CAS_VERSION_STR VERSION_LESS "6.9.1")
\r
112 FIND_LIBRARY(CAS_TKNIS TKNIS PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
114 FIND_LIBRARY(CAS_TKOffset TKOffset PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
115 FIND_LIBRARY(CAS_TKOpenGl TKOpenGl PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
116 FIND_LIBRARY(CAS_TKPrim TKPrim PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
117 FIND_LIBRARY(CAS_TKService TKService PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
118 FIND_LIBRARY(CAS_TKShHealing TKShHealing PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
119 FIND_LIBRARY(CAS_TKSTEP TKSTEP PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
120 FIND_LIBRARY(CAS_TKSTEP209 TKSTEP209 PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
121 FIND_LIBRARY(CAS_TKSTEPAttr TKSTEPAttr PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
122 FIND_LIBRARY(CAS_TKSTEPBase TKSTEPBase PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
123 FIND_LIBRARY(CAS_TKSTL TKSTL PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
124 FIND_LIBRARY(CAS_TKTObj TKTObj PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
125 FIND_LIBRARY(CAS_TKTopAlgo TKTopAlgo PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
126 FIND_LIBRARY(CAS_TKV3d TKV3d PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
127 FIND_LIBRARY(CAS_TKVRML TKVRML PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
128 FIND_LIBRARY(CAS_TKXCAF TKXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
129 FIND_LIBRARY(CAS_TKXDEIGES TKXDEIGES PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
130 FIND_LIBRARY(CAS_TKXDESTEP TKXDESTEP PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
131 FIND_LIBRARY(CAS_TKXMesh TKXMesh PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
132 FIND_LIBRARY(CAS_TKXml TKXml PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
133 FIND_LIBRARY(CAS_TKXmlL TKXmlL PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
134 FIND_LIBRARY(CAS_TKXmlTObj TKXmlTObj PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
135 FIND_LIBRARY(CAS_TKXmlXCAF TKXmlXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
136 FIND_LIBRARY(CAS_TKXSBase TKXSBase PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
138 IF(CAS_VERSION_STR VERSION_LESS "7.0")
\r
139 FIND_LIBRARY(CAS_PTKernel PTKernel PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
140 FIND_LIBRARY(CAS_TKPCAF TKPCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
141 FIND_LIBRARY(CAS_TKPLCAF TKPLCAF PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
142 FIND_LIBRARY(CAS_TKPShape TKPShape PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
143 FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
144 FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
145 FIND_LIBRARY(CAS_TKStdSchema TKStdSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
146 FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema PATH_SUFFIXES lib lin64/gcc/lib bin)
\r
149 SET(CAS_KERNEL ${CAS_TKernel} ${CAS_TKMath})
\r
150 SET(CAS_OCAF ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKCDF} ${CAS_TKLCAF})
\r
151 SET(CAS_VIEWER ${CAS_TKService} ${CAS_TKV3d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKBRep})
\r
152 SET(CAS_OCAFVIS ${CAS_TKCAF} ${CAS_TKBRep} ${CAS_TKG2d})
\r
153 SET(CAS_MODELER ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKBRep} ${CAS_TKTopAlgo} ${CAS_TKG2d})
\r
155 SET(CAS_TKV3d_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKV3d})
\r
156 SET(CAS_TKBool_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep} ${CAS_TKG2d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKTopAlgo} ${CAS_TKBool})
\r
157 SET(CAS_TKBRep_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep})
\r
158 SET(CAS_TKIGES_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKIGES})
\r
159 SET(CAS_TKSTEP_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKSTEP})
\r
160 SET(CAS_TKSTL_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKSTL})
\r
161 SET(CAS_TKCAF_EA ${CAS_TKPrim} ${CAS_TKCAF})
\r
163 SET(CAS_TKV3d ${CAS_TKV3d_EA})
\r
164 SET(CAS_TKBool ${CAS_TKBool_EA})
\r
165 SET(CAS_TKBRep ${CAS_TKBRep_EA})
\r
166 SET(CAS_TKIGES ${CAS_TKIGES_EA})
\r
167 SET(CAS_TKSTEP ${CAS_TKSTEP_EA})
\r
168 SET(CAS_TKSTL ${CAS_TKSTL_EA})
\r
169 SET(CAS_TKCAF ${CAS_TKCAF_EA})
\r
219 IF(CAS_VERSION_STR VERSION_LESS "7.0.1")
\r
220 LIST(APPEND _libs CAS_FWOSPlugin)
\r
222 LIST(APPEND _libs CAS_TKStd)
\r
225 IF(CAS_VERSION_STR VERSION_LESS "6.9.1")
\r
226 LIST(APPEND _libs CAS_TKNIS)
\r
229 IF(CAS_VERSION_STR VERSION_LESS "7.0")
\r
243 INCLUDE(FindPackageHandleStandardArgs)
\r
244 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CAS REQUIRED_VARS CAS_INCLUDE_DIRS ${_libs})
\r
246 IF(CAS_FOUND AND NOT CAS_FIND_QUIETLY)
\r
247 IF(CAS_VERSION_DEVELOPMENT)
\r
248 MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR} (development)")
\r
249 ELSE(CAS_VERSION_DEVELOPMENT)
\r
250 MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR}")
\r
251 ENDIF(CAS_VERSION_DEVELOPMENT)
\r