1 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 # Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 IF(NOT CAS_FIND_QUIETLY)
23 MESSAGE(STATUS "Looking for OpenCascade (CAS) ...")
26 SET(_CAS_VERSION_FILE_NAME Standard_Version.hxx)
28 # Include directories:
29 FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES inc)
30 FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES inc)
31 MARK_AS_ADVANCED(CAS_VERSION_FILE)
33 # Is this a development version:
34 SET(CAS_VERSION_DEVELOPMENT 0)
36 FILE(STRINGS ${CAS_VERSION_FILE} CAS_VERSION_DEVELOPMENT_STR
37 REGEX "^ *#define OCC_VERSION_DEVELOPMENT *\"dev\".*$")
38 IF(CAS_VERSION_DEVELOPMENT_STR)
39 SET(CAS_VERSION_DEVELOPMENT 1)
40 ENDIF(CAS_VERSION_DEVELOPMENT_STR)
42 # Extract normal version:
43 FILE(STRINGS ${CAS_VERSION_FILE} _tmp
44 REGEX "^ *#define OCC_VERSION_COMPLETE *\"[^\"]*\".*$")
45 STRING(REGEX REPLACE ".*\"([^\"]*)\".*" "\\1" CAS_VERSION_STR "${_tmp}")
49 IF(CAS_VERSION_DEVELOPMENT AND (NOT CAS_FIND_QUIETLY))
50 MESSAGE(STATUS "OpenCascade: development version is being used!")
55 IF(CMAKE_BUILD_TYPE STREQUAL Debug)
56 SET(CMAKE_LIBRARY_PATH $ENV{CAS_ROOT_DIR}/win32/libd)
58 SET(CMAKE_LIBRARY_PATH $ENV{CAS_ROOT_DIR}/win32/lib)
63 SET(CAS_DEFINITIONS "-DLIN -DLINTEL -DCSFDB")
64 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DNo_exception")
66 # No config.h file in the OPEN CASCADE on WINDOWS platform
68 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H")
70 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DWNT")
73 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DOCC_CONVERT_SIGNALS")
75 # Test for 64 bit machine:
76 IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
77 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -D_OCC64")
80 IF(CAS_VERSION_DEVELOPMENT STREQUAL 1)
81 SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DCAS_VERSION_DEVELOPMENT")
84 # Find Xmu library (X11 widgets?)
86 FIND_LIBRARY(CAS_Xmu Xmu)
88 SET(CAS_LDPATH ${Xmu})
92 FIND_LIBRARY(CAS_FWOSPlugin FWOSPlugin )
94 MESSAGE(STATUS "FWOS " ${CAS_FWOSPlugin})
96 FIND_LIBRARY(CAS_PTKernel PTKernel )
97 FIND_LIBRARY(CAS_TKAdvTools TKAdvTools )
98 FIND_LIBRARY(CAS_TKBin TKBin )
99 FIND_LIBRARY(CAS_TKBinL TKBinL )
100 FIND_LIBRARY(CAS_TKBinTObj TKBinTObj )
101 FIND_LIBRARY(CAS_TKBinXCAF TKBinXCAF )
102 FIND_LIBRARY(CAS_TKBO TKBO )
103 FIND_LIBRARY(CAS_TKBool TKBool )
104 FIND_LIBRARY(CAS_TKBRep TKBRep )
105 FIND_LIBRARY(CAS_TKCAF TKCAF )
106 FIND_LIBRARY(CAS_TKCDF TKCDF )
107 FIND_LIBRARY(CAS_TKernel TKernel )
108 FIND_LIBRARY(CAS_TKFeat TKFeat )
109 FIND_LIBRARY(CAS_TKFillet TKFillet )
110 FIND_LIBRARY(CAS_TKG2d TKG2d )
111 FIND_LIBRARY(CAS_TKG3d TKG3d )
112 FIND_LIBRARY(CAS_TKGeomAlgo TKGeomAlgo )
113 FIND_LIBRARY(CAS_TKGeomBase TKGeomBase )
114 FIND_LIBRARY(CAS_TKHLR TKHLR )
115 FIND_LIBRARY(CAS_TKIGES TKIGES )
116 FIND_LIBRARY(CAS_TKLCAF TKLCAF )
117 FIND_LIBRARY(CAS_TKMath TKMath )
118 FIND_LIBRARY(CAS_TKMesh TKMesh )
119 FIND_LIBRARY(CAS_TKMeshVS TKMeshVS )
120 FIND_LIBRARY(CAS_TKNIS TKNIS )
121 FIND_LIBRARY(CAS_TKOffset TKOffset )
122 FIND_LIBRARY(CAS_TKOpenGl TKOpenGl )
123 FIND_LIBRARY(CAS_TKPCAF TKPCAF )
124 FIND_LIBRARY(CAS_TKPLCAF TKPLCAF )
125 FIND_LIBRARY(CAS_TKPrim TKPrim )
126 FIND_LIBRARY(CAS_TKPShape TKPShape )
127 FIND_LIBRARY(CAS_TKService TKService )
128 FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema )
129 FIND_LIBRARY(CAS_TKShHealing TKShHealing )
130 FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema )
131 FIND_LIBRARY(CAS_TKStdSchema TKStdSchema )
132 FIND_LIBRARY(CAS_TKSTEP TKSTEP )
133 FIND_LIBRARY(CAS_TKSTEP209 TKSTEP209 )
134 FIND_LIBRARY(CAS_TKSTEPAttr TKSTEPAttr )
135 FIND_LIBRARY(CAS_TKSTEPBase TKSTEPBase )
136 FIND_LIBRARY(CAS_TKSTL TKSTL )
137 FIND_LIBRARY(CAS_TKTObj TKTObj )
138 FIND_LIBRARY(CAS_TKTopAlgo TKTopAlgo )
139 FIND_LIBRARY(CAS_TKV3d TKV3d )
140 FIND_LIBRARY(CAS_TKVRML TKVRML )
141 FIND_LIBRARY(CAS_TKXCAF TKXCAF )
142 FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema )
143 FIND_LIBRARY(CAS_TKXDEIGES TKXDEIGES )
144 FIND_LIBRARY(CAS_TKXDESTEP TKXDESTEP )
145 FIND_LIBRARY(CAS_TKXMesh TKXMesh )
146 FIND_LIBRARY(CAS_TKXml TKXml )
147 FIND_LIBRARY(CAS_TKXmlL TKXmlL )
148 FIND_LIBRARY(CAS_TKXmlTObj TKXmlTObj )
149 FIND_LIBRARY(CAS_TKXmlXCAF TKXmlXCAF )
150 FIND_LIBRARY(CAS_TKXSBase TKXSBase )
152 SET(CAS_KERNEL ${CAS_TKernel} ${CAS_TKMath})
153 SET(CAS_OCAF ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKCDF} ${CAS_TKLCAF})
154 SET(CAS_VIEWER ${CAS_TKService} ${CAS_TKV3d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKBRep})
155 SET(CAS_OCAFVIS ${CAS_TKCAF} ${CAS_TKBRep} ${CAS_TKG2d})
156 SET(CAS_MODELER ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKBRep} ${CAS_TKTopAlgo} ${CAS_TKG2d})
157 # TODO(mpv, vsv) Give a proper name for the following variable
158 SET(CAS_SHAPE ${CAS_TKShHealing} ${CAS_TKMesh} ${CAS_TKHLR})
161 SET(CAS_TKV3d_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKV3d})
162 SET(CAS_TKBool_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep} ${CAS_TKG2d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKTopAlgo} ${CAS_TKBool})
163 SET(CAS_TKBRep_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep})
164 SET(CAS_TKIGES_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKIGES})
165 SET(CAS_TKSTEP_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKSTEP})
166 SET(CAS_TKSTL_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKSTL})
167 SET(CAS_TKCAF_EA ${CAS_TKPrim} ${CAS_TKCAF})
169 SET(CAS_TKV3d ${CAS_TKV3d_EA})
170 SET(CAS_TKBool ${CAS_TKBool_EA})
171 SET(CAS_TKBRep ${CAS_TKBRep_EA})
172 SET(CAS_TKIGES ${CAS_TKIGES_EA})
173 SET(CAS_TKSTEP ${CAS_TKSTEP_EA})
174 SET(CAS_TKSTL ${CAS_TKSTL_EA})
175 SET(CAS_TKCAF ${CAS_TKCAF_EA})
177 INCLUDE(FindPackageHandleStandardArgs)
178 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CAS
179 REQUIRED_VARS CAS_INCLUDE_DIRS
238 IF(CAS_FOUND AND NOT CAS_FIND_QUIETLY)
239 MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR}")