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