0027051: BRepBuilderAPI_GTransform produces invalid result
[occt.git] / CMakeLists.txt
CommitLineData
19286d7c 1cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
166d6cd7 2
576f8b11 3set (CMAKE_SUPPRESS_REGENERATION TRUE)
4
fa0cbe55 5set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
03c69aec 6
316d77d9 7# macro: include patched file if it exists
8macro (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()
14endmacro()
15
16# include variable description
17OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
18
c259930b 19# set type of OCCT libraries
20if (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)
23endif()
24
25if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
26 set (BUILD_SHARED_LIBS ON)
27else()
28 unset (BUILD_SHARED_LIBS)
29endif()
30
9f33b387 31# the name of the project
32project (OCCT)
03c69aec 33
096ef695 34# include occt macros
35OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
36
9f33b387 37# Solution folder property
38set_property (GLOBAL PROPERTY USE_FOLDERS ON)
03c69aec 39
096ef695 40# get current OCCT version
41OCC_VERSION (OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT)
42
43set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR})
44set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR})
45set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE})
46
0e617b05 47set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
096ef695 48
49# single-configuration generator
50set (SINGLE_GENERATOR OFF)
51if (CMAKE_BUILD_TYPE)
52 set (SINGLE_GENERATOR ON)
53endif()
54
316d77d9 55# a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
56# check this variable and set if it's required
57if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
58 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 59endif()
60
898f6a92 61# enable extended messages of many OCCT algorithms
109aa56e 62set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}")
63if (BUILD_WITH_DEBUG)
898f6a92 64 add_definitions (-DOCCT_DEBUG)
65endif()
316d77d9 66
19286d7c 67# copy samples to install directory
0e617b05 68set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}")
19286d7c 69
096ef695 70# install dir of the project
71if (NOT DEFINED INSTALL_DIR)
4b3541c6 72 # set default install directory for Windows
73 if (WIN32)
74 set (CMAKE_INSTALL_PREFIX "C:/opencascade-${OCC_VERSION_STRING_EXT}")
75 endif()
096ef695 76 set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}")
77endif()
78
4b3541c6 79# choose a variant of the layout of the install paths
80if (NOT INSTALL_DIR_LAYOUT)
81 if (WIN32)
82 set (INSTALL_DIR_LAYOUT "Windows" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
83 else()
84 set (INSTALL_DIR_LAYOUT "Unix" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
85 endif()
86 SET_PROPERTY(CACHE INSTALL_DIR_LAYOUT PROPERTY STRINGS Windows Unix)
87endif()
88
89# check INSTALL_DIR_LAYOUT changes and update INSTALL_DIR_* paths if necessary
90if (NOT DEFINED INSTALL_DIR_LAYOUT_PREV)
91 set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
92elseif (NOT "${INSTALL_DIR_LAYOUT_PREV}" STREQUAL "${INSTALL_DIR_LAYOUT}")
93 set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
94 # The structure of install folder should be reset due to changed layout
95 OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
96
97 # Unset INSTALL_DIR_WITH_VERSION on windows
98 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
99 OCCT_CHECK_AND_UNSET (INSTALL_DIR_WITH_VERSION)
100 else()
101 if (NOT DEFINED INSTALL_DIR_WITH_VERSION)
102 set (INSTALL_DIR_WITH_VERSION OFF CACHE BOOL "${INSTALL_DIR_WITH_VERSION_DESCR}")
103 endif()
104 endif()
105endif()
106
107# check CMAKE_INSTALL_PREFIX changes and update INSTALL_DIR if necessary
d573adcf 108if (NOT DEFINED CMAKE_INSTALL_PREFIX_PREV)
109 set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
110elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
111 # CMAKE_INSTALL_PREFIX has been changed at previous step
112 set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
113
114 # INSTALL_DIR is required to be updated
115 set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
116endif()
117
4b3541c6 118# check INSTALL_DIR changes and update CMAKE_INSTALL_PREFIX if necessary
d573adcf 119if (NOT DEFINED INSTALL_DIR_PREV)
120 set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
121elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}")
122 # INSTALL_DIR has been changed at previous step
123 set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
124
125 # sync CMAKE_INSTALL_PREFIX with INSTALL_DIR
126 set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
127
128 # set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder
129 set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
4b3541c6 130endif()
d573adcf 131
4b3541c6 132if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
133 if (NOT DEFINED INSTALL_DIR_WITH_VERSION_PREV)
134 set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
135 elseif (NOT "${INSTALL_DIR_WITH_VERSION_PREV}" STREQUAL "${INSTALL_DIR_WITH_VERSION}")
136 # INSTALL_DIR_WITH_VERSION has been changed at previous step
137 set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
138
139 OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
140 endif()
096ef695 141endif()
142
143# hide CMAKE_INSTALL_PREFIX from a user
144set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
145
146set (BIN_LETTER "")
147if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
148 set (BIN_LETTER "d")
149elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
150 set (BIN_LETTER "i")
151endif()
03c69aec 152
096ef695 153# Get all used variables: OS_WITH_BIT, COMPILER
154OCCT_MAKE_OS_WITH_BITNESS()
155OCCT_MAKE_COMPILER_SHORT_NAME()
156
4b3541c6 157# do not define INSTALL_DIR_BIN for win.
096ef695 158# Leave library structure for win: <prefix>/win64/vc10/bin(d)
4b3541c6 159if (NOT DEFINED INSTALL_DIR_BIN)
160 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
161 set (INSTALL_DIR_BIN "bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
096ef695 162 else()
4b3541c6 163 set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
096ef695 164 endif()
165endif()
166
167# define folder contaning all shell/batch scripts
4b3541c6 168if (NOT DEFINED INSTALL_DIR_SCRIPT)
169 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
170 set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
096ef695 171 else()
4b3541c6 172 set (INSTALL_DIR_SCRIPT "." CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
096ef695 173 endif()
174endif()
175
176# place the libraries to <prefix>/lib folder for unix and leave old structure for windows
4b3541c6 177if (NOT DEFINED INSTALL_DIR_LIB)
178 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
179 set (INSTALL_DIR_LIB "lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
096ef695 180 else()
4b3541c6 181 set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
096ef695 182 endif()
183endif()
184
185# OCCT headers: <prefix>/inc for windows,
186# <prefix>/include/opencascade-7.0.0 for unix
4b3541c6 187if (NOT DEFINED INSTALL_DIR_INCLUDE)
188 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
189 set (INSTALL_DIR_INCLUDE "include/opencascade" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
190 if (INSTALL_DIR_WITH_VERSION)
191 set (INSTALL_DIR_INCLUDE "include/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}" FORCE)
192 endif()
096ef695 193 else()
4b3541c6 194 set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
096ef695 195 endif()
196endif()
197
198# OCCT resources: <prefix>/src for windows,
199# <prefix>/share/opencascade-7.0.0/resources for unix
4b3541c6 200if (NOT DEFINED INSTALL_DIR_RESOURCE)
201 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
202 set (INSTALL_DIR_RESOURCE "share/opencascade/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
203 if (INSTALL_DIR_WITH_VERSION)
204 set (INSTALL_DIR_RESOURCE "share/opencascade-${OCC_VERSION_STRING_EXT}/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}" FORCE)
205 endif()
096ef695 206 else()
4b3541c6 207 set (INSTALL_DIR_RESOURCE "src" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
096ef695 208 endif()
209endif()
210
211# OCCT data
4b3541c6 212if (NOT DEFINED INSTALL_DIR_DATA)
213 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
214 set (INSTALL_DIR_DATA "share/opencascade/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
215 if (INSTALL_DIR_WITH_VERSION)
216 set (INSTALL_DIR_DATA "share/opencascade-${OCC_VERSION_STRING_EXT}/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}" FORCE)
217 endif()
218 else()
219 set (INSTALL_DIR_DATA "data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
220 endif()
221endif()
222
223# OCCT samples
224if (NOT DEFINED INSTALL_DIR_SAMPLES)
225 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
226 set (INSTALL_DIR_SAMPLES "share/opencascade/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}")
227 if (INSTALL_DIR_WITH_VERSION)
228 set (INSTALL_DIR_SAMPLES "share/opencascade-${OCC_VERSION_STRING_EXT}/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}" FORCE)
229 endif()
230 else()
231 set (INSTALL_DIR_SAMPLES "samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}")
232 endif()
233endif()
234
235# OCCT tests
236if (NOT DEFINED INSTALL_DIR_TESTS)
237 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
238 set (INSTALL_DIR_TESTS "share/opencascade/tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}")
239 if (INSTALL_DIR_WITH_VERSION)
240 set (INSTALL_DIR_TESTS "share/opencascade-${OCC_VERSION_STRING_EXT}/tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}" FORCE)
241 endif()
242 else()
243 set (INSTALL_DIR_TESTS "tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}")
244 endif()
245endif()
246
247# OCCT doc
248if (NOT DEFINED INSTALL_DIR_DOC)
249 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
250 set (INSTALL_DIR_DOC "share/doc/opencascade" CACHE PATH "${INSTALL_DIR_DOC_DESCR}")
251 if (INSTALL_DIR_WITH_VERSION)
252 set (INSTALL_DIR_DOC "share/doc/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_DOC_DESCR}" FORCE)
253 endif()
096ef695 254 else()
4b3541c6 255 set (INSTALL_DIR_DOC "doc" CACHE PATH "${INSTALL_DIR_DOC_DESCR}")
096ef695 256 endif()
257endif()
258
4b3541c6 259# install LICENSE_LGPL_21.txt and OCCT_LGPL_EXCEPTION.txt files
260if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
261 OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR}/${INSTALL_DIR_DOC}")
262 OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR}/${INSTALL_DIR_DOC}")
263else()
264 OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR}")
265 OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR}")
266endif()
267
096ef695 268# a directory recognized as a 'patch' for OCCT
109aa56e 269set (BUILD_PATCH "" CACHE PATH "${BUILD_PATCH_DESCR}")
03c69aec 270
9f33b387 271# the list of being built toolkits
316d77d9 272set (BUILD_ADDITIONAL_TOOLKITS "" CACHE STRING "${BUILD_ADDITIONAL_TOOLKITS_DESCR}")
273separate_arguments (BUILD_ADDITIONAL_TOOLKITS)
03c69aec 274
ad211ad3 275if (MSVC)
4b3541c6 276 set (BUILD_MODULE_MfcSamples OFF CACHE BOOL "${BUILD_MODULE_MfcSamples_DESCR}")
85bcc072 277endif()
278
9f33b387 279# whether use optional 3rdparty or not
280if (APPLE)
316d77d9 281 set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
03c69aec 282endif()
096ef695 283
f60111dc 284if (WIN32)
285 set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
286endif()
85bcc072 287
9f33b387 288# include the patched or original list of modules
19286d7c 289# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
290# list <OCCT_MODULES> will contain all modules
291OCCT_MODULES_AND_TOOLKITS (OCCT_MODULES)
03c69aec 292
316d77d9 293foreach (OCCT_MODULE ${OCCT_MODULES})
294 BUILD_MODULE (${OCCT_MODULE})
19286d7c 295endforeach()
296
e713baee 297if (ANDROID AND BUILD_MODULE_Draw)
298 message (STATUS "Info. Draw module is turned off due to it is not supported on Android")
299 set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
300endif()
301
adc33035 302# Overview
4b3541c6 303set (BUILD_DOC_Overview OFF CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
adc33035 304
f60111dc 305if (NOT USE_D3D)
306 list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
307endif()
308
316d77d9 309# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
310list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
19286d7c 311
316d77d9 312foreach (OCCT_MODULE ${OCCT_MODULES})
313 if (BUILD_MODULE_${OCCT_MODULE})
314 list (APPEND BUILD_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
19286d7c 315 endif()
316endforeach()
317
318# DRAWEXE excluded when library build is static
319if (NOT BUILD_SHARED_LIBS)
316d77d9 320 list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
19286d7c 321 message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
322endif()
323
324# accumulate all used toolkits
316d77d9 325list (REMOVE_DUPLICATES BUILD_TOOLKITS)
326set (RAW_BUILD_TOOLKITS)
096ef695 327foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
316d77d9 328 OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS)
329 list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS})
19286d7c 330endforeach()
331
316d77d9 332list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS)
333set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS})
03c69aec 334
9f33b387 335# include the patched or original list of definitions and flags
19286d7c 336OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
03c69aec 337
19286d7c 338OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
03c69aec 339
a6874708 340# search for TKIVtk and TKIVtkDraw in BUILD_TOOLKITS
341list (FIND BUILD_TOOLKITS TKIVtk CAN_USE_VTK)
342if (CAN_USE_VTK EQUAL -1)
343 list (FIND BUILD_TOOLKITS TKIVtkDraw CAN_USE_VTK)
344endif()
345
346if (NOT CAN_USE_VTK EQUAL -1)
347 if (NOT DEFINED USE_VTK)
348 set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
349 endif()
350else()
351 OCCT_CHECK_AND_UNSET (USE_VTK)
352endif()
353
5682a6fa 354# Rebuild *.yacc and *.lex files that are contained by TKMath toolkit
355list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH)
356list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
357
fb3267c7 358if (NOT ${CAN_REBUILD_PDC_FOR_TKMATH} EQUAL -1 OR NOT ${CAN_REBUILD_PDC_FOR_STEPFILE} EQUAL -1)
109aa56e 359 set (BUILD_YACCLEX OFF CACHE BOOL "${BUILD_YACCLEX_DESCR}")
5682a6fa 360else()
109aa56e 361 OCCT_CHECK_AND_UNSET (BUILD_YACCLEX)
5682a6fa 362endif()
363
9f33b387 364if (NOT DEFINED 3RDPARTY_DIR)
316d77d9 365 set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
e713baee 366 get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
9f33b387 367endif()
234e52be 368
9f33b387 369# search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit
f2e9c853 370OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
03c69aec 371
fb3267c7 372if (USE_TCL)
5682a6fa 373 message (STATUS "Info: TCL is used by OCCT")
19286d7c 374 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
82f443b6 375
376 message (STATUS "Info: TK is used by OCCT")
377 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
9f33b387 378else()
9ccea0c6 379 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
380 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
5682a6fa 381
382 OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
82f443b6 383 OCCT_CHECK_AND_UNSET ("INSTALL_TK")
9f33b387 384endif()
03c69aec 385
9f33b387 386# search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
f2e9c853 387OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
03c69aec 388
fb3267c7 389if (USE_FREETYPE)
5682a6fa 390 message (STATUS "Info: Freetype is used by OCCT")
19286d7c 391 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
9f33b387 392else()
9ccea0c6 393 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
9f33b387 394 OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
395 OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
5682a6fa 396 OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
9f33b387 397endif()
03c69aec 398
09c597c9 399# VTK
400if (USE_VTK)
401 add_definitions (-DHAVE_VTK)
19286d7c 402 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
f2e9c853 403else()
404 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
a6874708 405
406 if (NOT CAN_USE_VTK EQUAL -1)
407 message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled")
408
409 list (REMOVE_ITEM BUILD_TOOLKITS TKIVtk)
410 list (REMOVE_ITEM BUILD_TOOLKITS TKIVtkDraw)
411 endif()
09c597c9 412endif()
413
f60111dc 414# D3D
415if (USE_D3D)
416 add_definitions (-DHAVE_D3D)
417 #if(MSVC_VERSION LESS 1700)
418 #OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
419 #endif()
420endif()
421
09c597c9 422# GLX
423if (USE_GLX)
424 add_definitions (-DMACOSX_USE_GLX)
19286d7c 425 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
09c597c9 426endif()
427
03c69aec 428# FREEIMAGE
5682a6fa 429# search for CSF_FREEIMAGE variable in EXTERNLIB of each being used toolkit
430OCCT_IS_PRODUCT_REQUIRED (CSF_FREEIMAGE CAN_USE_FREEIMAGE)
431OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGEPLUS)
432
433if (CAN_USE_FREEIMAGE OR CAN_USE_FREEIMAGEPLUS)
434 set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
435
436 if (USE_FREEIMAGE)
437 add_definitions (-DHAVE_FREEIMAGE)
438 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
439 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimageplus")
440 else()
441 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
442 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
443 OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
444 OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
445 endif()
9f33b387 446else()
5682a6fa 447 OCCT_CHECK_AND_UNSET ("USE_FREEIMAGE")
448
9f33b387 449 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
450 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
451 OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
452 OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
453endif()
03c69aec 454
455# GL2PS
5682a6fa 456# search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit
457OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS)
458
459if (NOT DEFINED ANDROID AND CAN_USE_GL2PS)
460 set (USE_GL2PS OFF CACHE BOOL "${USE_GL2PS_DESCR}")
461
462 if (USE_GL2PS)
463 add_definitions (-DHAVE_GL2PS)
464 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps")
465 else()
466 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
467 OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS")
468 endif()
9f33b387 469else()
5682a6fa 470 OCCT_CHECK_AND_UNSET ("USE_GL2PS")
471
9f33b387 472 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
473 OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS")
474endif()
03c69aec 475
9f33b387 476# TBB
5682a6fa 477# search for CSF_TBB variable in EXTERNLIB of each being used toolkit
478OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
479
480if (NOT DEFINED ANDROID AND CAN_USE_TBB)
481 set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
482
483 if (USE_TBB)
484 add_definitions (-DHAVE_TBB)
485 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
486 else()
487 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
488 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC")
489 OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
490 endif()
9f33b387 491else()
5682a6fa 492 OCCT_CHECK_AND_UNSET ("USE_TBB")
493
9f33b387 494 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
495 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC")
496 OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
497endif()
234e52be 498
adc33035 499# Doxygen
4b3541c6 500if (BUILD_DOC_Overview)
501 if (NOT DEFINED INSTALL_DOC_Overview)
502 set (INSTALL_DOC_Overview OFF CACHE BOOL "${INSTALL_DOC_Overview_DESCR}")
adc33035 503 endif()
504
4b3541c6 505 if (INSTALL_DOC_Overview)
506 install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_DOC}")
f2e9c853 507
096ef695 508 # create overview.html only for windows
4b3541c6 509 if (WIN32 AND "${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
510 OCCT_INSTALL_FILE_OR_DIR ("dox/resources/overview.html" "${INSTALL_DIR}/${INSTALL_DIR_DOC}/..")
096ef695 511 endif()
adc33035 512 endif()
513
514 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen")
515else()
4b3541c6 516 OCCT_CHECK_AND_UNSET ("INSTALL_DOC_Overview")
adc33035 517
518 OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_EXECUTABLE")
109aa56e 519 OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
adc33035 520endif()
521
316d77d9 522# bison
109aa56e 523if (BUILD_YACCLEX)
316d77d9 524 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
525else()
526 OCCT_CHECK_AND_UNSET ("3RDPARTY_BISON_EXECUTABLE")
527endif()
528
529# flex
109aa56e 530if (BUILD_YACCLEX)
316d77d9 531 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/flex")
532else()
533 OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
534endif()
535
9f33b387 536string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
234e52be 537
9f33b387 538# check all 3rdparty paths
539if (3RDPARTY_NOT_INCLUDED)
540 message (FATAL_ERROR "NOT FOUND: ${3RDPARTY_NOT_INCLUDED}" )
541endif()
7c633a3e 542
9bb81d6c 543if (3RDPARTY_INCLUDE_DIRS)
544 list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
545 string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
a6874708 546 message (STATUS "Info: The directories of 3rdparty headers: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
9bb81d6c 547 include_directories (${3RDPARTY_INCLUDE_DIRS})
548endif()
549
94829f84 550# include <cmake binary folder>/inc
551include_directories (${CMAKE_BINARY_DIR}/inc)
552
9bb81d6c 553if (3RDPARTY_LIBRARY_DIRS)
554 list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
555 string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
a6874708 556 message (STATUS "Info: The directories of 3rdparty libraries: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
9bb81d6c 557 link_directories (${3RDPARTY_LIBRARY_DIRS})
558endif()
234e52be 559
9f33b387 560# build directories
4b3541c6 561if (SINGLE_GENERATOR)
562 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
563 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
564 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
565 if (WIN32)
566 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
567 endif()
568endif()
569
fa0cbe55 570set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
571set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
572set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
19286d7c 573
316d77d9 574set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
575set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
576set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
19286d7c 577
fa0cbe55 578set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
579set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
580set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
19286d7c 581
fa0cbe55 582if (WIN32)
f2e9c853 583 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
584 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
585 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
19286d7c 586endif()
03c69aec 587
d94d80e5 588string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
589message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
94829f84 590
94829f84 591# collect all the headers to <binary dir>/inc folder
f2e9c853 592COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}")
94829f84 593
d94d80e5 594string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
595message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
596
4b3541c6 597OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR}/${INSTALL_DIR_DATA}")
598
599if (WIN32)
600 set (SCRIPT_EXT bat)
601else()
602 set (SCRIPT_EXT sh)
603endif()
03c69aec 604
096ef695 605# OCCT samples
0e617b05 606if (INSTALL_SAMPLES)
4b3541c6 607 OCCT_CONFIGURE ("adm/templates/env.samples.${SCRIPT_EXT}.in" "env.samples.${SCRIPT_EXT}")
096ef695 608 if (WIN32)
4b3541c6 609 OCCT_INSTALL_FILE_OR_DIR ("samples/CSharp" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
610 OCCT_INSTALL_FILE_OR_DIR ("samples/mfc" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
611
612 install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/CSharp" RENAME "env.${SCRIPT_EXT}")
613 install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/mfc/standard" RENAME "env.${SCRIPT_EXT}")
096ef695 614 endif()
03c69aec 615
4b3541c6 616 OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
617 OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
618 OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
096ef695 619
4b3541c6 620 install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}")
621 install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}")
622 install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}")
910970ab 623endif()
03c69aec 624
4b3541c6 625OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/${INSTALL_DIR_SAMPLES}")
626
627if (INSTALL_TEST_CASES)
628 OCCT_INSTALL_FILE_OR_DIR ("tests/" "${INSTALL_DIR}/${INSTALL_DIR_TESTS}")
910970ab 629endif()
03c69aec 630
096ef695 631# copy draw script to install script folder
109aa56e 632if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}")
4b3541c6 633 install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}"
096ef695 634 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
910970ab 635else()
4b3541c6 636 install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}"
096ef695 637 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
910970ab 638endif()
096ef695 639
640# copy draw script to CMake binary folder
910970ab 641OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
9f33b387 642
316d77d9 643set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}")
9f33b387 644
910970ab 645if (WIN32)
4b3541c6 646 set (ADDITIONAL_CUSTOM_CONTENT "\nif exist \"%~dp0${SUB_CUSTOM_NAME}\" (\n call \"%~dp0${SUB_CUSTOM_NAME}\" %1 %2 %3 \n)")
910970ab 647else()
096ef695 648 set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\$1\" \"\$2\" \nfi")
910970ab 649endif()
32856b63 650
910970ab 651 # change custom.bat/sh
4b3541c6 652if (EXISTS "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}")
653 file (READ "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT)
32856b63 654
910970ab 655 set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}")
32856b63 656
4b3541c6 657 file (WRITE "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
910970ab 658else()
4b3541c6 659 OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
910970ab 660endif()
32856b63 661
316d77d9 662# write current custom.bat/sh (for install directory)
663set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
4b3541c6 664OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
03c69aec 665
316d77d9 666# write current custom.bat/sh (for build directory)
667OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}")
668
4b3541c6 669if (BUILD_MODULE_MfcSamples)
670 OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
f2e9c853 671 OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.bat" "${CMAKE_BINARY_DIR}")
9f33b387 672endif()
673
316d77d9 674# env script for draw in building environment
4b3541c6 675OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
316d77d9 676
4b3541c6 677# install env script
678install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}")
316d77d9 679
680# copy DrawAppliInit from OCCT source to build directory
f2e9c853 681if (NOT EXISTS "${CMAKE_BINARY_DIR}/DrawAppliInit")
682 OCCT_COPY_FILE_OR_DIR (DrawAppliInit "${CMAKE_BINARY_DIR}")
316d77d9 683endif()
910970ab 684
9f33b387 685# RESOURCES
19286d7c 686FILE_TO_LIST ("adm/RESOURCES" RESOURCES)
687foreach(RESOURCE ${RESOURCES})
688 get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY)
689 if(NOT "${RESOURCE_FOLDER}" STREQUAL "")
690 get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME)
4b3541c6 691 OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
19286d7c 692 else()
4b3541c6 693 OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}")
19286d7c 694 endif()
695endforeach()
03c69aec 696
fb3267c7 697# define CSF variable
698OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
699
33839ae6 700# include patched toolkit projects or original ones
316d77d9 701foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
f2e9c853 702 OCCT_ADD_SUBDIRECTORY ("src/${BUILD_TOOLKIT}")
19286d7c 703endforeach()
234e52be 704
4b3541c6 705if (BUILD_DOC_Overview)
f2e9c853 706 OCCT_ADD_SUBDIRECTORY (dox)
adc33035 707endif()
708
94829f84 709# patch DRAWEXE
710if (MSVC AND 3RDPARTY_DLL_DIRS)
316d77d9 711 list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX)
94829f84 712 if (${DRAWEXE_INDEX} GREATER -1)
713 list (REMOVE_DUPLICATES 3RDPARTY_DLL_DIRS)
714 set (3RDPARTY_DLL_DIRS_FOR_PATH "")
715
716 foreach (3RDPARTY_DLL_DIR ${3RDPARTY_DLL_DIRS})
717 set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
718 endforeach()
719
720 OCCT_MAKE_COMPILER_BITNESS()
721 set (X_COMPILER_BITNESS "x64")
722 if ("${COMPILER_BITNESS}" STREQUAL "32")
723 set (X_COMPILER_BITNESS "Win32")
724 endif()
725
f2e9c853 726 OCCT_CONFIGURE ("adm/templates/DRAWEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/src/DRAWEXE/DRAWEXE.vcxproj.user")
94829f84 727 endif()
728endif()
729
33839ae6 730# samples do not support patch usage
4b3541c6 731if (BUILD_MODULE_MfcSamples)
19286d7c 732 set (OCCT_ROOT ${CMAKE_SOURCE_DIR})
234e52be 733
19286d7c 734 set (MFC_STANDARD_SAMPLES_DIR ${OCCT_ROOT}/samples/mfc/standard)
735 set (COMMON_WINMAIN_FILE ${MFC_STANDARD_SAMPLES_DIR}/Common/Winmain.cpp)
234e52be 736
9f33b387 737 add_subdirectory(samples/mfc/standard/mfcsample)
738 add_subdirectory(samples/mfc/standard/01_Geometry)
739 add_subdirectory(samples/mfc/standard/02_Modeling)
740 add_subdirectory(samples/mfc/standard/03_Viewer2d)
741 add_subdirectory(samples/mfc/standard/04_Viewer3d)
742 add_subdirectory(samples/mfc/standard/05_ImportExport)
743 add_subdirectory(samples/mfc/standard/06_Ocaf)
744 add_subdirectory(samples/mfc/standard/07_Triangulation)
745 add_subdirectory(samples/mfc/standard/08_HLR)
746 add_subdirectory(samples/mfc/standard/09_Animation)
747 add_subdirectory(samples/mfc/standard/10_Convert)
19286d7c 748endif()