0030690: Draw Harness - provide XDisplay command for displaying XDE document
[occt.git] / tools / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
2
3 set (ADDITIONAL_INLCUDE_DIR_DESCR "Additional directory to be added in the projects include section")
4 if (NOT DEFINED ADDITIONAL_INLCUDE_DIR)
5   set (ADDITIONAL_INLCUDE_DIR "" CACHE PATH ${ADDITIONAL_INLCUDE_DIR_DESCR})
6   get_filename_component (ADDITIONAL_INLCUDE_DIR "${ADDITIONAL_INLCUDE_DIR}" ABSOLUTE)
7 else()
8   file (TO_CMAKE_PATH "${ADDITIONAL_INLCUDE_DIR}" ADDITIONAL_INLCUDE_DIR)
9   set (ADDITIONAL_INLCUDE_DIR "${ADDITIONAL_INLCUDE_DIR}" CACHE PATH "${ADDITIONAL_INLCUDE_DIR_DESCR}" FORCE)
10 endif()
11
12 set (ADDITIONAL_DLL_DIR_DESCR "Additional directories that should be included into PATH")
13 if (NOT DEFINED ADDITIONAL_DLL_DIR)
14   set (ADDITIONAL_DLL_DIR "" CACHE PATH ${ADDITIONAL_DLL_DIR_DESCR})
15   get_filename_component (ADDITIONAL_DLL_DIR "${ADDITIONAL_DLL_DIR}" ABSOLUTE)
16 else()
17   file (TO_CMAKE_PATH "${ADDITIONAL_DLL_DIR}" ADDITIONAL_DLL_DIR)
18   set (ADDITIONAL_DLL_DIR "${ADDITIONAL_DLL_DIR}" CACHE PATH "${ADDITIONAL_DLL_DIR_DESCR}" FORCE)
19 endif()
20
21 set (CURRENT_DIR "${CMAKE_SOURCE_DIR}")
22 set (CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}/.." CACHE INTERNAL "" FORCE)
23 set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
24
25 set (CMAKE_SUPPRESS_REGENERATION TRUE)
26
27 set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
28
29 # macro: include patched file if it exists
30 macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
31   if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
32     include (${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake)
33   else()
34     include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
35   endif()
36 endmacro()
37
38 macro (OCCT_INCLUDE_3RDPARTY_PRODUCT USE_PRODUCT PRODUCT_CONFIG_FILE)
39   if (${USE_PRODUCT})
40     OCCT_INCLUDE_CMAKE_FILE ("${PRODUCT_CONFIG_FILE}")
41   endif (${USE_PRODUCT})
42 endmacro()
43
44 # include variable description
45 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
46
47 # set type of OCCT libraries
48 if (NOT BUILD_LIBRARY_TYPE)
49   set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "${BUILD_LIBRARY_TYPE_DESCR}" FORCE)
50   SET_PROPERTY(CACHE BUILD_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
51 endif()
52
53 if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
54   set (BUILD_SHARED_LIBS ON)
55
56   if (NOT DEFINED BUILD_SHARED_LIBRARY_NAME_POSTFIX)
57     set (BUILD_SHARED_LIBRARY_NAME_POSTFIX "" CACHE STRING "${BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR}" FORCE)
58   endif()
59 else()
60   unset (BUILD_SHARED_LIBS)
61   unset (BUILD_SHARED_LIBRARY_NAME_POSTFIX)
62 endif()
63
64 # the name of the project
65 project (Inspector)
66
67 if (WIN32)
68   add_definitions(-DUNICODE)
69   add_definitions(-D_UNICODE)
70 endif()
71
72 # include occt macros
73 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
74
75 # Solution folder property
76 set_property (GLOBAL PROPERTY USE_FOLDERS ON)
77
78 # a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable
79 # check this variable and set if it's required
80 if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator.
81   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)
82 endif()
83
84 if (BUILD_WITH_DEBUG)
85   set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
86 endif()
87
88 # install dir of the project
89 if (NOT DEFINED INSTALL_DIR)
90   # set default install directory for Windows
91   if (WIN32 AND NOT DEFINED CMAKE_INSTALL_PREFIX)
92     set (CMAKE_INSTALL_PREFIX "C:/opencascade-${OCC_VERSION_STRING_EXT}/inspector")
93   endif()
94   set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}")
95 else()
96   file (TO_CMAKE_PATH "${INSTALL_DIR}" INSTALL_DIR)
97   set (INSTALL_DIR "${INSTALL_DIR}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
98 endif()
99
100 # choose a variant of the layout of the install paths
101 if (NOT INSTALL_DIR_LAYOUT)
102   if (WIN32)
103     set (INSTALL_DIR_LAYOUT "Windows" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
104   else()
105     set (INSTALL_DIR_LAYOUT "Unix" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
106   endif()
107   SET_PROPERTY(CACHE INSTALL_DIR_LAYOUT PROPERTY STRINGS Windows Unix)
108 endif()
109
110 # check INSTALL_DIR_LAYOUT changes and update INSTALL_DIR_* paths if necessary
111 if (NOT DEFINED INSTALL_DIR_LAYOUT_PREV)
112   set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
113 elseif (NOT "${INSTALL_DIR_LAYOUT_PREV}" STREQUAL "${INSTALL_DIR_LAYOUT}")
114   set (INSTALL_DIR_LAYOUT_PREV "${INSTALL_DIR_LAYOUT}" CACHE INTERNAL "" FORCE)
115   # The structure of install folder should be reset due to changed layout
116   OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
117
118   # Unset INSTALL_DIR_WITH_VERSION on windows
119   if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
120     OCCT_CHECK_AND_UNSET (INSTALL_DIR_WITH_VERSION)
121   else()
122     if (NOT DEFINED INSTALL_DIR_WITH_VERSION)
123       set (INSTALL_DIR_WITH_VERSION OFF CACHE BOOL "${INSTALL_DIR_WITH_VERSION_DESCR}")
124     endif()
125   endif()
126 endif()
127
128 # check CMAKE_INSTALL_PREFIX changes and update INSTALL_DIR if necessary
129 if (NOT DEFINED CMAKE_INSTALL_PREFIX_PREV)
130   set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
131 elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
132   # CMAKE_INSTALL_PREFIX has been changed at previous step
133   set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
134   
135   # INSTALL_DIR is required to be updated
136   set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
137 endif()
138
139 # check INSTALL_DIR changes and update CMAKE_INSTALL_PREFIX if necessary
140 if (NOT DEFINED INSTALL_DIR_PREV)
141   set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
142 elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}")
143   # INSTALL_DIR has been changed at previous step
144   set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
145
146   # sync CMAKE_INSTALL_PREFIX with INSTALL_DIR 
147   set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
148
149   # set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder 
150   set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
151 endif()
152
153 if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
154   if (NOT DEFINED INSTALL_DIR_WITH_VERSION_PREV)
155     set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
156   elseif (NOT "${INSTALL_DIR_WITH_VERSION_PREV}" STREQUAL "${INSTALL_DIR_WITH_VERSION}")
157     # INSTALL_DIR_WITH_VERSION has been changed at previous step
158     set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
159
160     OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
161   endif()
162 endif()
163
164 # hide CMAKE_INSTALL_PREFIX from a user
165 set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
166
167 set (BIN_LETTER "")
168 if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
169   set (BIN_LETTER "d")
170 elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
171   set (BIN_LETTER "i")
172 endif()
173
174 # Get all used variables: OS_WITH_BIT, COMPILER
175 OCCT_MAKE_OS_WITH_BITNESS()
176 OCCT_MAKE_COMPILER_SHORT_NAME()
177
178 # do not define INSTALL_DIR_BIN for win.
179 # Leave library structure for win: <prefix>/win64/vc10/bin(d)
180 if (NOT DEFINED INSTALL_DIR_BIN)
181   if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
182     set (INSTALL_DIR_BIN "bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
183   else()
184     set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
185   endif()
186 endif()
187
188 # define folder contaning all shell/batch scripts
189 if (NOT DEFINED INSTALL_DIR_SCRIPT)
190   if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
191     set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
192   else()
193     set (INSTALL_DIR_SCRIPT "." CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
194   endif()
195 endif()
196
197 # place the libraries to <prefix>/lib folder for unix and leave old structure for windows
198 if (NOT DEFINED INSTALL_DIR_LIB)
199   if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
200     set (INSTALL_DIR_LIB "lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
201   else()
202     set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
203   endif()
204 endif()
205
206 # OCCT headers: <prefix>/inc for windows,
207 #               <prefix>/include/opencascade-7.0.0 for unix
208 if (NOT DEFINED INSTALL_DIR_INCLUDE)
209   if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
210     set (INSTALL_DIR_INCLUDE "include/opencascade" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
211     if (INSTALL_DIR_WITH_VERSION)
212       set (INSTALL_DIR_INCLUDE "include/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}" FORCE)
213     endif()
214   else()
215     set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
216   endif()
217 endif()
218
219 # OCCT resources: <prefix>/src for windows,
220 #                 <prefix>/share/opencascade-7.0.0/resources for unix
221 if (NOT DEFINED INSTALL_DIR_RESOURCE)
222   if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
223     set (INSTALL_DIR_RESOURCE "share/opencascade/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
224     if (INSTALL_DIR_WITH_VERSION)
225       set (INSTALL_DIR_RESOURCE "share/opencascade-${OCC_VERSION_STRING_EXT}/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}" FORCE)
226     endif()
227   else()
228     set (INSTALL_DIR_RESOURCE "src" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
229   endif()
230 endif()
231
232 # OCCT data
233 if (NOT DEFINED INSTALL_DIR_DATA)
234   if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
235     set (INSTALL_DIR_DATA "share/opencascade/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
236     if (INSTALL_DIR_WITH_VERSION)
237       set (INSTALL_DIR_DATA "share/opencascade-${OCC_VERSION_STRING_EXT}/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}" FORCE)
238     endif()
239   else()
240     set (INSTALL_DIR_DATA "data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
241   endif()
242 endif()
243
244 # include the patched or original list of definitions and flags
245 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
246
247 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
248
249 if (NOT DEFINED 3RDPARTY_DIR)
250   set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
251   get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
252 else()
253   file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
254   set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
255 endif()
256
257 find_package(OpenCASCADE QUIET PATHS "${OpenCASCADE_DIR}" "${OpenCASCADE_INSTALL_PREFIX}" NO_DEFAULT_PATH)
258 # include OCCT headers
259 include_directories ("${OpenCASCADE_INCLUDE_DIR}")
260
261 if (NOT OpenCASCADE_FOUND)
262   message (FATAL_ERROR "coult not find OpenCASCADE, please set OpenCASCADE_DIR variable" )
263 else()
264   set (OpenCASCADE_DIR "${OpenCASCADE_INSTALL_PREFIX}" CACHE PATH "OpenCASCADE directory" FORCE)
265   message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" )
266 endif()
267
268 set (USE_TCL "${OpenCASCADE_WITH_TCL}")
269 set (USE_FREETYPE "${OpenCASCADE_WITH_FREETYPE}")
270 set (USE_FREEIMAGE "${OpenCASCADE_WITH_FREEIMAGE}")
271 set (USE_GL2PS "${OpenCASCADE_WITH_GL2PS}")
272 set (USE_TBB "${OpenCASCADE_WITH_TBB}")
273 set (USE_VTK "${OpenCASCADE_WITH_VTK}")
274 set (USE_FFMPEG "${OpenCASCADE_WITH_FFMPEG}")
275 set (USE_GLES2 "${OpenCASCADE_WITH_GLES2}")
276 set (USE_GLX "${OpenCASCADE_WITH_GLX}")
277
278
279 # define CSF variable
280 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
281
282 # custom definitions (CMakeConfig of OCCT)
283 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_TCL "adm/cmake/tcl")
284 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FREETYPE "adm/cmake/freetype")
285 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FREEIMAGE "adm/cmake/freeimage")
286 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GL2PS "adm/cmake/gl2ps")
287 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_TBB "adm/cmake/tbb")
288 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_VTK "adm/cmake/vtk")
289 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_FFMPEG "adm/cmake/ffmpeg")
290 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLES2 "adm/cmake/egl")
291 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLES2 "adm/cmake/gles2")
292 OCCT_INCLUDE_3RDPARTY_PRODUCT (USE_GLX "adm/cmake/glx")
293
294
295 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt")
296 OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
297
298 #include (${CMAKE_SOURCE_DIR}/adm/cmake/3rdparty.cmake)
299
300 set (3RDPARTY_DLL_DEB_PATH "${3RDPARTY_DLL_PATH}")
301
302 # build directories
303 if (SINGLE_GENERATOR)
304   set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
305   set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
306   set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
307   if (WIN32)
308     set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
309   endif()
310 endif()
311
312 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
313 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
314 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
315
316 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
317 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
318 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
319
320 set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
321 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
322 set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
323
324 if (WIN32) 
325   set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE        "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
326   set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
327   set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG          "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
328 endif()
329
330 # OCCT tools
331 # include the patched or original list of tools
332 # list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
333 # list <OCCT_TOOLS> will contain all tools
334 #if (BUILD_Inspector)
335   OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
336   foreach (OCCT_TOOL ${OCCT_TOOLS})
337     list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
338   endforeach()
339
340   # collect all the headers to <binary dir>/inc/inspector folder
341   string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
342   message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...")
343   COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "${CMAKE_SOURCE_DIR}/tools" "${INSTALL_DIR_INCLUDE}/inspector")
344 #endif()
345
346 # include <cmake binary folder>/inc
347 include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})
348
349 include_directories (${ADDITIONAL_INLCUDE_DIR})
350
351 if (3RDPARTY_INCLUDE_DIRS)
352   list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
353   string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
354   message (STATUS "Info: The directories of 3rdparty headers: \n\t${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
355   include_directories (${3RDPARTY_INCLUDE_DIRS})
356 endif()
357
358 if (3RDPARTY_LIBRARY_DIRS)
359   list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
360   string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
361   message (STATUS "Info: The directories of 3rdparty libraries: \n\t${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
362   link_directories (${3RDPARTY_LIBRARY_DIRS})
363 endif()
364
365 # include patched toolkit projects or original ones
366 if (BUILD_TOOL_TOOLKITS)
367   foreach (BUILD_TOOL_TOOLKIT ${BUILD_TOOL_TOOLKITS})
368     OCCT_ADD_SUBDIRECTORY ("tools/${BUILD_TOOL_TOOLKIT}")
369   endforeach()
370 endif()
371
372 message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed")
373
374 OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES)
375
376 # patch TInspectorEXE
377 if (MSVC AND 3RDPARTY_DLL_DIRS)
378   list (REMOVE_DUPLICATES 3RDPARTY_DLL_DIRS)
379   set (3RDPARTY_DLL_DIRS_FOR_PATH "")
380
381   foreach (3RDPARTY_DLL_DIR ${3RDPARTY_DLL_DIRS})
382     set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
383   endforeach()
384
385   if (ADDITIONAL_DLL_DIR)
386     foreach (3RDPARTY_DLL_DIR ${ADDITIONAL_DLL_DIR})
387       set (3RDPARTY_DLL_DIRS_FOR_PATH "${3RDPARTY_DLL_DIRS_FOR_PATH};${3RDPARTY_DLL_DIR}")
388     endforeach()
389   endif (ADDITIONAL_DLL_DIR)
390
391   OCCT_MAKE_COMPILER_BITNESS()
392   set (X_COMPILER_BITNESS "x64")
393   if ("${COMPILER_BITNESS}" STREQUAL "32")
394     set (X_COMPILER_BITNESS "Win32")
395   endif()
396
397   # patch TInspectorEXE
398   OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/TInspectorEXE/TInspectorEXE.vcxproj.user")
399 endif()
400
401 message (STATUS "Info: \(${CURRENT_TIME}\) Inspector configuration files prepared")