19286d7c |
1 | cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) |
166d6cd7 |
2 | |
576f8b11 |
3 | set (CMAKE_SUPPRESS_REGENERATION TRUE) |
4 | |
fa0cbe55 |
5 | set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE) |
03c69aec |
6 | |
316d77d9 |
7 | # macro: include patched file if it exists |
8 | macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE) |
109aa56e |
9 | if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake") |
10 | include (${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake) |
316d77d9 |
11 | else() |
f2e9c853 |
12 | include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake) |
316d77d9 |
13 | endif() |
14 | endmacro() |
15 | |
16 | # include variable description |
17 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr") |
18 | |
c259930b |
19 | # set type of OCCT libraries |
20 | if (NOT BUILD_LIBRARY_TYPE) |
316d77d9 |
21 | set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "${BUILD_LIBRARY_TYPE_DESCR}" FORCE) |
c259930b |
22 | SET_PROPERTY(CACHE BUILD_LIBRARY_TYPE PROPERTY STRINGS Shared Static) |
23 | endif() |
24 | |
25 | if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared") |
26 | set (BUILD_SHARED_LIBS ON) |
46bd680a |
27 | |
28 | if (NOT DEFINED BUILD_SHARED_LIBRARY_NAME_POSTFIX) |
29 | set (BUILD_SHARED_LIBRARY_NAME_POSTFIX "" CACHE STRING "${BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR}" FORCE) |
30 | endif() |
c259930b |
31 | else() |
32 | unset (BUILD_SHARED_LIBS) |
3321f684 |
33 | message (STATUS "Info: Only 3rdparty's header files are used for building of static OCCT libraries") |
46bd680a |
34 | unset (BUILD_SHARED_LIBRARY_NAME_POSTFIX) |
c259930b |
35 | endif() |
36 | |
9f33b387 |
37 | # the name of the project |
38 | project (OCCT) |
03c69aec |
39 | |
096ef695 |
40 | # include occt macros |
41 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros") |
42 | |
9f33b387 |
43 | # Solution folder property |
44 | set_property (GLOBAL PROPERTY USE_FOLDERS ON) |
03c69aec |
45 | |
096ef695 |
46 | # get current OCCT version |
47 | OCC_VERSION (OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT) |
48 | |
49 | set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR}) |
50 | set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR}) |
51 | set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE}) |
52 | |
0e617b05 |
53 | set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}") |
096ef695 |
54 | |
ee5befae |
55 | # Regeneration of OCCT resource files |
56 | set (BUILD_RESOURCES OFF CACHE BOOL "${BUILD_RESOURCES_DESCR}") |
57 | |
096ef695 |
58 | # single-configuration generator |
59 | set (SINGLE_GENERATOR OFF) |
60 | if (CMAKE_BUILD_TYPE) |
61 | set (SINGLE_GENERATOR ON) |
62 | endif() |
63 | |
316d77d9 |
64 | # a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable |
65 | # check this variable and set if it's required |
66 | if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator. |
67 | set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE) |
19286d7c |
68 | endif() |
69 | |
898f6a92 |
70 | # enable extended messages of many OCCT algorithms |
742cc8b0 |
71 | if (((SINGLE_GENERATOR AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR NOT SINGLE_GENERATOR) AND (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")) |
e13e5f39 |
72 | if (NOT BUILD_WITH_DEBUG) |
73 | set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}") |
74 | endif() |
75 | else() |
76 | OCCT_CHECK_AND_UNSET (BUILD_WITH_DEBUG) |
77 | endif() |
78 | |
109aa56e |
79 | if (BUILD_WITH_DEBUG) |
e13e5f39 |
80 | set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>) |
898f6a92 |
81 | endif() |
316d77d9 |
82 | |
19286d7c |
83 | # copy samples to install directory |
0e617b05 |
84 | set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}") |
19286d7c |
85 | |
096ef695 |
86 | # install dir of the project |
87 | if (NOT DEFINED INSTALL_DIR) |
4b3541c6 |
88 | # set default install directory for Windows |
84258256 |
89 | if (WIN32 AND NOT DEFINED CMAKE_INSTALL_PREFIX) |
4b3541c6 |
90 | set (CMAKE_INSTALL_PREFIX "C:/opencascade-${OCC_VERSION_STRING_EXT}") |
91 | endif() |
096ef695 |
92 | set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}") |
84258256 |
93 | else() |
1d505bb0 |
94 | file (TO_CMAKE_PATH "${INSTALL_DIR}" INSTALL_DIR) |
84258256 |
95 | set (INSTALL_DIR "${INSTALL_DIR}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE) |
096ef695 |
96 | endif() |
97 | |
4b3541c6 |
98 | # choose a variant of the layout of the install paths |
99 | if (NOT INSTALL_DIR_LAYOUT) |
100 | if (WIN32) |
101 | set (INSTALL_DIR_LAYOUT "Windows" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE) |
102 | else() |
103 | set (INSTALL_DIR_LAYOUT "Unix" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE) |
104 | endif() |
105 | SET_PROPERTY(CACHE INSTALL_DIR_LAYOUT PROPERTY STRINGS Windows Unix) |
106 | endif() |
107 | |
108 | # check INSTALL_DIR_LAYOUT changes and update INSTALL_DIR_* paths if necessary |
109 | if (NOT DEFINED INSTALL_DIR_LAYOUT_PREV) |
110 | set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE) |
111 | elseif (NOT "${INSTALL_DIR_LAYOUT_PREV}" STREQUAL "${INSTALL_DIR_LAYOUT}") |
112 | set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE) |
113 | # The structure of install folder should be reset due to changed layout |
114 | OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS () |
115 | |
116 | # Unset INSTALL_DIR_WITH_VERSION on windows |
117 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Windows") |
118 | OCCT_CHECK_AND_UNSET (INSTALL_DIR_WITH_VERSION) |
119 | else() |
120 | if (NOT DEFINED INSTALL_DIR_WITH_VERSION) |
121 | set (INSTALL_DIR_WITH_VERSION OFF CACHE BOOL "${INSTALL_DIR_WITH_VERSION_DESCR}") |
122 | endif() |
123 | endif() |
124 | endif() |
125 | |
126 | # check CMAKE_INSTALL_PREFIX changes and update INSTALL_DIR if necessary |
d573adcf |
127 | if (NOT DEFINED CMAKE_INSTALL_PREFIX_PREV) |
128 | set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE) |
129 | elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}") |
130 | # CMAKE_INSTALL_PREFIX has been changed at previous step |
131 | set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE) |
132 | |
133 | # INSTALL_DIR is required to be updated |
134 | set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE) |
135 | endif() |
136 | |
4b3541c6 |
137 | # check INSTALL_DIR changes and update CMAKE_INSTALL_PREFIX if necessary |
d573adcf |
138 | if (NOT DEFINED INSTALL_DIR_PREV) |
139 | set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) |
140 | elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}") |
141 | # INSTALL_DIR has been changed at previous step |
142 | set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) |
143 | |
144 | # sync CMAKE_INSTALL_PREFIX with INSTALL_DIR |
145 | set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) |
146 | |
147 | # set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder |
148 | set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) |
4b3541c6 |
149 | endif() |
d573adcf |
150 | |
4b3541c6 |
151 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
152 | if (NOT DEFINED INSTALL_DIR_WITH_VERSION_PREV) |
153 | set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE) |
154 | elseif (NOT "${INSTALL_DIR_WITH_VERSION_PREV}" STREQUAL "${INSTALL_DIR_WITH_VERSION}") |
155 | # INSTALL_DIR_WITH_VERSION has been changed at previous step |
156 | set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE) |
157 | |
158 | OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS () |
159 | endif() |
096ef695 |
160 | endif() |
161 | |
162 | # hide CMAKE_INSTALL_PREFIX from a user |
163 | set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) |
164 | |
165 | set (BIN_LETTER "") |
166 | if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") |
167 | set (BIN_LETTER "d") |
168 | elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") |
169 | set (BIN_LETTER "i") |
170 | endif() |
03c69aec |
171 | |
096ef695 |
172 | # Get all used variables: OS_WITH_BIT, COMPILER |
173 | OCCT_MAKE_OS_WITH_BITNESS() |
174 | OCCT_MAKE_COMPILER_SHORT_NAME() |
175 | |
4b3541c6 |
176 | # do not define INSTALL_DIR_BIN for win. |
096ef695 |
177 | # Leave library structure for win: <prefix>/win64/vc10/bin(d) |
4b3541c6 |
178 | if (NOT DEFINED INSTALL_DIR_BIN) |
179 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
180 | set (INSTALL_DIR_BIN "bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}") |
096ef695 |
181 | else() |
4b3541c6 |
182 | set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}") |
096ef695 |
183 | endif() |
184 | endif() |
185 | |
186 | # define folder contaning all shell/batch scripts |
4b3541c6 |
187 | if (NOT DEFINED INSTALL_DIR_SCRIPT) |
188 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
189 | set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}") |
096ef695 |
190 | else() |
4b3541c6 |
191 | set (INSTALL_DIR_SCRIPT "." CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}") |
096ef695 |
192 | endif() |
193 | endif() |
194 | |
195 | # place the libraries to <prefix>/lib folder for unix and leave old structure for windows |
4b3541c6 |
196 | if (NOT DEFINED INSTALL_DIR_LIB) |
197 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
198 | set (INSTALL_DIR_LIB "lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}") |
096ef695 |
199 | else() |
4b3541c6 |
200 | set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}") |
096ef695 |
201 | endif() |
202 | endif() |
203 | |
204 | # OCCT headers: <prefix>/inc for windows, |
205 | # <prefix>/include/opencascade-7.0.0 for unix |
4b3541c6 |
206 | if (NOT DEFINED INSTALL_DIR_INCLUDE) |
207 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
208 | set (INSTALL_DIR_INCLUDE "include/opencascade" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}") |
209 | if (INSTALL_DIR_WITH_VERSION) |
210 | set (INSTALL_DIR_INCLUDE "include/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}" FORCE) |
211 | endif() |
096ef695 |
212 | else() |
4b3541c6 |
213 | set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}") |
096ef695 |
214 | endif() |
215 | endif() |
216 | |
217 | # OCCT resources: <prefix>/src for windows, |
218 | # <prefix>/share/opencascade-7.0.0/resources for unix |
4b3541c6 |
219 | if (NOT DEFINED INSTALL_DIR_RESOURCE) |
220 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
221 | set (INSTALL_DIR_RESOURCE "share/opencascade/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}") |
222 | if (INSTALL_DIR_WITH_VERSION) |
223 | set (INSTALL_DIR_RESOURCE "share/opencascade-${OCC_VERSION_STRING_EXT}/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}" FORCE) |
224 | endif() |
096ef695 |
225 | else() |
4b3541c6 |
226 | set (INSTALL_DIR_RESOURCE "src" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}") |
096ef695 |
227 | endif() |
228 | endif() |
229 | |
230 | # OCCT data |
4b3541c6 |
231 | if (NOT DEFINED INSTALL_DIR_DATA) |
232 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
233 | set (INSTALL_DIR_DATA "share/opencascade/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}") |
234 | if (INSTALL_DIR_WITH_VERSION) |
235 | set (INSTALL_DIR_DATA "share/opencascade-${OCC_VERSION_STRING_EXT}/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}" FORCE) |
236 | endif() |
237 | else() |
238 | set (INSTALL_DIR_DATA "data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}") |
239 | endif() |
240 | endif() |
241 | |
242 | # OCCT samples |
243 | if (NOT DEFINED INSTALL_DIR_SAMPLES) |
244 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
245 | set (INSTALL_DIR_SAMPLES "share/opencascade/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}") |
246 | if (INSTALL_DIR_WITH_VERSION) |
247 | set (INSTALL_DIR_SAMPLES "share/opencascade-${OCC_VERSION_STRING_EXT}/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}" FORCE) |
248 | endif() |
249 | else() |
250 | set (INSTALL_DIR_SAMPLES "samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}") |
251 | endif() |
252 | endif() |
253 | |
254 | # OCCT tests |
255 | if (NOT DEFINED INSTALL_DIR_TESTS) |
256 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
257 | set (INSTALL_DIR_TESTS "share/opencascade/tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}") |
258 | if (INSTALL_DIR_WITH_VERSION) |
259 | set (INSTALL_DIR_TESTS "share/opencascade-${OCC_VERSION_STRING_EXT}/tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}" FORCE) |
260 | endif() |
261 | else() |
262 | set (INSTALL_DIR_TESTS "tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}") |
263 | endif() |
264 | endif() |
265 | |
266 | # OCCT doc |
267 | if (NOT DEFINED INSTALL_DIR_DOC) |
268 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
269 | set (INSTALL_DIR_DOC "share/doc/opencascade" CACHE PATH "${INSTALL_DIR_DOC_DESCR}") |
270 | if (INSTALL_DIR_WITH_VERSION) |
271 | set (INSTALL_DIR_DOC "share/doc/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_DOC_DESCR}" FORCE) |
272 | endif() |
096ef695 |
273 | else() |
4b3541c6 |
274 | set (INSTALL_DIR_DOC "doc" CACHE PATH "${INSTALL_DIR_DOC_DESCR}") |
096ef695 |
275 | endif() |
276 | endif() |
277 | |
2e48c1cb |
278 | # define folder contaning CMake configuration files |
279 | if (NOT DEFINED INSTALL_DIR_CMAKE) |
280 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
281 | if (INSTALL_DIR_WITH_VERSION) |
282 | set (INSTALL_DIR_CMAKE "lib/cmake/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}") |
283 | else() |
284 | set (INSTALL_DIR_CMAKE "lib/cmake/opencascade" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}") |
285 | endif() |
286 | else() |
ada9ef40 |
287 | set (INSTALL_DIR_CMAKE "cmake" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}") |
2e48c1cb |
288 | endif() |
289 | endif() |
290 | |
ee5befae |
291 | # include occt macros |
292 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_resources") |
293 | |
4b3541c6 |
294 | # install LICENSE_LGPL_21.txt and OCCT_LGPL_EXCEPTION.txt files |
295 | if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") |
d26375e2 |
296 | OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR_DOC}") |
297 | OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR_DOC}") |
4b3541c6 |
298 | else() |
d26375e2 |
299 | OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" ".") |
300 | OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" ".") |
4b3541c6 |
301 | endif() |
302 | |
09eca2b5 |
303 | if(APPLE) |
304 | set (INSTALL_NAME_DIR "" CACHE STRING "install_name library suffix on OS X (e.g. @executable_path/../Frameworks)") |
305 | endif() |
306 | |
096ef695 |
307 | # a directory recognized as a 'patch' for OCCT |
109aa56e |
308 | set (BUILD_PATCH "" CACHE PATH "${BUILD_PATCH_DESCR}") |
03c69aec |
309 | |
9f33b387 |
310 | # the list of being built toolkits |
316d77d9 |
311 | set (BUILD_ADDITIONAL_TOOLKITS "" CACHE STRING "${BUILD_ADDITIONAL_TOOLKITS_DESCR}") |
312 | separate_arguments (BUILD_ADDITIONAL_TOOLKITS) |
03c69aec |
313 | |
ad211ad3 |
314 | if (MSVC) |
4b3541c6 |
315 | set (BUILD_MODULE_MfcSamples OFF CACHE BOOL "${BUILD_MODULE_MfcSamples_DESCR}") |
85bcc072 |
316 | endif() |
317 | |
742cc8b0 |
318 | # uwp sample |
319 | if (MSVC) |
320 | if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") |
321 | set (BUILD_MODULE_UwpSample OFF CACHE BOOL "${BUILD_MODULE_UwpSample_DESCR}") |
322 | else() |
323 | unset (BUILD_MODULE_UwpSample) |
324 | endif() |
325 | endif() |
326 | |
9f33b387 |
327 | # whether use optional 3rdparty or not |
328 | if (APPLE) |
316d77d9 |
329 | set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}") |
03c69aec |
330 | endif() |
096ef695 |
331 | |
f60111dc |
332 | if (WIN32) |
333 | set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}") |
334 | endif() |
85bcc072 |
335 | |
9f33b387 |
336 | # include the patched or original list of modules |
19286d7c |
337 | # list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits |
338 | # list <OCCT_MODULES> will contain all modules |
339 | OCCT_MODULES_AND_TOOLKITS (OCCT_MODULES) |
03c69aec |
340 | |
316d77d9 |
341 | foreach (OCCT_MODULE ${OCCT_MODULES}) |
342 | BUILD_MODULE (${OCCT_MODULE}) |
19286d7c |
343 | endforeach() |
344 | |
e713baee |
345 | if (ANDROID AND BUILD_MODULE_Draw) |
346 | message (STATUS "Info. Draw module is turned off due to it is not supported on Android") |
347 | set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE) |
348 | endif() |
49e5d238 |
349 | if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND BUILD_MODULE_Draw) |
350 | message (STATUS "Info. Draw module is turned off due to it is not supported on UWP") |
351 | set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE) |
352 | endif() |
e713baee |
353 | |
adc33035 |
354 | # Overview |
9d034c37 |
355 | if (NOT DEFINED BUILD_DOC_Overview) |
356 | set (DO_ONLY_CHECK_FOR_DOXYGEN ON) |
357 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen") |
358 | set (DO_ONLY_CHECK_FOR_DOXYGEN OFF) |
359 | |
360 | if (CAN_DOXYGEN_BE_USED) |
361 | message (STATUS "Info. Overview building is turned on") |
362 | endif() |
363 | |
364 | set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}") |
365 | endif() |
adc33035 |
366 | |
f60111dc |
367 | if (NOT USE_D3D) |
368 | list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost) |
369 | endif() |
370 | |
316d77d9 |
371 | # accumulate used toolkits (first level) in BUILD_TOOLKITS variable |
372 | list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS}) |
19286d7c |
373 | |
316d77d9 |
374 | foreach (OCCT_MODULE ${OCCT_MODULES}) |
375 | if (BUILD_MODULE_${OCCT_MODULE}) |
376 | list (APPEND BUILD_TOOLKITS ${${OCCT_MODULE}_TOOLKITS}) |
19286d7c |
377 | endif() |
378 | endforeach() |
379 | |
380 | # DRAWEXE excluded when library build is static |
381 | if (NOT BUILD_SHARED_LIBS) |
316d77d9 |
382 | list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE) |
19286d7c |
383 | message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type") |
384 | endif() |
385 | |
386 | # accumulate all used toolkits |
316d77d9 |
387 | list (REMOVE_DUPLICATES BUILD_TOOLKITS) |
388 | set (RAW_BUILD_TOOLKITS) |
096ef695 |
389 | foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS}) |
316d77d9 |
390 | OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS) |
391 | list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS}) |
19286d7c |
392 | endforeach() |
393 | |
316d77d9 |
394 | list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS) |
395 | set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS}) |
03c69aec |
396 | |
9f33b387 |
397 | # include the patched or original list of definitions and flags |
19286d7c |
398 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags") |
03c69aec |
399 | |
19286d7c |
400 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro") |
03c69aec |
401 | |
a6874708 |
402 | # search for TKIVtk and TKIVtkDraw in BUILD_TOOLKITS |
403 | list (FIND BUILD_TOOLKITS TKIVtk CAN_USE_VTK) |
404 | if (CAN_USE_VTK EQUAL -1) |
405 | list (FIND BUILD_TOOLKITS TKIVtkDraw CAN_USE_VTK) |
406 | endif() |
407 | |
408 | if (NOT CAN_USE_VTK EQUAL -1) |
409 | if (NOT DEFINED USE_VTK) |
410 | set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}") |
411 | endif() |
412 | else() |
413 | OCCT_CHECK_AND_UNSET (USE_VTK) |
414 | endif() |
415 | |
5682a6fa |
416 | # Rebuild *.yacc and *.lex files that are contained by TKMath toolkit |
417 | list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH) |
418 | list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE) |
419 | |
fb3267c7 |
420 | if (NOT ${CAN_REBUILD_PDC_FOR_TKMATH} EQUAL -1 OR NOT ${CAN_REBUILD_PDC_FOR_STEPFILE} EQUAL -1) |
109aa56e |
421 | set (BUILD_YACCLEX OFF CACHE BOOL "${BUILD_YACCLEX_DESCR}") |
5682a6fa |
422 | else() |
109aa56e |
423 | OCCT_CHECK_AND_UNSET (BUILD_YACCLEX) |
5682a6fa |
424 | endif() |
425 | |
9f33b387 |
426 | if (NOT DEFINED 3RDPARTY_DIR) |
316d77d9 |
427 | set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR}) |
e713baee |
428 | get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE) |
84258256 |
429 | else() |
1d505bb0 |
430 | file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR) |
84258256 |
431 | set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE) |
9f33b387 |
432 | endif() |
234e52be |
433 | |
9f33b387 |
434 | # search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit |
f2e9c853 |
435 | OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL) |
03c69aec |
436 | |
fb3267c7 |
437 | if (USE_TCL) |
5682a6fa |
438 | message (STATUS "Info: TCL is used by OCCT") |
19286d7c |
439 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl") |
82f443b6 |
440 | |
441 | message (STATUS "Info: TK is used by OCCT") |
442 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk") |
9f33b387 |
443 | else() |
9ccea0c6 |
444 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL") |
445 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK") |
5682a6fa |
446 | |
447 | OCCT_CHECK_AND_UNSET ("INSTALL_TCL") |
82f443b6 |
448 | OCCT_CHECK_AND_UNSET ("INSTALL_TK") |
9f33b387 |
449 | endif() |
03c69aec |
450 | |
9f33b387 |
451 | # search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit |
f2e9c853 |
452 | OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE) |
03c69aec |
453 | |
fb3267c7 |
454 | if (USE_FREETYPE) |
5682a6fa |
455 | message (STATUS "Info: Freetype is used by OCCT") |
19286d7c |
456 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype") |
9f33b387 |
457 | else() |
9ccea0c6 |
458 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE") |
9f33b387 |
459 | OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2") |
460 | OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build") |
5682a6fa |
461 | OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE") |
9f33b387 |
462 | endif() |
03c69aec |
463 | |
09c597c9 |
464 | # VTK |
465 | if (USE_VTK) |
466 | add_definitions (-DHAVE_VTK) |
19286d7c |
467 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk") |
f2e9c853 |
468 | else() |
469 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK") |
a6874708 |
470 | |
471 | if (NOT CAN_USE_VTK EQUAL -1) |
472 | message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled") |
473 | |
474 | list (REMOVE_ITEM BUILD_TOOLKITS TKIVtk) |
475 | list (REMOVE_ITEM BUILD_TOOLKITS TKIVtkDraw) |
476 | endif() |
09c597c9 |
477 | endif() |
478 | |
f60111dc |
479 | # D3D |
480 | if (USE_D3D) |
481 | add_definitions (-DHAVE_D3D) |
482 | #if(MSVC_VERSION LESS 1700) |
483 | #OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d") |
484 | #endif() |
485 | endif() |
486 | |
09c597c9 |
487 | # GLX |
488 | if (USE_GLX) |
489 | add_definitions (-DMACOSX_USE_GLX) |
19286d7c |
490 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx") |
09c597c9 |
491 | endif() |
492 | |
03c69aec |
493 | # FREEIMAGE |
5682a6fa |
494 | # search for CSF_FREEIMAGE variable in EXTERNLIB of each being used toolkit |
60273f77 |
495 | OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE) |
5682a6fa |
496 | |
60273f77 |
497 | if (CAN_USE_FREEIMAGE) |
5682a6fa |
498 | set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}") |
499 | |
500 | if (USE_FREEIMAGE) |
501 | add_definitions (-DHAVE_FREEIMAGE) |
502 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage") |
5682a6fa |
503 | else() |
504 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE") |
5682a6fa |
505 | OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE") |
5682a6fa |
506 | endif() |
9f33b387 |
507 | else() |
5682a6fa |
508 | OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE") |
509 | |
9f33b387 |
510 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE") |
9f33b387 |
511 | OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE") |
9f33b387 |
512 | endif() |
03c69aec |
513 | |
1ce0716b |
514 | # OpenGL ES 2.0 |
515 | OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2) |
516 | if (WIN32 AND CAN_USE_GLES2) |
517 | if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") |
518 | set (USE_GLES2 ON) |
519 | else() |
520 | set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}") |
521 | endif() |
522 | |
523 | if (USE_GLES2) |
524 | add_definitions (-DHAVE_GLES2) |
525 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl") |
526 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2") |
527 | else() |
528 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL") |
529 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2") |
530 | OCCT_CHECK_AND_UNSET ("INSTALL_EGL") |
531 | OCCT_CHECK_AND_UNSET ("INSTALL_GLES2") |
532 | endif() |
533 | else() |
534 | OCCT_CHECK_AND_UNSET ("USE_GLES2") |
535 | |
536 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL") |
537 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2") |
538 | OCCT_CHECK_AND_UNSET ("INSTALL_EGL") |
539 | OCCT_CHECK_AND_UNSET ("INSTALL_GLES2") |
540 | endif() |
541 | |
03c69aec |
542 | # GL2PS |
5682a6fa |
543 | # search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit |
544 | OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS) |
545 | |
546 | if (NOT DEFINED ANDROID AND CAN_USE_GL2PS) |
547 | set (USE_GL2PS OFF CACHE BOOL "${USE_GL2PS_DESCR}") |
548 | |
549 | if (USE_GL2PS) |
550 | add_definitions (-DHAVE_GL2PS) |
551 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps") |
552 | else() |
553 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS") |
554 | OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS") |
555 | endif() |
9f33b387 |
556 | else() |
5682a6fa |
557 | OCCT_CHECK_AND_UNSET ("USE_GL2PS") |
558 | |
9f33b387 |
559 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS") |
560 | OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS") |
561 | endif() |
03c69aec |
562 | |
9f33b387 |
563 | # TBB |
5682a6fa |
564 | # search for CSF_TBB variable in EXTERNLIB of each being used toolkit |
565 | OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB) |
566 | |
567 | if (NOT DEFINED ANDROID AND CAN_USE_TBB) |
568 | set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}") |
569 | |
570 | if (USE_TBB) |
571 | add_definitions (-DHAVE_TBB) |
572 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") |
573 | else() |
574 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB") |
575 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC") |
576 | OCCT_CHECK_AND_UNSET ("INSTALL_TBB") |
577 | endif() |
9f33b387 |
578 | else() |
5682a6fa |
579 | OCCT_CHECK_AND_UNSET ("USE_TBB") |
580 | |
9f33b387 |
581 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB") |
582 | OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC") |
583 | OCCT_CHECK_AND_UNSET ("INSTALL_TBB") |
584 | endif() |
234e52be |
585 | |
adc33035 |
586 | # Doxygen |
4b3541c6 |
587 | if (BUILD_DOC_Overview) |
588 | if (NOT DEFINED INSTALL_DOC_Overview) |
589 | set (INSTALL_DOC_Overview OFF CACHE BOOL "${INSTALL_DOC_Overview_DESCR}") |
adc33035 |
590 | endif() |
591 | |
4b3541c6 |
592 | if (INSTALL_DOC_Overview) |
d26375e2 |
593 | install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION "${INSTALL_DIR_DOC}") |
f2e9c853 |
594 | |
096ef695 |
595 | # create overview.html only for windows |
4b3541c6 |
596 | if (WIN32 AND "${INSTALL_DIR_LAYOUT}" STREQUAL "Windows") |
d26375e2 |
597 | OCCT_INSTALL_FILE_OR_DIR ("dox/resources/overview.html" "${INSTALL_DIR_DOC}/..") |
096ef695 |
598 | endif() |
adc33035 |
599 | endif() |
600 | |
601 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen") |
602 | else() |
4b3541c6 |
603 | OCCT_CHECK_AND_UNSET ("INSTALL_DOC_Overview") |
adc33035 |
604 | |
605 | OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_EXECUTABLE") |
109aa56e |
606 | OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE") |
adc33035 |
607 | endif() |
608 | |
316d77d9 |
609 | # bison |
109aa56e |
610 | if (BUILD_YACCLEX) |
316d77d9 |
611 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison") |
612 | else() |
613 | OCCT_CHECK_AND_UNSET ("3RDPARTY_BISON_EXECUTABLE") |
614 | endif() |
615 | |
616 | # flex |
109aa56e |
617 | if (BUILD_YACCLEX) |
316d77d9 |
618 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/flex") |
619 | else() |
620 | OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE") |
621 | endif() |
622 | |
9f33b387 |
623 | string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}") |
234e52be |
624 | |
9f33b387 |
625 | # check all 3rdparty paths |
626 | if (3RDPARTY_NOT_INCLUDED) |
627 | message (FATAL_ERROR "NOT FOUND: ${3RDPARTY_NOT_INCLUDED}" ) |
628 | endif() |
7c633a3e |
629 | |
9bb81d6c |
630 | if (3RDPARTY_INCLUDE_DIRS) |
631 | list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS) |
632 | string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}") |
ada9ef40 |
633 | message (STATUS "Info: The directories of 3rdparty headers: \n\t${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}") |
9bb81d6c |
634 | include_directories (${3RDPARTY_INCLUDE_DIRS}) |
635 | endif() |
636 | |
94829f84 |
637 | # include <cmake binary folder>/inc |
638 | include_directories (${CMAKE_BINARY_DIR}/inc) |
639 | |
3321f684 |
640 | if (3RDPARTY_LIBRARY_DIRS AND BUILD_SHARED_LIBS) |
9bb81d6c |
641 | list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS) |
642 | string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}") |
ada9ef40 |
643 | message (STATUS "Info: The directories of 3rdparty libraries: \n\t${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}") |
9bb81d6c |
644 | link_directories (${3RDPARTY_LIBRARY_DIRS}) |
645 | endif() |
234e52be |
646 | |
9f33b387 |
647 | # build directories |
4b3541c6 |
648 | if (SINGLE_GENERATOR) |
649 | set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}") |
650 | set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}") |
651 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}") |
652 | if (WIN32) |
653 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}") |
654 | endif() |
655 | endif() |
656 | |
fa0cbe55 |
657 | set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") |
658 | set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") |
659 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") |
19286d7c |
660 | |
316d77d9 |
661 | set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") |
662 | set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") |
663 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") |
19286d7c |
664 | |
fa0cbe55 |
665 | set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") |
666 | set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") |
667 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") |
19286d7c |
668 | |
fa0cbe55 |
669 | if (WIN32) |
f2e9c853 |
670 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") |
671 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") |
672 | set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") |
19286d7c |
673 | endif() |
03c69aec |
674 | |
d94d80e5 |
675 | string(TIMESTAMP CURRENT_TIME "%H:%M:%S") |
676 | message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...") |
94829f84 |
677 | |
94829f84 |
678 | # collect all the headers to <binary dir>/inc folder |
f2e9c853 |
679 | COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}") |
94829f84 |
680 | |
d94d80e5 |
681 | string(TIMESTAMP CURRENT_TIME "%H:%M:%S") |
682 | message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting") |
683 | |
d26375e2 |
684 | list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX) |
685 | if (${DRAWEXE_INDEX} GREATER -1) |
686 | OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}") |
687 | OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}") |
688 | endif() |
689 | |
4b3541c6 |
690 | if (WIN32) |
691 | set (SCRIPT_EXT bat) |
692 | else() |
693 | set (SCRIPT_EXT sh) |
694 | endif() |
03c69aec |
695 | |
096ef695 |
696 | # OCCT samples |
d26375e2 |
697 | # get absolute path from INSTALL_DIR |
698 | set (INSTALL_DIR_ABSOLUTE "${INSTALL_DIR}") |
699 | if(NOT IS_ABSOLUTE "${INSTALL_DIR_ABSOLUTE}") |
700 | get_filename_component(INSTALL_DIR_ABSOLUTE "${CMAKE_BINARY_DIR}/${INSTALL_DIR}" ABSOLUTE) |
701 | endif() |
702 | |
0e617b05 |
703 | if (INSTALL_SAMPLES) |
4b3541c6 |
704 | OCCT_CONFIGURE ("adm/templates/env.samples.${SCRIPT_EXT}.in" "env.samples.${SCRIPT_EXT}") |
096ef695 |
705 | if (WIN32) |
d26375e2 |
706 | OCCT_INSTALL_FILE_OR_DIR ("samples/CSharp" "${INSTALL_DIR_SAMPLES}") |
707 | OCCT_INSTALL_FILE_OR_DIR ("samples/mfc" "${INSTALL_DIR_SAMPLES}") |
4b3541c6 |
708 | |
742cc8b0 |
709 | if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") |
d26375e2 |
710 | OCCT_INSTALL_FILE_OR_DIR ("samples/xaml" "${INSTALL_DIR_SAMPLES}") |
742cc8b0 |
711 | endif() |
712 | |
d26375e2 |
713 | install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/CSharp" RENAME "env.${SCRIPT_EXT}") |
714 | install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/mfc/standard" RENAME "env.${SCRIPT_EXT}") |
096ef695 |
715 | endif() |
03c69aec |
716 | |
d26375e2 |
717 | OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR_SAMPLES}") |
718 | OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR_SAMPLES}") |
719 | OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR_SAMPLES}") |
096ef695 |
720 | |
d26375e2 |
721 | install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}") |
722 | install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}") |
723 | install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}") |
910970ab |
724 | endif() |
03c69aec |
725 | |
4b3541c6 |
726 | if (INSTALL_TEST_CASES) |
d26375e2 |
727 | OCCT_INSTALL_FILE_OR_DIR ("tests/" "${INSTALL_DIR_TESTS}") |
910970ab |
728 | endif() |
03c69aec |
729 | |
3eabbe1b |
730 | list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX) |
731 | if (${DRAWEXE_INDEX} GREATER -1) |
732 | # copy data and samples/tcl folders to install script folder |
d26375e2 |
733 | OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}") |
734 | OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}") |
096ef695 |
735 | |
3eabbe1b |
736 | # copy draw script to install script folder |
737 | if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}") |
d26375e2 |
738 | install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}" |
3eabbe1b |
739 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) |
740 | else() |
d26375e2 |
741 | install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}" |
3eabbe1b |
742 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) |
743 | endif() |
744 | |
745 | # copy draw script to CMake binary folder |
746 | OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}") |
747 | endif() |
9f33b387 |
748 | |
316d77d9 |
749 | set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}") |
9f33b387 |
750 | |
910970ab |
751 | if (WIN32) |
4b3541c6 |
752 | set (ADDITIONAL_CUSTOM_CONTENT "\nif exist \"%~dp0${SUB_CUSTOM_NAME}\" (\n call \"%~dp0${SUB_CUSTOM_NAME}\" %1 %2 %3 \n)") |
910970ab |
753 | else() |
096ef695 |
754 | set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\$1\" \"\$2\" \nfi") |
910970ab |
755 | endif() |
32856b63 |
756 | |
910970ab |
757 | # change custom.bat/sh |
4b3541c6 |
758 | if (EXISTS "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}") |
759 | file (READ "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT) |
32856b63 |
760 | |
910970ab |
761 | set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}") |
32856b63 |
762 | |
4b3541c6 |
763 | file (WRITE "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}") |
910970ab |
764 | else() |
d26375e2 |
765 | OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}") |
910970ab |
766 | endif() |
32856b63 |
767 | |
316d77d9 |
768 | # write current custom.bat/sh (for install directory) |
769 | set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}") |
d26375e2 |
770 | OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR_SCRIPT}") |
03c69aec |
771 | |
316d77d9 |
772 | # write current custom.bat/sh (for build directory) |
773 | OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}") |
774 | |
4b3541c6 |
775 | if (BUILD_MODULE_MfcSamples) |
d26375e2 |
776 | OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR_SCRIPT}") |
f2e9c853 |
777 | OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.bat" "${CMAKE_BINARY_DIR}") |
9f33b387 |
778 | endif() |
779 | |
316d77d9 |
780 | # env script for draw in building environment |
4b3541c6 |
781 | OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}") |
316d77d9 |
782 | |
4b3541c6 |
783 | # install env script |
d26375e2 |
784 | install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}") |
316d77d9 |
785 | |
786 | # copy DrawAppliInit from OCCT source to build directory |
f2e9c853 |
787 | if (NOT EXISTS "${CMAKE_BINARY_DIR}/DrawAppliInit") |
788 | OCCT_COPY_FILE_OR_DIR (DrawAppliInit "${CMAKE_BINARY_DIR}") |
316d77d9 |
789 | endif() |
910970ab |
790 | |
9f33b387 |
791 | # RESOURCES |
19286d7c |
792 | FILE_TO_LIST ("adm/RESOURCES" RESOURCES) |
793 | foreach(RESOURCE ${RESOURCES}) |
794 | get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY) |
795 | if(NOT "${RESOURCE_FOLDER}" STREQUAL "") |
796 | get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME) |
d26375e2 |
797 | OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}") |
19286d7c |
798 | else() |
d26375e2 |
799 | OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}") |
19286d7c |
800 | endif() |
801 | endforeach() |
03c69aec |
802 | |
46bd680a |
803 | # patch installed DrawDefault file if BUILD_SHARED_LIBRARY_NAME_POSTFIX is changed |
804 | if (NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "") |
805 | OCCT_UPDATE_DRAW_DEFAULT_FILE() |
806 | endif() |
807 | |
fb3267c7 |
808 | # define CSF variable |
809 | OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf") |
810 | |
33839ae6 |
811 | # include patched toolkit projects or original ones |
316d77d9 |
812 | foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS}) |
f2e9c853 |
813 | OCCT_ADD_SUBDIRECTORY ("src/${BUILD_TOOLKIT}") |
19286d7c |
814 | endforeach() |
234e52be |
815 | |
4b3541c6 |
816 | if (BUILD_DOC_Overview) |
f2e9c853 |
817 | OCCT_ADD_SUBDIRECTORY (dox) |
adc33035 |
818 | endif() |
819 | |
94829f84 |
820 | # patch DRAWEXE |
821 | if (MSVC AND 3RDPARTY_DLL_DIRS) |
316d77d9 |
822 | list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX) |
94829f84 |
823 | if (${DRAWEXE_INDEX} GREATER -1) |
824 | list (REMOVE_DUPLICATES 3RDPARTY_DLL_DIRS) |
825 | set (3RDPARTY_DLL_DIRS_FOR_PATH "") |
826 | |
827 | foreach (3RDPARTY_DLL_DIR ${3RDPARTY_DLL_DIRS}) |
828 | set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}") |
829 | endforeach() |
830 | |
831 | OCCT_MAKE_COMPILER_BITNESS() |
832 | set (X_COMPILER_BITNESS "x64") |
833 | if ("${COMPILER_BITNESS}" STREQUAL "32") |
834 | set (X_COMPILER_BITNESS "Win32") |
835 | endif() |
836 | |
f2e9c853 |
837 | OCCT_CONFIGURE ("adm/templates/DRAWEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/src/DRAWEXE/DRAWEXE.vcxproj.user") |
94829f84 |
838 | endif() |
839 | endif() |
840 | |
33839ae6 |
841 | # samples do not support patch usage |
4b3541c6 |
842 | if (BUILD_MODULE_MfcSamples) |
19286d7c |
843 | set (OCCT_ROOT ${CMAKE_SOURCE_DIR}) |
234e52be |
844 | |
19286d7c |
845 | set (MFC_STANDARD_SAMPLES_DIR ${OCCT_ROOT}/samples/mfc/standard) |
846 | set (COMMON_WINMAIN_FILE ${MFC_STANDARD_SAMPLES_DIR}/Common/Winmain.cpp) |
234e52be |
847 | |
9f33b387 |
848 | add_subdirectory(samples/mfc/standard/mfcsample) |
849 | add_subdirectory(samples/mfc/standard/01_Geometry) |
850 | add_subdirectory(samples/mfc/standard/02_Modeling) |
851 | add_subdirectory(samples/mfc/standard/03_Viewer2d) |
852 | add_subdirectory(samples/mfc/standard/04_Viewer3d) |
853 | add_subdirectory(samples/mfc/standard/05_ImportExport) |
854 | add_subdirectory(samples/mfc/standard/06_Ocaf) |
855 | add_subdirectory(samples/mfc/standard/07_Triangulation) |
856 | add_subdirectory(samples/mfc/standard/08_HLR) |
857 | add_subdirectory(samples/mfc/standard/09_Animation) |
858 | add_subdirectory(samples/mfc/standard/10_Convert) |
19286d7c |
859 | endif() |
2e48c1cb |
860 | |
742cc8b0 |
861 | if (BUILD_MODULE_UwpSample) |
862 | add_subdirectory(samples/xaml) |
863 | endif() |
864 | |
2e48c1cb |
865 | # Prepare variables for configuration of OpenCASCADE cmake config file |
866 | set (OCCT_MODULES_ENABLED) |
867 | set (OCCT_LIBRARIES) |
ada9ef40 |
868 | set (SET_OpenCASCADE_MODULES_TOOLKITS "\n# List of available OpenCASCADE libraries for each module\n") |
a3d2cb24 |
869 | set (OCCT_COMPILE_DEFINITIONS) |
870 | |
2e48c1cb |
871 | foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS}) |
872 | if (TARGET ${OCCT_TOOLKIT}) |
873 | |
874 | # get all libraries |
875 | get_target_property (${OCCT_TOOLKIT}_TYPE ${OCCT_TOOLKIT} "TYPE") |
876 | if ("${${OCCT_TOOLKIT}_TYPE}" STREQUAL "STATIC_LIBRARY" OR "${${OCCT_TOOLKIT}_TYPE}" STREQUAL "SHARED_LIBRARY" ) |
877 | list (APPEND OCCT_LIBRARIES ${OCCT_TOOLKIT}) |
2e48c1cb |
878 | |
ada9ef40 |
879 | # get all modules |
880 | get_target_property (${OCCT_TOOLKIT}_MODULE ${OCCT_TOOLKIT} "MODULE") |
881 | list (APPEND OCCT_MODULES_ENABLED ${${OCCT_TOOLKIT}_MODULE}) |
882 | list (APPEND OpenCASCADE_${${OCCT_TOOLKIT}_MODULE}_TOOLKITS ${OCCT_TOOLKIT}) |
a3d2cb24 |
883 | |
884 | # get compile definitions of target directory |
885 | get_directory_property (COMPILE_DEFINITIONS DIRECTORY "${${OCCT_TOOLKIT}_SOURCE_DIR}" "COMPILE_DEFINITIONS") |
886 | list (APPEND OCCT_COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS}) |
2e48c1cb |
887 | endif() |
888 | endif() |
889 | endforeach() |
890 | list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED) |
a3d2cb24 |
891 | list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS) |
892 | |
893 | # export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files |
894 | foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES}) |
895 | set (SET_OpenCASCADE_COMPILE_DEFINITIONS) |
896 | string (TOUPPER "${OCCT_CONFIGURATION}" OCCT_CONFIGURATION_UPPER) |
897 | string (TOLOWER "${OCCT_CONFIGURATION}" OCCT_CONFIGURATION_LOWER) |
898 | foreach(COMPILE_DEFINITION ${OCCT_COMPILE_DEFINITIONS}) |
899 | string(REPLACE "(" "\\(" COMPILE_DEFINITION "${COMPILE_DEFINITION}") |
900 | string(REPLACE ")" "\\)" COMPILE_DEFINITION "${COMPILE_DEFINITION}") |
901 | set (SET_OpenCASCADE_COMPILE_DEFINITIONS "${SET_OpenCASCADE_COMPILE_DEFINITIONS}set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:${OCCT_CONFIGURATION}>:${COMPILE_DEFINITION}>)\n") |
902 | endforeach() |
903 | set (SET_OpenCASCADE_CMAKE_C_FLAGS "${CMAKE_C_FLAGS_${OCCT_CONFIGURATION_UPPER}}") |
904 | set (SET_OpenCASCADE_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_${OCCT_CONFIGURATION_UPPER}}") |
905 | configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADECompileDefinitionsAndFlags.cmake.in" "OpenCASCADECompileDefinitionsAndFlags-${OCCT_CONFIGURATION_LOWER}.cmake" @ONLY) |
906 | endforeach() |
907 | # install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration |
908 | install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)") |
909 | install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)") |
2e48c1cb |
910 | |
ada9ef40 |
911 | foreach (OCCT_MODULE ${OCCT_MODULES}) |
912 | if (BUILD_MODULE_${OCCT_MODULE}) |
913 | set (SET_OpenCASCADE_MODULES_TOOLKITS "${SET_OpenCASCADE_MODULES_TOOLKITS}set (OpenCASCADE_${OCCT_MODULE}_LIBRARIES ${OpenCASCADE_${OCCT_MODULE}_TOOLKITS})\n") |
914 | endif() |
f7ac9097 |
915 | |
916 | # sort enabled modules for correct work of OpenCASCADE config file |
917 | list(FIND OCCT_MODULES_ENABLED "${OCCT_MODULE}" OCCT_MODULE_INDEX) |
918 | if (NOT ${OCCT_MODULE_INDEX} EQUAL -1) |
919 | list (APPEND OCCT_MODULES_ENABLED_SORTED ${OCCT_MODULE}) |
920 | endif() |
ada9ef40 |
921 | endforeach() |
f7ac9097 |
922 | set (OCCT_MODULES_ENABLED ${OCCT_MODULES_ENABLED_SORTED}) |
ada9ef40 |
923 | |
924 | # Add all targets to the build-tree export set |
925 | export (TARGETS ${OCCT_LIBRARIES} FILE "${CMAKE_BINARY_DIR}/OpenCASCADETargets.cmake") |
926 | |
927 | # Export the package for use from the build-tree |
928 | # (this registers the build-tree with a global CMake-registry) |
929 | export(PACKAGE OpenCASCADE) |
930 | |
2e48c1cb |
931 | if (CMAKE_BUILD_TYPE) |
932 | set (SET_OpenCASCADE_BUILD_TYPE "set (OpenCASCADE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")") |
933 | endif() |
934 | |
935 | if (BUILD_SHARED_LIBS) |
936 | set (SET_OpenCASCADE_LINKER_FLAGS "set (OpenCASCADE_LINKER_FLAGS \"${CMAKE_SHARED_LINKER_FLAGS}\")") |
937 | else() |
938 | set (SET_OpenCASCADE_LINKER_FLAGS "set (OpenCASCADE_LINKER_FLAGS \"${CMAKE_STATIC_LINKER_FLAGS}\")") |
939 | endif() |
940 | |
941 | if (WIN32) |
942 | set (SET_OpenCASCADE_WITH_D3D "set (OpenCASCADE_WITH_D3D ${USE_D3D})") |
943 | endif() |
944 | if (APPLE) |
945 | set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_GLX})") |
946 | endif() |
947 | |
ada9ef40 |
948 | if (NOT SINGLE_GENERATOR) |
949 | OCCT_INSERT_CODE_FOR_TARGET() |
950 | endif() |
951 | |
2e48c1cb |
952 | # Configure and install cmake config file |
ada9ef40 |
953 | configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADEConfig.cmake.in" "OpenCASCADEConfig.cmake" @ONLY) |
d26375e2 |
954 | install(FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfig.cmake" DESTINATION "${INSTALL_DIR_CMAKE}") |
2e48c1cb |
955 | |
956 | # Configure cmake version file |
957 | include(CMakePackageConfigHelpers) |
958 | write_basic_package_version_file( ${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.cmake |
959 | VERSION ${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE} |
960 | COMPATIBILITY ExactVersion ) |
961 | |
962 | # Install cmake version file |
d26375e2 |
963 | install (FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfigVersion.cmake" DESTINATION "${INSTALL_DIR_CMAKE}") |
ada9ef40 |
964 | |
965 | # Install the export set for use with the install-tree for each configuration |
f7ac9097 |
966 | foreach (OCCT_MODULE ${OCCT_MODULES_ENABLED}) |
967 | install(EXPORT OpenCASCADE${OCCT_MODULE}Targets DESTINATION "${INSTALL_DIR_CMAKE}") |
ada9ef40 |
968 | endforeach() |
969 | |
970 | # Update generated OpenCASCADETargets-*.cmake files |
971 | # to have correct paths to libraries depending on the configuration |
972 | OCCT_UPDATE_TARGET_FILE () |