1 cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
3 set (CMAKE_SUPPRESS_REGENERATION TRUE)
5 set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
7 # macro: include patched file if it exists
8 macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
9 if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "" AND EXISTS "${APPLY_OCCT_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake")
10 include (${APPLY_OCCT_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake)
12 include (${BEING_INCLUDED_FILE}.cmake)
16 # include variable description
17 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
19 # set type of OCCT libraries
20 if (NOT BUILD_LIBRARY_TYPE)
21 set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "${BUILD_LIBRARY_TYPE_DESCR}" FORCE)
22 SET_PROPERTY(CACHE BUILD_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
25 if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
26 set (BUILD_SHARED_LIBS ON)
28 unset (BUILD_SHARED_LIBS)
31 # the name of the project
34 # Solution folder property
35 set_property (GLOBAL PROPERTY USE_FOLDERS ON)
37 set (INSTALL_OCCT_TEST_CASES OFF CACHE BOOL "${INSTALL_OCCT_TEST_CASES_DESCR}")
38 # a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
39 # check this variable and set if it's required
40 if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
41 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)
45 # Rebuild *.yacc and *.lex files
46 set (REBUILD_PLATFORM_DEPENDENT_CODE OFF CACHE BOOL "${REBUILD_PLATFORM_DEPENDENT_CODE_DESCR}")
48 # copy samples to install directory
49 set (INSTALL_OCCT_SAMPLES OFF CACHE BOOL "${INSTALL_OCCT_SAMPLES_DESCR}")
51 # install dir of the built project
52 set (INSTALL_DIR "" CACHE PATH "${INSTALL_DIR_DESCR}" )
53 set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
55 set (APPLY_OCCT_PATCH_DIR "" CACHE PATH "${APPLY_OCCT_PATCH_DIR_DESCR}")
57 # the list of being built toolkits
58 set (BUILD_ADDITIONAL_TOOLKITS "" CACHE STRING "${BUILD_ADDITIONAL_TOOLKITS_DESCR}")
59 separate_arguments (BUILD_ADDITIONAL_TOOLKITS)
62 set (BUILD_MODULE_OcctMfcSamples OFF CACHE BOOL "${BUILD_MODULE_OcctMfcSamples_DESCR}")
65 # whether use optional 3rdparty or not
67 set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
70 set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
71 set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
73 if (NOT DEFINED ANDROID)
74 set (USE_GL2PS OFF CACHE BOOL "${USE_GL2PS_DESCR}")
75 set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
76 #set (USE_OPENCL OFF CACHE BOOL "Is OpenCL used or not")
80 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
82 # include the patched or original list of modules
83 # list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
84 # list <OCCT_MODULES> will contain all modules
85 OCCT_MODULES_AND_TOOLKITS (OCCT_MODULES)
87 foreach (OCCT_MODULE ${OCCT_MODULES})
88 BUILD_MODULE (${OCCT_MODULE})
92 set (BUILD_DOC_OcctOverview OFF CACHE BOOL "${BUILD_DOC_OcctOverview_DESCR}")
95 list (REMOVE_ITEM Visualization_TOOLKITS TKIVtk)
96 list (REMOVE_ITEM Draw_TOOLKITS TKIVtkDraw)
99 # accumulate used toolkits (first level) in BUILD_TOOLKITS variable
100 list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
102 foreach (OCCT_MODULE ${OCCT_MODULES})
103 if (BUILD_MODULE_${OCCT_MODULE})
104 list (APPEND BUILD_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
108 # DRAWEXE excluded when library build is static
109 if (NOT BUILD_SHARED_LIBS)
110 list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
111 message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
114 # accumulate all used toolkits
115 list (REMOVE_DUPLICATES BUILD_TOOLKITS)
116 set (RAW_BUILD_TOOLKITS)
117 foreach(BUILD_TOOLKIT ${BUILD_TOOLKITS})
118 OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS)
119 list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS})
122 list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS)
123 set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS})
125 # include the patched or original list of definitions and flags
126 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
128 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
130 if (NOT DEFINED 3RDPARTY_DIR)
131 set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
134 # search for 3rdparty dir
135 if ("${3RDPARTY_DIR}" STREQUAL "")
136 if (DEFINED ENV{3RDPARTY_DIR})
137 set (3RDPARTY_DIR "$ENV{3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
138 elseif (EXISTS "${CMAKE_SOURCE_DIR}/../")
139 # in version 6.7.0 and above, occt parent directory contains 3rdparties
140 get_filename_component (3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/../" ABSOLUTE)
141 set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
145 # search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit
146 OCCT_IS_PRODUCT_REQUIRED(CSF_TclLibs USE_TCL)
148 if ("${USE_TCL}" STREQUAL ON)
149 message (STATUS "Info: tcl is used by OCCT")
150 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
152 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
153 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
156 # search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
157 OCCT_IS_PRODUCT_REQUIRED(CSF_FREETYPE USE_FREETYPE)
159 if ("${USE_FREETYPE}" STREQUAL ON)
160 message (STATUS "Info: freetype is used by OCCT")
161 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
163 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
164 OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
165 OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
170 add_definitions (-DHAVE_VTK)
171 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
176 add_definitions (-DMACOSX_USE_GLX)
177 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
182 add_definitions (-DHAVE_FREEIMAGE)
183 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
184 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimageplus")
186 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
187 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
188 OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
189 OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
194 add_definitions (-DHAVE_GL2PS)
195 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps")
197 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
198 OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS")
203 # add_definitions (-DHAVE_OPENCL)
204 # OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/opencl")
206 # OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENCL")
207 # OCCT_CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER")
208 # OCCT_CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB")
209 # OCCT_CHECK_AND_UNSET ("INSTALL_OPENCL")
214 add_definitions (-DHAVE_TBB)
215 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
217 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
218 OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC")
219 OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
223 if (BUILD_DOC_OcctOverview)
224 if (NOT DEFINED INSTALL_DOC_OcctOverview)
225 set (INSTALL_DOC_OcctOverview OFF CACHE BOOL "${INSTALL_DOC_OcctOverview_DESCR}")
228 if (INSTALL_DOC_OcctOverview)
229 install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION "${INSTALL_DIR}/doc")
230 install (FILES "${CMAKE_SOURCE_DIR}/dox/resources/overview.html" DESTINATION "${INSTALL_DIR}")
233 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen")
235 OCCT_CHECK_AND_UNSET ("INSTALL_DOC_OcctOverview")
237 OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_EXECUTABLE")
238 OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_DOT_EXECUTABLE")
242 if (REBUILD_PLATFORM_DEPENDENT_CODE)
243 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
245 OCCT_CHECK_AND_UNSET ("3RDPARTY_BISON_EXECUTABLE")
249 if (REBUILD_PLATFORM_DEPENDENT_CODE)
250 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/flex")
252 OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
255 string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
257 # check all 3rdparty paths
258 if (3RDPARTY_NOT_INCLUDED)
259 message (FATAL_ERROR "NOT FOUND: ${3RDPARTY_NOT_INCLUDED}" )
262 if (3RDPARTY_INCLUDE_DIRS)
263 list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
264 string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
265 message (STATUS "The directories containing 3rdparty headers: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
266 include_directories (${3RDPARTY_INCLUDE_DIRS})
269 # include <cmake binary folder>/inc
270 include_directories (${CMAKE_BINARY_DIR}/inc)
272 if (3RDPARTY_LIBRARY_DIRS)
273 list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
274 string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
275 message (STATUS "The directories containing 3rdparty libraries: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
276 link_directories (${3RDPARTY_LIBRARY_DIRS})
279 # Get all used variables: OS_WITH_BIT, COMPILER
280 OCCT_MAKE_OS_WITH_BITNESS()
281 OCCT_MAKE_COMPILER_SHORT_NAME()
284 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
285 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
286 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
288 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
289 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
290 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
292 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
293 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
294 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
297 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
298 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
301 if ("${INSTALL_DIR}" STREQUAL "")
302 get_filename_component (CMAKE_BINARY_DIR_PARENT ${CMAKE_BINARY_DIR} DIRECTORY)
304 set (INSTALL_DIR "${CMAKE_BINARY_DIR_PARENT}/install" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
305 set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
307 message (STATUS "Info: INSTALL_DIR has been set as ${INSTALL_DIR}")
310 message (STATUS "\nInfo: Collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
312 # (!) patch is not taken into account COLLECT_AND_INSTALL_OCCT_HEADER_FILES
313 # collect all the headers to <binary dir>/inc folder
314 COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}")
315 # apply patched header files
316 #if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "")
317 # COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${APPLY_OCCT_PATCH_DIR}" "${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${CMAKE_BINARY_DIR}")
320 OCCT_INSTALL_FILE_OR_DIR ("data" "${INSTALL_DIR}")
321 OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/samples")
323 if (INSTALL_OCCT_SAMPLES)
324 OCCT_INSTALL_FILE_OR_DIR ("samples" "${INSTALL_DIR}")
327 if (INSTALL_OCCT_TEST_CASES)
328 OCCT_INSTALL_FILE_OR_DIR ("tests" "${INSTALL_DIR}")
337 # DRAW.BAT or DRAW.SH
338 if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "" AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}")
339 install (FILES "${APPLY_OCCT_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS
340 OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
342 install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS
343 OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
345 OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
347 set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}")
350 set (ADDITIONAL_CUSTOM_CONTENT "\nif exist \"%~dp0${SUB_CUSTOM_NAME}\" (\n call \"%~dp0${SUB_CUSTOM_NAME}\" %VCVER% %ARCH% %CASDEB% \n)")
352 set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\${COMPILER}\" \"\${WOKSTATION}\${ARCH}\" \"\${CASDEB}\" \nfi")
355 # change custom.bat/sh
356 if (EXISTS "${INSTALL_DIR}/custom.${SCRIPT_EXT}")
357 file (READ "${INSTALL_DIR}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT)
359 set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}")
361 file (WRITE "${INSTALL_DIR}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
363 OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR}")
366 # write current custom.bat/sh (for install directory)
367 set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
368 OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR}")
370 # write current custom.bat/sh (for build directory)
371 OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}")
373 if (BUILD_MODULE_OcctMfcSamples)
374 OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR}")
375 OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.bat" "${CMAKE_BINARY_DIR}")
378 # env script for draw in building environment
379 OCCT_CONFIGURE ("adm/templates/env.build.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
381 # end script for draw in standalone environment
383 set (BUILD_LETTER "")
384 OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.release.${SCRIPT_EXT}")
385 install (FILES "${CMAKE_BINARY_DIR}/env.install.release.${SCRIPT_EXT}"
386 CONFIGURATIONS Release
387 DESTINATION "${INSTALL_DIR}"
388 RENAME "env.${SCRIPT_EXT}")
391 set (BUILD_LETTER "d")
392 OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.debug.${SCRIPT_EXT}")
393 install (FILES "${CMAKE_BINARY_DIR}/env.install.debug.${SCRIPT_EXT}"
395 DESTINATION "${INSTALL_DIR}"
396 RENAME "env.${SCRIPT_EXT}")
398 # release with debug info version
399 set (BUILD_LETTER "i")
400 OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.relwithdebinfo.${SCRIPT_EXT}")
401 install (FILES "${CMAKE_BINARY_DIR}/env.install.relwithdebinfo.${SCRIPT_EXT}"
402 CONFIGURATIONS RelWithDebInfo
403 DESTINATION "${INSTALL_DIR}"
404 RENAME "env.${SCRIPT_EXT}")
406 # copy DrawAppliInit from OCCT source to build directory
407 if (EXISTS "${CMAKE_SOURCE_DIR}/DrawAppliInit" AND NOT EXISTS "${CMAKE_BINARY_DIR}/DrawAppliInit")
408 file (COPY "${CMAKE_SOURCE_DIR}/DrawAppliInit" DESTINATION "${CMAKE_BINARY_DIR}")
412 FILE_TO_LIST ("adm/RESOURCES" RESOURCES)
413 foreach(RESOURCE ${RESOURCES})
414 get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY)
415 if(NOT "${RESOURCE_FOLDER}" STREQUAL "")
416 get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME)
417 OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR}/src/${RESOURCE_FOLDER}")
419 OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR}/src")
423 # include patched toolkit projects or original ones
424 foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
425 if (NOT "${APPLY_OCCT_PATCH_DIR}" STREQUAL "" AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${BUILD_TOOLKIT}")
426 add_subdirectory(${APPLY_OCCT_PATCH_DIR}/src/${BUILD_TOOLKIT})
427 elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${BUILD_TOOLKIT}")
428 add_subdirectory (${CMAKE_SOURCE_DIR}/src/${BUILD_TOOLKIT})
430 message (STATUS "${BUILD_TOOLKIT} is not included")
434 if (BUILD_DOC_OcctOverview)
435 add_subdirectory (dox)
439 if (MSVC AND 3RDPARTY_DLL_DIRS)
440 list (FIND BUILD_TOOLKITS DRAWEXE DRAWEXE_INDEX)
441 if (${DRAWEXE_INDEX} GREATER -1)
442 list (REMOVE_DUPLICATES 3RDPARTY_DLL_DIRS)
443 set (3RDPARTY_DLL_DIRS_FOR_PATH "")
445 foreach (3RDPARTY_DLL_DIR ${3RDPARTY_DLL_DIRS})
446 set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
449 OCCT_MAKE_COMPILER_BITNESS()
450 set (X_COMPILER_BITNESS "x64")
451 if ("${COMPILER_BITNESS}" STREQUAL "32")
452 set (X_COMPILER_BITNESS "Win32")
455 configure_file (${CMAKE_SOURCE_DIR}/adm/templates/DRAWEXE.vcxproj.user.in ${CMAKE_BINARY_DIR}/src/DRAWEXE/DRAWEXE.vcxproj.user @ONLY)
459 # samples do not support patch usage
460 if (BUILD_MODULE_OcctMfcSamples)
461 set (OCCT_ROOT ${CMAKE_SOURCE_DIR})
463 set (MFC_STANDARD_SAMPLES_DIR ${OCCT_ROOT}/samples/mfc/standard)
464 set (COMMON_WINMAIN_FILE ${MFC_STANDARD_SAMPLES_DIR}/Common/Winmain.cpp)
466 add_subdirectory(samples/mfc/standard/mfcsample)
467 add_subdirectory(samples/mfc/standard/01_Geometry)
468 add_subdirectory(samples/mfc/standard/02_Modeling)
469 add_subdirectory(samples/mfc/standard/03_Viewer2d)
470 add_subdirectory(samples/mfc/standard/04_Viewer3d)
471 add_subdirectory(samples/mfc/standard/05_ImportExport)
472 add_subdirectory(samples/mfc/standard/06_Ocaf)
473 add_subdirectory(samples/mfc/standard/07_Triangulation)
474 add_subdirectory(samples/mfc/standard/08_HLR)
475 add_subdirectory(samples/mfc/standard/09_Animation)
476 add_subdirectory(samples/mfc/standard/10_Convert)