Compare commits
475 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
82b4c24940 | ||
|
32d5cd7b98 | ||
|
7f2debb25f | ||
|
80eb96707a | ||
|
c088aa932f | ||
|
46c99a694f | ||
|
db348d8c53 | ||
|
93e572caa0 | ||
|
49cfd13dca | ||
|
2fa97a4304 | ||
|
2dc8b7cc5b | ||
|
947085567f | ||
|
2caff0b32f | ||
|
e3573bb9ec | ||
|
c827ea3a68 | ||
|
00ea319b16 | ||
|
f3fb84ce21 | ||
|
18006a0f10 | ||
|
b350f6ee1e | ||
|
2958244411 | ||
|
2c5b6d9c12 | ||
|
a806787bd6 | ||
|
5e5ce65be4 | ||
|
6fb3418ea1 | ||
|
0797d9d30a | ||
|
a507ffd9d7 | ||
|
3edc7eea42 | ||
|
dbf0485ef0 | ||
|
43dbdb15db | ||
|
3908084224 | ||
|
e98e39903b | ||
|
05e2200bbf | ||
|
524a5f7aa7 | ||
|
1ccc9700f8 | ||
|
2b111fe8ba | ||
|
db91484119 | ||
|
02effd356b | ||
|
b858a6984e | ||
|
32c3693332 | ||
|
6e953e43f6 | ||
|
3798da68bc | ||
|
2da38dd24c | ||
|
fcc61cc4c9 | ||
|
4084fb643c | ||
|
db4d439c8f | ||
|
1eaf1cc1dc | ||
|
e1aa24d84b | ||
|
a0c202521d | ||
|
032d027214 | ||
|
50d0e1cefd | ||
|
67e36f0c7a | ||
|
1c9d151726 | ||
|
09f5e48e01 | ||
|
28746337be | ||
|
afbdee68fa | ||
|
5e6a855aa9 | ||
|
9256a43d09 | ||
|
7a13ab2df1 | ||
|
ac730776d8 | ||
|
903f7584b8 | ||
|
09c597c998 | ||
|
8591531065 | ||
|
905428003c | ||
|
7c58a2abc0 | ||
|
75827e7628 | ||
|
3fb72902ea | ||
|
876d1f2a2c | ||
|
0cc44c4730 | ||
|
e21b2bc603 | ||
|
3415763e74 | ||
|
0e0f7a7cde | ||
|
ba9e14dfb9 | ||
|
191082ac71 | ||
|
a69a08ee9e | ||
|
5e452c37ee | ||
|
86766b0ee0 | ||
|
bc67757515 | ||
|
40f70ac929 | ||
|
25ef750e44 | ||
|
f82a9555dc | ||
|
ed06327034 | ||
|
e1cbc34c5f | ||
|
196b01482b | ||
|
ba4feb7629 | ||
|
0644bfa483 | ||
|
4292bee12a | ||
|
83a8694888 | ||
|
aefdc31bf0 | ||
|
a520f6eb9a | ||
|
9e20ed5793 | ||
|
63c629aa3a | ||
|
7aa1b65c2a | ||
|
54a16ee447 | ||
|
058f130eff | ||
|
01d5be80b8 | ||
|
6d17debbe9 | ||
|
94dea18e8b | ||
|
6262a3032c | ||
|
5203f74183 | ||
|
4691b61a72 | ||
|
2a2e3ecdc7 | ||
|
d46546cdcd | ||
|
f0ecc0cc24 | ||
|
5b37e9d143 | ||
|
8e1e79f052 | ||
|
7d9e854bdc | ||
|
c60370656c | ||
|
256f9ac0ad | ||
|
2c2cebb3f7 | ||
|
eb46b12346 | ||
|
ab860031bd | ||
|
2bc75a1bce | ||
|
e3709f1d0a | ||
|
ab91ab6fea | ||
|
fcf15f5ca3 | ||
|
15534713ba | ||
|
2ab7a755c2 | ||
|
09711f3720 | ||
|
beb18c1f6e | ||
|
d81101039f | ||
|
de6f281fe9 | ||
|
4a350f9410 | ||
|
e2fd181c29 | ||
|
432a8df015 | ||
|
6e24232219 | ||
|
fb4b684a95 | ||
|
b6d587e35a | ||
|
519b544671 | ||
|
ab1469893c | ||
|
3910bc6501 | ||
|
4716247158 | ||
|
679d38788d | ||
|
0ef61b502b | ||
|
3a7a70135c | ||
|
30d33e7141 | ||
|
cca0f261aa | ||
|
39ef94f8f5 | ||
|
61aa7f3d3c | ||
|
cddbf6a985 | ||
|
a0fc422a3a | ||
|
50b830a09b | ||
|
ada5f62195 | ||
|
c7ccbb77a0 | ||
|
9df7f42944 | ||
|
848fa7e315 | ||
|
d9ff84e8ea | ||
|
d3dfddaebc | ||
|
8625ef7e94 | ||
|
25b97fac40 | ||
|
6b62b2da81 | ||
|
fe551aef6c | ||
|
8316c618a4 | ||
|
9c0b61f308 | ||
|
735dc1d26e | ||
|
0499eb0670 | ||
|
52d4584155 | ||
|
8e7c8ccf3a | ||
|
c19dd45ee0 | ||
|
1c1e319d1e | ||
|
e322db461d | ||
|
d32dc118f1 | ||
|
a6844d20f1 | ||
|
01a7df1b18 | ||
|
973001bfce | ||
|
008297e1e8 | ||
|
476e84b169 | ||
|
868dbdbae4 | ||
|
8e8070c47d | ||
|
59427cbc91 | ||
|
92ae0f2fe3 | ||
|
7277133aa9 | ||
|
c1e18dd843 | ||
|
ceb418e13f | ||
|
709e97a0c1 | ||
|
ec661e4333 | ||
|
f99b44099f | ||
|
f1c9c9d76b | ||
|
d2388a818c | ||
|
7a8c6a36e6 | ||
|
b89b1e0816 | ||
|
d538d7a221 | ||
|
d8726c7c6b | ||
|
ca3c13d1e8 | ||
|
7dc9a40776 | ||
|
a2ca2a304f | ||
|
0d1b4a2271 | ||
|
d780e37a83 | ||
|
4f93349381 | ||
|
5792217118 | ||
|
71598a83cd | ||
|
07dd6e9bee | ||
|
59af51e3c1 | ||
|
53f532f5ed | ||
|
3e594885aa | ||
|
d33222c108 | ||
|
a9b30f0acb | ||
|
d804b26d77 | ||
|
ba4181452c | ||
|
955b3e7102 | ||
|
418864aea1 | ||
|
eaf5c5e010 | ||
|
c1c03615f6 | ||
|
34028c1ff3 | ||
|
de10d8b144 | ||
|
9bf6baed3c | ||
|
aaf512f112 | ||
|
7d3e64ef5e | ||
|
9f33b387e2 | ||
|
8aeeca44df | ||
|
4e18052b7d | ||
|
1521659a7d | ||
|
9ffd84adf5 | ||
|
6303cb1205 | ||
|
963532f8a2 | ||
|
b353b9b435 | ||
|
f6d08024e1 | ||
|
a347ef35b4 | ||
|
0179bbc641 | ||
|
6aa39ac3ad | ||
|
53c888d174 | ||
|
7cf07fa506 | ||
|
e6cd097703 | ||
|
3e9b53cbf9 | ||
|
24b40f605a | ||
|
52f99d93a9 | ||
|
913a4c4ab0 | ||
|
1ffd3d70c2 | ||
|
2bd4bfac0d | ||
|
6e0fd076ae | ||
|
1e2fb24474 | ||
|
d9bd2bf756 | ||
|
03155c18a5 | ||
|
71b73fde24 | ||
|
1f205411c1 | ||
|
66190a47bb | ||
|
189062565f | ||
|
31cf9c5f7d | ||
|
2a78ec6a07 | ||
|
a315743983 | ||
|
0bd2a43ff5 | ||
|
0717ddc132 | ||
|
e3e895af61 | ||
|
10b9c7dfc0 | ||
|
4769a39529 | ||
|
6da50d2610 | ||
|
fd0344601b | ||
|
17d84c0ae8 | ||
|
ecc4f1489d | ||
|
d15f387afa | ||
|
eab2c8518e | ||
|
bedd79c434 | ||
|
8a8be2aabe | ||
|
38deba5d7f | ||
|
d91b3986ed | ||
|
73920cd481 | ||
|
95a2cf2f74 | ||
|
a967f10410 | ||
|
fc88faf18a | ||
|
1d33d22bd7 | ||
|
10ee997695 | ||
|
21678ea94a | ||
|
1ba5bcdc40 | ||
|
da8bb41da6 | ||
|
aeb722e31a | ||
|
53b15292f1 | ||
|
0304f71151 | ||
|
72b11796c5 | ||
|
c398b00ed8 | ||
|
5b98e25d8e | ||
|
7a76337e89 | ||
|
5a89733fd4 | ||
|
1951a27c98 | ||
|
de9a2842e1 | ||
|
6d1dc3e82c | ||
|
5402ccdda6 | ||
|
353474f083 | ||
|
616d8d0a78 | ||
|
2d7b28ac98 | ||
|
bc02c7cab1 | ||
|
576f8b111b | ||
|
9d0fc01b3f | ||
|
ffc26091ca | ||
|
2961777a50 | ||
|
f07434e2cc | ||
|
e4b5c45aa6 | ||
|
870722965d | ||
|
9a05760b6b | ||
|
5435450fc5 | ||
|
6a442250c4 | ||
|
1fa7cb8c3a | ||
|
8e007da7af | ||
|
d4f1753b9c | ||
|
37ac4a67fc | ||
|
14434f3e6c | ||
|
846c92e0f5 | ||
|
9cc773b5ad | ||
|
0e330c8cf5 | ||
|
7d7ddef39f | ||
|
16aec6a441 | ||
|
95f8573c29 | ||
|
2df4b1d33d | ||
|
ac83e94f8b | ||
|
c67cd62ecf | ||
|
cd7c40f5af | ||
|
113493b0f1 | ||
|
5a44311151 | ||
|
797d11c6f5 | ||
|
6bc6a6fc07 | ||
|
9dba391d4c | ||
|
f29db51421 | ||
|
c308fbd7c7 | ||
|
90cdb15d4a | ||
|
214df550f6 | ||
|
ecc1d911d1 | ||
|
a7b491fc50 | ||
|
8d3f219f5d | ||
|
3c64852756 | ||
|
0272e74033 | ||
|
347423b2c2 | ||
|
fe9fc66996 | ||
|
2a40d51c15 | ||
|
7ed22e71e0 | ||
|
d4d12e8b20 | ||
|
9a148b08df | ||
|
1aa6b1c9e2 | ||
|
87f42a3fb6 | ||
|
a987c2f484 | ||
|
fc9b36d630 | ||
|
b6c0b841ec | ||
|
a9568545f1 | ||
|
74618acf3d | ||
|
ebfb9ce298 | ||
|
01a6e62bc2 | ||
|
0e9d3b83b8 | ||
|
595a42a43f | ||
|
069eca4f44 | ||
|
d58d4282a6 | ||
|
8106f9bc2c | ||
|
dbe51192a3 | ||
|
9f2e7daaa9 | ||
|
0d4e350159 | ||
|
9cbe629085 | ||
|
1e07a0faf2 | ||
|
e6087fad55 | ||
|
5493d33411 | ||
|
5b14f80036 | ||
|
a89742cf17 | ||
|
8d3865d870 | ||
|
89e5391a31 | ||
|
57ad5cbd5d | ||
|
0a36ca0a40 | ||
|
623c29a5b6 | ||
|
aade732dda | ||
|
c9fb852983 | ||
|
b1574471ff | ||
|
75c5def578 | ||
|
af4b4ba9e5 | ||
|
465d1fba7c | ||
|
2d2aa6f1a6 | ||
|
b7cd4ba795 | ||
|
c1c1aefa71 | ||
|
2c5643b6a7 | ||
|
31c0e2194e | ||
|
7bbe90f2a7 | ||
|
7d0496dd6d | ||
|
e01907f12a | ||
|
9bdafcbe2d | ||
|
0ae61cf3b3 | ||
|
44a87d6967 | ||
|
a060129f78 | ||
|
f49c31097c | ||
|
0c67424831 | ||
|
acbb658afe | ||
|
e9216c6acf | ||
|
8bcb4f55cc | ||
|
26e17b5721 | ||
|
e3a6386d18 | ||
|
655fddc854 | ||
|
a4e383e1b8 | ||
|
f284355851 | ||
|
36f4947b8d | ||
|
9b0fb8cdd0 | ||
|
c764e804ba | ||
|
5e5b6f81c1 | ||
|
3a01a933af | ||
|
ddf2fe8eeb | ||
|
598fcce93c | ||
|
774d889744 | ||
|
2ad228f691 | ||
|
16c7b64236 | ||
|
8696d65d2c | ||
|
dc244065a9 | ||
|
9fae8c7367 | ||
|
f379643fc0 | ||
|
2fe0e897e3 | ||
|
79a35943dd | ||
|
574d723693 | ||
|
70167e6982 | ||
|
ff8178ef85 | ||
|
bdd1223f46 | ||
|
69b43824ac | ||
|
1e143abba6 | ||
|
68bd84a5f0 | ||
|
d92035598f | ||
|
ab58a62baa | ||
|
2a54ebbf29 | ||
|
cae42e78e5 | ||
|
b6a21c7e6d | ||
|
6e33d3ced2 | ||
|
99c68ea35f | ||
|
c7ac7603b0 | ||
|
bc8c79bbd5 | ||
|
dc9ef964d2 | ||
|
4bc0bb8ab1 | ||
|
3ae590318e | ||
|
f56518cdbe | ||
|
59495dbe8a | ||
|
0734c53d68 | ||
|
f1baf495b6 | ||
|
945c35291e | ||
|
48cc825e83 | ||
|
5ad539d2e0 | ||
|
0e93d9e5b8 | ||
|
63def8e679 | ||
|
6268cc68d7 | ||
|
011b361de5 | ||
|
1ee621b661 | ||
|
8e81749770 | ||
|
c471a1ba18 | ||
|
16a1f26537 | ||
|
72952ef2b8 | ||
|
3f5bebe804 | ||
|
8581b51995 | ||
|
76e9222246 | ||
|
7b3ce7dc84 | ||
|
44c7c33eb0 | ||
|
013a854956 | ||
|
29d778bf16 | ||
|
004e846676 | ||
|
4bbaf12b67 | ||
|
97385d6142 | ||
|
a096a7a58a | ||
|
fab29dc11a | ||
|
9efc0d1470 | ||
|
a34f083b8c | ||
|
6421543502 | ||
|
b1a3427054 | ||
|
c2a388f884 | ||
|
6a43d224e4 | ||
|
82fc327c7d | ||
|
7ccd27ca04 | ||
|
e97a6598fe | ||
|
18f4e8e28d | ||
|
eb1ebea490 | ||
|
fc8eab5e09 | ||
|
550f3b8b22 | ||
|
372ceec4ce | ||
|
7389f96df0 | ||
|
54f7544df6 | ||
|
6af4fe1c46 | ||
|
bd2de3965e | ||
|
3125ebb6f3 | ||
|
b439bc5856 | ||
|
73192b3746 | ||
|
db3cb1cede | ||
|
5546828378 | ||
|
c26b5a34bc | ||
|
85bcc07243 | ||
|
66fb4d9a40 | ||
|
21761b6feb | ||
|
1a25084d99 | ||
|
242da3e5ef | ||
|
32856b630d | ||
|
33839ae65b | ||
|
b8d1c74226 |
3
.gitattributes
vendored
@@ -41,6 +41,9 @@ FILES eol=lf
|
||||
PACKAGES eol=lf
|
||||
EXTERNLIB eol=lf
|
||||
UDLIST eol=lf
|
||||
tests/* eol=lf
|
||||
tests/*/* eol=lf
|
||||
tests/*/*/* eol=lf
|
||||
*.bat eol=crlf
|
||||
*.cmd eol=crlf
|
||||
*.rc eol=crlf
|
||||
|
3
.gitignore
vendored
@@ -34,6 +34,9 @@ Release
|
||||
*.ncb
|
||||
*.suo
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.ipch
|
||||
*.aps
|
||||
|
||||
# test results
|
||||
/results*
|
||||
|
751
CMakeLists.txt
@@ -1,530 +1,343 @@
|
||||
cmake_minimum_required ( VERSION 2.6)
|
||||
cmake_minimum_required (VERSION 2.8.10 FATAL_ERROR)
|
||||
|
||||
set (CMAKE_SUPPRESS_REGENERATION TRUE)
|
||||
|
||||
# set build configurations list
|
||||
if (NOT BUILD_CONFIGURATION)
|
||||
set(BUILD_CONFIGURATION "Release" CACHE STRING "Build type of OCCT" FORCE)
|
||||
set (BUILD_CONFIGURATION "Release" CACHE STRING "Build type of OCCT" FORCE)
|
||||
SET_PROPERTY(CACHE BUILD_CONFIGURATION PROPERTY STRINGS Release Debug RelWithDebInfo)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES ${BUILD_CONFIGURATION} CACHE INTERNAL "" FORCE)
|
||||
set (CMAKE_CONFIGURATION_TYPES ${BUILD_CONFIGURATION} CACHE INTERNAL "" FORCE)
|
||||
|
||||
project(OCCT)
|
||||
# the name of the project
|
||||
project (OCCT)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
# Solution folder property
|
||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
set (CMAKE_BUILD_TYPE ${BUILD_CONFIGURATION} CACHE INTERNAL "Build type of OCCT" FORCE )
|
||||
|
||||
IF("${BUILD_CONFIGURATION}" STREQUAL "${CMAKE_BUILD_TYPE}")
|
||||
SET(CHANGES_ARE_NEEDED OFF)
|
||||
ELSE()
|
||||
SET(CHANGES_ARE_NEEDED ON)
|
||||
ENDIF()
|
||||
# install dir of the built project
|
||||
set (INSTALL_DIR "" CACHE PATH "Directory that will contain install files of OCCT" )
|
||||
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
|
||||
|
||||
MATH(EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
|
||||
# whether install test bundle or not
|
||||
set (INSTALL_TESTS OFF CACHE BOOL "Is tests copy to install directory")
|
||||
|
||||
SET( CMAKE_BUILD_TYPE ${BUILD_CONFIGURATION} CACHE INTERNAL "Build type of OCCT" FORCE )
|
||||
|
||||
SET( INSTALL_DIR "" CACHE PATH "Directory that will contain install files of OCCT" )
|
||||
SET( CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
|
||||
set (BUILD_PATCH_DIR "" CACHE PATH "directory with OCCT patch")
|
||||
|
||||
# the list of being built toolkits
|
||||
set (BUILD_TOOLKITS "" CACHE STRING "Toolkits are also included in OCCT")
|
||||
separate_arguments(BUILD_TOOLKITS)
|
||||
|
||||
IF(MSVC)
|
||||
SET(BUILD_Samples OFF CACHE BOOL "OCCT samples building")
|
||||
ENDIF()
|
||||
|
||||
include(adm/cmake/CMakeModules.txt)
|
||||
|
||||
if (WIN32)
|
||||
set(SCRIPT_EXT bat)
|
||||
else()
|
||||
set(SCRIPT_EXT sh)
|
||||
endif()
|
||||
separate_arguments (BUILD_TOOLKITS)
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(/fp:precise)
|
||||
set (BUILD_MFC_SAMPLES OFF CACHE BOOL "OCCT samples building")
|
||||
endif()
|
||||
|
||||
# set compiler short name and choose SSE2 option for appropriate MSVC compilers
|
||||
if (DEFINED MSVC70)
|
||||
SET(COMPILER vc7)
|
||||
elseif (DEFINED MSVC80)
|
||||
SET(COMPILER vc8)
|
||||
if (${COMPILER_BITNESS} STREQUAL 32)
|
||||
add_definitions(/arch:SSE2)
|
||||
endif()
|
||||
elseif (DEFINED MSVC90)
|
||||
SET(COMPILER vc9)
|
||||
if (${COMPILER_BITNESS} STREQUAL 32)
|
||||
add_definitions(/arch:SSE2)
|
||||
endif()
|
||||
elseif (DEFINED MSVC10)
|
||||
SET(COMPILER vc10)
|
||||
if (${COMPILER_BITNESS} STREQUAL 32)
|
||||
add_definitions(/arch:SSE2)
|
||||
endif()
|
||||
elseif (DEFINED MSVC11)
|
||||
SET(COMPILER vc11)
|
||||
else()
|
||||
SET(COMPILER ${CMAKE_GENERATOR})
|
||||
# whether use optional 3rdparty or not
|
||||
if (APPLE)
|
||||
set (USE_GLX OFF CACHE BOOL "Are X11 OpenGL used on OSX or not")
|
||||
endif()
|
||||
|
||||
add_definitions(-DCSFDB)
|
||||
if(WIN32)
|
||||
add_definitions(/DWNT -wd4996)
|
||||
elseif(APPLE)
|
||||
add_definitions(-fexceptions -fPIC -DOCC_CONVERT_SIGNALS -DHAVE_WOK_CONFIG_H -DHAVE_CONFIG_H)
|
||||
else()
|
||||
add_definitions(-fexceptions -fPIC -DOCC_CONVERT_SIGNALS -DHAVE_WOK_CONFIG_H -DHAVE_CONFIG_H -DLIN)
|
||||
set (USE_FREEIMAGE OFF CACHE BOOL "Is freeimage used or not")
|
||||
set (USE_VTK OFF CACHE BOOL "Is VTK used or not")
|
||||
|
||||
if (NOT DEFINED ANDROID)
|
||||
set (USE_GL2PS OFF CACHE BOOL "Is gl2ps used or not")
|
||||
set (USE_TBB OFF CACHE BOOL "Is tbb used or not")
|
||||
set (USE_OPENCL OFF CACHE BOOL "Is OpenCL used or not")
|
||||
endif()
|
||||
|
||||
# enable structured exceptions for MSVC
|
||||
string(REGEX MATCH "EHsc" ISFLAG "${CMAKE_CXX_FLAGS}")
|
||||
IF(ISFLAG)
|
||||
STRING(REGEX REPLACE "EHsc" "EHa" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
ELSEIF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -EHa")
|
||||
ENDIF()
|
||||
|
||||
# enable parallel compilation on MSVC 9 and above
|
||||
IF(WIN32)
|
||||
IF(NOT DEFINED MSVC70 AND NOT DEFINED MSVC80)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# increase compiler warnings level (-W4 for MSVC, -Wall for GCC)
|
||||
IF(MSVC)
|
||||
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
# macro: include patched file if it exists
|
||||
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
|
||||
if (NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake")
|
||||
include(${BUILD_PATCH_DIR}/${BEING_INCLUDED_FILE}.cmake)
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
||||
include(${BEING_INCLUDED_FILE}.cmake)
|
||||
endif()
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
endmacro()
|
||||
|
||||
# include occt macros
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/occt_macros")
|
||||
|
||||
# BUILD_POSTFIX variable is used by all toolkit cmakelists.txt projects
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
# include the patched or original list of modules
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_modules")
|
||||
|
||||
# include the list of being used toolkits. USED_TOOLKITS variable
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_toolkits")
|
||||
|
||||
# include the patched or original list of definitions and flags
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/occt_defs_flags")
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/3rdparty_macro")
|
||||
|
||||
set (3RDPARTY_DIR_LABEL "The directory containing required 3rdparty products")
|
||||
if (NOT DEFINED 3RDPARTY_DIR)
|
||||
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_LABEL})
|
||||
endif()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
||||
# search for 3rdparty dir
|
||||
if ("${3RDPARTY_DIR}" STREQUAL "")
|
||||
if (DEFINED ENV{3RDPARTY_DIR})
|
||||
set (3RDPARTY_DIR "$ENV{3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_LABEL} FORCE)
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/../")
|
||||
# in version 6.7.0 and above, occt parent directory contains 3rdparties
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/../" ABSOLUTE)
|
||||
SET(3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH ${3RDPARTY_DIR_LABEL} FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEB")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEB")
|
||||
# search for CSF_TclLibs variable in EXTERNLIB of each being used toolkit
|
||||
OCCT_IS_PRODUCT_REQUIRED(CSF_TclLibs USE_TCL)
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/bin)
|
||||
if ("${USE_TCL}" STREQUAL ON)
|
||||
message (STATUS "Info: tcl is used by OCCT")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/tcl")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_TCL_DIR")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_TCL_INCLUDE_DIR")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_TCL_LIBRARY")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_TCL_LIBRARY_DIR")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_TK_INCLUDE_DIR")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_TK_LIBRARY")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_TK_LIBRARY_DIR")
|
||||
endif()
|
||||
|
||||
# RESOURCES
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/DrawResources" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/StdResource" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/SHMessage" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/Textures" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/Shaders" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSMessage" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSTEPResource" DESTINATION "${INSTALL_DIR}/src" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XmlOcafResource" DESTINATION "${INSTALL_DIR}/src" )
|
||||
# search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
|
||||
OCCT_IS_PRODUCT_REQUIRED(CSF_FREETYPE USE_FREETYPE)
|
||||
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Lexi_Expr.dat" DESTINATION "${INSTALL_DIR}/src/UnitsAPI" )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Units.dat" DESTINATION "${INSTALL_DIR}/src/UnitsAPI" )
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/src/TObj/TObj.msg" DESTINATION "${INSTALL_DIR}/src/TObj" )
|
||||
if ("${USE_FREETYPE}" STREQUAL ON)
|
||||
message (STATUS "Info: freetype is used by OCCT")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/freetype")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_DIR")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_LIBRARY")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_LIBRARY_DIR")
|
||||
endif()
|
||||
|
||||
IF("${BUILD_CONFIGURATION}" STREQUAL "Release")
|
||||
SET(BUILD_SUFFIX "")
|
||||
ELSE()
|
||||
SET(BUILD_SUFFIX "") # debug == release
|
||||
ENDIF()
|
||||
|
||||
FUNCTION(SUBDIRECTORY_NAMES MAIN_DIRECTORY RESULT)
|
||||
file(GLOB SUB_ITEMS "${MAIN_DIRECTORY}/*")
|
||||
|
||||
foreach(ITEM ${SUB_ITEMS})
|
||||
if(IS_DIRECTORY "${ITEM}")
|
||||
GET_FILENAME_COMPONENT(ITEM_NAME "${ITEM}" NAME)
|
||||
LIST(APPEND LOCAL_RESULT "${ITEM_NAME}")
|
||||
endif()
|
||||
endforeach()
|
||||
set (${RESULT} ${LOCAL_RESULT} PARENT_SCOPE)
|
||||
ENDFUNCTION()
|
||||
|
||||
FUNCTION(FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
|
||||
string( TOLOWER "${PRODUCT_NAME}" lower_PRODUCT_NAME )
|
||||
|
||||
LIST(APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
LIST(APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
LIST(APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER_BITNESS}")
|
||||
LIST(APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+")
|
||||
LIST(APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}")
|
||||
|
||||
SUBDIRECTORY_NAMES( "${ROOT_DIR}" SUBDIR_NAME_LIST)
|
||||
|
||||
FOREACH( SEARCH_TEMPLATE ${SEARCH_TEMPLATES})
|
||||
IF(LOCAL_RESULT)
|
||||
BREAK()
|
||||
ENDIF()
|
||||
|
||||
FOREACH(SUBDIR_NAME ${SUBDIR_NAME_LIST})
|
||||
string( TOLOWER "${SUBDIR_NAME}" lower_SUBDIR_NAME )
|
||||
|
||||
STRING(REGEX MATCH "${SEARCH_TEMPLATE}" DUMMY_VAR "${lower_SUBDIR_NAME}")
|
||||
IF(DUMMY_VAR)
|
||||
LIST(APPEND LOCAL_RESULT ${SUBDIR_NAME})
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDFOREACH()
|
||||
|
||||
IF(LOCAL_RESULT)
|
||||
LIST(LENGTH "${LOCAL_RESULT}" LOC_LEN)
|
||||
MATH(EXPR LAST_ELEMENT_INDEX "${LOC_LEN}-1")
|
||||
LIST(GET LOCAL_RESULT ${LAST_ELEMENT_INDEX} DUMMY)
|
||||
SET(${RESULT} ${DUMMY} PARENT_SCOPE)
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
|
||||
IF(WIN32)
|
||||
SET(DLL_SO "dll")
|
||||
SET(DLL_SO_FOLDER "bin")
|
||||
SET(DLL_SO_PREFIX "")
|
||||
ELSEIF(APPLE)
|
||||
SET(DLL_SO "dylib")
|
||||
SET(DLL_SO_FOLDER "lib")
|
||||
SET(DLL_SO_PREFIX "lib")
|
||||
ELSE()
|
||||
SET(DLL_SO "so")
|
||||
SET(DLL_SO_FOLDER "lib")
|
||||
SET(DLL_SO_PREFIX "lib")
|
||||
ENDIF()
|
||||
|
||||
SET(3RDPARTY_DIR ${CMAKE_SOURCE_DIR} CACHE PATH "Directory contains required 3rdparty products")
|
||||
SET(3RDPARTY_INCLUDE_DIRS "")
|
||||
SET(3RDPARTY_NOT_INCLUDED)
|
||||
|
||||
IF(APPLE)
|
||||
SET(USE_GLX OFF CACHE BOOL "whether use X11 OpenGL on OSX or not")
|
||||
ENDIF()
|
||||
|
||||
SET(USE_GL2PS OFF CACHE BOOL "whether use gl2ps product or not")
|
||||
SET(USE_FREEIMAGE OFF CACHE BOOL "whether use freeimage product or not")
|
||||
SET(USE_TBB OFF CACHE BOOL "whether use tbb product or not")
|
||||
SET(USE_OPENCL OFF CACHE BOOL "whether use OpenCL or not")
|
||||
|
||||
SET(INSTALL_TESTS OFF CACHE BOOL "Is tests copy to install directory")
|
||||
|
||||
MACRO (CHECK_AND_UNSET VARNAME)
|
||||
IF(DEFINED ${VARNAME})
|
||||
UNSET(${VARNAME} CACHE)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
MACRO (CHECK_AND_UNSET_GROUP VARNAME)
|
||||
CHECK_AND_UNSET ("${VARNAME}_DIR")
|
||||
CHECK_AND_UNSET ("${VARNAME}_INCLUDE_DIR")
|
||||
CHECK_AND_UNSET ("${VARNAME}_DLL")
|
||||
CHECK_AND_UNSET ("${VARNAME}_LIBRARY")
|
||||
ENDMACRO()
|
||||
|
||||
MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME)
|
||||
IF(NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DIR)
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "Directory contains ${PRODUCT_NAME} product")
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_DIR AND ("${3RDPARTY_${PRODUCT_NAME}_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" ${PRODUCT_NAME} ${PRODUCT_NAME}_DIR_NAME)
|
||||
IF("${${PRODUCT_NAME}_DIR_NAME}" STREQUAL "")
|
||||
MESSAGE(STATUS "${PRODUCT_NAME} DON'T FIND")
|
||||
ELSE()
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DIR "${3RDPARTY_DIR}/${${PRODUCT_NAME}_DIR_NAME}" CACHE PATH "Directory contains ${PRODUCT_NAME} product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "Is ${PRODUCT_NAME} lib copy to install directory")
|
||||
|
||||
IF(3RDPARTY_${PRODUCT_NAME}_DIR)
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "Directory contains headers of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_PATH(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME} PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/include" NO_DEFAULT_PATH)
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME} PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/lib" NO_DEFAULT_PATH)
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_FILE(3RDPARTY_${PRODUCT_NAME}_DLL "${DLL_SO_PREFIX}${LIBRARY_NAME}.${DLL_SO}" PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/${DLL_SO_FOLDER}" NO_DEFAULT_PATH)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(3RDPARTY_${PRODUCT_NAME}_DIR)
|
||||
ELSE()
|
||||
|
||||
ENDIF()
|
||||
|
||||
# check default path (with additions) for header search
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}" STREQUAL "" OR "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "Directory contains headers of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_PATH(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME} ${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_HEADER})
|
||||
ENDIF()
|
||||
|
||||
# check default path (with additions) for library search
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "" OR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Directory contains library of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME} ${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_LIB})
|
||||
ENDIF()
|
||||
|
||||
# check default path (with additions) for DLL search
|
||||
IF("${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "" OR "${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Directory contains shared library of the ${PRODUCT_NAME} product" FORCE)
|
||||
FIND_FILE(3RDPARTY_${PRODUCT_NAME}_DLL "${DLL_SO_PREFIX}${LIBRARY_NAME}.${DLL_SO}" ${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_DLL})
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_${PRODUCT_NAME}_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_${PRODUCT_NAME}_DLL)
|
||||
#
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_DLL)
|
||||
ENDIF()
|
||||
|
||||
IF(INSTALL_${PRODUCT_NAME})
|
||||
INSTALL(FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DLL_DIR "")
|
||||
ELSE()
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
# TCL
|
||||
INCLUDE(adm/templates/tcl.cmake)
|
||||
|
||||
#install tcltk
|
||||
IF(INSTALL_TCL)
|
||||
SET(3RDPARTY_TCL_DLL_DIR "")
|
||||
SET(3RDPARTY_TCL_LIB_DIR "")
|
||||
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_LIB_DIR_INSIDE "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_DLL_DIR_INSIDE "${3RDPARTY_TCL_DLL}" PATH)
|
||||
|
||||
IF (IS_TCL_VERSION_FOUND)
|
||||
SET (TCL_VERSION ${TCL_MAJOR_VERSION}${TCL_SEP}${TCL_MINOR_VERSION})
|
||||
SET (TCL_FOLDER_VERSION ${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION})
|
||||
ELSE()
|
||||
SET (TCL_VERSION "")
|
||||
|
||||
#TODO SEARCH tclX.X & tkX.X subdirs
|
||||
SET (TCL_FOLDER_VERSION "")
|
||||
ENDIF()
|
||||
|
||||
INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR_INSIDE}/${DLL_SO_PREFIX}tcl${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR_INSIDE}/${DLL_SO_PREFIX}tk${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
|
||||
IF (IS_TCL_VERSION_FOUND)
|
||||
INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tcl8" DESTINATION "${INSTALL_DIR}/lib")
|
||||
INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tcl${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib")
|
||||
INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR_INSIDE}/tk${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.")
|
||||
MESSAGE(STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_LIB_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
ENDIF()
|
||||
# VTK
|
||||
if (USE_VTK)
|
||||
add_definitions (-DHAVE_VTK)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/vtk")
|
||||
endif()
|
||||
|
||||
# GLX
|
||||
IF(USE_GLX)
|
||||
ADD_DEFINITIONS(-DMACOSX_USE_GLX)
|
||||
|
||||
IF(NOT DEFINED 3RDPARTY_GLX_DIR)
|
||||
SET(3RDPARTY_GLX_DIR "" CACHE PATH "Directory contains GLX product")
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_DIR AND ("${3RDPARTY_GLX_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" GLX GLX_DIR_NAME)
|
||||
IF("${GLX_DIR_NAME}" STREQUAL "")
|
||||
MESSAGE(STATUS "GLX DON'T FIND")
|
||||
ELSE()
|
||||
SET(3RDPARTY_GLX_DIR "${3RDPARTY_DIR}/${GLX_DIR_NAME}" CACHE PATH "Directory contains GLX product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_GLX_DIR)
|
||||
SET(3RDPARTY_GLX_INCLUDE_DIR "${3RDPARTY_GLX_DIR}/include" CACHE FILEPATH "Directory contains headers of the GLX product" FORCE)
|
||||
SET(3RDPARTY_GLX_LIBRARY_DIR "${3RDPARTY_GLX_DIR}/lib" CACHE FILEPATH "Directory contains library of the GLX product" FORCE)
|
||||
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_GLX_INCLUDE_DIR}")
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_GLX_LIBRARY_DIR}")
|
||||
|
||||
MARK_AS_ADVANCED(3RDPARTY_GLX_DIR)
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_GLX_INCLUDE_DIR)
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_GLX_LIBRARY_DIR)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# FREETYPE
|
||||
THIRDPARTY_PRODUCT("FREETYPE" "ft2build.h" "freetype${BUILD_SUFFIX}")
|
||||
|
||||
IF("${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "" OR "${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND")
|
||||
|
||||
ELSEIF(EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2/")
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2")
|
||||
ENDIF()
|
||||
if (USE_GLX)
|
||||
add_definitions (-DMACOSX_USE_GLX)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/glx")
|
||||
endif()
|
||||
|
||||
# FREEIMAGE
|
||||
IF(USE_FREEIMAGE)
|
||||
ADD_DEFINITIONS(-DHAVE_FREEIMAGE)
|
||||
|
||||
THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "freeimage${BUILD_SUFFIX}")
|
||||
IF(WIN32)
|
||||
IF("${3RDPARTY_FREEIMAGE_DIR}" STREQUAL "")
|
||||
ELSE()
|
||||
SET (3RDPARTY_FREEIMAGEPLUS_DIR "${3RDPARTY_FREEIMAGE_DIR}")
|
||||
ENDIF()
|
||||
|
||||
THIRDPARTY_PRODUCT("FREEIMAGEPLUS" "FreeImagePlus.h" "freeimageplus${BUILD_SUFFIX}")
|
||||
|
||||
ENDIF()
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
|
||||
CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
|
||||
CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
|
||||
ENDIF()
|
||||
if (USE_FREEIMAGE)
|
||||
add_definitions (-DHAVE_FREEIMAGE)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/freeimage")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/freeimageplus")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
|
||||
endif()
|
||||
|
||||
# GL2PS
|
||||
IF(USE_GL2PS)
|
||||
ADD_DEFINITIONS(-DHAVE_GL2PS)
|
||||
THIRDPARTY_PRODUCT("GL2PS" "gl2ps.h" "gl2ps${BUILD_SUFFIX}")
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
|
||||
CHECK_AND_UNSET ("INSTALL_GL2PS")
|
||||
ENDIF()
|
||||
if (USE_GL2PS)
|
||||
add_definitions (-DHAVE_GL2PS)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/gl2ps")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_GL2PS")
|
||||
endif()
|
||||
|
||||
# OPENCL
|
||||
IF(USE_OPENCL)
|
||||
ADD_DEFINITIONS(-DHAVE_OPENCL)
|
||||
|
||||
SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER $ENV{AMDAPPSDKROOT}/include
|
||||
$ENV{INTELOCLSDKROOT}/include
|
||||
$ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/inc
|
||||
$ENV{ATISTREAMSDKROOT}/include)
|
||||
|
||||
|
||||
IF(${COMPILER_BITNESS} STREQUAL 32)
|
||||
SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB $ENV{AMDAPPSDKROOT}/lib/x86
|
||||
$ENV{INTELOCLSDKROOT}/lib/x86
|
||||
$ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/lib/Win32
|
||||
$ENV{ATISTREAMSDKROOT}/lib/x86)
|
||||
ELSEIF(${COMPILER_BITNESS} STREQUAL 64)
|
||||
SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB $ENV{AMDAPPSDKROOT}/lib/x86_64
|
||||
$ENV{INTELOCLSDKROOT}/lib/x64
|
||||
$ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/lib/x64
|
||||
$ENV{ATISTREAMSDKROOT}/lib/x86_64)
|
||||
ENDIF()
|
||||
|
||||
|
||||
THIRDPARTY_PRODUCT("OPENCL" "CL/cl.h" "OpenCL${BUILD_SUFFIX}")
|
||||
|
||||
# if CL/cl.h isn't found (and 3RDPARTY_OPENCL_INCLUDE_DIR isn't defined)
|
||||
# then try to find OpenCL/cl.h (all other variable won't be changed)
|
||||
THIRDPARTY_PRODUCT("OPENCL" "OpenCL/cl.h" "OpenCL${BUILD_SUFFIX}")
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENCL")
|
||||
CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB")
|
||||
CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB")
|
||||
CHECK_AND_UNSET ("INSTALL_OPENCL")
|
||||
ENDIF()
|
||||
if (USE_OPENCL)
|
||||
add_definitions (-DHAVE_OPENCL)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/opencl")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENCL")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_OPENCL")
|
||||
endif()
|
||||
|
||||
# TBB
|
||||
IF (USE_TBB)
|
||||
if (USE_TBB)
|
||||
ADD_DEFINITIONS(-DHAVE_TBB)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/tbb")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
|
||||
endif()
|
||||
|
||||
INCLUDE(adm/templates/tbb.cmake)
|
||||
string (REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
|
||||
|
||||
IF(INSTALL_TBB)
|
||||
INSTALL(FILES "${3RDPARTY_TBB_DLL}" "${3RDPARTY_TBB_MALLOC_DLL}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
|
||||
# check all 3rdparty paths
|
||||
if (3RDPARTY_NOT_INCLUDED)
|
||||
message (FATAL_ERROR "NOT FOUND: ${3RDPARTY_NOT_INCLUDED}" )
|
||||
endif()
|
||||
|
||||
SET(3RDPARTY_TBB_DLL_DIR "")
|
||||
SET(3RDPARTY_TBB_MALLOC_DLL_DIR "")
|
||||
ELSE()
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_DLL_DIR "${3RDPARTY_TBB_DLL}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_MALLOC_DLL_DIR "${3RDPARTY_TBB_MALLOC_DLL}" PATH)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB_MALLOC")
|
||||
CHECK_AND_UNSET ("3RDPARTY_TBB_DIR_NAME")
|
||||
CHECK_AND_UNSET ("INSTALL_TBB")
|
||||
ENDIF()
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
|
||||
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
|
||||
message (STATUS "The directories containing 3rdparty headers: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
|
||||
include_directories (${3RDPARTY_INCLUDE_DIRS})
|
||||
|
||||
string( REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
|
||||
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
|
||||
message (STATUS "The directories containing 3rdparty libraries: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
|
||||
link_directories (${3RDPARTY_LIBRARY_DIRS})
|
||||
|
||||
#CHECK ALL 3RDPARTY PATHS
|
||||
IF(3RDPARTY_NOT_INCLUDED)
|
||||
MESSAGE(FATAL_ERROR "NOT FOUND: ${3RDPARTY_NOT_INCLUDED}" )
|
||||
ENDIF()
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
list(REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
|
||||
string( REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
|
||||
MESSAGE(STATUS "3RDPARTY_INCLUDE_DIRS: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
|
||||
include_directories( ${3RDPARTY_INCLUDE_DIRS} )
|
||||
# build directories
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/lib${BUILD_POSTFIX})
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/lib${BUILD_POSTFIX})
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out/bin${BUILD_POSTFIX})
|
||||
|
||||
list(REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
|
||||
string( REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
|
||||
MESSAGE(STATUS "3RDPARTY_LIBRARY_DIRS: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
|
||||
link_directories( ${3RDPARTY_LIBRARY_DIRS} )
|
||||
|
||||
IF("${INSTALL_DIR}" STREQUAL "")
|
||||
MESSAGE(FATAL_ERROR "INSTALL_DIR is empty")
|
||||
ELSE()
|
||||
if ("${INSTALL_DIR}" STREQUAL "")
|
||||
message (FATAL_ERROR "INSTALL_DIR variable is empty. It's required to define installation directory")
|
||||
else()
|
||||
# inc,data,tests DIRECTORY
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/inc" DESTINATION "${INSTALL_DIR}" )
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/data" DESTINATION "${INSTALL_DIR}" )
|
||||
IF(INSTALL_TESTS)
|
||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tests" DESTINATION "${INSTALL_DIR}" )
|
||||
ENDIF()
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/inc" DESTINATION "${INSTALL_DIR}")
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/data" DESTINATION "${INSTALL_DIR}")
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/samples/tcl" DESTINATION "${INSTALL_DIR}/samples")
|
||||
if (INSTALL_TESTS)
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/tests" DESTINATION "${INSTALL_DIR}" )
|
||||
endif()
|
||||
|
||||
# install patch inc, data, tests folder
|
||||
if (NOT "${BUILD_PATCH_DIR}" STREQUAL "")
|
||||
if (EXISTS "${BUILD_PATCH_DIR}/inc")
|
||||
install (DIRECTORY "${BUILD_PATCH_DIR}/inc" DESTINATION "${INSTALL_DIR}" )
|
||||
endif()
|
||||
|
||||
if (EXISTS "${BUILD_PATCH_DIR}/data")
|
||||
install (DIRECTORY "${BUILD_PATCH_DIR}/data" DESTINATION "${INSTALL_DIR}" )
|
||||
endif()
|
||||
|
||||
if (INSTALL_TESTS)
|
||||
if (EXISTS "${BUILD_PATCH_DIR}/tests")
|
||||
install (DIRECTORY "${BUILD_PATCH_DIR}/tests" DESTINATION "${INSTALL_DIR}" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set (SCRIPT_EXT bat)
|
||||
else()
|
||||
set (SCRIPT_EXT sh)
|
||||
endif()
|
||||
|
||||
# DRAW.BAT or DRAW.SH
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_WRITE GROUP_EXECUTE
|
||||
WORLD_READ WORLD_WRITE WORLD_EXECUTE)
|
||||
IF (BUILD_Samples)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/adm/templates/sample.bat" DESTINATION "${INSTALL_DIR}")
|
||||
IF(NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}")
|
||||
install(FILES "${BUILD_PATCH_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
|
||||
ELSE()
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
|
||||
ENDIF()
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/env.${SCRIPT_EXT}.in" env.${SCRIPT_EXT} @ONLY)
|
||||
install(FILES "${OCCT_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" )
|
||||
ENDIF()
|
||||
# set compiler short name
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
include(adm/cmake/CMakeToolKitsDeps.txt)
|
||||
OCCT_MAKE_COMPILER_BITNESS()
|
||||
|
||||
IF (BUILD_Samples)
|
||||
SET (CMAKE_MFC_FLAG 2)
|
||||
SET(SUB_CUSTOM "custom_${COMPILER}_${COMPILER_BITNESS}_${BUILD_POSTFIX}.${SCRIPT_EXT}")
|
||||
|
||||
if (WIN32)
|
||||
SET (ADDITIONAL_CUSTOM_CONTENT "\nif exist \"%~dp0${SUB_CUSTOM}\" (\n call \"%~dp0${SUB_CUSTOM}\" %1 %2 %3 \n)")
|
||||
else()
|
||||
SET (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM}\" \"\${COMPILER}\" \"\${WOKSTATION}\${ARCH}\" \"\${CASDEB}\" \nfi")
|
||||
endif()
|
||||
|
||||
# change custom.bat/sh
|
||||
if (EXISTS "${INSTALL_DIR}/custom.${SCRIPT_EXT}")
|
||||
file (READ "${INSTALL_DIR}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT)
|
||||
|
||||
set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}")
|
||||
|
||||
file (WRITE "${INSTALL_DIR}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
|
||||
else()
|
||||
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "${INSTALL_DIR}")
|
||||
endif()
|
||||
|
||||
# write current custom.bat/sh
|
||||
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.in" "${SUB_CUSTOM}" "${INSTALL_DIR}")
|
||||
|
||||
if (BUILD_MFC_SAMPLES)
|
||||
OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR}")
|
||||
endif()
|
||||
|
||||
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}" "${INSTALL_DIR}")
|
||||
endif()
|
||||
|
||||
# RESOURCES
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/DrawResources" "${INSTALL_DIR}/src")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/StdResource" "${INSTALL_DIR}/src")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/SHMessage" "${INSTALL_DIR}/src")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/Textures" "${INSTALL_DIR}/src")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/Shaders" "${INSTALL_DIR}/src")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/XSMessage" "${INSTALL_DIR}/src")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/XSTEPResource" "${INSTALL_DIR}/src")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/XmlOcafResource" "${INSTALL_DIR}/src")
|
||||
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/UnitsAPI/Lexi_Expr.dat" "${INSTALL_DIR}/src/UnitsAPI")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/UnitsAPI/Units.dat" "${INSTALL_DIR}/src/UnitsAPI")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/TObj/TObj.msg" "${INSTALL_DIR}/src/TObj")
|
||||
|
||||
|
||||
#Toolkits uses variables: INSTALL_DIR, OS_WITH_BIT, COMPILER, BUILD_POSTFIX
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
|
||||
# consider for patch existence
|
||||
set (IS_PATCH_CURRENT "NO")
|
||||
set (TK_ROOT_DIR ${CMAKE_SOURCE_DIR})
|
||||
if (NOT "${BUILD_PATCH_DIR}" STREQUAL "")
|
||||
set (IS_PATCH_CURRENT "YES")
|
||||
set (TK_ROOT_DIR ${BUILD_PATCH_DIR})
|
||||
endif()
|
||||
|
||||
# include patched toolkit projects or original ones
|
||||
set (UNSUBDIRS "")
|
||||
if (NOT "${BUILD_PATCH_DIR}" STREQUAL "" AND EXISTS "${BUILD_PATCH_DIR}/adm/cmake/occt_inc_toolkits.cmake")
|
||||
set (TK_ROOT_DIR ${BUILD_PATCH_DIR})
|
||||
include (${BUILD_PATCH_DIR}/adm/cmake/occt_inc_toolkits.cmake)
|
||||
else()
|
||||
set (IS_PATCH_CURRENT "NO")
|
||||
set (TK_ROOT_DIR ${CMAKE_SOURCE_DIR})
|
||||
include (adm/cmake/occt_inc_toolkits.cmake)
|
||||
endif()
|
||||
|
||||
# include some required original occt_inc_toolkits
|
||||
if (NOT "${UNSUBDIRS}" STREQUAL "")
|
||||
set (IS_PATCH_CURRENT "NO")
|
||||
# add required subdirs
|
||||
foreach (UNSUBDIR ${UNSUBDIRS})
|
||||
add_subdirectory (${CMAKE_SOURCE_DIR}/${UNSUBDIR})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# samples do not support patch usage
|
||||
IF (BUILD_MFC_SAMPLES)
|
||||
SET (OCCT_ROOT ${CMAKE_SOURCE_DIR})
|
||||
|
||||
SET (MFC_STANDARD_SAMPLES_DIR ${OCCT_ROOT}/samples/mfc/standard)
|
||||
SET (COMMON_WINMAIN_FILE ${MFC_STANDARD_SAMPLES_DIR}/Common/Winmain.cpp)
|
||||
|
||||
subdirs(samples/mfc/standard/mfcsample)
|
||||
subdirs(samples/mfc/standard/01_Geometry)
|
||||
subdirs(samples/mfc/standard/02_Modeling)
|
||||
subdirs(samples/mfc/standard/03_Viewer2d)
|
||||
subdirs(samples/mfc/standard/04_Viewer3d)
|
||||
subdirs(samples/mfc/standard/05_ImportExport)
|
||||
subdirs(samples/mfc/standard/06_Ocaf)
|
||||
subdirs(samples/mfc/standard/07_Triangulation)
|
||||
subdirs(samples/mfc/standard/08_HLR)
|
||||
subdirs(samples/mfc/standard/09_Animation)
|
||||
subdirs(samples/mfc/standard/10_Convert)
|
||||
add_subdirectory(samples/mfc/standard/mfcsample)
|
||||
add_subdirectory(samples/mfc/standard/01_Geometry)
|
||||
add_subdirectory(samples/mfc/standard/02_Modeling)
|
||||
add_subdirectory(samples/mfc/standard/03_Viewer2d)
|
||||
add_subdirectory(samples/mfc/standard/04_Viewer3d)
|
||||
add_subdirectory(samples/mfc/standard/05_ImportExport)
|
||||
add_subdirectory(samples/mfc/standard/06_Ocaf)
|
||||
add_subdirectory(samples/mfc/standard/07_Triangulation)
|
||||
add_subdirectory(samples/mfc/standard/08_HLR)
|
||||
add_subdirectory(samples/mfc/standard/09_Animation)
|
||||
add_subdirectory(samples/mfc/standard/10_Convert)
|
||||
ENDIF()
|
||||
|
18
adm/UDLIST
@@ -1,4 +1,3 @@
|
||||
n IncludeLibrary
|
||||
n NCollection
|
||||
p BSplCLib
|
||||
p BSplSLib
|
||||
@@ -7,17 +6,13 @@ p BVH
|
||||
p CSLib
|
||||
p Convert
|
||||
p Dico
|
||||
p Dynamic
|
||||
p ElCLib
|
||||
p ElSLib
|
||||
p Expr
|
||||
p ExprIntrp
|
||||
p FSD
|
||||
p GeomAbs
|
||||
p GraphDS
|
||||
p GraphTools
|
||||
p MMgt
|
||||
p Materials
|
||||
p Message
|
||||
p OSD
|
||||
p PLib
|
||||
@@ -40,7 +35,6 @@ p UnitsAPI
|
||||
p gp
|
||||
p math
|
||||
r OS
|
||||
t TKAdvTools
|
||||
t TKMath
|
||||
t TKernel
|
||||
p Adaptor2d
|
||||
@@ -111,7 +105,7 @@ p BRepGProp
|
||||
p BRepIntCurveSurface
|
||||
p BRepLib
|
||||
p BRepMAT2d
|
||||
p BRepMesh
|
||||
n BRepMesh
|
||||
p BRepOffset
|
||||
p BRepOffsetAPI
|
||||
p BRepPrim
|
||||
@@ -188,7 +182,7 @@ p TopOpeBRepBuild
|
||||
p TopOpeBRepDS
|
||||
p TopOpeBRepTool
|
||||
p TopTrans
|
||||
p XBRepMesh
|
||||
n XBRepMesh
|
||||
t TKBO
|
||||
t TKBool
|
||||
t TKFeat
|
||||
@@ -481,4 +475,10 @@ p Font
|
||||
p BOPAlgo
|
||||
p BOPDS
|
||||
p BOPCol
|
||||
p BOPInt
|
||||
p IVtk
|
||||
p IVtkOCC
|
||||
p IVtkVTK
|
||||
p IVtkTools
|
||||
t TKIVtk
|
||||
p IVtkDraw
|
||||
t TKIVtkDraw
|
@@ -684,7 +684,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
|
||||
foreach tk [$module:toolkits] {
|
||||
foreach pk [split [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $productsPath]]] {
|
||||
if { [llength $pk] != "{}" } {
|
||||
lappend filelist [OCCDoc_GetHeadersList "p" "pubinclude" "$pk" "$productsPath"]
|
||||
lappend filelist [OCCDoc_GetHeadersList "p" "$pk" "$productsPath"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -537,26 +537,15 @@ proc OCCDoc_GetModulesList { {theProductsDir ""} } {
|
||||
}
|
||||
|
||||
# Returns list of desired files in the specified location
|
||||
proc OCCDoc_GetHeadersList { theDesiredContent theFileType thePackageName {theProductsDir ""} } {
|
||||
proc OCCDoc_GetHeadersList { theDesiredContent thePackageName {theProductsDir ""} } {
|
||||
|
||||
# Get list of header files with path
|
||||
set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetIncDir $theProductsDir]" "${thePackageName}.hxx" "${thePackageName}_*.hxx"]]
|
||||
|
||||
# Get file type
|
||||
set file_type_pattern "*.*"
|
||||
if { $theFileType == "pubinclude" } {
|
||||
set file_type_pattern "*.*"
|
||||
} elseif { $theFileType == "privinclude" } {
|
||||
set file_type_pattern "*.ixx"
|
||||
}
|
||||
|
||||
# Get content according to desired type ('p' for path and 'f' for filenames only)
|
||||
if { $theDesiredContent == "p" } {
|
||||
|
||||
# Get list of files with path
|
||||
set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetIncDir $theProductsDir]" "$thePackageName$file_type_pattern"]]
|
||||
|
||||
return $files_list
|
||||
} elseif { $theDesiredContent == "f" } {
|
||||
# Get list of files without path
|
||||
set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetIncDir $theProductsDir]" "$thePackageName$file_type_pattern"]]
|
||||
|
||||
# Cut paths from filenames
|
||||
foreach file $files_list {
|
||||
@@ -662,7 +651,7 @@ proc OCCDoc_MakeMainPage {outDir outFile modules {theProductsDir ""} } {
|
||||
set u [OCCDoc_GetNameFromPath $pk]
|
||||
puts $fd "/**"
|
||||
puts $fd "\\page [string tolower $package_prefix$u] Package $u"
|
||||
foreach hdr [lsort [OCCDoc_GetHeadersList "f" "pubinclude" "$pk" "$theProductsDir"]] {
|
||||
foreach hdr [lsort [OCCDoc_GetHeadersList "f" "$pk" "$theProductsDir"]] {
|
||||
if { ! [regexp {^Handle_} $hdr] && [regexp {(.*)[.]hxx} $hdr str obj] } {
|
||||
puts $fd "\\li \\subpage $obj"
|
||||
}
|
||||
|
185
adm/templates/3rdparty_macro.cmake
Normal file
@@ -0,0 +1,185 @@
|
||||
#
|
||||
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler and build_postfix
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/occt_macros")
|
||||
|
||||
macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEBUG)
|
||||
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
# define 3RDPARTY_${PRODUCT_NAME}_DIR variable is it isn't defined
|
||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DIR)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "The directory containing ${PRODUCT_NAME}")
|
||||
endif()
|
||||
|
||||
# search for product directory inside 3RDPARTY_DIR directory
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DIR AND 3RDPARTY_DIR)
|
||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" "${PRODUCT_NAME}" ${PRODUCT_NAME}_DIR_NAME)
|
||||
if (${PRODUCT_NAME}_DIR_NAME)
|
||||
message (STATUS "Info: ${PRODUCT_NAME}: ${${PRODUCT_NAME}_DIR_NAME} folder is used")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DIR "${3RDPARTY_DIR}/${${PRODUCT_NAME}_DIR_NAME}" CACHE PATH "The directory containing ${PRODUCT_NAME}" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED INSTALL_${PRODUCT_NAME})
|
||||
set (INSTALL_${PRODUCT_NAME} OFF CACHE BOOL "Is ${PRODUCT_NAME} required to be copied into install directory")
|
||||
endif()
|
||||
|
||||
# search for include directory
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing the headers of the ${PRODUCT_NAME}" FORCE)
|
||||
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME} PATHS
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DIR}/include"
|
||||
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_HEADER}
|
||||
NO_DEFAULT_PATH)
|
||||
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME})
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing the headers of the ${PRODUCT_NAME}" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
||||
elseif (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||
get_filename_component(3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_TMP "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
||||
if (NOT "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" STREQUAL "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_TMP}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# search for library
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
||||
|
||||
# first of all, search for debug version of a library if build type is debug
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME_DEBUG}
|
||||
PATHS
|
||||
"${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}"
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DIR}/lib"
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DIR}/libd"
|
||||
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_LIB}
|
||||
NO_DEFAULT_PATH)
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME_DEBUG})
|
||||
endif()
|
||||
|
||||
# if build type is release or debug version of library isn't found - search for release version of one
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} library" FORCE)
|
||||
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
message (STATUS "Warning: debug version of ${PRODUCT_NAME} library isn't found (${LIBRARY_NAME_DEBUG}) in ${3RDPARTY_${PRODUCT_NAME}_DIR}/lib(d). Search for release one")
|
||||
endif()
|
||||
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME} PATHS
|
||||
"${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}"
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DIR}/lib"
|
||||
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_LIB}
|
||||
NO_DEFAULT_PATH)
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# library path
|
||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" PATH)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# search for shared library (just for win case)
|
||||
if (WIN32)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
||||
elseif (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||
get_filename_component(3RDPARTY_${PRODUCT_NAME}_DLL_DIR_TMP "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
||||
if (NOT "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" STREQUAL "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_TMP}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
||||
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME_DEBUG}"
|
||||
PATHS
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}"
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DIR}/bin"
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DIR}/bind"
|
||||
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_DLL}
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME_DEBUG}")
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${PRODUCT_NAME} shared library" FORCE)
|
||||
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
message (STATUS "Warning: debug version of ${PRODUCT_NAME} dll isn't found (${LIBRARY_NAME_DEBUG}) in ${3RDPARTY_${PRODUCT_NAME}_DIR}/bin(d). Search for release one")
|
||||
endif()
|
||||
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME}" PATHS
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}"
|
||||
"${3RDPARTY_${PRODUCT_NAME}_DIR}/bin"
|
||||
${3RDPARTY_${PRODUCT_NAME}_ADDITIONAL_PATH_FOR_DLL}
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL "${LIBRARY_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
||||
endif()
|
||||
|
||||
# shared library path
|
||||
if (3RDPARTY_${PRODUCT_NAME}_DLL AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL}" PATH)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${PRODUCT_NAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (INSTALL_${PRODUCT_NAME})
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
if (WIN32)
|
||||
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BUILD_POSTFIX}")
|
||||
else()
|
||||
install (FILES "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BUILD_POSTFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY 3RDPARTY_${PRODUCT_NAME}_DLL)
|
||||
endmacro()
|
15
adm/templates/custom.bat.in
Normal file
@@ -0,0 +1,15 @@
|
||||
echo off
|
||||
|
||||
if "%VCVER%" == "@COMPILER@" (
|
||||
if "%ARCH%" == "@COMPILER_BITNESS@" (
|
||||
if "%CASDEB%" == "@BUILD_POSTFIX@" (
|
||||
set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
|
||||
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
||||
set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@"
|
||||
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
|
||||
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
12
adm/templates/custom.bat.main
Normal file
@@ -0,0 +1,12 @@
|
||||
echo off
|
||||
|
||||
if not ["%1"] == [""] set "VCVER=%1"
|
||||
if not ["%2"] == [""] set "ARCH=%2"
|
||||
if /I ["%ARCH%"] == ["win32"] set "ARCH=32"
|
||||
if /I ["%ARCH%"] == ["win64"] set "ARCH=64"
|
||||
if /I ["%3"] == ["debug"] set "CASDEB=d"
|
||||
if /I ["%3"] == ["d"] set "CASDEB=d"
|
||||
|
||||
rem include other custom.bat files with specific 3rdparty paths
|
||||
@ADDITIONAL_CUSTOM_CONTENT@
|
||||
|
15
adm/templates/custom.sh.in
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$COMPILER" == "@COMPILER@" ]; then
|
||||
if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
|
||||
if [ "$CASDEB" == "@BUILD_POSTFIX@" ]; then
|
||||
export TCL_DIR="@3RDPARTY_TCL_LIBRARY_DIR@"
|
||||
export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"
|
||||
export FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_LIBRARY_DIR@"
|
||||
export GL2PS_DIR="@3RDPARTY_GL2PS_LIBRARY_DIR@"
|
||||
export TBB_DIR="@3RDPARTY_TBB_LIBRARY_DIR@"
|
||||
export VTK_DIR="@3RDPARTY_VTK_LIBRARY_DIR@"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
4
adm/templates/custom.sh.main
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
@ADDITIONAL_CUSTOM_CONTENT@
|
||||
|
@@ -1,7 +1,10 @@
|
||||
@echo off
|
||||
|
||||
rem Setup environment and launch DRAWEXE
|
||||
call "%~dp0env.bat"
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
echo Hint: use "pload ALL" command to load standard commands
|
||||
DRAWEXE.exe
|
||||
"%CASROOT%/%BIN_TAIL%/DRAWEXE.exe"
|
||||
|
||||
set "PATH=%ORIGIN_PATH%"
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
|
||||
source "${aScriptPath}/env.sh"
|
||||
source "${aScriptPath}/env.sh" "$1"
|
||||
|
||||
echo 'Hint: use "pload ALL" command to load standard commands'
|
||||
DRAWEXE
|
||||
|
@@ -3,25 +3,35 @@ echo off
|
||||
set "SCRIPTROOT=%~dp0"
|
||||
set "SCRIPTROOT=%SCRIPTROOT:~0,-1%"
|
||||
|
||||
set "VCVER=@COMPILER@"
|
||||
set "ARCH=@COMPILER_BITNESS@"
|
||||
set "CASDEB=@BUILD_POSTFIX@"
|
||||
|
||||
if not ["%1"] == [""] set "VCVER=%1"
|
||||
if not ["%2"] == [""] set "ARCH=%2"
|
||||
if /I ["%ARCH%"] == ["win32"] set "ARCH=32"
|
||||
if /I ["%ARCH%"] == ["win64"] set "ARCH=64"
|
||||
if /I ["%3"] == ["debug"] set "CASDEB=d"
|
||||
if /I ["%3"] == ["d"] set "CASDEB=d"
|
||||
|
||||
if exist "%~dp0custom.bat" (
|
||||
call "%~dp0custom.bat" %1 %2 %3
|
||||
)
|
||||
|
||||
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
|
||||
|
||||
set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
|
||||
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
||||
set "ORIGIN_PATH=%PATH%"
|
||||
|
||||
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||
|
||||
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
||||
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
|
||||
|
||||
set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@"
|
||||
if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%"
|
||||
|
||||
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
|
||||
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
|
||||
if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%"
|
||||
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
|
||||
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
||||
|
||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||
set "PATH=%CASROOT%\bin;%PATH%"
|
||||
set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%"
|
||||
set "PATH=%CASROOT%/%BIN_TAIL%;%PATH%"
|
||||
|
||||
rem ----- Set envoronment variables used by OCCT -----
|
||||
set CSF_LANGUAGE=us
|
||||
@@ -56,4 +66,5 @@ if exist "%CASROOT%\src\DrawResources" (
|
||||
|
||||
if exist "%CASROOT%\src\DrawResourcesProducts" (
|
||||
set "CSF_DrawPluginProductsDefaults=%CASROOT%\src\DrawResourcesProducts"
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -6,63 +6,78 @@ if [ "${CASROOT}" == "" ]; then
|
||||
export CASROOT="${aScriptPath}"
|
||||
fi
|
||||
|
||||
aLibPath="${CASROOT}/lib"
|
||||
# Read script arguments
|
||||
shopt -s nocasematch
|
||||
export CASDEB="@BUILD_POSTFIX@";
|
||||
if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
|
||||
if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
|
||||
shopt -u nocasematch
|
||||
|
||||
TCL_DIR="@3RDPARTY_TCL_DLL_DIR@"
|
||||
if [ "$TCL_DIR" != "" ]; then
|
||||
aLibPath="${TCL_DIR}:${aLibPath}"
|
||||
fi
|
||||
|
||||
FREETYPE_DIR="@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||
if [ "$FREETYPE_DIR" != "" ]; then
|
||||
aLibPath="${FREETYPE_DIR}:${aLibPath}"
|
||||
fi
|
||||
|
||||
FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
||||
if [ "$FREEIMAGE_DIR" != "" ]; then
|
||||
aLibPath="${FREEIMAGE_DIR}:${aLibPath}"
|
||||
fi
|
||||
|
||||
GL2PS_DIR="@3RDPARTY_GL2PS_DLL_DIR@"
|
||||
if [ "$GL2PS_DIR" != "" ]; then
|
||||
aLibPath="${GL2PS_DIR}:${aLibPath}"
|
||||
fi
|
||||
|
||||
TBB_DIR="@3RDPARTY_TBB_DLL_DIR@"
|
||||
if [ "$TBB_DIR" != "" ]; then
|
||||
aLibPath="${TBB_DIR}:${aLibPath}"
|
||||
fi
|
||||
export COMPILER="@COMPILER@"
|
||||
|
||||
# ----- Set path to 3rd party and OCCT libraries -----
|
||||
aSystem=`uname -s`
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export WOKSTATION="mac";
|
||||
if [ "$DYLD_LIBRARY_PATH" != "" ]; then
|
||||
export DYLD_LIBRARY_PATH="${aLibPath}:${DYLD_LIBRARY_PATH}"
|
||||
else
|
||||
export DYLD_LIBRARY_PATH="${aLibPath}"
|
||||
fi
|
||||
else
|
||||
export WOKSTATION="lin";
|
||||
if [ "$LD_LIBRARY_PATH" != "" ]; then
|
||||
export LD_LIBRARY_PATH="${aLibPath}:${LD_LIBRARY_PATH}"
|
||||
else
|
||||
export LD_LIBRARY_PATH="${aLibPath}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ----- Set path to OCCT executables -----
|
||||
PATH="${PATH}:${CASROOT}/bin"
|
||||
|
||||
# ----- Setup Environment Variables -----
|
||||
anArch=`uname -m`
|
||||
if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
|
||||
export ARCH="32";
|
||||
else
|
||||
export ARCH="64";
|
||||
fi
|
||||
|
||||
aSystem=`uname -s`
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export WOKSTATION="mac";
|
||||
export ARCH="64";
|
||||
else
|
||||
export WOKSTATION="lin";
|
||||
fi
|
||||
|
||||
# ----- Set local settings -----
|
||||
if [ -e "${aScriptPath}/custom.sh" ]; then
|
||||
source "${aScriptPath}/custom.sh" "${COMPILER}" "${WOKSTATION}${ARCH}" "${CASDEB}"
|
||||
fi
|
||||
|
||||
THRDPARTY_PATH=""
|
||||
if [ "$TCL_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$FREETYPE_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$FREEIMAGE_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$GL2PS_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${GL2PS_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$TBB_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${TBB_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$VTK_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
|
||||
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
|
||||
|
||||
export PATH="${CASROOT}/${BIN_PATH}:${PATH}"
|
||||
|
||||
if [ "$LD_LIBRARY_PATH" != "" ]; then
|
||||
export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
|
||||
else
|
||||
export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$WOKSTATION" == "mac" ]; then
|
||||
if [ "$DYLD_LIBRARY_PATH" != "" ]; then
|
||||
export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
|
||||
else
|
||||
export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ----- Set envoronment variables used by OCCT -----
|
||||
@@ -98,4 +113,5 @@ fi
|
||||
|
||||
if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then
|
||||
export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
3
adm/templates/freeimage.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
#freeimage
|
||||
|
||||
THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "freeimage" "freeimaged")
|
9
adm/templates/freeimageplus.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
#freeimageplus
|
||||
|
||||
if (WIN32)
|
||||
if (3RDPARTY_FREEIMAGE_DIR AND NOT 3RDPARTY_FREEIMAGEPLUS_DIR)
|
||||
set (3RDPARTY_FREEIMAGEPLUS_DIR "${3RDPARTY_FREEIMAGE_DIR}" CACHE PATH "The directory containing freeimageplus" FORCE)
|
||||
endif()
|
||||
|
||||
THIRDPARTY_PRODUCT("FREEIMAGEPLUS" "FreeImagePlus.h" "freeimageplus" "freeimageplusd")
|
||||
endif()
|
233
adm/templates/freetype.cmake
Normal file
@@ -0,0 +1,233 @@
|
||||
# freetype
|
||||
|
||||
if (NOT DEFINED INSTALL_FREETYPE)
|
||||
set (INSTALL_FREETYPE OFF CACHE BOOL "Is freetype required to be copied into install directory")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FREETYPE_DIR)
|
||||
set (3RDPARTY_FREETYPE_DIR "" CACHE PATH "The directory containing freetype")
|
||||
endif()
|
||||
|
||||
# store ENV{FREETYPE_DIR}
|
||||
SET (CACHED_FREETYPE_DIR $ENV{FREETYPE_DIR})
|
||||
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler and build_postfix
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/occt_macros")
|
||||
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
OCCT_MAKE_COMPILER_BITNESS()
|
||||
|
||||
if (NOT ENV{FREETYPE_DIR})
|
||||
# search for freetype in user defined directory
|
||||
if (NOT 3RDPARTY_FREETYPE_DIR AND 3RDPARTY_DIR)
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" FREETYPE FREETYPE_DIR_NAME)
|
||||
if (FREETYPE_DIR_NAME)
|
||||
set (3RDPARTY_FREETYPE_DIR "${3RDPARTY_DIR}/${FREETYPE_DIR_NAME}" CACHE PATH "The directory containing freetype" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
||||
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "" CACHE FILEPATH "the path of ft2build.h")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "" CACHE FILEPATH "the path of freetype2")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY OR NOT 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE FILEPATH "The directory containing freetype library")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL OR NOT 3RDPARTY_FREETYPE_DLL_DIR)
|
||||
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_FREETYPE_DLL_DIR)
|
||||
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE FILEPATH "The directory containing freetype shared library")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message (STATUS "Info: CMake default freetype search start...")
|
||||
find_package(Freetype)
|
||||
message (STATUS "Info: CMake default freetype search end")
|
||||
|
||||
# ft2build header
|
||||
if (FREETYPE_INCLUDE_DIR_ft2build AND EXISTS "${FREETYPE_INCLUDE_DIR_ft2build}")
|
||||
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build "${FREETYPE_INCLUDE_DIR_ft2build}" CACHE FILEPATH "the path of ft2build.h" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||
# cmake (version is < 3.0) doesn't find ftheader.h of freetype (version is >= 2.5.1)
|
||||
# do search taking into account freetype structure of 2.5.1 version
|
||||
message (STATUS "Info: CMake default search doesn't found FREETYPE_INCLUDE_DIR_freetype2")
|
||||
find_path (FREETYPE_INCLUDE_DIR_freetype2 NAMES
|
||||
freetype/config/ftheader.h
|
||||
config/ftheader.h
|
||||
HINTS
|
||||
ENV FREETYPE_DIR
|
||||
PATHS
|
||||
/usr/X11R6
|
||||
/usr/local/X11R6
|
||||
/usr/local/X11
|
||||
/usr/freeware
|
||||
PATH_SUFFIXES include/freetype2 include freetype2
|
||||
NO_DEFAULT_PATH)
|
||||
find_path (FREETYPE_INCLUDE_DIR_freetype2 NAMES freetype/config/ftheader.h config/ftheader.h)
|
||||
|
||||
if (NOT FREETYPE_INCLUDE_DIR_freetype2 OR NOT EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||
message (STATUS "Info: FREETYPE_INCLUDE_DIR_freetype2 is NOT found by additional search")
|
||||
else()
|
||||
message (STATUS "Info: FREETYPE_INCLUDE_DIR_freetype2 is found by additional search")
|
||||
endif()
|
||||
elseif (FREETYPE_INCLUDE_DIR_freetype2 OR EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
|
||||
get_filename_component (3RDPARTY_FREETYPE_DIR_ABS "${3RDPARTY_FREETYPE_DIR}" ABSOLUTE)
|
||||
get_filename_component (FREETYPE_INCLUDE_DIR_freetype2_ABS "${FREETYPE_INCLUDE_DIR_freetype2}" ABSOLUTE)
|
||||
|
||||
string (REGEX MATCH "${3RDPARTY_FREETYPE_DIR_ABS}" DOES_PATH_CONTAIN "${FREETYPE_INCLUDE_DIR_freetype2_ABS}")
|
||||
|
||||
if (NOT DOES_PATH_CONTAIN) # if cmake found freetype2 at different place from 3RDPARTY_FREETYPE_DIR
|
||||
# search for freetype2 in 3RDPARTY_FREETYPE_DIR and if it will be found - replace freetyp2 path by new one
|
||||
set (TMP_FREETYPE2 "TMP_FREETYPE2-NOTFOUND" CACHE FILEPATH "" FORCE)
|
||||
find_path (TMP_FREETYPE2 NAMES freetype/config/ftheader.h config/ftheader.h
|
||||
PATHS "${3RDPARTY_FREETYPE_DIR}"
|
||||
PATH_SUFFIXES include/freetype2 include freetype2
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (TMP_FREETYPE2 OR NOT EXISTS "${TMP_FREETYPE2}")
|
||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${TMP_FREETYPE2}" CACHE FILEPATH "the path of freetype2" FORCE)
|
||||
|
||||
# hide and remove TMP_FREETYPE2
|
||||
mark_as_advanced (TMP_FREETYPE2)
|
||||
unset (TMP_FREETYPE2)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# return ENV{FREETYPE_DIR}
|
||||
SET (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
|
||||
|
||||
# freetype2 header
|
||||
if (FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}")
|
||||
if (NOT 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
||||
set (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2 "${FREETYPE_INCLUDE_DIR_freetype2}" CACHE FILEPATH "the path of freetype2" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
|
||||
elseif (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
||||
get_filename_component(3RDPARTY_FREETYPE_LIBRARY_DIR_TMP "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
|
||||
if (NOT "${3RDPARTY_FREETYPE_LIBRARY_DIR}" STREQUAL "${3RDPARTY_FREETYPE_LIBRARY_DIR_TMP}")
|
||||
set (3RDPARTY_FREETYPE_LIBRARY "" CACHE FILEPATH "freetype library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_FREETYPE_DLL_DIR)
|
||||
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
|
||||
elseif (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||
get_filename_component(3RDPARTY_FREETYPE_DLL_DIR_TMP "${3RDPARTY_FREETYPE_DLL}" PATH)
|
||||
if (NOT "${3RDPARTY_FREETYPE_DLL_DIR}" STREQUAL "${3RDPARTY_FREETYPE_DLL_DIR_TMP}")
|
||||
set (3RDPARTY_FREETYPE_DLL "" CACHE FILEPATH "freetype shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# freetype library
|
||||
if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
|
||||
if (NOT 3RDPARTY_FREETYPE_LIBRARY)
|
||||
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "freetype library" FORCE)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
||||
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
|
||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE FILEPATH "The directory containing freetype library" FORCE)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||
get_filename_component (FREETYPE_LIBRARY_PARENT_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" PATH) # parent of the library directory
|
||||
|
||||
set (3RDPARTY_FREETYPE_DLL "3RDPARTY_FREETYPE_DLL-NOTFOUND" CACHE FILEPATH "freetype shared library" FORCE)
|
||||
find_library (3RDPARTY_FREETYPE_DLL freetype PATHS "${FREETYPE_LIBRARY_PARENT_DIR}/bin" NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FREETYPE_DLL AND EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||
get_filename_component (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL}" PATH)
|
||||
set (3RDPARTY_FREETYPE_DLL_DIR "${3RDPARTY_FREETYPE_DLL_DIR}" CACHE FILEPATH "The directory containing freetype shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if (NOT 3RDPARTY_FREETYPE_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE FILEPATH "The directory containing freetype library" FORCE)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_FREETYPE_DLL_DIR OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL_DIR}")
|
||||
set (3RDPARTY_FREETYPE_DLL_DIR "" CACHE FILEPATH "The directory containing shared freetype library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include found paths to common variables
|
||||
if (3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FREETYPE_LIBRARY)
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_FREETYPE_DLL OR NOT EXISTS "${3RDPARTY_FREETYPE_DLL}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FREETYPE_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (INSTALL_FREETYPE)
|
||||
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
if (WIN32)
|
||||
install (FILES "${3RDPARTY_FREETYPE_DLL}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BUILD_POSTFIX}")
|
||||
else()
|
||||
install (FILES "${3RDPARTY_FREETYPE_LIBRARY}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BUILD_POSTFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# unset all redundant variables
|
||||
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
|
||||
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
|
||||
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY)
|
||||
|
||||
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)
|
3
adm/templates/gl2ps.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
#GL2PS
|
||||
|
||||
THIRDPARTY_PRODUCT("GL2PS" "gl2ps.h" "gl2ps" "gl2psd")
|
3
adm/templates/glx.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
# glx
|
||||
|
||||
THIRDPARTY_PRODUCT("GLX" "GL/glx.h" "GL" "GLd")
|
68
adm/templates/occt_defs_flags.cmake
Normal file
@@ -0,0 +1,68 @@
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(/fp:precise)
|
||||
endif()
|
||||
|
||||
# set compiler short name and choose SSE2 option for appropriate MSVC compilers
|
||||
# ONLY for 32-bit
|
||||
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
if (MSVC80 OR MSVC90 OR MSVC10)
|
||||
add_definitions(/arch:SSE2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions (-DCSFDB)
|
||||
if (WIN32)
|
||||
add_definitions (/DWNT -wd4996)
|
||||
elseif (APPLE)
|
||||
add_definitions (-fexceptions -fPIC -DOCC_CONVERT_SIGNALS -DHAVE_WOK_CONFIG_H -DHAVE_CONFIG_H)
|
||||
else()
|
||||
add_definitions (-fexceptions -fPIC -DOCC_CONVERT_SIGNALS -DHAVE_WOK_CONFIG_H -DHAVE_CONFIG_H -DLIN)
|
||||
endif()
|
||||
|
||||
# enable structured exceptions for MSVC
|
||||
string (REGEX MATCH "EHsc" ISFLAG "${CMAKE_CXX_FLAGS}")
|
||||
if (ISFLAG)
|
||||
string (REGEX REPLACE "EHsc" "EHa" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
elseif (WIN32)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -EHa")
|
||||
endif()
|
||||
|
||||
# remove DEBUG flag if it exists
|
||||
string (REGEX MATCH "-DDEBUG" IS_DEBUG_CXX "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
if (IS_DEBUG_CXX)
|
||||
message (STATUS "-DDEBUG has been removed from CMAKE_CXX_FLAGS_DEBUG")
|
||||
string (REGEX REPLACE "-DDEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
string (REGEX MATCH "-DDEBUG" IS_DEBUG_C "${CMAKE_C_FLAGS_DEBUG}")
|
||||
if (IS_DEBUG_C)
|
||||
message (STATUS "-DDEBUG has been removed from CMAKE_C_FLAGS_DEBUG")
|
||||
string (REGEX REPLACE "-DDEBUG" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
# enable parallel compilation on MSVC 9 and above
|
||||
if (MSVC AND NOT MSVC70 AND NOT MSVC80)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP")
|
||||
endif()
|
||||
|
||||
# generate a single response file which enlist all of the object files
|
||||
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
||||
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
||||
|
||||
# increase compiler warnings level (-W4 for MSVC, -Wall for GCC)
|
||||
if (MSVC)
|
||||
if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||
string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
else()
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
||||
endif()
|
||||
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
endif()
|
||||
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
|
||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
|
||||
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEB")
|
||||
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEB")
|
201
adm/templates/occt_macros.cmake
Normal file
@@ -0,0 +1,201 @@
|
||||
#
|
||||
|
||||
macro (OCCT_CHECK_AND_UNSET VARNAME)
|
||||
if (DEFINED ${VARNAME})
|
||||
unset (${VARNAME} CACHE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_CHECK_AND_UNSET_GROUP VARNAME)
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_DIR")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_INCLUDE_DIR")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_LIBRARY")
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_LIBRARY_DIR")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_DLL")
|
||||
OCCT_CHECK_AND_UNSET ("${VARNAME}_DLL_DIR")
|
||||
endmacro()
|
||||
|
||||
# BUILD_POSTFIX, IS_BUILD_DEBUG variables
|
||||
macro (OCCT_MAKE_BUILD_POSTFIX)
|
||||
if ("${BUILD_CONFIGURATION}" STREQUAL "Debug")
|
||||
set (BUILD_POSTFIX "d")
|
||||
set (IS_BUILD_DEBUG "")
|
||||
else()
|
||||
set (BUILD_POSTFIX "")
|
||||
OCCT_CHECK_AND_UNSET (IS_BUILD_DEBUG)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# COMPILER_BITNESS variable
|
||||
macro (OCCT_MAKE_COMPILER_BITNESS)
|
||||
math (EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
|
||||
endmacro()
|
||||
|
||||
# OS_WITH_BIT
|
||||
macro (OCCT_MAKE_OS_WITH_BITNESS)
|
||||
|
||||
OCCT_MAKE_COMPILER_BITNESS()
|
||||
|
||||
if (WIN32)
|
||||
set (OS_WITH_BIT "win${COMPILER_BITNESS}")
|
||||
elseif(APPLE)
|
||||
set (OS_WITH_BIT "mac${COMPILER_BITNESS}")
|
||||
else()
|
||||
set (OS_WITH_BIT "lin${COMPILER_BITNESS}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# COMPILER variable
|
||||
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
||||
if (MSVC)
|
||||
if (MSVC70)
|
||||
set (COMPILER vc7)
|
||||
elseif (MSVC80)
|
||||
set (COMPILER vc8)
|
||||
elseif (MSVC90)
|
||||
set (COMPILER vc9)
|
||||
elseif (MSVC10)
|
||||
set (COMPILER vc10)
|
||||
elseif (MSVC11)
|
||||
set (COMPILER vc11)
|
||||
elseif (MSVC12)
|
||||
set (COMPILER vc12)
|
||||
endif()
|
||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
|
||||
set (COMPILER gcc)
|
||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
|
||||
set (COMPILER gxx)
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set (COMPILER clang)
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
set (COMPILER icc)
|
||||
else()
|
||||
set (COMPILER ${CMAKE_GENERATOR})
|
||||
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function (SUBDIRECTORY_NAMES MAIN_DIRECTORY RESULT)
|
||||
file (GLOB SUB_ITEMS "${MAIN_DIRECTORY}/*")
|
||||
|
||||
foreach (ITEM ${SUB_ITEMS})
|
||||
if (IS_DIRECTORY "${ITEM}")
|
||||
get_filename_component (ITEM_NAME "${ITEM}" NAME)
|
||||
list (APPEND LOCAL_RESULT "${ITEM_NAME}")
|
||||
endif()
|
||||
endforeach()
|
||||
set (${RESULT} ${LOCAL_RESULT} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
OCCT_MAKE_COMPILER_BITNESS()
|
||||
|
||||
string (TOLOWER "${PRODUCT_NAME}" lower_PRODUCT_NAME)
|
||||
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+")
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}")
|
||||
|
||||
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)
|
||||
|
||||
foreach (SEARCH_TEMPLATE ${SEARCH_TEMPLATES})
|
||||
if (LOCAL_RESULT)
|
||||
BREAK()
|
||||
endif()
|
||||
|
||||
foreach (SUBDIR_NAME ${SUBDIR_NAME_LIST})
|
||||
string (TOLOWER "${SUBDIR_NAME}" lower_SUBDIR_NAME)
|
||||
|
||||
string (REGEX MATCH "${SEARCH_TEMPLATE}" DUMMY_VAR "${lower_SUBDIR_NAME}")
|
||||
if (DUMMY_VAR)
|
||||
list (APPEND LOCAL_RESULT ${SUBDIR_NAME})
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
if (LOCAL_RESULT)
|
||||
list (LENGTH "${LOCAL_RESULT}" LOC_LEN)
|
||||
math (EXPR LAST_ELEMENT_INDEX "${LOC_LEN}-1")
|
||||
list (GET LOCAL_RESULT ${LAST_ELEMENT_INDEX} DUMMY)
|
||||
set (${RESULT} ${DUMMY} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro (OCCT_INSTALL_FILE_OR_DIR BEING_INSTALLED_OBJECT DESTINATION_PATH)
|
||||
if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}")
|
||||
if (IS_DIRECTORY "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}")
|
||||
# first of all, install original files
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
|
||||
# secondly, rewrite original files with patched ones
|
||||
install (DIRECTORY "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
else()
|
||||
install (FILES "${BUILD_PATCH_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
endif()
|
||||
else()
|
||||
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
else()
|
||||
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE FINAL_NAME DESTINATION_PATH)
|
||||
if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/${BEING_CONGIRUGED_FILE}")
|
||||
configure_file("${BUILD_PATCH_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
|
||||
else()
|
||||
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
|
||||
endif()
|
||||
|
||||
install(FILES "${OCCT_BINARY_DIR}/${FINAL_NAME}" DESTINATION "${DESTINATION_PATH}")
|
||||
endmacro()
|
||||
|
||||
function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
|
||||
set (${USE_PRODUCT} OFF PARENT_SCOPE)
|
||||
|
||||
if (NOT USED_TOOLKITS)
|
||||
message(STATUS "Warning: the list of being used toolkits is empty")
|
||||
else()
|
||||
foreach (USED_TOOLKIT ${USED_TOOLKITS})
|
||||
if (BUILD_PATCH_DIR AND EXISTS "${BUILD_PATCH_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
|
||||
file (READ "${BUILD_PATCH_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
|
||||
file (READ "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
|
||||
endif()
|
||||
|
||||
string (REGEX MATCH "${CSF_VAR_NAME}" DOES_FILE_CONTAIN "${FILE_CONTENT}")
|
||||
|
||||
if (DOES_FILE_CONTAIN)
|
||||
set (${USE_PRODUCT} ON PARENT_SCOPE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
27
adm/templates/opencl.cmake
Normal file
@@ -0,0 +1,27 @@
|
||||
#OpenCl
|
||||
|
||||
SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER $ENV{AMDAPPSDKROOT}/include
|
||||
$ENV{INTELOCLSDKROOT}/include
|
||||
$ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/inc
|
||||
$ENV{ATISTREAMSDKROOT}/include)
|
||||
|
||||
|
||||
IF(${COMPILER_BITNESS} STREQUAL 32)
|
||||
SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB $ENV{AMDAPPSDKROOT}/lib/x86
|
||||
$ENV{INTELOCLSDKROOT}/lib/x86
|
||||
$ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/lib/Win32
|
||||
$ENV{ATISTREAMSDKROOT}/lib/x86)
|
||||
ELSEIF(${COMPILER_BITNESS} STREQUAL 64)
|
||||
SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB $ENV{AMDAPPSDKROOT}/lib/x86_64
|
||||
$ENV{INTELOCLSDKROOT}/lib/x64
|
||||
$ENV{NVSDKCOMPUTE_ROOT}/OpenCL/common/lib/x64
|
||||
$ENV{ATISTREAMSDKROOT}/lib/x86_64)
|
||||
ENDIF()
|
||||
|
||||
THIRDPARTY_PRODUCT("OPENCL" "CL/cl.h" "OpenCL" "OpenCLd")
|
||||
|
||||
# if CL/cl.h isn't found (and 3RDPARTY_OPENCL_INCLUDE_DIR isn't defined)
|
||||
# then try to find OpenCL/cl.h (all other variable won't be changed)
|
||||
IF(NOT 3RDPARTY_OPENCL_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_OPENCL_INCLUDE_DIR}")
|
||||
THIRDPARTY_PRODUCT("OPENCL" "OpenCL/cl.h" "OpenCL" "OpenCLd")
|
||||
ENDIF()
|
@@ -2,7 +2,9 @@
|
||||
|
||||
if ["%1"] == [""] (
|
||||
echo Launch selected sample as follows:
|
||||
echo sample.bat SampleName
|
||||
echo sample.bat SampleName vc10 win32 d
|
||||
echo or to use last sample build configuration:
|
||||
echo sample.bat SampleName
|
||||
echo available samples:
|
||||
echo Geometry
|
||||
echo Modeling
|
||||
@@ -17,12 +19,13 @@ if ["%1"] == [""] (
|
||||
exit /B
|
||||
)
|
||||
|
||||
if not exist "%~dp0/bin/%1.exe" (
|
||||
echo Executable %~dp0/bin/%4.exe not found.
|
||||
call "%~dp0env.bat" %2 %3 %4
|
||||
|
||||
if not exist "%~dp0/%BIN_TAIL%/%1.exe" (
|
||||
echo Executable %~dp0/%BIN_TAIL%/%1.exe not found.
|
||||
echo Probably you didn't compile the application.
|
||||
exit /B
|
||||
)
|
||||
|
||||
call "%~dp0/env.bat"
|
||||
"%~dp0/%BIN_TAIL%/%1.exe"
|
||||
|
||||
"%~dp0/bin/%1.exe"
|
||||
|
@@ -1,109 +1,241 @@
|
||||
# Find tbb includes and libraries
|
||||
|
||||
IF(${COMPILER_BITNESS} STREQUAL 32)
|
||||
SET (TBB_ARCH_NAME ia32)
|
||||
ELSE()
|
||||
SET (TBB_ARCH_NAME intel64)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT DEFINED 3RDPARTY_TBB_DIR)
|
||||
SET(3RDPARTY_TBB_DIR "" CACHE PATH "Directory contains tbb product")
|
||||
ENDIF()
|
||||
|
||||
SET(3RDPARTY_TBB_DIR_NAME "")
|
||||
IF(3RDPARTY_DIR AND ("${3RDPARTY_TBB_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" "TBB" 3RDPARTY_TBB_DIR_NAME)
|
||||
IF("${3RDPARTY_TBB_DIR_NAME}" STREQUAL "")
|
||||
MESSAGE(STATUS "TBB DON'T FIND")
|
||||
ELSE()
|
||||
SET(3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${3RDPARTY_TBB_DIR_NAME}" CACHE PATH "Directory contains tbb product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(INSTALL_TBB OFF CACHE BOOL "Is tbb lib copy to install directory")
|
||||
# tbb
|
||||
|
||||
IF(3RDPARTY_TBB_DIR)
|
||||
IF("${3RDPARTY_TBB_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "Directory contains headers of the tbb product" FORCE)
|
||||
FIND_PATH(3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include")
|
||||
ENDIF()
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
SET(TBB_DEBUG_POSTFIX "")
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
SET(TBB_DEBUG_POSTFIX "_debug")
|
||||
ENDIF()
|
||||
if (NOT DEFINED INSTALL_TBB)
|
||||
set (INSTALL_TBB OFF CACHE BOOL "Is tbb required to be copied into install directory")
|
||||
endif()
|
||||
|
||||
# tbb directory
|
||||
if (NOT DEFINED 3RDPARTY_TBB_DIR)
|
||||
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
|
||||
endif()
|
||||
|
||||
# tbb include directory
|
||||
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
|
||||
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of the tbb")
|
||||
endif()
|
||||
|
||||
# tbb library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TBB_LIBRARY OR NOT 3RDPARTY_TBB_LIBRARY_DIR)
|
||||
set (3RDPARTY_TBB_LIBRARY "" CACHE FILEPATH "tbb library" FORCE)
|
||||
endif()
|
||||
|
||||
# tbb library directory
|
||||
if (NOT DEFINED 3RDPARTY_TBB_LIBRARY_DIR)
|
||||
set (3RDPARTY_TBB_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tbb library")
|
||||
endif()
|
||||
|
||||
# tbb malloc library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TBBMALLOC_LIBRARY OR NOT 3RDPARTY_TBBMALLOC_LIBRARY_DIR)
|
||||
set (3RDPARTY_TBBMALLOC_LIBRARY "" CACHE FILEPATH "tbb malloc library" FORCE)
|
||||
endif()
|
||||
|
||||
# tbb malloc library directory
|
||||
if (NOT DEFINED 3RDPARTY_TBBMALLOC_LIBRARY_DIR)
|
||||
set (3RDPARTY_TBBMALLOC_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tbb malloc library")
|
||||
endif()
|
||||
|
||||
# tbb shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TBB_DLL OR NOT 3RDPARTY_TBB_DLL_DIR)
|
||||
set (3RDPARTY_TBB_DLL "" CACHE FILEPATH "tbb shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tbb shared library directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TBB_DLL_DIR)
|
||||
set (3RDPARTY_TBB_DLL_DIR "" CACHE FILEPATH "The directory containing tbb shared library")
|
||||
endif()
|
||||
|
||||
# tbb malloc shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TBBMALLOC_DLL OR NOT 3RDPARTY_TBBMALLOC_DLL_DIR)
|
||||
set (3RDPARTY_TBBMALLOC_DLL "" CACHE FILEPATH "tbb malloc shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tbb malloc shared library directory
|
||||
if (NOT DEFINED 3RDPARTY_TBBMALLOC_DLL_DIR)
|
||||
set (3RDPARTY_TBBMALLOC_DLL_DIR "" CACHE FILEPATH "The directory containing tbb malloc shared library")
|
||||
endif()
|
||||
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler and build_postfix
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/occt_macros")
|
||||
|
||||
# search for product directory inside 3RDPARTY_DIR directory
|
||||
if (NOT 3RDPARTY_TBB_DIR AND 3RDPARTY_DIR)
|
||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" "TBB" TBB_DIR_NAME)
|
||||
if (TBB_DIR_NAME)
|
||||
message (STATUS "Info: TBB: ${TBB_DIR_NAME} folder is used")
|
||||
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
OCCT_MAKE_COMPILER_BITNESS()
|
||||
|
||||
if (${COMPILER_BITNESS} STREQUAL 32)
|
||||
set (TBB_ARCH_NAME ia32)
|
||||
else()
|
||||
set (TBB_ARCH_NAME intel64)
|
||||
endif()
|
||||
|
||||
# search for include directory in defined 3rdparty directory
|
||||
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "The directory containing the headers of tbb" FORCE)
|
||||
find_path (3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include")
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE FILEPATH "The directory containing the headers of tbb" FORCE)
|
||||
endif()
|
||||
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
# TBB_COMPILER_FOLER
|
||||
#if (WIN32)
|
||||
set (TBB_COMPILER_FOLER ${COMPILER})
|
||||
#else()
|
||||
# set (TBB_COMPILER_FOLER ${COMPILER})
|
||||
#endif()
|
||||
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
# search for tbb and tbb malloc library in defined 3rdparty directory
|
||||
foreach (LIBRARY_NAME TBB TBBMALLOC)
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR)
|
||||
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${LIBRARY_NAME} library" FORCE)
|
||||
elseif (3RDPARTY_${LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
|
||||
get_filename_component(3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR_TMP "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}" PATH)
|
||||
if (NOT "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}" STREQUAL "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR_TMP}")
|
||||
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${LIBRARY_NAME} library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
|
||||
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "3RDPARTY_${LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of ${LIBRARY_NAME}" FORCE)
|
||||
|
||||
# first of all, search for debug version of a library if build type is debug
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${LIBRARY_NAME}_debug
|
||||
PATHS
|
||||
"${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}"
|
||||
"${3RDPARTY_TBB_DIR}/libd/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||
"${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${LIBRARY_NAME}_debug)
|
||||
endif()
|
||||
|
||||
# if build type is release or debug version of library isn't found - search for release version of one
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
|
||||
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY "3RDPARTY_${LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of ${LIBRARY_NAME}" FORCE)
|
||||
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
message (STATUS "Warning: debug version of ${LIBRARY_NAME} library isn't found (${LIBRARY_NAME}_debug) in ${3RDPARTY_TBB_DIR}/lib(d). Search for release one")
|
||||
endif()
|
||||
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${LIBRARY_NAME}
|
||||
PATHS
|
||||
"${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}"
|
||||
"${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_LIBRARY ${LIBRARY_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}")
|
||||
get_filename_component(3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}" PATH)
|
||||
set (3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBRARY_NAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# search for dll in defined 3rdparty directory (just for win case)
|
||||
if (WIN32)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TBB_LIBRARY "3RDPARTY_TBB_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
|
||||
FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL_DIR)
|
||||
set (3RDPARTY_${LIBRARY_NAME}_DLL "" CACHE FILEPATH "${LIBRARY_NAME} shared library" FORCE)
|
||||
elseif (3RDPARTY_${LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
|
||||
get_filename_component(3RDPARTY_${LIBRARY_NAME}_DLL_DIR_TMP "${3RDPARTY_${LIBRARY_NAME}_DLL}" PATH)
|
||||
if (NOT "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}" STREQUAL "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR_TMP}")
|
||||
set (3RDPARTY_${LIBRARY_NAME}_DLL "" CACHE FILEPATH "${LIBRARY_NAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TBB_MALLOC_LIBRARY "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb malloc product" FORCE)
|
||||
FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
|
||||
FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
||||
IF("${3RDPARTY_TBB_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_DLL "3RDPARTY_TBB_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb product" FORCE)
|
||||
FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_DLL}" STREQUAL "3RDPARTY_TBB_DLL-NOTFOUND")
|
||||
FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
|
||||
SET(3RDPARTY_TBB_MALLOC_DLL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb malloc product" FORCE)
|
||||
FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
|
||||
|
||||
IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND")
|
||||
FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
|
||||
set (3RDPARTY_${LIBRARY_NAME}_DLL "3RDPARTY_${LIBRARY_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of ${LIBRARY_NAME}" FORCE)
|
||||
|
||||
MARK_AS_ADVANCED(3RDPARTY_TBB_DIR_NAME)
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DIR)
|
||||
ENDIF()
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME}_debug
|
||||
PATHS
|
||||
"${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}"
|
||||
"${3RDPARTY_TBB_DIR}/bind/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||
"${3RDPARTY_TBB_DIR}/bin/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
IF(3RDPARTY_TBB_INCLUDE_DIR)
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
|
||||
ENDIF()
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME}_debug)
|
||||
endif()
|
||||
|
||||
IF(3RDPARTY_TBB_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_MALLOC_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_MALLOC_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_LIBRARY)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_DLL)
|
||||
#
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DLL)
|
||||
ENDIF()
|
||||
|
||||
IF(3RDPARTY_TBB_MALLOC_DLL)
|
||||
#
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_DLL)
|
||||
ENDIF()
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
|
||||
set (3RDPARTY_${LIBRARY_NAME}_DLL "3RDPARTY_${LIBRARY_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of ${LIBRARY_NAME}" FORCE)
|
||||
|
||||
if (DEFINED IS_BUILD_DEBUG)
|
||||
message (STATUS "Warning: debug version of ${LIBRARY_NAME} dll isn't found (${LIBRARY_NAME}_debug) in ${3RDPARTY_TBB_DIR}/bin(d). Search for release one")
|
||||
endif()
|
||||
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME}
|
||||
PATHS
|
||||
"${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}"
|
||||
"${3RDPARTY_TBB_DIR}/bin/${TBB_ARCH_NAME}/${TBB_COMPILER_FOLER}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# second search if previous one do not find anything
|
||||
find_library (3RDPARTY_${LIBRARY_NAME}_DLL ${LIBRARY_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}")
|
||||
get_filename_component(3RDPARTY_${LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${LIBRARY_NAME}_DLL}" PATH)
|
||||
set (3RDPARTY_${LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${LIBRARY_NAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${LIBRARY_NAME} shared library" FORCE)
|
||||
endif()
|
||||
endif() # end dll search
|
||||
endforeach() # end tbb / tbbmalloc
|
||||
|
||||
# include found paths to common variables
|
||||
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
foreach (LIBRARY_NAME TBB TBBMALLOC)
|
||||
if (3RDPARTY_${LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBRARY_NAME}_LIBRARY_DIR)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_${LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBRARY_NAME}_DLL}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBRARY_NAME}_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# install tbb
|
||||
if (INSTALL_TBB)
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
if (WIN32)
|
||||
install (FILES ${3RDPARTY_TBB_DLL} ${3RDPARTY_TBBMALLOC_DLL} DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BUILD_POSTFIX}")
|
||||
else()
|
||||
install (FILES ${3RDPARTY_TBB_LIBRARY} ${3RDPARTY_TBBMALLOC_LIBRARY} DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BUILD_POSTFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (3RDPARTY_TBB_LIBRARY 3RDPARTY_TBBMALLOC_LIBRARY 3RDPARTY_TBB_DLL 3RDPARTY_TBBMALLOC_DLL)
|
||||
|
@@ -1,163 +1,333 @@
|
||||
# - Find Tcl includes and libraries
|
||||
# tcl
|
||||
|
||||
IF(WIN32)
|
||||
SET(TCL_SEP "")
|
||||
if (NOT DEFINED INSTALL_TCL)
|
||||
set (INSTALL_TCL OFF CACHE BOOL "Is tcl lib required to be copied into install directory")
|
||||
endif()
|
||||
|
||||
GET_FILENAME_COMPONENT(ActiveTcl_CurrentVersion
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]" NAME)
|
||||
# tcl directory
|
||||
if (NOT DEFINED 3RDPARTY_TCL_DIR)
|
||||
set (3RDPARTY_TCL_DIR "" CACHE PATH "The directory containing tcl")
|
||||
endif()
|
||||
|
||||
ELSE()
|
||||
SET(TCL_SEP ".")
|
||||
ENDIF()
|
||||
# tcl include directory
|
||||
if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
|
||||
endif()
|
||||
|
||||
IF(NOT DEFINED 3RDPARTY_TCL_DIR)
|
||||
SET(3RDPARTY_TCL_DIR "" CACHE PATH "Directory contains TCL product")
|
||||
ENDIF()
|
||||
# tk include directory
|
||||
if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
|
||||
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
|
||||
endif()
|
||||
|
||||
IF(3RDPARTY_DIR AND ("${3RDPARTY_TCL_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
|
||||
# tcl library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
|
||||
endif()
|
||||
|
||||
# tcl library directory
|
||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
|
||||
endif()
|
||||
|
||||
# tk library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
|
||||
set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "tk library" FORCE)
|
||||
endif()
|
||||
|
||||
# tk library directory
|
||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY_DIR)
|
||||
set (3RDPARTY_TK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tk library")
|
||||
endif()
|
||||
|
||||
# tcl shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tcl shared library directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
|
||||
endif()
|
||||
|
||||
# tk shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TK_DLL OR NOT 3RDPARTY_TK_DLL_DIR)
|
||||
set (3RDPARTY_TK_DLL "" CACHE FILEPATH "tk shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tk shared library directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TK_DLL_DIR)
|
||||
set (3RDPARTY_TK_DLL_DIR "" CACHE FILEPATH "The directory containing tk shared library")
|
||||
endif()
|
||||
|
||||
# search for tcl in user defined directory
|
||||
if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
|
||||
IF("${TCL_DIR_NAME}" STREQUAL "")
|
||||
MESSAGE(STATUS "\nInfo: tcl folder isn't found in ${3RDPARTY_DIR}. Start seeking in default folders")
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_DIR "${3RDPARTY_DIR}/${TCL_DIR_NAME}" CACHE PATH "Directory contains TCL product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(INSTALL_TCL OFF CACHE BOOL "Is TCL lib copy to install directory")
|
||||
if (TCL_DIR_NAME)
|
||||
set (3RDPARTY_TCL_DIR "${3RDPARTY_DIR}/${TCL_DIR_NAME}" CACHE PATH "The directory containing tcl" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include dir search
|
||||
IF("${3RDPARTY_TCL_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TCL_INCLUDE_DIR}" STREQUAL "3RDPARTY_TCL_INCLUDE_DIR-NOTFOUND")
|
||||
SET(3RDPARTY_TCL_INCLUDE_DIR "3RDPARTY_TCL_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "Directory contains headers of the TCL product" FORCE)
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
FIND_PATH(3RDPARTY_TCL_INCLUDE_DIR tcl.h PATHS "${3RDPARTY_TCL_DIR}/include" NO_DEFAULT_PATH)
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS /usr/include
|
||||
/usr/local/include
|
||||
/usr/include/tcl8${TCL_SEP}6
|
||||
/usr/include/tcl8${TCL_SEP}5)
|
||||
IF(WIN32)
|
||||
SET(3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS ${3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
|
||||
"$ENV{ProgramFiles}/Tcl/include"
|
||||
#"$ENV{ProgramFiles\(x86\)}/Tcl/include"
|
||||
"C:/Program Files/Tcl/include"
|
||||
"C:/Tcl/include")
|
||||
ENDIF(WIN32)
|
||||
# define paths for default engine
|
||||
if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
|
||||
set (TCL_INCLUDE_PATH "${3RDPARTY_TCL_DIR}/include")
|
||||
endif()
|
||||
|
||||
# check default path (with additions) for header search
|
||||
FIND_PATH(3RDPARTY_TCL_INCLUDE_DIR tcl.h PATHS ${3RDPARTY_TCL_POSSIBLE_INCLUDE_DIRS})
|
||||
# check tcl/tk include dir, library dir and shared library dir
|
||||
macro (DIR_SUBDIR_FILE_FIT LIBNAME)
|
||||
if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
|
||||
# tcl/tk include dir
|
||||
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||
endif()
|
||||
|
||||
#if find_path found something - set 3RDPARTY_TCL_DIR
|
||||
IF(NOT "${3RDPARTY_TCL_INCLUDE_DIR}" STREQUAL "3RDPARTY_TCL_INCLUDE_DIR-NOTFOUND")
|
||||
GET_FILENAME_COMPONENT (3RDPARTY_TCL_DIR "${3RDPARTY_TCL_INCLUDE_DIR}/../" ABSOLUTE)
|
||||
SET(3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DIR} CACHE FILEPATH "Directory contains TCL product" FORCE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
# tcl/tk library dir
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
|
||||
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
#library dir search
|
||||
IF("${3RDPARTY_TCL_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TCL_LIBRARY}" STREQUAL "3RDPARTY_TCL_LIBRARY-NOTFOUND")
|
||||
SET(3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of the TCL product" FORCE)
|
||||
# tcl/tk shared library dir
|
||||
if (WIN32)
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check tcl/tk library
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# check tcl/tk shared library
|
||||
if (WIN32)
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
if (3RDPARTY_${LIBNAME}_DLL AND EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DLL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
DIR_SUBDIR_FILE_FIT(TCL)
|
||||
DIR_SUBDIR_FILE_FIT(TK)
|
||||
|
||||
|
||||
# use default (CMake) TCL search
|
||||
find_package(TCL)
|
||||
|
||||
foreach (LIBNAME TCL TK)
|
||||
string (TOLOWER "${LIBNAME}" LIBNAME_L)
|
||||
|
||||
# tcl/tk include dir
|
||||
if (NOT 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
|
||||
if (${LIBNAME}_INCLUDE_PATH AND EXISTS "${${LIBNAME}_INCLUDE_PATH}")
|
||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "${${LIBNAME}_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tcl/tk dir and library
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||
if (${LIBNAME}_LIBRARY AND EXISTS "${${LIBNAME}_LIBRARY}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "${${LIBNAME}_LIBRARY}" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
FIND_LIBRARY(3RDPARTY_TCL_LIBRARY
|
||||
NAMES tcl tcl8${TCL_SEP}6 tcl8${TCL_SEP}5
|
||||
PATHS "${3RDPARTY_TCL_DIR}/lib" NO_DEFAULT_PATH)
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS /usr/lib /usr/local/lib)
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
elseif (3RDPARTY_${LIBNAME}_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}86 ${LIBNAME_L}85
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
DIR_SUBDIR_FILE_FIT(${LIBNAME})
|
||||
|
||||
|
||||
# tcl/tk dir and library
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "3RDPARTY_${LIBNAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
|
||||
PATHS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
IF(WIN32)
|
||||
SET(3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS ${3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
|
||||
"$ENV{ProgramFiles}/Tcl/Lib"
|
||||
"C:/Program Files/Tcl/lib"
|
||||
"C:/Tcl/lib" )
|
||||
ENDIF()
|
||||
# search in another place if previous search doesn't find anything
|
||||
find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
|
||||
PATHS "${3RDPARTY_TCL_DIR}/lib"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# check default path (with additions) for library search
|
||||
FIND_LIBRARY(3RDPARTY_TCL_LIBRARY
|
||||
NAMES tcl tcl8${TCL_SEP}6 tcl8${TCL_SEP}5
|
||||
PATHS ${3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#search the version of found tcl library
|
||||
IF("${3RDPARTY_TCL_LIBRARY}" STREQUAL "" OR "${3RDPARTY_TCL_LIBRARY}" STREQUAL "3RDPARTY_TCL_LIBRARY-NOTFOUND")
|
||||
SET (TCL_DLL_SO_NAMES ${DLL_SO_PREFIX}tcl.${DLL_SO}
|
||||
${DLL_SO_PREFIX}tcl8${TCL_SEP}5.${DLL_SO}
|
||||
${DLL_SO_PREFIX}tcl8${TCL_SEP}6.${DLL_SO} )
|
||||
ELSE()
|
||||
GET_FILENAME_COMPONENT(TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
|
||||
|
||||
STRING(REGEX REPLACE "^.*tcl([0-9])[^0-9]*[0-9].*$" "\\1" TCL_MAJOR_VERSION "${TCL_LIBRARY_NAME}")
|
||||
STRING(REGEX REPLACE "^.*tcl[0-9][^0-9]*([0-9]).*$" "\\1" TCL_MINOR_VERSION "${TCL_LIBRARY_NAME}")
|
||||
|
||||
IF (NOT "${TCL_MAJOR_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
|
||||
SET (IS_TCL_VERSION_FOUND ON)
|
||||
ELSE()
|
||||
SET (IS_TCL_VERSION_FOUND OFF)
|
||||
ENDIF()
|
||||
|
||||
IF (IS_TCL_VERSION_FOUND)
|
||||
SET (TCL_DLL_SO_NAMES "${DLL_SO_PREFIX}tcl${TCL_MAJOR_VERSION}${TCL_SEP}${TCL_MINOR_VERSION}.${DLL_SO}")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "\nWarning: Tcl version isn't found. ${DLL_SO_PREFIX}tcl.${DLL_SO} is used")
|
||||
SET (TCL_DLL_SO_NAMES "${DLL_SO_PREFIX}tcl.${DLL_SO}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
#dll_so search
|
||||
IF("${3RDPARTY_TCL_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TCL_DLL}" STREQUAL "3RDPARTY_TCL_DLL-NOTFOUND")
|
||||
SET(3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of the TCL product" FORCE)
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
FIND_FILE(3RDPARTY_TCL_DLL
|
||||
NAMES ${TCL_DLL_SO_NAMES}
|
||||
PATHS "${3RDPARTY_TCL_DIR}/${DLL_SO_FOLDER}" NO_DEFAULT_PATH)
|
||||
ELSE()
|
||||
SET(3RDPARTY_TCL_POSSIBLE_SO_DIRS /usr/lib /usr/local/lib)
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
IF(WIN32)
|
||||
SET(3RDPARTY_TCL_POSSIBLE_SO_DIRS ${3RDPARTY_TCL_POSSIBLE_SO_DIRS}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
|
||||
"$ENV{ProgramFiles}/Tcl/Bin"
|
||||
"C:/Program Files/Tcl/bin"
|
||||
"C:/Tcl/b" )
|
||||
ENDIF()
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY_DIR AND 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "")
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
get_filename_component (${LIBNAME}_LIBRARY_NAME "${3RDPARTY_${LIBNAME}_LIBRARY}" NAME)
|
||||
string(REGEX REPLACE "^.*${LIBNAME_L}([0-9]\\.*[0-9]).*$" "\\1" ${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_LIBRARY_NAME}")
|
||||
|
||||
# check default path (with additions) for dll_so search
|
||||
FIND_FILE(3RDPARTY_TCL_DLL
|
||||
NAMES ${TCL_DLL_SO_NAMES}
|
||||
PATHS ${3RDPARTY_TCL_POSSIBLE_SO_DIRS})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
if (NOT "${${LIBNAME}_LIBRARY_VERSION}" STREQUAL "${${LIBNAME}_LIBRARY_NAME}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_LIBRARY_VERSION}")
|
||||
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
|
||||
message (STATUS "Info: ${LIBNAME} version isn't found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
|
||||
MARK_AS_ADVANCED(3RDPARTY_TCL_DIR)
|
||||
ENDIF()
|
||||
|
||||
# #includes found paths to common variables
|
||||
IF(3RDPARTY_TCL_INCLUDE_DIR)
|
||||
SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_TCL_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
ENDIF()
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "")
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_VERSION)
|
||||
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_${LIBNAME}_MAJOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
|
||||
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_${LIBNAME}_MINOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_${LIBNAME}_MAJOR_VERSION}.${3RDPARTY_${LIBNAME}_MINOR_VERSION}")
|
||||
endif()
|
||||
|
||||
IF(3RDPARTY_TCL_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TCL_LIBRARY_DIR}")
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_LIBRARY)
|
||||
ENDIF()
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
else()
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL_DIR AND 3RDPARTY_${LIBNAME}_DLL)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL}" PATH)
|
||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF(3RDPARTY_TCL_DLL)
|
||||
ELSE()
|
||||
LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_DLL)
|
||||
ENDIF()
|
||||
# include found paths to common variables
|
||||
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_LIBRARY_DIR})
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# install tcltk
|
||||
if (INSTALL_TCL)
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler and build_postfix
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/templates/occt_macros")
|
||||
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
|
||||
if (WIN32)
|
||||
install (FILES ${3RDPARTY_TCL_DLL} ${3RDPARTY_TK_DLL} DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BUILD_POSTFIX}")
|
||||
else()
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY} ${3RDPARTY_TK_LIBRARY} DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BUILD_POSTFIX}")
|
||||
endif()
|
||||
|
||||
if (TCL_TCLSH_VERSION)
|
||||
# tcl is required to install in lib folder (without ${BUILD_POSTFIX})
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
else()
|
||||
message (STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.")
|
||||
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TK_LIBRARY 3RDPARTY_TCL_DLL 3RDPARTY_TK_DLL)
|
||||
|
||||
# unset all redundant variables
|
||||
#TCL
|
||||
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
|
||||
#TK
|
||||
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TK_WISH)
|
||||
|
156
adm/templates/vtk.cmake
Normal file
@@ -0,0 +1,156 @@
|
||||
# vtk
|
||||
|
||||
if (NOT DEFINED INSTALL_VTK)
|
||||
set (INSTALL_VTK OFF CACHE BOOL "Is vtk required to be copied into install directory")
|
||||
endif()
|
||||
|
||||
# vtk directory
|
||||
if (NOT DEFINED 3RDPARTY_VTK_DIR)
|
||||
set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing vtk")
|
||||
endif()
|
||||
|
||||
# vtk include directory
|
||||
if (NOT DEFINED 3RDPARTY_VTK_INCLUDE_DIR)
|
||||
set (3RDPARTY_VTK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of vtk")
|
||||
endif()
|
||||
|
||||
# vtk library directory
|
||||
if (NOT DEFINED 3RDPARTY_VTK_LIBRARY_DIR)
|
||||
set (3RDPARTY_VTK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing vtk library")
|
||||
endif()
|
||||
|
||||
# vtk dll directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_VTK_DLL_DIR)
|
||||
set (3RDPARTY_VTK_DLL_DIR "" CACHE FILEPATH "The directory containing VTK dll")
|
||||
endif()
|
||||
|
||||
# search for vtk in user defined directory
|
||||
if (NOT 3RDPARTY_VTK_DIR AND 3RDPARTY_DIR)
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" vtk VTK_DIR_NAME)
|
||||
if (VTK_DIR_NAME)
|
||||
set (3RDPARTY_VTK_DIR "${3RDPARTY_DIR}/${VTK_DIR_NAME}" CACHE PATH "The directory containing vtk product" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# find installed vtk
|
||||
find_package(VTK QUIET)
|
||||
|
||||
# find native vtk
|
||||
if (NOT VTK_FOUND)
|
||||
find_package(VTK QUIET PATHS "${3RDPARTY_VTK_DIR}")
|
||||
endif()
|
||||
|
||||
if (NOT VTK_FOUND AND NOT 3RDPARTY_VTK_DIR OR NOT EXISTS "${3RDPARTY_VTK_DIR}")
|
||||
message(SEND_ERROR "VTK not found. Set the 3RDPARTY_VTK_DIR cmake cache entry to the directory containing VTK.")
|
||||
set (3RDPARTY_VTK_DIR "3RDPARTY_VTK_DIR-NOTFOUND" CACHE PATH "The directory containing vtk product" FORCE)
|
||||
endif()
|
||||
|
||||
OCCT_MAKE_BUILD_POSTFIX()
|
||||
set(VTK_VERSION "")
|
||||
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
||||
get_filename_component(3RDPARTY_VTK_DIR_NAME "${3RDPARTY_VTK_DIR}" NAME)
|
||||
string(REGEX MATCH "^VTK-([0-9].[0-9])" VTK_VERSION "${3RDPARTY_VTK_DIR_NAME}")
|
||||
set(VTK_VERSION "${CMAKE_MATCH_1}")
|
||||
if (NOT 3RDPARTY_VTK_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
||||
set (3RDPARTY_VTK_INCLUDE_DIR "${3RDPARTY_VTK_DIR}/include/vtk-${VTK_VERSION}" CACHE FILEPATH "The directory containing includes of VTK" FORCE)
|
||||
endif()
|
||||
if (NOT 3RDPARTY_VTK_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_VTK_LIBRARY_DIR}")
|
||||
if(EXISTS "${3RDPARTY_VTK_DIR}/lib${BUILD_POSTFIX}")
|
||||
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_DIR}/lib${BUILD_POSTFIX}" CACHE FILEPATH "The directory containing libs of VTK" FORCE)
|
||||
else()
|
||||
if (NOT "${BUILD_POSTFIX}" STREQUAL "" AND EXISTS "${3RDPARTY_VTK_DIR}/lib")
|
||||
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_DIR}/lib" CACHE FILEPATH "The directory containing libs of VTK" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(3RDPARTY_VTK_LIBRARY_DIR)
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_VTK_LIBRARY_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# vtk libraries
|
||||
# lib
|
||||
set (VTK_LIBRARY_NAMES vtkCommonCore-${VTK_VERSION}.lib vtkCommonDataModel-${VTK_VERSION}.lib vtkCommonExecutionModel-${VTK_VERSION}.lib
|
||||
vtkCommonMath-${VTK_VERSION}.lib vtkCommonTransforms-${VTK_VERSION}.lib vtkRenderingCore-${VTK_VERSION}.lib
|
||||
vtkRenderingOpenGL-${VTK_VERSION}.lib vtkFiltersGeneral-${VTK_VERSION}.lib vtkIOCore-${VTK_VERSION}.lib
|
||||
vtkIOImage-${VTK_VERSION}.lib vtkImagingCore-${VTK_VERSION}.lib vtkInteractionStyle-${VTK_VERSION}.lib )
|
||||
|
||||
#dll
|
||||
set (VTK_DLL_NAMES vtkCommonComputationalGeometry-${VTK_VERSION}.dll
|
||||
vtkCommonCore-${VTK_VERSION}.dll
|
||||
vtkCommonDataModel-${VTK_VERSION}.dll
|
||||
vtkCommonExecutionModel-${VTK_VERSION}.dll
|
||||
vtkCommonMath-${VTK_VERSION}.dll
|
||||
vtkCommonMisc-${VTK_VERSION}.dll
|
||||
vtkCommonSystem-${VTK_VERSION}.dll
|
||||
vtkCommonTransforms-${VTK_VERSION}.dll
|
||||
vtkDICOMParser-${VTK_VERSION}.dll
|
||||
vtkFiltersCore-${VTK_VERSION}.dll
|
||||
vtkFiltersExtraction-${VTK_VERSION}.dll
|
||||
vtkFiltersGeneral-${VTK_VERSION}.dll
|
||||
vtkFiltersGeometry-${VTK_VERSION}.dll
|
||||
vtkFiltersSources-${VTK_VERSION}.dll
|
||||
vtkFiltersStatistics-${VTK_VERSION}.dll
|
||||
vtkIOCore-${VTK_VERSION}.dll
|
||||
vtkIOImage-${VTK_VERSION}.dll
|
||||
vtkImagingCore-${VTK_VERSION}.dll
|
||||
vtkImagingFourier-${VTK_VERSION}.dll
|
||||
vtkImagingHybrid-${VTK_VERSION}.dll
|
||||
vtkInteractionStyle-${VTK_VERSION}.dll
|
||||
vtkRenderingCore-${VTK_VERSION}.dll
|
||||
vtkRenderingOpenGL-${VTK_VERSION}.dll
|
||||
vtkalglib-${VTK_VERSION}.dll
|
||||
vtkjpeg-${VTK_VERSION}.dll
|
||||
vtkmetaio-${VTK_VERSION}.dll
|
||||
vtkpng-${VTK_VERSION}.dll
|
||||
vtksys-${VTK_VERSION}.dll
|
||||
vtktiff-${VTK_VERSION}.dll
|
||||
vtkzlib-${VTK_VERSION}.dll )
|
||||
|
||||
# search for dll directory
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_VTK_DLL_DIR OR NOT EXISTS "${3RDPARTY_VTK_DLL_DIR}")
|
||||
if(EXISTS "${3RDPARTY_VTK_DIR}/bin${BUILD_POSTFIX}")
|
||||
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DIR}/bin${BUILD_POSTFIX}" CACHE FILEPATH "The directory containing dll of VTK" FORCE)
|
||||
else()
|
||||
if (NOT "${BUILD_POSTFIX}" STREQUAL "" AND EXISTS "${3RDPARTY_VTK_DIR}/bin")
|
||||
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DIR}/bin" CACHE FILEPATH "The directory containing dll of VTK" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
OCCT_CHECK_AND_UNSET(VTK_DIR)
|
||||
|
||||
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_VTK_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
if (INSTALL_VTK)
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
if (WIN32)
|
||||
if(3RDPARTY_VTK_DLL_DIR AND EXISTS "${3RDPARTY_VTK_DLL_DIR}")
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
foreach(VTK_DLL_NAME ${VTK_DLL_NAMES})
|
||||
set (3RDPARTY_VTK_DLL "3RDPARTY_VTK_DLL-NOTFOUND" CACHE FILEPATH "VTK shared library" FORCE)
|
||||
find_library(3RDPARTY_VTK_DLL "${VTK_DLL_NAME}" PATHS "${3RDPARTY_VTK_DLL_DIR}" NO_DEFAULT_PATH)
|
||||
if (NOT 3RDPARTY_VTK_DLL OR NOT EXISTS "${3RDPARTY_VTK_DLL}")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED "${3RDPARTY_VTK_DLL}")
|
||||
else()
|
||||
install (FILES ${3RDPARTY_VTK_DLL} DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BUILD_POSTFIX}")
|
||||
endif()
|
||||
endforeach()
|
||||
OCCT_CHECK_AND_UNSET(3RDPARTY_VTK_DLL)
|
||||
endif()
|
||||
else ()
|
||||
foreach(VTK_DLL_NAME ${VTK_DLL_NAMES})
|
||||
string(REPLACE ".dll" ".so.1" VTK_DLL_NAME "${VTK_DLL_NAME}")
|
||||
install(FILES "${3RDPARTY_VTK_LIBRARY_DIR}/lib${VTK_DLL_NAME}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BUILD_POSTFIX}" RENAME "lib${VTK_DLL_NAME}")
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (VTK_INCLUDE_DIRS VTK_LIBRARY_DIRS VTK_DIR)
|
BIN
data/images/hatch_1.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
@@ -9,6 +9,10 @@ overview/overview.md
|
||||
|
||||
../samples/mfc/standard/ReadMe.md
|
||||
../samples/CSharp/ReadMe.md
|
||||
../samples/CSharp/ReadMe_D3D.md
|
||||
|
||||
../samples/qt/AndroidQt/ReadMe.md
|
||||
../samples/java/jniviewer/ReadMe.md
|
||||
|
||||
tutorial/tutorial.md
|
||||
|
||||
@@ -26,12 +30,13 @@ user_guides/step/step.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/ocaf/ocaf.md
|
||||
user_guides/tobj/tobj.md
|
||||
user_guides/draw_test_harness.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
user_guides/brep_wp/brep_wp.md
|
||||
user_guides/ocaf_functionmechanism_wp/ocaf_functionmechanism_wp.md
|
||||
user_guides/ocaf_tree_wp/ocaf_tree_wp.md
|
||||
user_guides/ocaf_wp/ocaf_wp.md
|
||||
user_guides/voxels_wp/voxels_wp.md
|
||||
user_guides/vis/vis.md
|
||||
|
||||
dev_guides/dev_guides.md
|
||||
dev_guides/documentation/documentation.md
|
||||
@@ -50,6 +55,7 @@ dev_guides/building/3rdparty/3rdparty_osx.md
|
||||
dev_guides/building/wok/wok.md
|
||||
dev_guides/building/automake.md
|
||||
dev_guides/building/cmake/cmake.md
|
||||
dev_guides/building/android/android.md
|
||||
dev_guides/building/code_blocks.md
|
||||
dev_guides/building/msvc.md
|
||||
dev_guides/building/xcode.md
|
||||
|
@@ -16,11 +16,12 @@ user_guides/ocaf_functionmechanism_wp/ocaf_functionmechanism_wp.md
|
||||
user_guides/ocaf_tree_wp/ocaf_tree_wp.md
|
||||
user_guides/ocaf_wp/ocaf_wp.md
|
||||
user_guides/step/step.md
|
||||
user_guides/draw_test_harness.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
user_guides/tobj/tobj.md
|
||||
user_guides/visualization/visualization.md
|
||||
user_guides/voxels_wp/voxels_wp.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/vis/vis.md
|
||||
|
||||
dev_guides/contribution_workflow/contribution_workflow.md
|
||||
dev_guides/documentation/documentation.md
|
||||
|
@@ -16,11 +16,12 @@ There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
* Mandatory products:
|
||||
* Tcl/Tk 8.5 - 8.6;
|
||||
* FreeType 2.4.10 - 2.4.11;
|
||||
* FreeType 2.4.10 - 2.5.3;
|
||||
* Optional products:
|
||||
* TBB 3.x - 4.x;
|
||||
* gl2ps 1.3.5 - 1.3.8;
|
||||
* FreeImage 3.14.1 - 3.15.4.
|
||||
* FreeImage 3.14.1 - 3.16.0;
|
||||
* VTK 6.1.0.
|
||||
|
||||
@section dev_guides__building_3rdparty_linux_2 Building Mandatory Third-party Products
|
||||
|
||||
@@ -28,22 +29,6 @@ There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
Tcl/Tk is required for DRAW test harness.
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_linux_2_1_1 Installation from binaries:
|
||||
|
||||
It is possible to download ready-to-install binaries from
|
||||
http://www.activestate.com/activetcl/downloads
|
||||
|
||||
1. Download the binaries archive and unpack them to a directory, which is further referred to as *TCL_SRC_DIR*.
|
||||
2. Enter the directory *TCL_SRC_DIR*.
|
||||
|
||||
cd TCL_SRC_DIR
|
||||
|
||||
3. Run the install command:
|
||||
|
||||
install.sh
|
||||
|
||||
and follow the instructions.
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_linux_2_1_2 Installation from sources: Tcl
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
@@ -120,7 +105,7 @@ Download the necessary archive from http://sourceforge.net/projects/freetype/fil
|
||||
@subsection dev_guides__building_3rdparty_linux_3_1 TBB
|
||||
|
||||
This third-party product is installed with binaries from the archive that can be downloaded from http://threadingbuildingblocks.org.
|
||||
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
|
||||
Go to the **Download** page, find the release version you need and pick the archive for Linux platform.
|
||||
To install, unpack the downloaded archive of TBB product.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_2 gl2ps
|
||||
@@ -211,56 +196,49 @@ and unpack it. The directory with unpacked sources is further referred to as *F
|
||||
make DESTDIR=FREEIMAGE_INSTALL_DIR install
|
||||
|
||||
5. Clean temporary files
|
||||
|
||||
make clean
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_3_4 OpenCL ICD Loader
|
||||
make clean
|
||||
|
||||
If you have OpenCL SDK (one provided by Apple, AMD, NVIDIA, Intel, or other
|
||||
vendor) installed on your system, you should find OpenCL headers and
|
||||
libraries required for building OCCT inside that SDK.
|
||||
@subsection dev_guides__building_3rdparty_linux_3_4 VTK
|
||||
|
||||
Alternatively, you can use OpenCL ICD (Installable Client Driver) Loader
|
||||
provided by Khronos group. The following describes steps used to build OpenCL
|
||||
ICD Loader version 1.2.11.0.
|
||||
You can download VTK sources from http://www.vtk.org/VTK/resources/software.html
|
||||
|
||||
1. Download OpenCL ICD Loader sources archive and OpenCL header files from
|
||||
Khronos OpenCL Registry
|
||||
http://www.khronos.org/registry/cl/
|
||||
### The building procedure:
|
||||
|
||||
2. Unpack the archive and put headers in *inc/CL* sub-folder
|
||||
Download the necessary archive from http://www.vtk.org/VTK/resources/software.html and unpack it.
|
||||
|
||||
3. Print *make* in the root of the unpacked archive to compile OpenCL libraries.
|
||||
1. Install or build *cmake* product from the source file.
|
||||
2. Start *cmake* in GUI mode with the directory where the source files of *VTK* are located:
|
||||
|
||||
4. Create installation folder for OpenCL IDL Loader package and put there:
|
||||
ccmake VTK_SRC_DIR
|
||||
|
||||
1. OpenCL header files in *include/CL* subfolder
|
||||
* Press <i>[c]</i> to make the initial configuration
|
||||
* Define the necessary options in *VTK_INSTALL_PREFIX*
|
||||
* Press <i>[c]</i> to make the final configuration
|
||||
* Press <i>[g]</i> to generate Makefile and exit
|
||||
|
||||
2. *libOpenCL.so* (generated in *bin* subfolder of source package) in *lib* subfolder
|
||||
3. Start the building of VTK:
|
||||
|
||||
make
|
||||
|
||||
4. Start the installation of gl2ps. Binaries will be installed according to the *VTK_INSTALL_PREFIX* option.
|
||||
|
||||
make install
|
||||
|
||||
@section dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_4_1 Debian-based distributives
|
||||
|
||||
All 3rd-party products required for building of OCCT could be installed
|
||||
from official repositories. You may install them from console using apt-get utility:
|
||||
All 3rd-party products required for building of OCCT could be installed
|
||||
from official repositories. You may install them from console using apt-get utility:
|
||||
|
||||
sudo apt-get install \
|
||||
tcllib tklib tcl-dev tk-dev \
|
||||
libfreetype-dev \
|
||||
libxt-dev libxmu-dev \
|
||||
libgl1-mesa-dev \
|
||||
libfreeimage-dev \
|
||||
libtbb-dev \
|
||||
libgl2ps-dev
|
||||
|
||||
To launch binaries built with WOK you need to install C shell and 32-bit libraries on x86_64 distributives:
|
||||
|
||||
sudo apt-get install \
|
||||
csh \
|
||||
libstdc++5:i386 libxt6:i386
|
||||
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libxt-dev libxmu-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libfreeimage-dev libtbb-dev libgl2ps-dev
|
||||
|
||||
Building is possible with any C++ compliant compiler :
|
||||
|
||||
sudo apt-get install \
|
||||
g++
|
||||
To launch binaries built with WOK you need to install C shell and 32-bit libraries on x86_64 distributives:
|
||||
|
||||
# you may need to add i386 if not done already by command "dpkg --add-architecture i386"
|
||||
sudo apt-get install csh libstdc++6:i386 libxt6:i386 libxext6:i386 libxmu6:i386
|
||||
|
||||
Building is possible with C++ compliant compiler:
|
||||
|
||||
sudo apt-get install g++
|
||||
|
20
dox/dev_guides/building/3rdparty/3rdparty_osx.md
vendored
@@ -14,13 +14,12 @@ http://www.opencascade.org/getocc/require/</a>.
|
||||
There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
* Mandatory products:
|
||||
* Tcl 8.5,
|
||||
* Tk 8.5,
|
||||
* FreeType 2.4.10
|
||||
* Tcl/Tk 8.5 - 8.6;
|
||||
* FreeType 2.4.10 - 2.5.3.
|
||||
* Optional products:
|
||||
* TBB 3.x or 4.x,
|
||||
* gl2ps 1.3.5,
|
||||
* FreeImage 3.14.1 or 3.15.x
|
||||
* TBB 3.x - 4.x;
|
||||
* gl2ps 1.3.5 - 1.3.8;
|
||||
* FreeImage 3.14.1 - 3.16.0
|
||||
|
||||
@section dev_guides__building_3rdparty_osx_2 Building Mandatory Third-party Products
|
||||
|
||||
@@ -28,15 +27,6 @@ There are two types of third-party products, which are necessary to build OCCT:
|
||||
|
||||
Tcl/Tk is required for DRAW test harness. Version 8.5 or 8.6 can be used with OCCT.
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_osx_2_1_1 Installation from binaries
|
||||
|
||||
It is possible to download ready-to-install binaries from
|
||||
http://www.activestate.com/activetcl/downloads
|
||||
|
||||
1. Download the disk image to a directory, which is further referred to as *TCL_DOWNLOAD_DIR*.
|
||||
2. Open the directory *TCL_DOWNLOAD_DIR* in the Finder .
|
||||
3. Open the disk image and follow the instructions.
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_osx_2_1_2 Installation from sources: Tcl 8.5
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
@@ -12,11 +12,12 @@ The links for downloading the third-party products are available on the web site
|
||||
|
||||
* Mandatory products:
|
||||
* Tcl/Tk 8.5 - 8.6;
|
||||
* FreeType 2.4.10 - 2.4.11.
|
||||
* FreeType 2.4.10 - 2.5.3.
|
||||
* Optional products:
|
||||
* TBB 3.x - 4.x;
|
||||
* gl2ps 1.3.5 - 1.3.8;
|
||||
* FreeImage 3.14.1 -3.15.4.
|
||||
* FreeImage 3.14.1 -3.16.0;
|
||||
* VTK 6.1.0.
|
||||
|
||||
It is recommended to create a separate new folder on your workstation, where you will unpack the downloaded archives of the third-party products, and where you will build these products (for example, *c:\\occ3rdparty*).
|
||||
|
||||
@@ -26,18 +27,59 @@ Further in this document, this folder is referred to as *3rdparty*.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_2_1 Tcl/Tk
|
||||
|
||||
Tcl/Tk is required for DRAW test harness. We recommend installing a binary distribution that can be downloaded from http://www.activestate.com/activetcl.
|
||||
Tcl/Tk is required for DRAW test harness.
|
||||
|
||||
Go to \"Free Downloads\" and pick the version of the Install Wizard
|
||||
that matches your target platform – 32 bit (x86) or 64 bit (x64).
|
||||
The version of Visual Studio you use is irrelevant when choosing the Install Wizard.
|
||||
@subsubsection dev_guides__building_3rdparty_win_2_1_1 Installation from sources: Tcl
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
1. In the *win* sub-directory, edit file *buildall.vc.bat*:
|
||||
|
||||
Run the downloaded Install Wizard and install Tcl/Tk products :
|
||||
* Edit the line "call ... vcvars32.bat" to have correct path to the version of Visual Studio to be used for building, for instance:
|
||||
|
||||
* to *3rdparty\\tcltk-win32* folder (for 32-bit platform) or
|
||||
* to *3rdparty\\tcltk-win64* folder (for 64-bit platform).
|
||||
call "%VS80COMNTOOLS%\vsvars32.bat"
|
||||
|
||||
Further in this document, this folder is referred to as *tcltk*.
|
||||
If you are building 64-bit version, set environment accordingly, e.g.:
|
||||
|
||||
call "%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
|
||||
|
||||
* Define variable *INSTALLDIR* pointing to directory where Tcl/Tk will be installed, e.g.:
|
||||
|
||||
set INSTALLDIR=D:\OCCT\3rdparty\tcltk-86-32
|
||||
|
||||
* Add option *install* to the first command line calling *nmake*:
|
||||
|
||||
nmake -nologo -f makefile.vc release htmlhelp install %1
|
||||
|
||||
* Remove second call to *nmake* (building statically linked executable)
|
||||
|
||||
2. Edit file *rules.vc* replacing line
|
||||
|
||||
SUFX = tsgx
|
||||
|
||||
by
|
||||
|
||||
SUFX = sgx
|
||||
|
||||
This is to avoid extra prefix 't' in the library name, which is not recognized by default by OCCT build tools.
|
||||
|
||||
3. In the command prompt, run *buildall.vc.bat*
|
||||
|
||||
You might need to run this script twice to have *tclsh* executable installed; check subfolder *bin* of specified installation path to verify this.
|
||||
|
||||
4. For convenience of use, we recommend making a copy of *tclsh* executable created in subfolder *bin* of *INSTALLDIR* and named with Tcl version number suffix, as *tclsh.exe* (with no suffix)
|
||||
|
||||
> cd D:\OCCT\3rdparty\tcltk-86-32\bin
|
||||
> cp tclsh86.exe tclsh.exe
|
||||
|
||||
@subsubsection dev_guides__building_3rdparty_win_2_1_2 Installation from sources: Tk
|
||||
|
||||
Download the necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
|
||||
|
||||
Apply the same steps as described for building Tcl above, with the same INSTALLDIR.
|
||||
Note that Tk produces its own executable, called *wish*.
|
||||
|
||||
You might need to edit default value of *TCLDIR* variable defined in *buildall.vc.bat* (should be not necessary if you unpack both Tcl and Tk sources in the same folder).
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_2_2 FreeType
|
||||
|
||||
@@ -258,35 +300,22 @@ http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
|
||||
|
||||
As a result, you should have the library files of FreeImage product in *freeimage\\Dist* folder (*FreeImage.dll* and *FreeImage.lib*) and in *freeimage\\Wrapper\\FreeImagePlus\\dist* folder (*FreeImagePlus.dll* and *FreeImagePlus.lib*).
|
||||
|
||||
@subsection dev_guides__building_3rdparty_win_opencl OpenCL ICD Loader
|
||||
@subsection dev_guides__building_3rdparty_win_3_4 VTK
|
||||
|
||||
If you have OpenCL SDK (one provided by Apple, AMD, NVIDIA, Intel, or other
|
||||
vendor) installed on your system, you should find OpenCL headers and
|
||||
libraries required for building OCCT inside that SDK.
|
||||
VTK is an open-source, freely available software system for 3D computer graphics, image processing and visualization. VTK Integration Services component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library.
|
||||
|
||||
Alternatively, you can use OpenCL ICD (Installable Client Driver) Loader
|
||||
provided by Khronos group. The following describes steps used to build OpenCL
|
||||
ICD Loader version 1.2.11.0.
|
||||
### The building procedure:
|
||||
|
||||
1. Download OpenCL ICD Loader sources archive and OpenCL header files from
|
||||
Khronos OpenCL Registry
|
||||
http://www.khronos.org/registry/cl/
|
||||
1. Download the necessary archive from http://www.vtk.org/VTK/resources/software.html and unpack it into *3rdparty* folder.
|
||||
|
||||
2. Unpack the archive and put headers in *inc/CL* sub-folder
|
||||
As a result, you will get a folder named, for example, <i>3rdparty\VTK-6.1.0.</i>
|
||||
|
||||
3. Use CMake to generate VS projects for building the library:
|
||||
- Start CMake-GUI and select OpenCL ICD Loader folder as source path, and the folder of your choice for VS project and intermediate build data;
|
||||
- Click **Generate**;
|
||||
- Select the VS version to be used from the ones you have installed (we recommend using VS 2010) and the architecture (32- or 64-bit).
|
||||
Further in this document, this folder is referred to as *VTK*.
|
||||
|
||||
4. Open solution *OPENCL_ICD_LOADER.sln* generated in the build folder.
|
||||
Though not strictly necessary, we recommend making two changes in the generated projects:
|
||||
- Add file *OpenCL.rc* to project OpenCL, to have version and Khronos copyright correctly embedded in DLL;
|
||||
- Change **Runtime library** to **Multi-threaded(/MT)** in the properties of OpenCL project, on **C/C++ / Code Generation** page for Release configuration, to avoid dependency on run-time DLL.
|
||||
|
||||
5. Build project OpenCL in Release mode
|
||||
2. Use CMake to generate VS projects for building the library:
|
||||
- Start CMake-GUI and select VTK folder as source path, and the folder of your choice for VS project and intermediate build data.
|
||||
- Click **Configure**.
|
||||
- Select the VS version to be used from the ones you have installed (we recommend using VS 2010) and the architecture (32 or 64-bit).
|
||||
- Generate VS projects with default CMake options. The open solution *VTK.sln* will be generated in the build folder.
|
||||
|
||||
6. Create the installation folder for OpenCL IDL Loader package and put there:
|
||||
- OpenCL header files in *include/CL* subfolder;
|
||||
- *OpenCL.dll* (generated in *bin/Release* subfolder of the source package) in *bin* subfolder;
|
||||
- *OpenCL.lib* (generated in *Release* subfolder of the build directory) in *lib* subfolder.
|
||||
3. Build project VTK in Release mode.
|
||||
|
71
dox/dev_guides/building/android/android.md
Normal file
@@ -0,0 +1,71 @@
|
||||
Building with CMake and ADT for Android {#occt_dev_guides__building_android}
|
||||
===================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This file describes the steps to build OCCT libraries from a complete source package
|
||||
with following tools:
|
||||
- Generation of eclipse project files
|
||||
- CMake v3.0+ http://www.cmake.org/cmake/resources/software.html
|
||||
- Cross-compilation toolchain for CMake https://github.com/taka-no-me/android-cmake
|
||||
- Android NDK rev.10+ https://developer.android.com/tools/sdk/ndk/index.html
|
||||
- Make: MinGW v4.82+ for Windows, GNU Make vXX for Linux. http://sourceforge.net/projects/mingw/files/
|
||||
- Building eclipse project files of OCCT
|
||||
- Android Developer Tools (ADT) v22+ https://developer.android.com/sdk/index.html
|
||||
|
||||
## Generation of eclipse project files
|
||||
Run GUI tool provided by CMake: cmake-gui
|
||||
|
||||
### Tools configuration
|
||||
- Specify the root folder of OCCT (<i>$CASROOT</i>, which contains *CMakelists.txt* file) by clicking **Browse Source**.
|
||||
- Specify the location (build folder) for Cmake generated project files by clicking **Browse Build**.
|
||||
|
||||
@figure{/dev_guides/building/android/images/android_image001.png}
|
||||
|
||||
Click **Configure** button. It opens the window with a drop-down list of generators supported by CMake project. -
|
||||
|
||||
Select "Eclipse CDT4 - MinGW MakeFiles" item from the list
|
||||
- Choose "Specify toolchain file for cross-compiling"
|
||||
- Click "Next"
|
||||
@figure{/dev_guides/building/android/images/android_image002.png}
|
||||
- Specify the Toolchain file at next dialog by android.toolchain.cmake is contained by cross-compilation toolchain for CMake
|
||||
- Click "Finish"
|
||||
@figure{/dev_guides/building/android/images/android_image003.png}
|
||||
|
||||
Add cache entry ANDROID_NDK - path (entry type is PATH) to the NDK folder ("Add Entry" button)
|
||||
@figure{/dev_guides/building/android/images/android_image004.png}
|
||||
|
||||
if there is message "CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool."
|
||||
Define CMAKE_MAKE_PROGRAM variable with the file path to mingw32-make executable.
|
||||
@figure{/dev_guides/building/android/images/android_image005.png}
|
||||
|
||||
### OCCT Configuration
|
||||
|
||||
How to configure OCCT, see "OCCT Configuration" section of @ref occt_dev_guides__building_cmake "Building with CMake"
|
||||
taking into account the specific configuration variables for android:
|
||||
- ANDROID_ABI = armeabi-v7a
|
||||
- ANDROID_NATIVE_API_LEVEL = 15
|
||||
- ANDROID_NDK_LAYOUT is equal to BUILD_CONFIGURATION variable
|
||||
- CMAKE_ECLIPSE_VERSION is equal to installed eclipse version (e.g., 4.2)
|
||||
|
||||
Configure parallel building:
|
||||
- CMAKE_ECLIPSE_MAKE_ARGUMENTS = -jN where N = your numbers of CPU cores (threads)
|
||||
|
||||
@figure{/dev_guides/building/android/images/android_image006.png}
|
||||
|
||||
### Generation of eclipse projects files
|
||||
|
||||
Click **Generate** button and wait until the generation process is finished.
|
||||
Then the eclipse project files will appear in the build folder (e.g. <i> D:/android-build-eclipse-api-15 </i>).
|
||||
|
||||
## Building eclipse project files of OCCT
|
||||
|
||||
- Open eclipse (downloaded ADT bundle contains it)
|
||||
@figure{/dev_guides/building/android/images/android_image007.png}
|
||||
- Import "Existing project into Workspace"
|
||||
@figure{/dev_guides/building/android/images/android_image008.png}
|
||||
@figure{/dev_guides/building/android/images/android_image009.png}
|
||||
- Build ALL
|
||||
@figure{/dev_guides/building/android/images/android_image010.png}
|
||||
|
||||
When the building process has finished, libraries are located in \<build folder\>/out (e.g. <i> D:/android-build-eclipse-api-15/out </i>).
|
BIN
dox/dev_guides/building/android/images/android_image001.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
dox/dev_guides/building/android/images/android_image002.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
dox/dev_guides/building/android/images/android_image003.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
dox/dev_guides/building/android/images/android_image004.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
dox/dev_guides/building/android/images/android_image005.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
dox/dev_guides/building/android/images/android_image006.png
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
dox/dev_guides/building/android/images/android_image007.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
dox/dev_guides/building/android/images/android_image008.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
dox/dev_guides/building/android/images/android_image009.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
dox/dev_guides/building/android/images/android_image010.png
Normal file
After Width: | Height: | Size: 46 KiB |
@@ -1,71 +1,72 @@
|
||||
Building with Automake {#occt_dev_guides__building_automake}
|
||||
======================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source
|
||||
archive on Linux with GNU build system (Autotools).
|
||||
This file describes steps to build OCCT libraries from a complete source
|
||||
archive on Linux with **Autotools** GNU build system.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
If you build OCCT from bare sources (as in Git repository), or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See paragraph 1 \ref occt_dev_guides__building_wok for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see paragraph 1 of
|
||||
Before building OCCT, you need to install the required third-party libraries; see paragraph 1 of
|
||||
\ref occt_dev_guides__building for instructions.
|
||||
|
||||
Note that during compilation by makefiles on some Linux OS on a station with
|
||||
Note that during compilation by makefiles on Linux station with
|
||||
NVIDIA video card you may experience problems because the installation
|
||||
procedure of NVIDIA video driver removes library libGL.so included in package
|
||||
libMesaGL from directory /usr/X11R6/lib and places this library libGL.so in
|
||||
directory /usr/lib. However, libtool expects to find the library in directory
|
||||
/usr/X11R6/lib, which causes compilation crash (See /usr/X11R6/lib/libGLU.la).
|
||||
procedure of NVIDIA video driver removes library *libGL.so* included in package
|
||||
*libMesaGL* from directory <i>/usr/X11R6/lib</i> and places this library *libGL.so* in
|
||||
directory <i>/usr/lib</i>. However, *libtool* expects to find the library in directory
|
||||
<i>/usr/X11R6/lib</i>, which causes compilation crash (See <i>/usr/X11R6/lib/libGLU.la </i>).
|
||||
|
||||
To prevent this, suggest making links:
|
||||
To prevent this, it is suggested to make links:
|
||||
|
||||
ln -s /usr/lib/libGL.so /usr/X11R6/lib/libGL.so
|
||||
ln -s /usr/lib/libGL.la /usr/X11R6/lib/libGL.la
|
||||
|
||||
1.In OCCT root folder, launch build_configure script
|
||||
ln -s /usr/lib/libGL.so /usr/X11R6/lib/libGL.so
|
||||
ln -s /usr/lib/libGL.la /usr/X11R6/lib/libGL.la
|
||||
|
||||
This will generate files configure and Makefile.in for your system.
|
||||
|
||||
2.Go to the directory where OCCT will be built, and run configure to generate
|
||||
makefiles.
|
||||
1.In OCCT root folder, launch *build_configure* script to generate files *configure* and *Makefile.in* for your system.
|
||||
|
||||
$CASROOT/configure \<FLAGS\>
|
||||
2.Go to the directory, where OCCT will be built, and run *configure* to generate makefiles.
|
||||
|
||||
Where \<FLAGS\> is a set of options.
|
||||
|
||||
$CASROOT/configure \<FLAGS\>
|
||||
|
||||
Where <i> \<FLAGS\> </i> is a set of options.
|
||||
The following flags are mandatory:
|
||||
|
||||
* --with-tcl= defines location of tclConfig.sh
|
||||
* --with-tk= defines location of tkConfig.sh
|
||||
* --with-freetype= defines location of installed FreeType product
|
||||
* --prefix= defines location for the installation of OCCT binaries
|
||||
* <i> --with-tcl= </i> defines the location of *tclConfig.sh*;
|
||||
* <i> --with-tk= </i> defines location of *tkConfig.sh*;
|
||||
* <i> --with-freetype= </i> defines location of installed **FreeType** product
|
||||
* <i> --prefix= </i> defines the location for installation of OCCT binaries
|
||||
|
||||
Additional flags:
|
||||
|
||||
* --with-gl2ps= defines location of installed gl2ps product
|
||||
* --with-freeimage= defines location of installed FreeImage product
|
||||
* --with-tbb-include= defines location of tbb.h
|
||||
* --with-tbb-library= defines location of libtbb.so
|
||||
* --with-opencl-include= defines location of cl.h
|
||||
* --with-opencl-library= defines location of libOpenCL.so
|
||||
* --enable-debug= yes: includes debug information, no: does not include debug information
|
||||
* --enable-production= yes: switches code optimization, no: switches off code optimization
|
||||
* --disable-draw - allows OCCT building without Draw.
|
||||
* <i> --with-gl2ps= </i> defines the location of installed **gl2ps** product;
|
||||
* <i> --with-freeimage= </i> defines the location of installed **FreeImage** product;
|
||||
* <i> --with-tbb-include= </i> defines the location of *tbb.h*;
|
||||
* <i> --with-tbb-library= </i> defines the location of *libtbb.so*;
|
||||
* <i> --with-vtk-include= </i> defines the location of VTK includes;
|
||||
* <i> --with-vtk-library= </i> defines the location of VTK libraries;
|
||||
* <i> --enable-debug= yes: </i> includes debug information, no: does not include debug information;
|
||||
* <i> --enable-production= yes: </i> switches code optimization, no: switches off code optimization;
|
||||
* <i> --disable-draw </i> allows OCCT building without Draw.
|
||||
|
||||
If location of FreeImage, TBB, gl2ps or OpenCL is not specified, OCCT will be
|
||||
built without these optional libraries.
|
||||
If location of **FreeImage, TBB, gl2ps** or **VTK** is not specified, OCCT will be built without these optional libraries.
|
||||
|
||||
|
||||
Attention: 64-bit platforms are detected automatically.
|
||||
Attention: 64-bit platforms are detected automatically.
|
||||
|
||||
Example:
|
||||
Example:
|
||||
|
||||
|
||||
> ./configure -prefix=/PRODUCTS/occt-6.5.5 --with-tcl=/PRODUCTS/tcltk-8.5.8/lib --with-tk=/PRODUCTS/tcltk-8.5.8/lib --with-freetype=/PRODUCTS/freetype-2.4.10 --with-gl2ps=/PRODUCTS/gl2ps-1.3.5 --with-freeimage=/PRODUCTS/freeimage-3.14.1 --with-tbb-include=/PRODUCTS/tbb30_018oss/include --with-tbb-library=/PRODUCTS/tbb30_018oss/lib/ia32/cc4.1.0_libc2.4_kernel2.6.16.21 --with-opencl-include=/PRODUCTS/opencl-icd-1.2.11.0/include --with-opencl-library=/PRODUCTS/opencl-icd-1.2.11.0/lib
|
||||
\> ./configure -prefix=/PRODUCTS/occt-6.5.5 --with-tcl=/PRODUCTS/tcltk-8.5.8/lib --with-tk=/PRODUCTS/tcltk-8.5.8/lib --with-freetype=/PRODUCTS/freetype-2.4.10 --with-gl2ps=/PRODUCTS/gl2ps-1.3.5 --with-freeimage=/PRODUCTS/freeimage-3.14.1 --with-tbb-include=/PRODUCTS/tbb30_018oss/include --with-tbb-library=/PRODUCTS/tbb30_018oss/lib/ia32/cc4.1.0_libc2.4_kernel2.6.16.21 -–with-vtk-include=/PRODUCTS/VTK-6.1.0/include/vtk-6.1 –with-vtk-library=/PRODUCTS/ /VTK-6.1.0//lib
|
||||
|
||||
3.If configure exits successfully, you can build OCCT with make command.
|
||||
|
||||
> make -j8 install
|
||||
3.If configure exits successfully, you can build OCCT with *make* command.
|
||||
|
||||
To start DRAW, launch
|
||||
\> make -j8 install
|
||||
|
||||
> draw.sh
|
||||
4.To start *DRAW*, launch
|
||||
|
||||
\> draw.sh
|
||||
|
@@ -24,6 +24,7 @@ you need to:
|
||||
3. Build using your preferred build tool.
|
||||
- \subpage occt_dev_guides__building_automake "Building on Linux with Autotools"
|
||||
- \subpage occt_dev_guides__building_cmake "Building with CMake (cross-platform)"
|
||||
- \subpage occt_dev_guides__building_android "Building with CMake and ADT for Android (cross-platform)"
|
||||
- \subpage occt_dev_guides__building_code_blocks "Building on Mac OS X with Code::Blocks"
|
||||
- \subpage occt_dev_guides__building_msvc "Building on Windows with MS Visual Studio"
|
||||
- \subpage occt_dev_guides__building_xcode "Building on Mac OS X with Xcode"
|
||||
|
@@ -3,230 +3,229 @@ Building with CMake {#occt_dev_guides__building_cmake}
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source package
|
||||
with CMake. CMake is free software that can create GNU Makefiles, KDevelop,
|
||||
XCode, and Visual Studio project files. Version 2.6 or above of CMake is
|
||||
This file describes the steps to build OCCT libraries from a complete source package
|
||||
with **CMake**. CMake is free software that can create GNU Makefiles, KDevelop,
|
||||
XCode, Eclipse and Visual Studio project files. **CMake** version 3.0 or above is
|
||||
required.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
If you build OCCT from bare sources (as in Git repository) or make some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See \ref occt_dev_guides__building_wok for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
Before building OCCT, you need to install the required third-party libraries; see the
|
||||
instructions for your platform in @ref occt_dev_guides__building.
|
||||
|
||||
## Decide on location of build and install directories.
|
||||
## Define the location of build and install directories.
|
||||
|
||||
The build directory is the one where intermediate files will be created (projects / makefiles, objects, binaries).
|
||||
The install directory is the one where binaries will be installed after build,
|
||||
along with header files and resources required for OCCT use in applications.
|
||||
The build directory is where intermediate files (projects / makefiles, objects, binaries) will be created. Each built configuration should have its own build directory.
|
||||
|
||||
OCCT CMake scripts assume use of separate build and one install directories
|
||||
for each configuration (Debug or Release).
|
||||
The install directory is where binaries will be installed after build, along with header files and resources required for OCCT use in applications.
|
||||
It is possible to install several configurations of OCCT (differentiated by platform, bitness, compiler, and build type) into the same directory.
|
||||
|
||||
It is recommended to separate build and install directories from OCCT source directory, for example:
|
||||
|
||||
/user/home/occt/ - sources
|
||||
/user/home/tmp/occt-build-release - intermediate files (release)
|
||||
/user/home/occt-install-release - installed binaries (release)
|
||||
/user/home/occt/ - sources
|
||||
/user/home/tmp/occt-build-vc10-x64-release - intermediate files
|
||||
/user/home/occt-install - installed binaries
|
||||
|
||||
## CMake usage
|
||||
|
||||
Run CMake indicating path to OCCT sources ($CASROOT; in previous example
|
||||
CASROOT equal to /user/home/occt in lin case, and d:/occt in windows case)
|
||||
and selected build directory (in prev example build directory is
|
||||
/user/home/tmp/occt-build-release).
|
||||
Run CMake indicating the path to OCCT sources <i>($CASROOT)</i> and selected build directory.
|
||||
|
||||
It is recommended to use GUI tools provided by CMake: cmake-gui on Windows
|
||||
and Mac, ccmake on Linux.
|
||||
It is recommended to use GUI tools provided by CMake: *cmake-gui* on Windows, Mac and Linux (*ccmake* also can be used on Linux).
|
||||
|
||||
### Windows:
|
||||
|
||||
@image html /dev_guides/building/cmake/images/cmake_image001.png
|
||||
@image latex /dev_guides/building/cmake/images/cmake_image001.png
|
||||
Specify the root folder of OCCT (<i>$CASROOT</i>, which contains *CMakelists.txt* file) by clicking **Browse Source**.
|
||||
|
||||
* Specify "main" CMakelists.txt meta-project location by clicking Browse Source (e.g., $CASROOT)
|
||||
* Specify location (build folder) for Cmake generated project files by clicking Browse Build (e.g., d:/occt/build/win32-vc9-debug) (each cmake configuration of the project uses a specific build directory and a specific directory for installed files. It is recommended to compose names of the binary and install directory from system, bitness, compiler and build type.)
|
||||
* Configure opens the window with a drop-down list of generators supported by CMake project. Select the required generator (e.g., Visual Studio 2008) and click Finish)
|
||||
@figure{/dev_guides/building/cmake/images/cmake_image001.png}
|
||||
|
||||
@image html /dev_guides/building/cmake/images/cmake_image002.png
|
||||
@image latex /dev_guides/building/cmake/images/cmake_image002.png
|
||||
Specify the location (build folder) for Cmake generated project files by clicking **Browse Build**.
|
||||
|
||||
### Linux:
|
||||
Each configuration of the project should be built in its own directory. When building multiple configurations it is recommended to indicate in the name of build directories the system, bitness, compiler, and build type (e.g., <i>d:/occt/build/win32-vc9-debug</i> ).
|
||||
|
||||
In the console, change to the build directory and call ccmake with the path to the source directory of the project:
|
||||
**Configure** opens the window with a drop-down list of generators supported by CMake project. Select the required generator (e.g., Visual Studio 2008) and click **Finish**.
|
||||
|
||||
@figure{/dev_guides/building/cmake/images/cmake_image002.png}
|
||||
|
||||
### Linux (ccmake variant):
|
||||
|
||||
In the console, change to the build directory and call *ccmake* with the path to the source directory of the project:
|
||||
|
||||
> cd ~/occt/build/debug
|
||||
> ccmake ~/occt
|
||||
|
||||
@image html /dev_guides/building/cmake/images/cmake_image003.png
|
||||
@image latex /dev_guides/building/cmake/images/cmake_image003.png
|
||||
@figure{/dev_guides/building/cmake/images/cmake_image003.png}
|
||||
|
||||
Press "c" to configure.
|
||||
Press *c* to configure.
|
||||
|
||||
*cmake-gui* is used in the same way as described above for Windows.
|
||||
|
||||
### Mac OS:
|
||||
|
||||
Use cmake-gui (Applications -> CMake 2.8-10.app) to generate project files for the chosen build environment (e.g., XCode).
|
||||
Use *cmake-gui* **Applications -> CMake 2.8-10.app** to generate project files for the chosen build environment (e.g., XCode).
|
||||
|
||||
@image html /dev_guides/building/cmake/images/cmake_image004.png
|
||||
@image latex /dev_guides/building/cmake/images/cmake_image004.png
|
||||
@figure{/dev_guides/building/cmake/images/cmake_image004.png}
|
||||
|
||||
## OCCT Configuration
|
||||
|
||||
The error message which appears at the end of configuration process, informs you about the required variables
|
||||
The error message, which appears at the end of configuration process, informs you about the required variables,
|
||||
which need to be defined. This error will appear until all required variables are defined correctly.
|
||||
Note: In cmake-gui there is "grouped" option, which groups variables with a common prefix.
|
||||
|
||||
### Selection of components to be built
|
||||
Note: In *cmake-gui* there is "grouped" option, which groups variables with a common prefix.
|
||||
|
||||
The variables with "BUILD_" prefix allow specifying OCCT components and
|
||||
### Selection of the components to be built
|
||||
|
||||
The variables with <i>BUILD_</i> prefix allow specifying OCCT components and
|
||||
configuration to be built:
|
||||
|
||||
* BUILD_CONFIGURATION - defines configuration to be built (Release by default).
|
||||
* BUILD_<MODULE> - specify whether corresponding OCCT module should be
|
||||
built (all toolkits). Note that even if whole module is not
|
||||
selected for build, its toolkits used by other toolkits
|
||||
selected for build will be included automatically.
|
||||
* BUILD_TOOLKITS - allows including additional toolkits from non-selected
|
||||
modules (should be list of toolkit names separated by a
|
||||
space or a semicolon).
|
||||
* BUILD_SAMPLES - specify whether OCCT MFC samples should be built.
|
||||
* *BUILD_CONFIGURATION* - defines configuration to be built (Release by default).
|
||||
* <i>BUILD_<MODULE></i> - specifies whether the corresponding OCCT module should be
|
||||
built (all toolkits). Note that even if the whole module is not
|
||||
selected for build, its toolkits used by other toolkits
|
||||
selected for build will be included automatically.
|
||||
* *BUILD_TOOLKITS* - allows including additional toolkits from non-selected
|
||||
modules (should be list of toolkit names separated by a
|
||||
space or a semicolon).
|
||||
* *BUILD_SAMPLES* - specifies whether OCCT MFC samples should be built.
|
||||
* *BUILD_PATCH_DIR* - optionally specifies additional folder containing patched OCCT source files.
|
||||
The patch may contain arbitrary subset of OCCT source files (including CMake scripts, templates, etc.), organized in the same structure of folders as OCCT.
|
||||
The projects generated by CMake will use files found in the patch folder instead of the corresponding files of OCCT.
|
||||
|
||||
Check variables with "USE_" prefix (USE_FREEIMAGE, USE_GL2PS, USE_TBB, and
|
||||
USE_OPENCL) if you want to enable use of the corresponding optional 3rd-party
|
||||
Check variables with <i>USE_</i> prefix (<i>USE_FREEIMAGE, USE_GL2PS, USE_TBB,</i> and
|
||||
<i>USE_OPENCL</i>) if you want to enable use of the corresponding optional 3rd-party
|
||||
library.
|
||||
|
||||
### 3rd-party configuration
|
||||
|
||||
### 3rd-party configuration (The variables with 3RDPARTY_ prefix)
|
||||
### 3rd-party configuration (The variables with <i>3RDPARTY_</i> prefix)
|
||||
|
||||
If you have 3rd-party libraries in a non-default location
|
||||
(e.g., on Windows, binaries downloaded from "http://www.opencascade.org/getocc/download/3rdparty/"),
|
||||
specify 3RDPARTY_DIR variable that points to the folders of 3rdparty products (some or all).
|
||||
At the next configuration 3rd-party product paths stored in 3RDPARTY_\<PRODUCT\>_DIR variable
|
||||
will be searched for in 3RDPARTY_DIR directory. If the structure of 3RDPARTY_DIR directory
|
||||
is the same as adopted in the OCCT, the directory will contain product dir, lib and header files.
|
||||
(e.g., on Windows, binaries downloaded from http://www.opencascade.org/getocc/download/3rdparty/")
|
||||
*3RDPARTY_DIR* variable should be specified with the path to the folders where required 3rd-party libraries will be sought
|
||||
|
||||
Press "Configure" ("c" key for ccmake).
|
||||
The results of search for 3rd-party directories will be stored in *3RDPARTY_\<LIBRARY\>_DIR* variables. If *3RDPARTY_DIR* directory is defined, required libraries are sought in *3RDPARTY_DIR* location.
|
||||
|
||||
The result of the 3rdparty product search will be recorded in the corresponding variables:
|
||||
The procedure expects to find binary and header files of each 3rd-party library in its own sub-directory: *bin*, *lib* and *include*.
|
||||
|
||||
* 3RDPARTY_\<PRODUCT\>_DIR - path to the product directory (with directory name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32)
|
||||
* 3RDPARTY_\<PRODUCT\>_LIBRARY - path to the .lib libraries (with the library name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/lib/tcl85.lib). In non-windows case, this variable is the same as 3RDPARTY_\<PRODUCT\>_DLL.
|
||||
* 3RDPARTY_\<PRODUCT\>_INCLUDE - path to the include directory that contains the required header file (with "include" name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/include including tcl.h)
|
||||
* 3RDPARTY_\<PRODUCT\>_DLL - path to the .dll/.so/.dylib library (with the library name) (e.g., D:/3rdparty/Tcl-8.5.12.0-32/bin/tcl85.dll)
|
||||
Press **Configure** (**c** key for ccmake).
|
||||
|
||||
The result of the search are recorded in the corresponding variables:
|
||||
|
||||
* *3RDPARTY_\<PRODUCT\>_DIR* - path to the 3rdparty directory (with directory name) (e.g. <i>D:/3rdparty/tcltk-86-32</i>)
|
||||
* *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR* - path to directory containing a library (e.g. <i>D:/3rdparty/tcltk-86-32/lib</i>).
|
||||
* *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* - path to the directory containing a header file (e.g., <i>D:/3rdparty/tcltk-86-32/include</i>)
|
||||
* *3RDPARTY_\<PRODUCT\>_DLL_DIR* - path to the directory containing a shared library (e.g., <i>D:/3rdparty/tcltk-86-32/bin</i>) This variable is able just in windows case
|
||||
|
||||
|
||||
Note: a libraries and include directories should be the children of product directory if the last one is defined.
|
||||
|
||||
The search process is as follows:
|
||||
|
||||
1. Common path: 3RDPARTY_DIR
|
||||
2. Path to particular 3rd-party library: 3RDPARTY_\<PRODUCT\>_DIR
|
||||
1. Common path: *3RDPARTY_DIR*
|
||||
2. Path to a particular 3rd-party library: *3RDPARTY_\<PRODUCT\>_DIR*
|
||||
3. Paths to headers and binaries:
|
||||
1. 3RDPARTY_\<PRODUCT\>_INCLUDE
|
||||
2. 3RDPARTY_\<PRODUCT\>_LIBRARY
|
||||
3. 3RDPARTY_\<PRODUCT\>_DLL
|
||||
1. *3RDPARTY_\<PRODUCT\>_INCLUDE_DIR*
|
||||
2. *3RDPARTY_\<PRODUCT\>_LIBRARY_DIR*
|
||||
3. *3RDPARTY_\<PRODUCT\>_DLL_DIR*
|
||||
|
||||
If a variable of any level is not defined (empty or \<variable name\>-NOTFOUND)
|
||||
If a variable of any level is not defined (empty or <i> \<variable name\>-NOTFOUND </i>)
|
||||
and the upper level variable is defined, the content of the non-defined variable
|
||||
will be searched for at the next configuration step. If search process in level 3
|
||||
does not find the required files, it searches in default places also.
|
||||
will be sought at the next configuration step. If search process at level 3 does not find the required files, it seeks in default places.
|
||||
|
||||
**Note**: the names of searched libraries and header files are hardcoded.
|
||||
Freetype search process tries to find ft2build.h file in 3RDPARTY_FREETYPE INCLUDE dir
|
||||
and after that adds "3RDPARTY_FREETYPE_INCLUDE /freetype2" path to common includes if it exists.
|
||||
Important: If *BUILD_CONFIGURATION* variable is changed, at the next configuration
|
||||
*3RDPARTY_ variables* will be replaced by the search process result, except for the *3RDPARTY_DIR* variable.
|
||||
|
||||
Important: If BUILD_CONFIGURATION variable is changed - at the next configuration
|
||||
3RDPARTY_ variables will be replaced by the search process result, except for the 3RDPARTY_DIR variable.
|
||||
|
||||
*Note*: CMake will produce an error after the configuration step until all required variables are defined correctly.
|
||||
If the search result (include path, or library path, or dll path) does not meet your expectations -
|
||||
you can change 3RDPARTY_\<PRODUCT\>_DIR variable, clear (if they are not empty)
|
||||
3RDPARTY_\<PRODUCT\>_DLL, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR and 3RDPARTY_\<PRODUCT\>_LIBRARY variables
|
||||
**Note** : CMake will produce an error after the configuration step until all required variables are defined correctly.
|
||||
If the search result (include path, or library path, or dll path) does not meet your expectations,
|
||||
you can change *3RDPARTY_\<PRODUCT\>_*_DIR variable*, clear (if they are not empty)
|
||||
*3RDPARTY_\<PRODUCT\>_DLL_DIR, 3RDPARTY_\<PRODUCT\>_INCLUDE_DIR* and 3RDPARTY_\<PRODUCT\>_LIBRARY_DIR variables
|
||||
(or clear one of them) and run the configuration process again.
|
||||
|
||||
At this time the search will be performed in the new identified directory
|
||||
and the result will be recorded to empty variables (non-empty variables will not be replaced).
|
||||
At this time the search will be performed in the newly identified directory
|
||||
and the result will be recorded to corresponding variables (replace old value if it is necessary).
|
||||
|
||||
For example, (Linux case) 3RDPARTY_FREETYPE_DIR variable
|
||||
|
||||
/PRODUCTS/maintenance/Mandriva2010/freetype-2.3.7
|
||||
|
||||
can be changed to
|
||||
For example, (Linux case) *3RDPARTY_FREETYPE_DIR* variable
|
||||
|
||||
/PRODUCTS/maintenance/Mandriva2010/freetype-2.4.10
|
||||
|
||||
and the related variables: 3RDPARTY_FREETYPE_DLL, 3RDPARTY_FREETYPE_INCLUDE_DIR and 3RDPARTY_FREETYPE_LIBRARY will be cleared.
|
||||
can be changed to
|
||||
|
||||
@image html /dev_guides/building/cmake/images/cmake_image005.png
|
||||
@image latex /dev_guides/building/cmake/images/cmake_image005.png
|
||||
/PRODUCTS/maintenance/Mandriva2010/freetype-2.5.3
|
||||
|
||||
During configuration process the cleaned variables will be filled with new found values.
|
||||
During the configuration process and the related variables (*3RDPARTY_FREETYPE_DLL_DIR*, *3RDPARTY_FREETYPE_INCLUDE_DIR* and *3RDPARTY_FREETYPE_LIBRARY_DIR*) will be filled with new found values
|
||||
|
||||
**Note**: The names of searched libraries and header files are hard-coded. If there is the need to change their names,
|
||||
change appropriate cmake variables (edit CMakeCache.txt file or edit in cmake-gui in advance mode) without reconfiguration: *3RDPARTY_\<PRODUCT\>_INCLUDE* for include, *3RDPARTY_\<PRODUCT\>_LIB* for library and *3RDPARTY_\<PRODUCT\>_DLL* for shared library.
|
||||
|
||||
###The variables with INSTALL_ prefix:
|
||||
|
||||
Define in INSTALL_DIR variable the path where will be placed built OCCT files (libraries, executables and headers).
|
||||
If INSTALL_\<PRODUCT\> variable is checked - 3rd-party products will be copied to the install directory.
|
||||
Define *INSTALL_DIR* variable as the path will be contain the built OCCT files (libraries, executables and headers)
|
||||
If <i>INSTALL_\<PRODUCT\></i> variable is checked, 3rd-party products will be copied to the install directory.
|
||||
|
||||
#### At the end of the configuration process "configuring done" message will be shown and the generation process can be started.
|
||||
At the end of the configuration process "configuring done" message will be shown and the generation process can be started.
|
||||
|
||||
## OCCT Generation
|
||||
|
||||
This will create makefiles or project files for your build system.
|
||||
This procedure will create makefiles or project files for your build system.
|
||||
|
||||
### Windows
|
||||
|
||||
Click Generate button and wait until the generation process is finished.
|
||||
Then the project files will appear in the build folder (e.g., d:/occt/build/win32-vc9-release).
|
||||
Click **Generate** button and wait until the generation process is finished.
|
||||
Then the project files will appear in the build folder (e.g. <i> d:/occt/build/win32-vc9-release </i>).
|
||||
|
||||
### Linux
|
||||
|
||||
When the configuration is complete, start the generation process by pressing "g".
|
||||
|
||||
@image html /dev_guides/building/cmake/images/cmake_image006.png
|
||||
@image latex /dev_guides/building/cmake/images/cmake_image006.png
|
||||
Click **Generate** button (if you use cmake-gui) or press **g** (for ccmake) to start the generation process.
|
||||
|
||||
### Mac OS X
|
||||
|
||||
Click Generate button and wait until the generation process is finished.
|
||||
Then the project files will appear in the build folder (e.g., /Developer/occt/build/XCode).
|
||||
Click **Generate** button and wait until the generation process is finished.
|
||||
Then the project files will appear in the build folder (e.g. <i> /Developer/occt/build/XCode </i>).
|
||||
|
||||
## OCCT Building
|
||||
|
||||
The install folder contains bin, inc, lib and res folders and a script to run DRAWEXE (draw.bat or draw.sh).
|
||||
"bin" contains executables, DLL (Windows) style shared libraries and pdb-files in OCCT debug version,.
|
||||
"lib" contains the import parts of DLL libraries.
|
||||
"inc" contains header files.
|
||||
"res" contains all required source files for OCCT.
|
||||
The install folder contains the scripts to run *DRAWEXE* (*draw.bat* or *draw.sh*) and samples (if its were built; (see below **MFC samples**)); the directory structure is follow:
|
||||
* **data** - data files for OCCT (brep, iges, stp)
|
||||
* **inc** - header files
|
||||
* **samples** - tcl sample files
|
||||
* **src** - all required source files for OCCT
|
||||
* **tests** - OCCT test suite
|
||||
* **win32/vc10/bind**> - example relative directory tree of binary files (3rdparty and occt)
|
||||
* **win32/vc9/lib**> - example relative directory tree of libraries (3rdparty and occt)
|
||||
|
||||
### Windows (Visual studio)
|
||||
|
||||
Go to the build folder, start the Visual Studio solution (OCCT.sln) and build it by clicking Build - Build Solution.
|
||||
When the building process finished, build the INSTALL project
|
||||
(by default the build solution process skips the building of the INSTALL project) to move the above files to INSTALL_DIR.
|
||||
For this in the solution explorer right click on the INSTALL project and select Project Only - Build Only INSTALL.
|
||||
Go to the build folder, start the Visual Studio solution *OCCT.sln* and build it by clicking **Build -> Build Solution**.
|
||||
|
||||
When the building process is finished, build the *INSTALL* project (by default the build solution process skips the building of the INSTALL project) to move the above files to *INSTALL_DIR*.
|
||||
|
||||
For this, right-click on the *INSTALL* project and select **Project Only -> Build Only** -> *INSTALL* in the solution explorer.
|
||||
|
||||
### Linux (make)
|
||||
Change directory to binary dir and run make command
|
||||
|
||||
Change directory to the directory with binaries and run *make* command
|
||||
|
||||
> make
|
||||
|
||||
To copy all libraries, executables and chosen 3rd-party libraries run "make" command with "install" argument
|
||||
To copy all libraries, executables and chosen 3rd-party libraries run *make* command with *install* argument
|
||||
|
||||
> make install
|
||||
|
||||
This command will move the above files to INSTALL_DIR.
|
||||
This command will move the above files to *INSTALL_DIR*.
|
||||
|
||||
### Mac OS X (XCode)
|
||||
|
||||
Go to the build folder, start the XCode solution (OCCT.xcodeproj)
|
||||
and build it by clicking Build -> Build.
|
||||
Please notice that XCode may have worst responsibility to user actions
|
||||
due to sources processing at first start.
|
||||
Go to the build folder, start XCode solution *OCCT.xcodeproj* and build it by clicking **Build -> Build**.
|
||||
Please notice that XCode may lag because it processes sources at the first start.
|
||||
|
||||
When the building process finished, build the INSTALL project
|
||||
(by default the build solution process skips the building of the INSTALL project)
|
||||
to move the above files to INSTALL_DIR.
|
||||
Notice that env.sh (configure PATH and DYLD_LIBRARY_PATH environment variables
|
||||
as well as Draw Harness extra variables) and draw.sh (to launch DRAWEXE) will be created in target directory.
|
||||
When the building process has finished, build the *INSTALL* project (by default the build solution process skips the building of *INSTALL* project) to move the above files to *INSTALL_DIR*.
|
||||
Notice that *env.sh* (which configures *PATH* and *DYLD_LIBRARY_PATH* environment variables
|
||||
as well as Draw Harness extra variables) and *draw.sh* (to launch *DRAWEXE* ) will be created in the target directory.
|
||||
|
||||
## OCCT project debugging for Visual Studio
|
||||
Run OCCT.bat from the build directory to start Visual Studio with required environment for debugging.
|
||||
### MFC samples
|
||||
|
||||
On Windows you can also build binaries of MFC samples together with OCCT. For this, activate **BUILD_Samples** check-box in CMake configuration dialog.
|
||||
|
||||
@figure{/dev_guides/building/cmake/images/cmake_image007.png}
|
||||
|
||||
Please take into account that MFC sample binaries will be installed in the same folder as OCCT binaries during building of *INSTALL* project.
|
||||
To run an MFC sample use *sample.bat* launcher. The command format is: <i>sample.bat *SampleName*</i> (e.g. <i>sample.bat ImportExport</i>).
|
||||
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 188 KiB |
BIN
dox/dev_guides/building/cmake/images/cmake_image007.png
Normal file
After Width: | Height: | Size: 22 KiB |
@@ -1,64 +1,70 @@
|
||||
Building with Code::Blocks on Mac OS X {#occt_dev_guides__building_code_blocks}
|
||||
======================================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source package
|
||||
on Mac OS X with Code::Blocks.
|
||||
This file describes steps to build OCCT libraries from a complete source package
|
||||
on Mac OS X with **Code::Blocks**.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
If you build OCCT from bare sources (as in Git repository) or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See \ref occt_dev_guides__building_wok for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
Before building OCCT, you need to install the required third-party libraries; see
|
||||
paragraph 1 of \ref occt_dev_guides__building for details.
|
||||
|
||||
1. Add paths to the mandatory 3rd-party products (Tcl/Tk and FreeType) in file
|
||||
custom.sh located in \<OCCT_ROOT_DIR\>. For this:
|
||||
1. Add paths to the mandatory 3rd-party products (**Tcl/Tk** and **FreeType**) in file
|
||||
*custom.sh* located in <i>\<OCCT_ROOT_DIR\></i>. For this:
|
||||
|
||||
1.1. Add paths to the includes in variable "CSF_OPT_INC";
|
||||
1.1. Add paths to the includes in variable *CSF_OPT_INC*;
|
||||
|
||||
1.2. Add paths to the binary libraries in variable "CSF_OPT_LIB64";
|
||||
1.2. Add paths to the binary libraries in variable *CSF_OPT_LIB64*;
|
||||
|
||||
All paths should be separated by ":" symbol.
|
||||
|
||||
2. Add paths to the optional 3rd-party libraries (TBB, gl2ps and FreeImage)
|
||||
in the aforementioned environment variables "CSF_OPT_INC" and
|
||||
"CSF_OPT_LIB64" from file custom.sh.
|
||||
2. Add paths to the optional 3rd-party libraries (**TBB, gl2ps** and **FreeImage**)
|
||||
in the aforementioned environment variables *CSF_OPT_INC* and
|
||||
*CSF_OPT_LIB64* from file *custom.sh*.
|
||||
|
||||
If you want to build OCCT without the optional libraries perform the
|
||||
following steps:
|
||||
|
||||
2.1 Disable unnecessary library in custom.sh by setting the corresponding
|
||||
variable HAVE_\<LIBRARY_NAME\> to "false".
|
||||
variable <i>HAVE_\<LIBRARY_NAME\></i> to *false*.
|
||||
|
||||
export HAVE_GL2PS=false
|
||||
~~~~~
|
||||
export HAVE_GL2PS=false
|
||||
~~~~~
|
||||
|
||||
2.2 Remove this library from Linker settings in Code::Blocks for each project
|
||||
that uses it: right click on the required project, choose "Build options",
|
||||
go to "Linker settings" tab in the opened window , select unnecessary
|
||||
libraries and click "Delete" button.
|
||||
2.2 Remove this library from Linker settings in **Code::Blocks** for each project
|
||||
that uses it: right click on the required project, choose **Build options**,
|
||||
go to **Linker settings** tab in the opened window , select unnecessary
|
||||
libraries and click **Delete** button.
|
||||
|
||||
3. Open Terminal application
|
||||
|
||||
4. Enter \<OCCT_ROOT_DIR\>:
|
||||
4. Enter <i> \<OCCT_ROOT_DIR\></i>:
|
||||
|
||||
~~~~~
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
~~~~~
|
||||
|
||||
5. To start Code::Blocks, run the command /codeblocks.sh
|
||||
5. To start **Code::Blocks**, run the command <i>/codeblocks.sh</i>
|
||||
|
||||
6. To build all toolkits, click "Build->Build workspace" in the menu bar.
|
||||
6. To build all toolkits, click **Build->Build workspace** in the menu bar.
|
||||
|
||||
|
||||
To start DRAWEXE, which has been built with Code::Blocks on Mac OS X, perform
|
||||
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, perform
|
||||
the following steps:
|
||||
|
||||
1. Open Terminal application
|
||||
1.Open Terminal application
|
||||
|
||||
2. Enter \<OCCT_ROOT_DIR\>:
|
||||
2.Enter <i>\<OCCT_ROOT_DIR\></i>:
|
||||
|
||||
~~~~~
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
~~~~~
|
||||
|
||||
3. Run script
|
||||
|
||||
3.Run the script
|
||||
~~~~~
|
||||
./draw_cbp.sh cbp [d]
|
||||
|
||||
Option "d" is used if OCCT has been built in Debug mode.
|
||||
~~~~~
|
||||
Option *d* is used if OCCT has been built in **Debug** mode.
|
||||
|
@@ -1,31 +1,35 @@
|
||||
Building with MS Visual C++ {#occt_dev_guides__building_msvc}
|
||||
===========================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source
|
||||
archive on Windows with MS Visual C++.
|
||||
This file describes steps to build OCCT libraries from a complete source
|
||||
archive on Windows with <b>MS Visual C++</b>.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
If you build OCCT from bare sources (as in Git repository) or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See \ref occt_dev_guides__building_wok for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
Before building OCCT, you need to install the required third-party libraries; see
|
||||
paragraph 1 of \ref occt_dev_guides__building for instructions.
|
||||
|
||||
1. Edit file custom.bat to define environment:
|
||||
1. Edit file *custom.bat* to define the environment:
|
||||
|
||||
- VCVER - version of Visual Studio (vc8, vc9, vc10, vc11 or vc12),
|
||||
and relevant VCVARS path
|
||||
- ARCH - architecture (32 or 64), affects only PATH variable for execution
|
||||
- HAVE_* - flags to enable or disable use of optional third-party products
|
||||
- *VCVER* - version of Visual Studio (vc8, vc9, vc10, vc11 or vc12),
|
||||
and relevant *VCVARS* path
|
||||
- *ARCH* - architecture (32 or 64), affects only *PATH* variable for execution
|
||||
- <i>HAVE_*</i> - flags to enable or disable use of optional third-party products
|
||||
- CSF_OPT_* - paths to search for includes and binaries of all used
|
||||
third-party products
|
||||
|
||||
2. Launch msvc.bat to start Visual Studio with all necessary environment
|
||||
2. Launch *msvc.bat* to start Visual Studio with all necessary environment
|
||||
variables defined.
|
||||
|
||||
Note: the MSVC project files are located in folders adm\\msvc\\vc[9-12].
|
||||
Binaries are produced in win32 or win64 folders.
|
||||
Note: the MSVC project files are located in folders <i>adm\\msvc\\vc[9-12]</i>.
|
||||
Binaries are produced in *win32* or *win64* folders.
|
||||
|
||||
3. Build with Visual Studio
|
||||
|
||||
To start DRAW, launch draw.bat.
|
||||
Note: If VTK was not installed on you computer and you are not interested in usage of
|
||||
OCCT VTK Integration Services (VIS) component you should exclude TKIVtk and TKIVtkDraw
|
||||
projects from process of compilation in the main menu <b>Build / Configuration Manager</b>.
|
||||
|
||||
To start DRAW, launch *draw.bat*.
|
||||
|
@@ -1,71 +1,70 @@
|
||||
Building with Xcode {#occt_dev_guides__building_xcode}
|
||||
===================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source package
|
||||
on Mac OS X with Xcode.
|
||||
This file describes steps to build OCCT libraries from a complete source package
|
||||
on Mac OS X with **Xcode**.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
If you build OCCT from bare sources (as in Git repository) or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See \ref occt_dev_guides__building_wok for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
Before building OCCT, you need to install the required third-party libraries; see
|
||||
paragraph 1 of \ref occt_dev_guides__building for details.
|
||||
|
||||
1. Add paths to the mandatory 3rd-party products (Tcl/Tk and FreeType)
|
||||
in file custom.sh located in \<OCCT_ROOT_DIR\>. For this:
|
||||
1. Add paths to the mandatory 3rd-party products (**Tcl/Tk** and **FreeType**)
|
||||
in file *custom.sh* located in <i>\<OCCT_ROOT_DIR\> </i>. For this:
|
||||
|
||||
1.1. Add paths to the includes in variable "CSF_OPT_INC";
|
||||
1.1. Add paths to the includes in variable *CSF_OPT_INC*;
|
||||
|
||||
1.2. Add paths to the binary libraries in variable "CSF_OPT_LIB64";
|
||||
1.2. Add paths to the binary libraries in variable *CSF_OPT_LIB64*;
|
||||
|
||||
All paths should be separated by ":" symbol.
|
||||
|
||||
2. Add paths to the optional 3rd-party libraries (TBB, gl2ps and FreeImage)
|
||||
in the aforementioned environment variables "CSF_OPT_INC" and
|
||||
"CSF_OPT_LIB64" from file custom.sh.
|
||||
2. Add paths to the optional 3rd-party libraries (**TBB, gl2ps** and **FreeImage**)
|
||||
in the aforementioned environment variables *CSF_OPT_INC* and *CSF_OPT_LIB64* from file *custom.sh*.
|
||||
|
||||
If you want to build OCCT without the optional libraries perform the
|
||||
following steps:
|
||||
|
||||
2.1 Disable unnecessary library in custom.sh by setting the corresponding
|
||||
variable HAVE_<LIBRARY_NAME> to "false".
|
||||
If you want to build OCCT without the optional libraries perform the following steps:
|
||||
|
||||
2.1 Disable unnecessary library in *custom.sh* by setting the corresponding
|
||||
variable <i>HAVE_<LIBRARY_NAME></i> to *false*.
|
||||
~~~~~
|
||||
export HAVE_GL2PS=false
|
||||
|
||||
~~~~~
|
||||
2.2 Remove this library from Project navigator in Xcode for each project that
|
||||
uses it: choose the required project, right click on the unnecessary
|
||||
library and select "Delete" button.
|
||||
library and select **Delete** button.
|
||||
|
||||
3. Open Terminal application.
|
||||
|
||||
4. Enter \<OCCT_ROOT_DIR\>:
|
||||
|
||||
4. Enter <i>\<OCCT_ROOT_DIR\></i>:
|
||||
~~~~~
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
~~~~~
|
||||
5. To start **Xcode**, run command <i>/xcode.sh</i>
|
||||
|
||||
5. To start Xcode, run the command /xcode.sh
|
||||
6. To build a certain toolkit, select it in **Scheme** drop-down list in Xcode
|
||||
toolbar, press **Product** in the menu and click **Build** button.
|
||||
|
||||
6. To build a certain toolkit, select it in "Scheme" drop-down list in Xcode
|
||||
toolbar, press "Product" in the menu and click "Build" button.
|
||||
|
||||
To build the entire OCCT, create a new empty project (select "File ->
|
||||
New -> Project -> "Empty project" in the menu. Input the project name,
|
||||
e.g. "OCCT", click "Next" and "Create" buttons). Drag and drop the "OCCT"
|
||||
folder in the created "OCCT" project in the Project navigator. Select
|
||||
"File -> New -> Target -> Aggregate" in the menu. Enter the project name
|
||||
(e.g. "OCCT") and click "Finish". The "Build Phases" tab will open.
|
||||
To build the entire OCCT, create a new empty project (select **File ->
|
||||
New -> Project -> "Empty project** in the menu. Input the project name,
|
||||
e.g. *OCCT*, click **Next** and **Create** buttons). Drag and drop the *OCCT*
|
||||
folder in the created *OCCT* project in the Project navigator. Select
|
||||
**File -> New -> Target -> Aggregate** in the menu. Enter the project name
|
||||
(e.g. <i>OCCT</i>) and click **Finish**. The **Build Phases** tab will open.
|
||||
Click "+" button to add the necessary toolkits to the target project.
|
||||
It is possible to select all toolkits by pressing "Command+A" combination.
|
||||
It is possible to select all toolkits by pressing **Command+A** combination.
|
||||
|
||||
To start DRAWEXE, which has been built with Xcode on Mac OS X, perform the following steps:
|
||||
To start *DRAWEXE*, which has been built with Xcode on Mac OS X, perform the following steps:
|
||||
|
||||
1. Open Terminal application
|
||||
|
||||
2. Enter \<OCCT_ROOT_DIR\>:
|
||||
1.Open Terminal application
|
||||
|
||||
2.Enter <i>\<OCCT_ROOT_DIR\></i>:
|
||||
~~~~~
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
~~~~~
|
||||
|
||||
3. Run script
|
||||
|
||||
3.Run the script
|
||||
~~~~~
|
||||
./draw_cbp.sh xcd [d]
|
||||
|
||||
Option "d" is used if OCCT has been built in Debug mode.
|
||||
~~~~~
|
||||
Option *d* is used if OCCT has been built in **Debug** mode.
|
||||
|
@@ -296,19 +296,19 @@ Each descriptive block should contain at least a function name and purpose descr
|
||||
See the following example:
|
||||
|
||||
~~~~~{.cpp}
|
||||
// ----------------------------------------------
|
||||
// =======================================================================
|
||||
// function : TellMeSmthGood
|
||||
// purpose : Gives me good news
|
||||
// ----------------------------------------------
|
||||
// =======================================================================
|
||||
void TellMeSmthGood()
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
// ----------------------------------------------
|
||||
// =======================================================================
|
||||
// function : TellMeSmthBad
|
||||
// purpose : Gives me bad news
|
||||
// ----------------------------------------------
|
||||
// =======================================================================
|
||||
void TellMeSmthBad()
|
||||
{
|
||||
...
|
||||
@@ -556,6 +556,41 @@ If a class has a destructor, an assignment operator or a copy constructor, it us
|
||||
|
||||
A class with virtual function(s) ought to have a virtual destructor.
|
||||
|
||||
### Overriding virtual methods
|
||||
|
||||
Declaration of overriding method should contains specifiers "virtual" and "override"
|
||||
(using Standard_OVERRIDE alias for compatibility with old compilers).
|
||||
|
||||
~~~~~{.cpp}
|
||||
class MyPackage_BaseClass
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Perform();
|
||||
|
||||
};
|
||||
|
||||
~~~~~{.cpp}
|
||||
class MyPackage_MyClass : public MyPackage_BaseClass
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Perform() Standard_OVERRIDE;
|
||||
|
||||
};
|
||||
~~~~~
|
||||
|
||||
This makes class definition more clear (virtual methods become highlighted).
|
||||
|
||||
Declaration of interface using pure virtual functions protects against
|
||||
incomplete inheritance at first level, but does not help when method is overridden multiple times within nested inheritance
|
||||
or when method in base class is intended to be optional.
|
||||
|
||||
And here "override" specifier introduces additional protection against situations when interface changes might be missed
|
||||
(class might contain old methods which will be never called).
|
||||
|
||||
### Default parameter value
|
||||
|
||||
Do not redefine a default parameter value in an inherited function.
|
||||
|
@@ -3,6 +3,26 @@ Debugging tools and hints {#occt_dev_guides__debug}
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section occt_debug_macro Compiler macro to enable extended debug messages
|
||||
|
||||
Many OCCT algorithms can produce extended debug messages, usually printed to cout.
|
||||
These include messages on internal errors and special cases encountered, timing etc.
|
||||
In OCCT versions prior to 6.8.0 most of these messages were activated by compiler macro *DEB*, enabled by default in debug builds.
|
||||
Since version 6.8.0 this is disabled by default but can be enabled by defining compiler macro *OCCT_DEBUG*.
|
||||
|
||||
To enable this macro on Windows when building with Visual Studio projects, edit file custom.bat and add the line:
|
||||
|
||||
set CSF_DEFINES=OCCT_DEBUG
|
||||
|
||||
Some algorithms use specific macros for yet more verbose messages, usually started with OCCT_DEBUG_.
|
||||
These messages can be enabled in the same way, by defining corresponding macro.
|
||||
|
||||
Note that some header files are modified when *OCCT_DEBUG* is enabled, hence binaries built with it enabled are not compatible with client code built without this option; this is not intended for production use.
|
||||
|
||||
@section occt_debug_exceptions Calling JIT debugger on exception
|
||||
|
||||
On Windows platform when using Visual Studio compiler there is a possibility to start the debugger automatically if an exception is caught in a program running OCCT. For this, set environment variable *CSF_DEBUG* to any value. Note that this feature works only if you enable OCCT exception handler in your application by calling *OSD::SetSignal()*.
|
||||
|
||||
@section occt_debug_intro Introduction
|
||||
|
||||
This manual describes facilities included in OCCT to support debugging, and provides some hints for more efficient debug.
|
||||
@@ -15,10 +35,6 @@ This feature can be activated by defining environment variable *CSF_DEBUG_BOP*,
|
||||
|
||||
The diagnostic code checks validity of the input arguments and the result of each Boolean operation. When an invalid situation is detected, the report consisting of argument shapes and a DRAW script to reproduce the problematic operation is saved to the directory pointed by *CSF_DEBUG_BOP*.
|
||||
|
||||
@section occt_debug_exceptions Calling JIT debugger on exception
|
||||
|
||||
On Windows platform when using Visual Studio compiler there is a possibility to start the debugger automatically if an exception is caught in a program running OCCT. For this, set environment variable *CSF_DEBUG* to any value. Note that this feature works only if you enable OCCT exception handler in your application by calling *OSD::SetSignal()*.
|
||||
|
||||
@section occt_debug_call Functions for calling from debugger
|
||||
|
||||
Modern interactive debuggers provide the possibility to execute application code at a program break point. This feature can be used to analyse the temporary objects available only in the context of the debugged code. OCCT provides several global functions that can be used in this way.
|
||||
@@ -80,6 +96,16 @@ const char* BRepTools_DumpLoc (void* theShapePtr)
|
||||
Dumps shape or its location to cout.
|
||||
- *theShapePtr* - a pointer to *TopoDS_Shape* variable.
|
||||
|
||||
The following function is provided by *TKMesh* toolkit:
|
||||
|
||||
~~~~~
|
||||
const char* BRepMesh_Dump (void* theMeshHandlePtr, const char* theFileNameStr)
|
||||
~~~~~
|
||||
|
||||
Stores mesh produced in parametric space to BREP file.
|
||||
- *theMeshHandlePtr* - a pointer to *Handle(BRepMesh_DataStructureOfDelaun)* variable.
|
||||
- *theFileNameStr* - name of file the mesh sould be stored to.
|
||||
|
||||
The following additional function is provided by *TKGeomBase* toolkit:
|
||||
|
||||
~~~~~
|
||||
@@ -114,11 +140,13 @@ For convenience it is possible to define aliases to commands in this window, for
|
||||
~~~~~
|
||||
>alias deval ? ({,,TKDraw}Draw_Eval)
|
||||
>alias dsetshape ? ({,,TKDraw}DBRep_Set)
|
||||
>alias dsetgeom ? ({,,TKDraw}DrawTrSurf_SetPnt)
|
||||
>alias dsetgeom ? ({,,TKDraw}DrawTrSurf_Set)
|
||||
>alias dsetpnt ? ({,,TKDraw}DrawTrSurf_SetPnt)
|
||||
>alias dsetpnt2d ? ({,,TKDraw}DrawTrSurf_SetPnt2d)
|
||||
>alias saveshape ? ({,,TKBRep}BRepTools_Write)
|
||||
>alias dumpshape ? ({,,TKBRep}BRepTools_Dump)
|
||||
>alias dumploc ? ({,,TKBRep}BRepTools_DumpLoc)
|
||||
>alias dumpmesh ? ({,,TKMesh}BRepMesh_Dump)
|
||||
>alias dumpgeom ? ({,,TKGeomBase}GeomTools_Dump)
|
||||
~~~~~
|
||||
|
||||
|
@@ -396,7 +396,7 @@ In TortoiseGit:
|
||||
@image latex OCCT_GitGuide_V2_image014.png
|
||||
|
||||
Unstaged files will be shown if you check the option ‘Show Unversioned Files’.
|
||||
Double-clock on each modified file to see the changes to be committed (as a difference vs. the base version).
|
||||
Double-click on each modified file to see the changes to be committed (as a difference vs. the base version).
|
||||
|
||||
@subsection occt_gitguide_4_6 Pushing branch to the remote repository
|
||||
|
||||
|
@@ -56,7 +56,7 @@ return ;# this is to avoid an echo of the last command above in cout
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Note that variable *CSF_TestDataPath* is set to default value at DRAW start, pointing at the folder <i>$CASROOT/data</i>.
|
||||
In this example, subdirectory <i>d:/occt/test-data</i> is added to this path. Similar code could be used on Linux and Mac OS X except that on non-Windows platforms colon ‘:’ should be used as path separator instead of semicolon ‘;’.
|
||||
In this example, subdirectory <i>d:/occt/test-data</i> is added to this path. Similar code could be used on Linux and Mac OS X except that on non-Windows platforms colon ":" should be used as path separator instead of semicolon ";".
|
||||
|
||||
All tests are run from DRAW command prompt (run *draw.tcl* or *draw.sh* to start it).
|
||||
|
||||
@@ -70,12 +70,13 @@ Example:
|
||||
Draw[]> testgrid
|
||||
~~~~~
|
||||
|
||||
For running only a group or a grid of tests, give additional arguments indicating followed by path to the group and (if needed) the grid name.
|
||||
For running only a subset of test cases, give masks for group, grid, and test case names to be executed.
|
||||
Each argument is a list of comma- or space-separated file masks; by default "*" is assumed.
|
||||
|
||||
Example:
|
||||
|
||||
~~~~~
|
||||
Draw[]> testgrid blend simple
|
||||
Draw[]> testgrid bugs caf,moddata*,xde
|
||||
~~~~~
|
||||
|
||||
|
||||
@@ -106,7 +107,7 @@ If necessary, a non-default output directory can be specified using option <i>
|
||||
|
||||
Example:
|
||||
~~~~~
|
||||
Draw[]> testgrid –outdir d:/occt/last_results -overwrite
|
||||
Draw[]> testgrid -outdir d:/occt/last_results -overwrite
|
||||
~~~~~
|
||||
In the output directory, a cumulative HTML report summary.html provides links to reports on each test case. An additional report in JUnit-style XML format can be output for use in Jenkins or other continuous integration system.
|
||||
|
||||
@@ -117,18 +118,20 @@ For example:
|
||||
~~~~~
|
||||
Draw[3]> help testgrid
|
||||
testgrid: Run all tests, or specified group, or one grid
|
||||
Use: testgrid [group [grid]] [options...]
|
||||
Use: testgrid [groupmask [gridmask [casemask]]] [options...]
|
||||
Allowed options are:
|
||||
-parallel N: run N parallel processes (default is number of CPUs, 0 to disable)
|
||||
-refresh N: save summary logs every N seconds (default 60, minimal 1, 0 to disable)
|
||||
-outdir dirname: set log directory (should be empty or non-existing)
|
||||
-overwrite: force writing logs in existing non-empty directory
|
||||
-xml filename: write XML report for Jenkins (in JUnit-like format)
|
||||
Groups, grids, and test cases to be executed can be specified by list of file
|
||||
masks, separated by spaces or comma; default is all (*).
|
||||
~~~~~
|
||||
|
||||
@subsubsection testmanual_1_3_3 Running a Single Test
|
||||
|
||||
To run a single test, type command *test*’ followed by names of group, grid, and test case.
|
||||
To run a single test, type command *test* followed by names of group, grid, and test case.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -147,7 +150,7 @@ To see intermediate commands and their output during the test execution, add one
|
||||
|
||||
The detailed rules of creation of new tests are given in <a href="#testmanual_3">section 3</a>. The following short description covers the most typical situations:
|
||||
|
||||
Use prefix “bug” followed by Mantis issue ID and, if necessary, additional suffixes, for naming the test script and DRAW commands specific for this test case.
|
||||
Use prefix "bug" followed by Mantis issue ID and, if necessary, additional suffixes, for naming the test script and DRAW commands specific for this test case.
|
||||
|
||||
1. If the test requires C++ code, add it as new DRAW command(s) in one of files in *QABugs* package. Note that this package defines macros *QVERIFY* and *QCOMPARE*, thus code created for QTest or GoogleTest frameworks can be used with minimal modifications.
|
||||
2. Add script(s) for the test case in grid (subfolder) corresponding to the relevant OCCT module of the group bugs <i>($CASROOT/tests/bugs)</i>. See <a href="#testmanual_5_2">the correspondence map</a>.
|
||||
@@ -156,7 +159,7 @@ Use prefix “bug” followed by Mantis issue ID and, if necessary, additional s
|
||||
* Use command *locate_data_file* to get a path to data files used by test script. (Make sure to have this command not inside catch statement if it is used.)
|
||||
* Use DRAW commands to reproduce the situation being tested.
|
||||
* If test case is added to describe existing problem and the fix is not available, add TODO message for each error to mark it as known problem. The TODO statements must be specific so as to match the actually generated messages but not all similar errors.
|
||||
* Make sure that in case of failure the test produces message containing word “Error” or other recognized by test system as error (see files parse.rules).
|
||||
* Make sure that in case of failure the test produces message containing word "Error" or other recognized by test system as error (see files parse.rules).
|
||||
4. If the test case uses data file(s) not yet present in the test database, these can be put to subfolder data of the test grid, and integrated to Git along with the test case.
|
||||
5. Check that the test case runs as expected (test for fix: OK with the fix, FAILED without the fix; test for existing problem: BAD), and integrate to Git branch created for the issue.
|
||||
|
||||
@@ -617,7 +620,8 @@ return ;# this is to avoid an echo of the last command above in cout
|
||||
|
||||
For better efficiency, on computers with multiple CPUs the tests can be run in parallel mode. This is default behavior for command *testgrid* : the tests are executed in parallel processes (their number is equal to the number of CPUs available on the system). In order to change this behavior, use option parallel followed by the number of processes to be used (1 or 0 to run sequentially).
|
||||
|
||||
Note that the parallel execution is only possible if Tcl extension package *Thread* is installed. It is included in *ActiveTcl* package, but can be absent in some Linux distributions. If this package is not available, *testgrid* command will output a warning message.
|
||||
Note that the parallel execution is only possible if Tcl extension package *Thread* is installed.
|
||||
If this package is not available, *testgrid* command will output a warning message.
|
||||
|
||||
@subsection testmanual_4_4 Checking non-regression of performance, memory, and visualization
|
||||
|
||||
@@ -943,7 +947,7 @@ This group allows testing extended data exchange packages.
|
||||
| Data Exchange | TKSTEPBase, TKSTEPAttr, TKSTEP209, TKSTEP | step |
|
||||
| Data Exchange | TKSTL, TKVRML | stlvrml |
|
||||
| Data Exchange | TKXSBase, TKXCAF, TKXCAFSchema, TKXDEIGES, TKXDESTEP, TKXmlXCAF, TKBinXCAF | xde |
|
||||
| Foundation Classes | TKernel, TKMath, TKAdvTools | fclasses |
|
||||
| Foundation Classes | TKernel, TKMath | fclasses |
|
||||
| Modeling_algorithms | TKGeomAlgo, TKTopAlgo, TKPrim, TKBO, TKBool, TKHLR, TKFillet, TKOffset, TKFeat, TKXMesh | modalg |
|
||||
| Modeling Data | TKG2d, TKG3d, TKGeomBase, TKBRep | moddata |
|
||||
| Visualization | TKService, TKV2d, TKV3d, TKOpenGl, TKMeshVS, TKNIS, TKVoxel | vis |
|
||||
|
@@ -2982,8 +2982,7 @@ As a simple textual language, tcl is intended primarily for issuing commands to
|
||||
|
||||
As a library package, tcl can be embedded in application programs. The tcl library consists of a parser for the cl language, routines to implement the tcl builtin commands, and procedures that allow each application to extend tcl with additional commands specific to that application. The application program generates tcl commands and passes them to the tcl parser for execution. Commands may be generated by reading characters from an input source, or by associating command strings with elements of the application's user interface, such as menu entries, buttons, or keystrokes.
|
||||
|
||||
For Linux platform it is possible to download Tcltk 8.5 or 8.6 from http://www.tcl.tk/software/tcltk/8.6.html
|
||||
For Windows platforn it is possible to download ActiveTcl 8.5 or 8.6 from http://www.activestate.com/activetcl/downloads
|
||||
Download Tcltk 8.5 or 8.6 from http://www.tcl.tk/software/tcltk/8.6.html
|
||||
|
||||
A help application, tclhelp, is also provided with tcl and can be activated by command *tclhelp*.
|
||||
|
||||
|
@@ -1,616 +0,0 @@
|
||||
Overview {#mainpage}
|
||||
========
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section OCCT_OVW_SECTION_1 Welcome
|
||||
|
||||
Welcome to Open CASCADE Technology (OCCT), a software development platform
|
||||
providing services for 3D surface and solid modeling, CAD data exchange, and
|
||||
visualization. Most of OCCT functionality is available in the form of C++
|
||||
libraries. OCCT can be best applied in development of software dealing with 3D
|
||||
modeling (CAD), manufacturing / measuring (CAM) or numerical simulation (CAE).
|
||||
|
||||
@htmlonly<center>@endhtmlonly
|
||||
http://www.opencascade.org
|
||||
@image html /resources/occt_logo.png
|
||||
@image latex /resources/occt_logo.png
|
||||
@htmlonly</center>@endhtmlonly
|
||||
|
||||
@section OCCT_OVW_SECTION_2 Copyrights
|
||||
|
||||
Open CASCADE Technology and all materials, including this documentation, is
|
||||
Copyright (c) 1999-2013 by OPEN CASCADE S.A.S. All rights reserved.
|
||||
|
||||
@htmlonly<center>@endhtmlonly
|
||||
http://www.opencascade.com
|
||||
@image html /resources/occ_logo.png
|
||||
@image latex /resources/occ_logo.png
|
||||
@htmlonly</center>@endhtmlonly
|
||||
|
||||
License
|
||||
--------
|
||||
|
||||
Open CASCADE Technology is free software; you can redistribute it and / or
|
||||
modify it under the terms of the
|
||||
@ref license_lgpl_21 "GNU Lesser General Public License (LGPL) version 2.1",
|
||||
with additional @ref occt_lgpl_exception "exception".
|
||||
|
||||
Alternatively, Open CASCADE Technology may be used under the terms of Open
|
||||
CASCADE commercial license or contractual agreement.
|
||||
|
||||
Note that Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT
|
||||
WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and
|
||||
materials is on you. See the @ref occt_public_license "license" text for formal
|
||||
disclaimer.
|
||||
|
||||
Trademark information
|
||||
----------------------
|
||||
|
||||
You are hereby informed that all software is a property of its respective authors and is protected by
|
||||
international and domestic laws on intellectual property and trademarks.
|
||||
Should you need further information, please directly contact the authors.
|
||||
|
||||
**CAS.CADE** and **Open CASCADE** are registered trademarks of
|
||||
OPEN CASCADE S.A.S.
|
||||
|
||||
**Linux** is a registered trademark of Linus Torvalds.
|
||||
|
||||
**Windows** is a registered trademark of Microsoft Corporation in the United States and other countries.
|
||||
|
||||
**Mac** and the Mac logo, **OpenCL** and the OpenCL logo, are trademarks of
|
||||
Apple Inc., registered in the U.S. and other countries.
|
||||
|
||||
Acknowledgements
|
||||
------------------
|
||||
|
||||
The following parties are acknowledged for producing tools which are used within
|
||||
Open CASCADE Technology libraries or for release preparation.
|
||||
|
||||
You are hereby informed that all rights to the software listed below belong to its respective
|
||||
authors and such software may not be freely available and/or be free of charge for any kind
|
||||
of use or purpose. We strongly recommend that you carefully read the license of these products
|
||||
and, in case you need any further information, directly contact their authors.
|
||||
|
||||
**Qt** is a cross-platform application framework that is widely used for developing application software
|
||||
with graphical user interface (GUI). Qt is free and open source software distributed under
|
||||
the terms of the GNU Lesser General Public License. In OCCT Qt is used for programming samples.
|
||||
If you need further information on Qt, please, refer to Qt Homepage (http://qt.digia.com).
|
||||
|
||||
**Tcl** is a high-level programming language. Tk is a graphical user interface (GUI) toolkit,
|
||||
with buttons, menus, listboxes, scrollbars, and so on. Taken together Tcl and Tk provide a solution
|
||||
to develop cross-platform graphical user interfaces with a native look and feel. Tcl/Tk is under copyright by
|
||||
Scriptics Corp., Sun Microsystems, and other companies. However, Tcl/Tk is an open source, and
|
||||
the copyright allows you to use, modify, and redistribute Tcl/Tk for any purpose, without an
|
||||
explicit license agreement and without paying any license fees or royalties.
|
||||
To use Tcl/Tk, please refer to the Licensing Terms (http://www.tcl.tk/software/tcltk/license.html).
|
||||
|
||||
**Robert Boehne** has developed **GNU Autoconf**, **Automake** and **Libtool** scripts and makefiles
|
||||
for the Open CASCADE project http://sourceforge.net/projects/autoopencas/,
|
||||
which became an initial groundwork for the build scripts based on respective GNU tools
|
||||
(autoconf, automake and libtool) in Open CASCADE Technology version 4.0.
|
||||
These scripts are now maintained by the OPEN CASCADE company.
|
||||
|
||||
**GL2PS** is developed by Christophe Geuzaine and others. It is optionally used by OCCT to
|
||||
export content of OpenGL scene to vector graphics formats (PS, PDF, EMF, SVG).
|
||||
The library is licensed under GL2PS LICENSE http://www.geuz.org/gl2ps/COPYING.GL2PS Version 2, November 2003.
|
||||
|
||||
**FreeType 2** is developed by Antoine Leca, David Turner, Werner Lemberg and others.
|
||||
It is a software font engine that is designed to be small, efficient, highly customizable and
|
||||
portable while capable of producing high-quality output (glyph images). This product
|
||||
can be used in graphic libraries, display servers, font conversion tools,
|
||||
text image generation tools, and many other products.
|
||||
|
||||
FreeType 2 is released under two open-source licenses: BSD-like FreeType License and the GPL.
|
||||
|
||||
**Intel(R) Threading Building Blocks (TBB)** offers a rich and complete approach to expressing parallelism in a C++ program.
|
||||
It is a library that helps you to take advantage of multi-core processor performance without having to be a threading expert.
|
||||
Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that
|
||||
abstracts platform details and threading mechanisms for scalability and performance.
|
||||
TBB is available under GPLv2 license with the runtime exception.
|
||||
|
||||
Open CASCADE Technology WOK module on Windows also makes use of LGPL-licensed C routines **regexp**
|
||||
and **getopt**, taken from GNU C library.
|
||||
|
||||
**OpenGL** is an industry standard API for 3D graphics used by OCCT for
|
||||
implementation of 3D viewer. OpenGL specification is developed by the
|
||||
Khronos group, http://www.khronos.org/opengl/. OCCT code includes header
|
||||
file *glext.h* obtained from Khronos web site.
|
||||
|
||||
**OpenCL** (Open Computing Language) is open, royalty-free standard for
|
||||
cross-platform, parallel programming of modern processors, optionally used by
|
||||
OCCT for ray tracing. OpenCL specification is developed by the
|
||||
Khronos group, http://www.khronos.org/opencl/. The implementations of OpenCL
|
||||
are available from Apple, AMD, NVIDIA, Intel, and other vendors.
|
||||
**OpenCL Installable Client Driver (ICD) Loader** is a library provided by
|
||||
Khronos group which allows dispatching OpenCL calls to underlying
|
||||
implementation.
|
||||
|
||||
**Doxygen** developed by Dimitri van Heesch is open source documentation system for
|
||||
C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology
|
||||
for automatic creation of Technical Documentation from C++ header files.
|
||||
If you need further information on Doxygen, please refer to http://www.stack.nl/~dimitri/doxygen/index.html.
|
||||
|
||||
**Graphviz** is open source graph visualization software developed by John Ellson, Emden Gansner, Yifan Hu and Arif Bilgin.
|
||||
Graph visualization is representiation of structured information as diagrams of abstract graphs and networks.
|
||||
This product is used together with Doxygen in Open CASCADE Technology for automatic creation of Technical Documentation
|
||||
(generation of dependency graphs). Current versions of Graphviz are licensed on an open source
|
||||
basis under The Eclipse Public License (EPL) (http://www.graphviz.org/License.php).
|
||||
|
||||
**Inno Setup** is a free script-driven installation system created in CodeGear Delphi by Jordan Russell.
|
||||
In OCCT Inno Setup is used to create Installation Wizard on Windows.
|
||||
It is licensed under Inno Setup License (http://www.jrsoftware.org/files/is/license.txt).
|
||||
|
||||
**FreeImage** is an Open Source library supporting popular graphics image formats, such as PNG, BMP, JPEG, TIFF,
|
||||
and others used by multimedia applications. This library is developed by Hervé Drolon and Floris van den Berg.
|
||||
FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit or 64-bit versions of Windows,
|
||||
and cross-platform (works both with Linux and Mac OS X). FreeImage is optionally used by OCCT to work
|
||||
with images, on conditions of the FreeImage Public License (FIPL) (http://freeimage.sourceforge.net/freeimage-license.txt).
|
||||
|
||||
**MikTEX** is up-to-date implementation of TeX/LaTeX and related programs for Windows. It is used
|
||||
for generation of User and Developer Guides in PDF format. See http://miktex.org for information
|
||||
on this tool.
|
||||
|
||||
Adobe Systems, Inc. provides **Adobe Reader**, which can be used to view files in Portable Document Format (PDF).
|
||||
|
||||
@section OCCT_OVW_SECTION_3 Documentation
|
||||
|
||||
OCCT documentation is provided in several forms:
|
||||
|
||||
- This overview provides general description of OCCT structure, functionality, modules, and features.
|
||||
It is available in HTML format (generated by Doxygen) and includes User and Developer Guides.
|
||||
The sources of this documentation are contained in **dox** subdirectory of OCCT sources
|
||||
(plain text format is used, with mixed MarkDown / Doxygen syntax mark-up).
|
||||
|
||||
- User and Developer Guides describing in details OCCT modules and development tools are also available in
|
||||
Adobe Portable Document Format (PDF). To read this format, you need Adobe Acrobat Reader,
|
||||
which is a freeware and can be downloaded from the Adobe site.
|
||||
|
||||
- Full reference documentation covering all OCCT classes generated automatically by Doxygen
|
||||
software is provided in HTML format, in a separate package.
|
||||
Reference documentation is presented in **Modules --> Toolkits --> Packages --> Classes**
|
||||
logic structure with cross-references to all OCCT classes and complete in-browser search by all classes.
|
||||
|
||||
See @ref occt_dev_guides__documentation "OCCT Documentation Guide" for details on OCCT documentation system.
|
||||
|
||||
**Generation of HTML documentation**
|
||||
|
||||
To generate HTML documentation from sources contained in *dox* subdirectory,
|
||||
you need to have Tcl and Doxygen 1.8.4 (or above) installed on your system.
|
||||
|
||||
In Tcl prompt, cd to OCCT root folder and run
|
||||
|
||||
tclsh> source dox/start.tcl
|
||||
|
||||
On Windows you can also run batch script **gendoc.bat**.
|
||||
|
||||
|
||||
**Generation of reference documentation**
|
||||
|
||||
Reference documentation can be generated with help of WOK tool that
|
||||
is available for download from www.opencascade.org and dev.opencascade.org sites.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
* Doxygen version 1.8.4 or higher
|
||||
* Graphviz version 2.28.0 or higher
|
||||
|
||||
Run WOK (cd \<WOK_INSTALL_DIR\>/site folder):
|
||||
|
||||
* Using WOK TCL shell:
|
||||
> wok_tclsh.sh
|
||||
|
||||
* Using Emacs editor:
|
||||
> wok_emacs.sh
|
||||
|
||||
In the WOK prompt, step into your workbench:
|
||||
|
||||
> wokcd <your workbench>
|
||||
|
||||
In your workbench, use **wgendoc** command with –h argument to get information about arguments of **wgendoc** command:
|
||||
|
||||
> wgendoc -h
|
||||
|
||||
then run **wgendoc** command with required arguments, for instance:
|
||||
|
||||
> wgendoc -output=d:/occt/doc {-m=Draw Visualization}
|
||||
|
||||
@section OCCT_OVW_SECTION_5 Requirements
|
||||
|
||||
Open CASCADE Technology is designed to be highly portable and is known to
|
||||
work on wide range of platforms (UNIX, Linux, Windows, Mac OS X).
|
||||
Current version is officially certified on Windows (IA-32 and x86-64),
|
||||
Linux (x86-64) and MAC OS X (x86-64) platforms.
|
||||
|
||||
The tables below describe the recommended hardware and software configurations
|
||||
for which OCCT is certified to work.
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_1 Linux
|
||||
|
||||
| Operating System | Mandriva 2010, CentOS 5.5, CentOS 6.3, Fedora 17, Fedora 18, Ubuntu-1304, Debian 6.0\* |
|
||||
| ----- | ----- |
|
||||
| Minimum memory | 512 MB, 1 GB recommended |
|
||||
| Free disk space (complete installation) | 600 MB approx. |
|
||||
| Video card | See \ref overview_req_graphics |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 2.1+ is recommended)|
|
||||
| C++ | GNU gcc 4.0. - 4.7.3. |
|
||||
| TCL (for testing tools) | Tcltk 8.5 or 8.6 http://www.tcl.tk/software/tcltk/8.6.html |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.nokia.com/downloads |
|
||||
| Freetype (for text rendering) | freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.15.4 http://sourceforge.net/projects/freeimage/files |
|
||||
| gl2ps (optional, for export contents of OCCT viewer to vector graphic files) | gl2ps-1.3.8 http://geuz.org/gl2ps/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 3.x or 4.x http://www.threadingbuildingblocks.org/ |
|
||||
| OpenCL (optional, for ray tracing visualization) | OpenCL SDK (usually one provided by vendor of your graphic card) or OpenCL ICD Loader by Khronos group, http://www.khronos.org/registry/cl |
|
||||
|
||||
* Debian 60 64 bit is a platform used for regular testing of contributions
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_2 Windows
|
||||
|
||||
| Operating System | Windows 8 / 7 SP1 / Vista SP2 / XP SP3 |
|
||||
| ----- | ----- |
|
||||
| Minimum memory | 512 MB, 1 GB recommended |
|
||||
| Free disk space (complete installation) | 600 MB approx. |
|
||||
| Video card | See \ref overview_req_graphics |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 2.1+ is recommended)|
|
||||
| C++ | Microsoft Visual Studio: 2005 SP1, 2008 SP1\*, 2010 SP1, 2012 Update 3, 2013 <br>Intel C++ Composer XE 2013 SP1 |
|
||||
| TCL (for testing tools) | ActiveTcl 8.5 or 8.6 http://www.activestate.com/activetcl/downloads |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.nokia.com/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats) | FreeImage 3.15.4 http://sourceforge.net/projects/freeimage/files |
|
||||
| gl2ps (Export contents of OCCT viewer to vector graphic file) | gl2ps-1.3.8 http://geuz.org/gl2ps/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 3.x or 4.x http://www.threadingbuildingblocks.org/ |
|
||||
| OpenCL (optional, for ray tracing visualization) | OpenCL SDK (usually one provided by vendor of your graphic card) or OpenCL ICD Loader by Khronos group, http://www.khronos.org/registry/cl |
|
||||
|
||||
* VC++ 9 32-bit is used for certification of contributions and for building
|
||||
binary package of official release of OCCT on Windows.
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_3 MAC OS X
|
||||
|
||||
| Operating System | Mac OS X 10.9 Mavericks / 10.8 Mountain Lion / 10.7 Lion / 10.6.8 Snow Leopard |
|
||||
| ----- | ----- |
|
||||
| Minimum memory | 512 MB, 1 GB recommended |
|
||||
| Free disk space (complete installation) | 600 MB approx. |
|
||||
| Video card | See \ref overview_req_graphics |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 2.1+ is recommended)|
|
||||
| C++ | XCode 3.2 or newer (4.x is recommended) |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.nokia.com/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats) | FreeImage 3.15.4 http://sourceforge.net/projects/freeimage/files |
|
||||
| gl2ps (Export contents of OCCT viewer to vector graphic file) | gl2ps-1.3.8 http://geuz.org/gl2ps/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 3.x or 4.x http://www.threadingbuildingblocks.org/ |
|
||||
| OpenCL (optional, for ray tracing visualization) | Native OpenCL 1.2.8 |
|
||||
|
||||
@subsection overview_req_graphics Graphic cards
|
||||
|
||||
For 3d viewer, graphic card or software implementation supporting OpenGL 1.1
|
||||
or above is required. OpenGL 2.1+ is highly recommended.
|
||||
For ray tracing, hardware implementation of OpenCL 1.1+ is required.
|
||||
|
||||
The following table lists graphic cards tested to work with OCCT.
|
||||
|
||||
| Graphic card | Driver/GL/GLSL/CL version | OS | OpenGL (fixed pipeline) | OpenGL (shaders) | OpenCL (ray tracing) |
|
||||
| ---- | ---- | ---- | :----: | :----: | :----: |
|
||||
| NVIDIA GeForce GT 610, 630M, 640 | Driver 311.44, GL 4.3.0, GLSL 4.30 | Windows 7 64 bit | OK | OK | OK |
|
||||
| Intel(R) HD Graphics 3000 | GL 3.1.0, GLSL 1.40 | Windows 7 64 bit | OK | OK | none |
|
||||
| RadeOn 9600 | GL 2.1.8454, GLSL 1.20 | | OK | bad | none |
|
||||
| AMD/ATI RadeOn HD 7870 | Driver 6.14.10.12002, GL 4.2.12002, GLSL 4.20 | Windows 7 64-bit | OK | OK | OK |
|
||||
| Mesa 7.8.2 Windows GDI Driver\* | GL 2.1, GLSL version 1.20 | Mac OS X 10.6 / OS X 10.9 | OK | artifacts | none |
|
||||
| NVIDIA GeForce 320 | | Mac OS X 10.6 / OS X 10.9 | OK | OK | OK on OSX 10.6, bad on OSX 10.9 |
|
||||
| NVIDIA GeForce 6600 GT | GL 2.1.2, GLSL 1.20 | Windows XP 32-bit | OK | OK | none |
|
||||
| Apple software OpenGL | | Mac OS X 10.6 / OS X 10.9 | OK | OK | OK |
|
||||
|
||||
* Mesa implementation of OpenGL is used for certification testing of OCCT
|
||||
|
||||
@section OCCT_OVW_SECTION_4 Installation
|
||||
|
||||
In most cases you need to rebuild OCCT on your platform (OS, compiler) before
|
||||
using it in your project, to ensure binary compatibility.
|
||||
See @ref occt_dev_guides__building for instructions on
|
||||
building OCCT from sources on supported platforms.
|
||||
|
||||
@subsection OCCT_OVW_SECTION_4_1 Using Windows installer
|
||||
|
||||
On Windows Open CASCADE Technology can be installed with binaries precompiled by
|
||||
Visual C++ 2008 with installation procedure.
|
||||
|
||||
**Recommendation:**
|
||||
|
||||
If you have a previous version of OCCT installed on your station,
|
||||
and you do not plan to use it along with the new version, you might want to uninstall
|
||||
the previous version (using Control Panel, Add/Remove Programs) before
|
||||
the installation of this new version, to avoid possible problems
|
||||
(conflict of system variables, paths, etc).
|
||||
|
||||
**Attention:** For full installation OCCT requires approximately 650 Mb of disk space,
|
||||
but during the installation process you will need 1,2 Gb of free disk space.
|
||||
|
||||
OCCT installation with reference documentation requires 1,4 Gb on disk.
|
||||
|
||||
* Download the OCCT installer from OPEN CASCADE web site using the link. you have been provided
|
||||
* Launch the installer and follow the instructions.
|
||||
|
||||
The includes and binaries of third-party libraries necessary for building and launching
|
||||
OCCT are included into binary distribution (built with Visual C++ 2008).
|
||||
When the installation is complete, you will find the directories for 3rd party products
|
||||
(some might be absent in case of custom installation) and the main **OCCT** directory:
|
||||
|
||||
@image html /overview/images/overview_3rdparty.png
|
||||
@image latex /overview/images/overview_3rdparty.png
|
||||
|
||||
The contents of the OCCT-6.7.0 directory (called further "OCCT root", or $CASROOT) are as follows:
|
||||
|
||||
@image html /overview/images/overview_installation.png "The directory tree"
|
||||
@image latex /overview/images/overview_installation.png "The directory tree"
|
||||
|
||||
* **adm** This folder contains administration files, which allow rebuilding OCCT;
|
||||
* **adm/cmake** This folder contains files of CMake building procedure;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2005, 2008 and 2010, which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionality;
|
||||
* **doc** This folder contains OCCT documentation in HTML and PDF format;
|
||||
* **dox** This folder contains sources of OCCT documentation in plain text (MarkDown) format;
|
||||
* **drv** This folder contains source files generated by WOK (private header files and instantiations of generic classes);
|
||||
* **inc** This folder contains all OCCT header files;
|
||||
* **samples** This folder contains sample applications.
|
||||
* **src** This folder contains OCCT source files. They are organized in folders, one per development unit;
|
||||
* **tests** This folder contains scripts for OCCT testing.
|
||||
* **win32/vc9** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2008;
|
||||
|
||||
@section OCCT_OVW_SECTION_4_2 Environment Variables
|
||||
|
||||
To run any Open CASCADE Technology application you need to set the environment variables.
|
||||
|
||||
### On Windows
|
||||
|
||||
You can define the environment variables with env.bat script located in the
|
||||
$CASROOT folder. This script accepts two arguments to be used:
|
||||
the version of Visual Studio (vc8 - vc12) and the architecture (win32 or win64).
|
||||
|
||||
The additional environment settings necessary for compiling OCCT libraries and samples
|
||||
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
|
||||
You might need to edit this script to correct the paths to third-party libraries
|
||||
if they are installed on your system in a non-default location.
|
||||
|
||||
Script msvc.bat can be used with the same arguments for immediate launch of Visual Studio for (re)compiling OCCT.
|
||||
|
||||
### On Unix
|
||||
|
||||
|
||||
If OCCT was built by Code::Blocks, you can define the environment variables with env_cbp.sh or custom_cbp.sh script.
|
||||
|
||||
If OCCT was built by Automake, you can define the environment variables with env_amk.sh or custom_amk.sh script.
|
||||
|
||||
The scripts are located in the OCCT root folder.
|
||||
|
||||
|
||||
### Description of system variables:
|
||||
|
||||
|
||||
* **CASROOT** is used to define the root directory of Open CASCADE Technology;
|
||||
* **PATH** is required to define the path to OCCT binaries and 3rdparty folder;
|
||||
* **LD_LIBRARY_PATH** is required to define the path to OCCT libraries (on UNIX platforms only);
|
||||
* **MMGT_OPT** (optional) if set to 1, the memory manager performs optimizations as described below; if set to 2,
|
||||
Intel (R) TBB optimized memory manager is used; if 0 (default), every memory block is allocated
|
||||
in C memory heap directly (via malloc() and free() functions).
|
||||
In the latter case, all other options except MMGT_CLEAR and MMGT_REENTRANT are ignored;
|
||||
* **MMGT_CLEAR** (optional) if set to 1 (default), every allocated memory block is cleared by zeros;
|
||||
if set to 0, memory block is returned as it is;
|
||||
* **MMGT_CELLSIZE** (optional) defines the maximal size of blocks allocated in large pools of memory. Default is 200;
|
||||
* **MMGT_NBPAGES** (optional) defines the size of memory chunks allocated for small blocks in pages
|
||||
(operating-system dependent). Default is 10000;
|
||||
* **MMGT_THRESHOLD** (optional) defines the maximal size of blocks that are recycled internally
|
||||
instead of being returned to the heap. Default is 40000;
|
||||
* **MMGT_MMAP** (optional) when set to 1 (default), large memory blocks are allocated using
|
||||
memory mapping functions of the operating system; if set to 0,
|
||||
they will be allocated in the C heap by malloc();
|
||||
* **CSF_LANGUAGE** is required to define the default language of messages;
|
||||
* **CSF_DEBUG** (optional, Windows only): if defined then a diagnostic message is displayed in case of an exception;
|
||||
* **CSF_DEBUG_BOP** (optional): if defined then it should specify directory where diagnostic data on problems occured in Boolean operations will be saved;
|
||||
* **CSF_MDTVTexturesDirectory** defines the directory for available textures when using texture mapping;
|
||||
* **CSF_ShadersDirectory** defines the directory for GLSL programs (required for advanced rendering techniques and custom shaders);
|
||||
* **CSF_UnitsDefinition** and **CSF_UnitsLexicon** should define paths to resource files Lexi_Expr.dat and Units.dat, respectively, required for support of measurement units;
|
||||
* **CSF_SHMessage** is required in order to define the path to the messages file for *ShapeHealing*;
|
||||
* **CSF_XSMessage** is required in order to define the path to the messages file for **STEP** and **IGES** translators;
|
||||
* **CSF_StandardDefaults** and **CSF_PluginDefaults** are required in order to maintain CASCADE Persistence mechanism to make possible any open/save operations with OCAF documents;
|
||||
* **CSF_StandardLiteDefaults** is required in order to maintain *OCCT Persistence mechanism* to make possible any open/save operations with Lite OCAF documents;
|
||||
* **CSF_XCAFDefaults** any open/save operations for **XDE** documents;
|
||||
* **CSF_IGESDefaults** and **CSF_STEPDefaults** are required for **IGES** and **STEP** translators correspondingly in order to define the path to the resource files;
|
||||
* **CSF_XmlOcafResource** is required in order to set the path to **XSD** resources, which defines XML grammar.
|
||||
* **CSF_MIGRATION_TYPES** is required in order to read documents that contain old data types, such as *TDataStd_Shape*;
|
||||
* **TCLLIBPATH**, **TCL_LIBRARY**, **TK_LIBRARY** and **TIX_LIBRARY** are required to allow work with **DRAW** and **WOK**.
|
||||
|
||||
@section OCCT_OVW_SECTION_7 Getting Started
|
||||
|
||||
@subsection OCCT_OVW_SECTION_7_1 Draw Test Harness
|
||||
|
||||
Draw is a command interpreter based on TCL and a graphical system used for testing and demonstrating OCCT modeling libraries.
|
||||
|
||||
Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
|
||||
|
||||
@image html /overview/images/overview_draw.png
|
||||
@image latex /overview/images/overview_draw.png
|
||||
|
||||
Scripts can be written to customize Draw and perform tests.
|
||||
New types of objects and new commands can be added using C++ programming language.
|
||||
|
||||
Draw contains:
|
||||
|
||||
* A command interpreter based on TCL command language.
|
||||
* A 2D an 3D graphic viewer with support of operations such as zoom, pan, rotation and full-screen views.
|
||||
* An optional set of geometric commands to create and modify curves and surfaces and to use OCCT geometry algorithms.
|
||||
* A set of topological commands to create and modify BRep shapes and to use OCCT topology algorithms.
|
||||
* A set of graphic commands for view and display operations including Mesh Visualization Service.
|
||||
* A set of Application framework commands for handling of files and attributes.
|
||||
* A set of Data Exchange commands for translation of files from various formats (IGES,STEP) into OCCT shapes.
|
||||
* A set of Shape Healing commands: check of overlapping edges, approximation of a shape to BSpline, etc.
|
||||
|
||||
You can add new custom test harness commands to Draw in order to test
|
||||
or demonstrate a new functionality, which you are developing.
|
||||
|
||||
Currently DRAW Test Harness is a single executable called DRAWEXE.
|
||||
|
||||
Commands grouped in toolkits can be loaded at run-time thereby implementing dynamically loaded plug-ins.
|
||||
Thus you can work only with the commands that suit your needs adding
|
||||
the commands dynamically without leaving the Test Harness session.
|
||||
|
||||
Declaration of available plug-ins is done through special resource file(s).
|
||||
The pload command loads the plug-in in accordance with
|
||||
the specified resource file and activates the commands implemented in the plug-in.
|
||||
|
||||
The whole process of using the plug-in mechanism as well as the instructions for extending Test Harness is described in the @ref occt_user_guides__test_harness.
|
||||
|
||||
Draw Test Harness provides an environment for OCCT automated testing system.
|
||||
Please, consult its @ref occt_dev_guides__tests "Automated Testing System" for details.
|
||||
|
||||
Remarks:
|
||||
|
||||
* The DRAWEXE executable is delivered with the installation procedure on Windows platform only.
|
||||
* To start it, launch DRAWEXE executable from Open CASCADE Technology/Draw Test Harness item of the Start\\Programs menu.
|
||||
|
||||
@subsection OCCT_OVW_SECTION_7_2 Experimenting with Draw Test Harness
|
||||
|
||||
Running Draw
|
||||
------------
|
||||
|
||||
**On Linux:**
|
||||
|
||||
1. If OCCT was built by Code::Blocks use <i>$CASROOT/draw_cbp.sh</i> file to launch *DRAWEXE* executable;
|
||||
2. If OCCT was built by Automake use <i>$CASROOT/draw_amk.sh</i> file to launch *DRAWEXE* executable;
|
||||
|
||||
Draw[1]> prompt appears in the command window
|
||||
|
||||
Type *pload ALL*
|
||||
|
||||
**On Windows:**
|
||||
|
||||
Launch Draw executable from Open CASCADE Technology\\Test Harness\\Draw Test Harness
|
||||
item of the Start\\Programs menu or Use <i>$CASROOT\\draw.bat</i> file to launch *DRAWEXE* executable.
|
||||
|
||||
Draw[1]> prompt appears in the command window
|
||||
|
||||
Type pload ALL
|
||||
|
||||
**Creating your first geometric objects**
|
||||
|
||||
1. In the command window, type *axo* to create an axonometric view
|
||||
2. Type *box b -10 -10 -10 20 20 20* to create a cube *b* of size 20, parallel to the X Y Z axis and centered on the origin. The cube will be displayed in the axonometric view in wireframe mode.
|
||||
3. Type *fit* to fill the viewer with the cube
|
||||
4. Type *pcylinder c 2 30* to create a cylinder *c* of radius 2 and height 30. The cylinder will be displayed in addition to the cube
|
||||
|
||||
**Manipulating the view**
|
||||
|
||||
1. Type *clear* to erase the view
|
||||
2. Type *donly c* to display the cylinder only
|
||||
3. Type *donly b* to display the cube only
|
||||
4. Type *hlr hlr b* to display the cube in the hidden line removal mode
|
||||
|
||||
**Running demonstration files**
|
||||
|
||||
1. Type *cd ../..* to return to the root directory
|
||||
2. Type *cd samples/tcl* to reach the *DrawResources* directory
|
||||
3. Type *source \<demo_file\>* to run the demonstration file provided with Open CASCADE. The following demonstration files are available:
|
||||
* DataExchangeDemo.tcl: demonstrates sample sequence of operations with writing and reading IGES file
|
||||
* ModelingDemo.tcl: demonstrates creation of simple shape and displaying it in HLR mode
|
||||
* VisualizationDemo.tcl: demonstrates use of 3d viewer
|
||||
* challenge.tcl: creates solid shape looking like abbreviation "CAD"
|
||||
* bottle.tcl: creates bottle as in OCCT Tutorial
|
||||
* drill.tcl: creates twist drill bit shape
|
||||
* mill.tcl: creates milling cutter shape
|
||||
* raytrace.tcl: demonstrates use of ray tracing display in 3d viewer
|
||||
|
||||
**Getting Help**
|
||||
|
||||
1. Type *help* to see all available commands
|
||||
2. Type *help \<command_name\>* to find out the arguments for a given command
|
||||
|
||||
@subsection OCCT_OVW_SECTION_7_3 Programming Samples
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_1 MFC
|
||||
|
||||
Visual C++ programming samples containing 10 Visual C++ projects
|
||||
illustrating how to use a particular module or functionality.
|
||||
|
||||
The list of MFC samples:
|
||||
|
||||
* Geometry
|
||||
* Modeling
|
||||
* Viewer2d
|
||||
* Viewer3d
|
||||
* ImportExport
|
||||
* Ocaf
|
||||
* Triangulation
|
||||
* HLR
|
||||
* Animation
|
||||
* Convert
|
||||
|
||||
@image html /overview/images/overview_mvc.png
|
||||
@image latex /overview/images/overview_mvc.png
|
||||
|
||||
**Remarks:**
|
||||
|
||||
* MFC samples are available only on Windows platform;
|
||||
* To start a sample use Open CASCADE Technology\\Samples\\Mfc\\ item of the Start\\Programs menu;
|
||||
* Read carefully readme.txt to learn about launching and compilation options.
|
||||
|
||||
See \subpage samples_mfc_standard "Readme" for details.
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_2 Qt
|
||||
|
||||
OCCT contains three samples based on Qt application framework
|
||||
|
||||
Import Export
|
||||
-------------
|
||||
|
||||
Import Export programming sample contains 3D Viewer and Import / Export functionality.
|
||||
|
||||
@image html /overview/images/overview_qt.png
|
||||
@image latex /overview/images/overview_qt.png
|
||||
|
||||
Tutorial
|
||||
---------
|
||||
|
||||
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
|
||||
The purpose of the tutorial is not to explain all OCCT classes but
|
||||
to help start thinking in terms of the Open CASCADE Technology.
|
||||
|
||||
This tutorial assumes that the user has experience in using and setting up C++.
|
||||
From the viewpoint of programming, Open CASCADE Technology is designed
|
||||
to enhance user's C++ tools with high performance modeling classes, methods and functions.
|
||||
The combination of these resources allows creating substantial applications.
|
||||
|
||||
**See also:** @ref occt__tutorial "OCCT Tutorial"
|
||||
|
||||
Voxel
|
||||
------
|
||||
|
||||
This is a demonstration application showing OCCT voxel models. It also includes a set of non-regression tests and other commands for testing this functionality (accessible only through TEST pre-processor definition).
|
||||
|
||||
**See also:** <a href="occt_voxels_wp.html">Voxels User's guide</a>
|
||||
|
||||
**Remarks:**
|
||||
|
||||
* Qt samples are available on all supported platforms;
|
||||
* To start a sample on Windows use Open CASCADE Technology\\Samples\\Qt\\ item of the Start\\Programs menu.
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_3 C#
|
||||
|
||||
C# sample demonstrates integration of OCCT 3D Viewer and Import / Export functionality into .NET applications (using Windows Forms and WPF front ends).
|
||||
|
||||
@image html /overview/images/overview_c__ie.png
|
||||
@image latex /overview/images/overview_c__ie.png
|
||||
|
||||
Import:
|
||||
|
||||
* BRep
|
||||
* Iges
|
||||
* Step
|
||||
|
||||
Export:
|
||||
|
||||
* Brep
|
||||
* Iges
|
||||
* Step
|
||||
* Stl
|
||||
* Vrml
|
||||
|
||||
See \subpage samples_csharp "Readme" for details.
|
||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 9.5 KiB |
BIN
dox/overview/images/samples_java_android_occt.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
dox/overview/images/samples_qml_android_occt.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
@@ -1,4 +1,4 @@
|
||||
Overview {#mainpage}
|
||||
Overview {#mainpage}
|
||||
========
|
||||
|
||||
@tableofcontents
|
||||
@@ -117,14 +117,7 @@ implementation of 3D viewer. OpenGL specification is developed by the
|
||||
Khronos group, http://www.khronos.org/opengl/. OCCT code includes header
|
||||
file *glext.h* obtained from Khronos web site.
|
||||
|
||||
**OpenCL** (Open Computing Language) is open, royalty-free standard for
|
||||
cross-platform, parallel programming of modern processors, optionally used by
|
||||
OCCT for ray tracing. OpenCL specification is developed by the
|
||||
Khronos group, http://www.khronos.org/opencl/. The implementations of OpenCL
|
||||
are available from Apple, AMD, NVIDIA, Intel, and other vendors.
|
||||
**OpenCL Installable Client Driver (ICD) Loader** is a library provided by
|
||||
Khronos group which allows dispatching OpenCL calls to underlying
|
||||
implementation.
|
||||
**VTK** - The **Visualization Toolkit (VTK)** is an open-source, freely available software system for 3D computer graphics, image processing and visualization. OCCT VIS component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library. If you need further information on VTK, please, refer to VTK Homepage http://www.vtk.org/.
|
||||
|
||||
**Doxygen** developed by Dimitri van Heesch is open source documentation system for
|
||||
C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology
|
||||
@@ -218,9 +211,9 @@ then run **wgendoc** command with required arguments, for instance:
|
||||
@section OCCT_OVW_SECTION_5 Requirements
|
||||
|
||||
Open CASCADE Technology is designed to be highly portable and is known to
|
||||
work on wide range of platforms (UNIX, Linux, Windows, Mac OS X).
|
||||
work on wide range of platforms (UNIX, Linux, Windows, Mac OS X, Android).
|
||||
Current version is officially certified on Windows (IA-32 and x86-64),
|
||||
Linux (x86-64) and MAC OS X (x86-64) platforms.
|
||||
Linux (x86-64), MAC OS X (x86-64) and Android (4.0.4 armv7) platforms.
|
||||
|
||||
The tables below describe the recommended hardware and software configurations
|
||||
for which OCCT is certified to work.
|
||||
@@ -234,13 +227,13 @@ for which OCCT is certified to work.
|
||||
| Video card | See \ref overview_req_graphics |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 2.1+ is recommended)|
|
||||
| C++ | GNU gcc 4.0. - 4.7.3. |
|
||||
| TCL (for testing tools) | Tcltk 8.5 or 8.6 http://www.tcl.tk/software/tcltk/8.6.html |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.nokia.com/downloads |
|
||||
| Freetype (for text rendering) | freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.15.4 http://sourceforge.net/projects/freeimage/files |
|
||||
| TCL (for testing tools) | Tcltk 8.5 or 8.6 http://www.tcl.tk/software/tcltk/download.html |
|
||||
| Qt (for demonstration tools) | Qt 4.8.6 http://qt-project.org/downloads |
|
||||
| Freetype (for text rendering) | freetype-2.5.3 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.16.0 http://sourceforge.net/projects/freeimage/files |
|
||||
| gl2ps (optional, for export contents of OCCT viewer to vector graphic files) | gl2ps-1.3.8 http://geuz.org/gl2ps/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 3.x or 4.x http://www.threadingbuildingblocks.org/ |
|
||||
| OpenCL (optional, for ray tracing visualization) | OpenCL SDK (usually one provided by vendor of your graphic card) or OpenCL ICD Loader by Khronos group, http://www.khronos.org/registry/cl |
|
||||
| VTK (for VTK Integration Services | VTK 6.1.0 http://www.vtk.org/VTK/resources/software.html |
|
||||
|
||||
* Debian 60 64 bit is a platform used for regular testing of contributions
|
||||
|
||||
@@ -253,15 +246,15 @@ for which OCCT is certified to work.
|
||||
| Video card | See \ref overview_req_graphics |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 2.1+ is recommended)|
|
||||
| C++ | Microsoft Visual Studio: 2005 SP1, 2008 SP1\*, 2010 SP1, 2012 Update 3, 2013 <br>Intel C++ Composer XE 2013 SP1 |
|
||||
| TCL (for testing tools) | ActiveTcl 8.5 or 8.6 http://www.activestate.com/activetcl/downloads |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.nokia.com/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats) | FreeImage 3.15.4 http://sourceforge.net/projects/freeimage/files |
|
||||
| TCL (for testing tools) | Tcl/Tk 8.5 or 8.6 http://www.tcl.tk/software/tcltk/download.html |
|
||||
| Qt (for demonstration tools) | Qt 4.8.6 http://qt-project.org/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.5.3 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats) | FreeImage 3.16.0 http://sourceforge.net/projects/freeimage/files |
|
||||
| gl2ps (Export contents of OCCT viewer to vector graphic file) | gl2ps-1.3.8 http://geuz.org/gl2ps/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 3.x or 4.x http://www.threadingbuildingblocks.org/ |
|
||||
| OpenCL (optional, for ray tracing visualization) | OpenCL SDK (usually one provided by vendor of your graphic card) or OpenCL ICD Loader by Khronos group, http://www.khronos.org/registry/cl |
|
||||
| VTK (for VTK Integration Services | VTK 6.1.0 http://www.vtk.org/VTK/resources/software.html |
|
||||
|
||||
* VC++ 9 32-bit is used for certification of contributions and for building
|
||||
* VC++ 10 32-bit is used for certification of contributions and for building
|
||||
binary package of official release of OCCT on Windows.
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_3 MAC OS X
|
||||
@@ -273,12 +266,19 @@ for which OCCT is certified to work.
|
||||
| Video card | See \ref overview_req_graphics |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 2.1+ is recommended)|
|
||||
| C++ | XCode 3.2 or newer (4.x is recommended) |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.nokia.com/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.4.11 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats) | FreeImage 3.15.4 http://sourceforge.net/projects/freeimage/files |
|
||||
| TCL (for testing tools) | Tcltk 8.5 or 8.6 http://www.tcl.tk/software/tcltk/download.html |
|
||||
| Qt (for demonstration tools) | Qt 4.8.6 http://qt-project.org/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.5.3 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats) | FreeImage 3.16.0 http://sourceforge.net/projects/freeimage/files |
|
||||
| gl2ps (Export contents of OCCT viewer to vector graphic file) | gl2ps-1.3.8 http://geuz.org/gl2ps/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 3.x or 4.x http://www.threadingbuildingblocks.org/ |
|
||||
| OpenCL (optional, for ray tracing visualization) | Native OpenCL 1.2.8 |
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_4 Android
|
||||
|
||||
| Operating System | Android 4.0.4+ |
|
||||
| ----- | ----- |
|
||||
| Minimum memory | 512 MB, 1 GB recommended |
|
||||
| Freetype (for text rendering) | freetype-2.5.3 http://sourceforge.net/projects/freetype/files/ |
|
||||
|
||||
@subsection overview_req_graphics Graphic cards
|
||||
|
||||
@@ -311,7 +311,7 @@ building OCCT from sources on supported platforms.
|
||||
@subsection OCCT_OVW_SECTION_4_1 Using Windows installer
|
||||
|
||||
On Windows Open CASCADE Technology can be installed with binaries precompiled by
|
||||
Visual C++ 2008 with installation procedure.
|
||||
Visual C++ 2010 with installation procedure.
|
||||
|
||||
**Recommendation:**
|
||||
|
||||
@@ -337,14 +337,14 @@ When the installation is complete, you will find the directories for 3rd party p
|
||||
@image html /overview/images/overview_3rdparty.png
|
||||
@image latex /overview/images/overview_3rdparty.png
|
||||
|
||||
The contents of the OCCT-6.7.0 directory (called further "OCCT root", or $CASROOT) are as follows:
|
||||
The contents of the OCCT-6.8.0 directory (called further "OCCT root", or $CASROOT) are as follows:
|
||||
|
||||
@image html /overview/images/overview_installation.png "The directory tree"
|
||||
@image latex /overview/images/overview_installation.png "The directory tree"
|
||||
|
||||
* **adm** This folder contains administration files, which allow rebuilding OCCT;
|
||||
* **adm/cmake** This folder contains files of CMake building procedure;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2005, 2008 and 2010, which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2005, 2008, 2010, 2012 and 2013 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionality;
|
||||
* **doc** This folder contains OCCT documentation in HTML and PDF format;
|
||||
* **dox** This folder contains sources of OCCT documentation in plain text (MarkDown) format;
|
||||
@@ -353,7 +353,7 @@ The contents of the OCCT-6.7.0 directory (called further "OCCT root", or $CASROO
|
||||
* **samples** This folder contains sample applications.
|
||||
* **src** This folder contains OCCT source files. They are organized in folders, one per development unit;
|
||||
* **tests** This folder contains scripts for OCCT testing.
|
||||
* **win32/vc9** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2008;
|
||||
* **win32/vc10** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2010;
|
||||
|
||||
@section OCCT_OVW_SECTION_4_2 Environment Variables
|
||||
|
||||
@@ -384,14 +384,13 @@ The scripts are located in the OCCT root folder.
|
||||
|
||||
### Description of system variables:
|
||||
|
||||
|
||||
* **CASROOT** is used to define the root directory of Open CASCADE Technology;
|
||||
* **PATH** is required to define the path to OCCT binaries and 3rdparty folder;
|
||||
* **LD_LIBRARY_PATH** is required to define the path to OCCT libraries (on UNIX platforms only);
|
||||
* **MMGT_OPT** (optional) if set to 1, the memory manager performs optimizations as described below; if set to 2,
|
||||
Intel (R) TBB optimized memory manager is used; if 0 (default), every memory block is allocated
|
||||
in C memory heap directly (via malloc() and free() functions).
|
||||
In the latter case, all other options except MMGT_CLEAR and MMGT_REENTRANT are ignored;
|
||||
In the latter case, all other options except MMGT_CLEAR are ignored;
|
||||
* **MMGT_CLEAR** (optional) if set to 1 (default), every allocated memory block is cleared by zeros;
|
||||
if set to 0, memory block is returned as it is;
|
||||
* **MMGT_CELLSIZE** (optional) defines the maximal size of blocks allocated in large pools of memory. Default is 200;
|
||||
@@ -511,11 +510,14 @@ Type pload ALL
|
||||
* DataExchangeDemo.tcl: demonstrates sample sequence of operations with writing and reading IGES file
|
||||
* ModelingDemo.tcl: demonstrates creation of simple shape and displaying it in HLR mode
|
||||
* VisualizationDemo.tcl: demonstrates use of 3d viewer
|
||||
* challenge.tcl: creates solid shape looking like abbreviation "CAD"
|
||||
* cad.tcl: creates solid shape looking like abbreviation "CAD"
|
||||
* bottle.tcl: creates bottle as in OCCT Tutorial
|
||||
* drill.tcl: creates twist drill bit shape
|
||||
* mill.tcl: creates milling cutter shape
|
||||
* cutter.tcl: creates milling cutter shape
|
||||
* xde.tcl: demonstrates creation of simple assembly in XDE
|
||||
* materials.tcl: demonstrates visual properties of materials supported by 3d viewer
|
||||
* raytrace.tcl: demonstrates use of ray tracing display in 3d viewer
|
||||
* dimensions.tcl: demonstrates use of dimensions, clipping, and capping in 3d viewer
|
||||
|
||||
**Getting Help**
|
||||
|
||||
@@ -612,5 +614,22 @@ Export:
|
||||
* Stl
|
||||
* Vrml
|
||||
|
||||
See \subpage samples_csharp "Readme" for details.
|
||||
See \subpage samples_csharp_occt "Readme" for details.
|
||||
|
||||
There is also another C# example with the same functionality, which demonstrates the integration of Direct3D Viewer into .NET applications using WPF front end.
|
||||
|
||||
See \subpage samples_csharp_direct3d "Readme" for details.
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_4 Android
|
||||
|
||||
There are two samples are representing usage OCCT framework on Android mobile platform. They represent an OCCT-based 3D-viewer with CAD import support in formats BREP, STEP and IGES: jniviewer (java) and AndroidQt (qt+qml)
|
||||
|
||||
jniviewer
|
||||
@image html /overview/images/samples_java_android_occt.jpg
|
||||
@image latex /overview/images/samples_java_android_occt.jpg
|
||||
Java - See \subpage samples_java_android_occt "Readme" for details.
|
||||
|
||||
AndroidQt
|
||||
@image html /overview/images/samples_qml_android_occt.jpg
|
||||
@image latex /overview/images/samples_qml_android_occt.jpg
|
||||
Qt - See \subpage samples_qml_android_occt "Readme" for details.
|
||||
|
BIN
dox/technical_overview/images/239_xde_12_400.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dox/technical_overview/images/610_xde_01_400.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
dox/technical_overview/images/614_xde_04_400.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
dox/technical_overview/images/642_sh_08_400.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
dox/technical_overview/images/644_sh_09_400.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dox/technical_overview/images/646_xde_11_400.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
dox/technical_overview/images/technical_overview_schema.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dox/user_guides/draw_test_harness/images/draw_image001.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
dox/user_guides/draw_test_harness/images/draw_image002.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
dox/user_guides/draw_test_harness/images/draw_image003.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dox/user_guides/draw_test_harness/images/draw_image004.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
dox/user_guides/draw_test_harness/images/draw_image005.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
dox/user_guides/draw_test_harness/images/draw_image006.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
@@ -534,10 +534,7 @@ The configuration is defined by numeric values of the following environment var
|
||||
* *MMGT_NBPAGES*: defines the size of memory chunks allocated for small blocks in pages (operating-system dependent). Default is 1000.
|
||||
* *MMGT_THRESHOLD*: defines the maximal size of blocks that are recycled internally instead of being returned to the heap. Default is 40000.
|
||||
* *MMGT_MMAP*: when set to 1 (default), large memory blocks are allocated using memory mapping functions of the operating system; if set to 0, they will be allocated in the C heap by *malloc()*.
|
||||
* *MMGT_REENTRANT*: when set to 1 (default), all calls to the optimized memory manager will be secured against possible simultaneous access from different execution threads. This variable should be set in any multithreaded application that uses an optimized memory manager (*MMGT_OPT=1*) and has more than one thread potentially calling OCCT functions. If set to 0, OCCT memory management and exception handling routines will skip the code protecting from possible concurrency in multi-threaded environment. This can yield some performance gain in some applications, but can lead to unpredictable results if used in a multithreaded application.
|
||||
|
||||
**Note** it is recommended to use options *MMGT_OPT=2* and *MMGT_REENTRANT=1* for applications that use OCCT memory manager from more than one thread, on multiprocessor hardware.
|
||||
|
||||
|
||||
@subsubsection occt_fcug_2_3_3 Implementation details
|
||||
When *MMGT_OPT* is set to 1, the following optimization techniques are used:
|
||||
* Small blocks with a size less than *MMGT_CELLSIZE*, are not allocated separately. Instead, a large pools of memory are allocated (the size of each pool is *MMGT_NBPAGES* pages). Every new memory block is arranged in a spare place of the current pool. When the current memory pool is completely occupied, the next one is allocated, and so on.
|
||||
@@ -564,7 +561,8 @@ Note that these overheads may be greater or less than overheads induced by the
|
||||
|
||||
As a general rule, it is advisable to allocate memory through significant blocks. In this way, you can work with blocks of contiguous data, and processing is facilitated for the memory page manager.
|
||||
|
||||
In multithreaded mode <i>(MMGT_REENTRANT=1)</i>, the OCCT memory manager uses mutex to lock access to free lists, therefore it may have less performance than non-optimized mode in situations when different threads often make simultaneous calls to the memory manager. The reason is that modern implementations of *malloc()* and *free()* employ several allocation arenas and thus avoid delays waiting mutex release, which are possible in such situations.
|
||||
OCCT memory manager uses mutex to lock access to free lists, therefore it may have less performance than non-optimized mode in situations when different threads often make simultaneous calls to the memory manager.
|
||||
The reason is that modern implementations of *malloc()* and *free()* employ several allocation arenas and thus avoid delays waiting mutex release, which are possible in such situations.
|
||||
|
||||
@subsection occt_fcug_2_4 Exception Handling
|
||||
Exception handling provides a means of transferring control from a given point in a program being executed to an **exception handler** associated with another point previously executed.
|
||||
|
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 44 KiB |
@@ -2711,19 +2711,42 @@ TopoDS_Shape OutLineHCompound =
|
||||
aPolyHLRToShape.OutLineHCompound();
|
||||
~~~~~
|
||||
|
||||
@section occt_modalg_10_2 Meshing of Shapes
|
||||
@section occt_modalg_10_2 Meshing of Shapes
|
||||
|
||||
The *HLRBRep_PolyAlgo* algorithm works with triangulation of shapes. This is provided by the function *BRepMesh::Mesh*, which adds a triangulation of the shape to its topological data structure. This triangulation is computed with a given deflection.
|
||||
The algorithm of shape triangulation is provided by the functionality of *BRepMesh_IncrementalMesh* class, which adds a triangulation of the shape to its topological data structure. This triangulation is used to visualize the shape in shaded mode.
|
||||
|
||||
~~~~~
|
||||
Standard_Real radius=10. ;
|
||||
Standard_Real height=25. ;
|
||||
BRepBuilderAPI_MakeCylinder myCyl (radius, height) ;
|
||||
TopoDS_Shape myShape = myCyl.Shape() ;
|
||||
Standard_Real Deflection = 0.01 ;
|
||||
BRepMesh::Mesh (myShape, Deflection);
|
||||
const Standard_Real aRadius = 10.0;
|
||||
const Standard_Real aHeight = 25.0;
|
||||
BRepBuilderAPI_MakeCylinder aCylinder(aRadius, aHeight);
|
||||
TopoDS_Shape aShape = aCylinder.Shape();
|
||||
|
||||
const Standard_Real aLinearDeflection = 0.01;
|
||||
const Standard_Real anAngularDeflection = 0.5;
|
||||
|
||||
BRepMesh_IncrementalMesh aMesh(aShape, aLinearDeflection, Standard_False, anAngularDeflection);
|
||||
~~~~~
|
||||
|
||||
Meshing covers a shape with a triangular mesh. Other than hidden line removal, you can use meshing to transfer the shape to another tool: a manufacturing tool, a shading algorithm, a finite element algorithm, or a collision algorithm, for example.
|
||||
The default meshing algorithm *BRepMesh_IncrementalMesh* has two major options to define triangulation – linear and angular deflections.
|
||||
|
||||
You can obtain information on the shape by first exploring it. To then access triangulation of a face in the shape, use *BRepTool::Triangulation*. To access a polygon which is the approximation of an edge of the face, use *BRepTool::PolygonOnTriangulation*.
|
||||
At the first step all edges from a face are discretized according to the specified parameters.
|
||||
|
||||
At the second step, the faces are tessellated. Linear deflection limits the distance between a curve and its tessellation, whereas angular deflection limits the angle between subsequent segments in a polyline.
|
||||
|
||||
@figure{/user_guides/modeling_algos/images/modeling_algos_image056.png, "Deflection parameters of BRepMesh_IncrementalMesh algorithm"}
|
||||
|
||||
Linear deflection limits the distance between triangles and the face interior.
|
||||
|
||||
@figure{/user_guides/modeling_algos/images/modeling_algos_image057.png, "Linear deflection"}
|
||||
|
||||
Note that if a given value of linear deflection is less than shape tolerance then the algorithm will skip this value and will take into account the shape tolerance.
|
||||
|
||||
The application should provide deflection parameters to compute a satisfactory mesh. Angular deflection is relatively simple and allows using a default value (12-20 degrees). Linear deflection has an absolute meaning and the application should provide the correct value for its models. Giving small values may result in a too huge mesh (consuming a lot of memory, which results in a long computation time and slow rendering) while big values result in an ugly mesh.
|
||||
|
||||
For an application working in dimensions known in advance it can be reasonable to use the absolute linear deflection for all models. This provides meshes according to metrics and precision used in the application (for example, it it is known that the model will be stored in meters, 0.004 m is enough for most tasks).
|
||||
|
||||
However, an application that imports models created in other applications may not use the same deflection for all models. Note that actually this is an abnormal situation and this application is probably just a viewer for CAD models with dimensions varying by an order of magnitude. This problem can be solved by introducing the concept of a relative linear deflection with some LOD (level of detail). The level of detail is a scale factor for absolute deflection, which is applied to model dimensions.
|
||||
|
||||
Meshing covers a shape with a triangular mesh. Other than hidden line removal, you can use meshing to transfer the shape to another tool: a manufacturing tool, a shading algorithm, a finite element algorithm, or a collision algorithm.
|
||||
|
||||
You can obtain information on the shape by first exploring it. To access triangulation of a face in the shape later, use *BRepTool::Triangulation*. To access a polygon, which is the approximation of an edge of the face, use *BRepTool::PolygonOnTriangulation*.
|
||||
|
@@ -75,27 +75,34 @@ The simplest way for fixing shapes is to use classes *ShapeFix_Shape* and *Shape
|
||||
The sequence of actions is as follows :
|
||||
|
||||
1. Create tool *ShapeFix_Shape* and initialize it by shape:
|
||||
~~~~~
|
||||
Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
|
||||
sfs->Init ( shape );
|
||||
~~~~~
|
||||
2. Set the basic precision and the maximum allowed tolerance:
|
||||
~~~~~
|
||||
sfs->SetPrecision ( Prec );
|
||||
sfs->SetMaxTolerance ( maxTol );
|
||||
~~~~~
|
||||
where *Prec* – basic precision, *maxTol* – maximum allowed tolerance.
|
||||
All problems will be detected for cases when a dimension of invalidity is larger than the basic precision or a tolerance of sub-shape on that problem is detected.
|
||||
The maximum tolerance value limits the increasing tolerance for fixing a problem. If a value larger than the maximum allowed tolerance is necessary for correcting a detected problem the problem can not be fixed.
|
||||
|
||||
Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
|
||||
sfs->Init ( shape );
|
||||
|
||||
2. Set the basic precision, the maximum allowed tolerance, the minimal allowed tolerance:
|
||||
|
||||
sfs->SetPrecision ( Prec );
|
||||
sfs->SetMaxTolerance ( maxTol );
|
||||
sfs->SetMinTolerance ( mintol );
|
||||
|
||||
where *Prec* – basic precision, *maxTol* – maximum allowed tolerance, *minTol* – minimal allowed tolerance.
|
||||
* *maxTol* - All problems will be detected for cases when a dimension of invalidity is larger than the basic precision or a tolerance of sub-shape on that problem is detected.
|
||||
The maximum tolerance value limits the increasing tolerance for fixing a problem such as fix of not connenected and self-intersected wires. If a value larger than the maximum allowed tolerance is necessary for correcting a detected problem the problem can not be fixed.
|
||||
The maximal tolerance is not taking into account during computation of tolerance of edges in ShapeFix_SameParameter() method and ShapeFix_Edge::FixVertexTolerance() method.
|
||||
See @ref occt_shg_2_3_8 for details.
|
||||
* *minTol* - The minimal allowed tolerance defines minimal allowed length of edges. Detected edges having length less than specified minimal tolerance will be removed if ModifyTopologyMode in Repairing tool for wires is set to true.
|
||||
See @ref occt_shg_2_3_7 for details.
|
||||
|
||||
3. Launch fixing:
|
||||
~~~~~
|
||||
sfs->Perform();
|
||||
~~~~~
|
||||
|
||||
sfs->Perform();
|
||||
|
||||
4. Get the result:
|
||||
~~~~~
|
||||
TopoDS_Shape aResult = sfs->Shape();
|
||||
~~~~~
|
||||
In some cases using only *ShapeFix_Shape* can be insufficient. It is possible to use tools for merging and removing small edges and fixing gaps between 2D and 3D curves.
|
||||
|
||||
TopoDS_Shape aResult = sfs->Shape();
|
||||
|
||||
In some cases using only *ShapeFix_Shape* can be insufficient. It is possible to use tools for merging and removing small edges and fixing gaps between 2D and 3D curves.
|
||||
|
||||
5. Create *ShapeFix_Wireframe* tool and initialize it by shape:
|
||||
~~~~~
|
||||
Handle(ShapeFix_Wirefarme) SFWF = new ShapeFix_Wirefarme(shape);
|
||||
|
@@ -863,6 +863,22 @@ See description of parameter read.step.resource.name above for more details on u
|
||||
Default values:
|
||||
* read.step.resource.name - STEP,
|
||||
* read.step.sequence - ToSTEP.
|
||||
|
||||
<h4>write.step.vertex.mode</h4>
|
||||
This parameter indicates which of free vertices writing mode is switch on.
|
||||
* 0 (One Compound) : (default) All free vertices are united into one compound and exported in one SHAPE DEFINITION REPRESENTATION (vertex name and style are lost).
|
||||
* 1 (Single Vertex) : Each vertex exported in its own SHAPE DEFINITION REPRESENTATION (vertex name and style are not lost, but size of STEP file increases).
|
||||
|
||||
Read this parameter with:
|
||||
~~~~~
|
||||
Standard_Integer ic = Interface_Static::IVal("write.step.vertex.mode");
|
||||
~~~~~
|
||||
Modify this parameter with:
|
||||
~~~~~
|
||||
if(!Interface_Static::SetIVal("write.step.vertex.mode",1))
|
||||
.. error ..
|
||||
~~~~~
|
||||
Default value is 0.
|
||||
|
||||
@subsubsection occt_step_3_3_3 Performing the Open CASCADE Technology shape translation
|
||||
An OCCT shape can be translated to STEP using one of the following models (shape_representations):
|
||||
|
@@ -11,6 +11,7 @@ OCCT User Guides are organized by OCCT modules:
|
||||
* @subpage occt_user_guides__shape_healing "Shape Healing"
|
||||
* @subpage occt_user_guides__visualization "Visualization"
|
||||
* @subpage occt_user_guides__voxels_wp "Voxels"
|
||||
* @subpage occt_user_guides__vis "VTK Integration Services"
|
||||
* Data Exchange
|
||||
* @subpage occt_user_guides__iges "IGES translator"
|
||||
* @subpage occt_user_guides__step "STEP translator"
|
||||
|
BIN
dox/user_guides/vis/images/vis_image001.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
dox/user_guides/vis/images/vis_image002.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dox/user_guides/vis/images/vis_image003.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
dox/user_guides/vis/images/vis_image004.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dox/user_guides/vis/images/vis_image005.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
dox/user_guides/vis/images/vis_image006.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
dox/user_guides/vis/images/vis_image007.png
Normal file
After Width: | Height: | Size: 22 KiB |
366
dox/user_guides/vis/vis.md
Normal file
@@ -0,0 +1,366 @@
|
||||
VTK Integration Services (VIS) {#occt_user_guides__vis}
|
||||
============================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section occt_vis_1 Introduction
|
||||
VIS component provides adaptation functionality for visualization of OCCT topological shapes by means of VTK library. This User’s Guide describes how to apply VIS classes in application dealing with 3D visualization based on VTK library.
|
||||
|
||||
@figure{/user_guides/vis/images/vis_image001.png}
|
||||
|
||||
There are two ways to use VIS in the application:
|
||||
* Use a **high-level API**. It is a simple scenario to use VTK viewer with displayed OCCT shapes. It considers usage of tools provided with VIS component such as a specific VTK data source, a picker class and specific VTK filters. Basically, in this scenario you enrich your custom VTK pipeline with extensions coming from VIS.
|
||||
* Use a **low-level API**. It is an advanced scenario for the users with specific needs, which are not addressed by the higher-level utilities of VIS. It presumes implementation of custom VTK algorithms (such as filters) with help of low-level API of VIS component.
|
||||
This document describes both scenarios of VIS integration into application. To understand this document, it is necessary to be familiar with VTK and OCCT libraries.
|
||||
|
||||
@section occt_vis_2 Component Architecture
|
||||
@subsection occt_vis_2_1 Common structure
|
||||
VIS component consists of the following packages:
|
||||
* **IVtk** – common interfaces which define the principal objects playing as foundation of VIS.
|
||||
* **IVtkOCC** – implementation of interfaces related to CAD domain. The classes from this package deal with topological shapes, faceting and interactive selection facilities of OCCT;
|
||||
* **IVtkVTK** – implementation of interfaces related to VTK visualization toolkit;
|
||||
* **IVtkTools** – high-level tools designed for integration into VTK visualization pipelines.
|
||||
|
||||
@figure{/user_guides/vis/images/vis_image002.png "Dependencies of VIS packages"}
|
||||
|
||||
The idea behind the mentioned organization of packages is separation of interfaces from their actual implementations by their dependencies from a particular library (OCCT, VTK). Besides providing of semantic separation, such splitting helps to avoid excessive dependencies on other OCCT toolkits and VTK.
|
||||
* **IVtk** package does not depend on VTK libraries at all and needs OCCT libraries only because of collections usage (*TKernel* library);
|
||||
* Implementation classes from **IVtkOCC** package depend on OCCT libraries only and do not need VTK;
|
||||
* **IVtkVTK** package depends on VTK libraries only and does not need any OCCT functionality except collections.
|
||||
|
||||
@figure{/user_guides/vis/images/vis_image003.png "Dependencies of VIS packages"}
|
||||
|
||||
Basically, it is enough to use the first three packages in the end user’s application (*IVtk, IVtkOCC* and *IVtkVTK*) to be able to work with OCCT shapes in VTK viewer. However, *IVtkTools* package is also provided as a part of the component to make the work more comfortable.
|
||||
|
||||
|
||||
@subsection occt_vis_2_2 IVtk package
|
||||
**IVtk** package contains the following classes:
|
||||
* *IVtk_Interface* - Base class for all interfaces of the component. Provides inheritance for *Handle* (OCCT “smart pointer”) functionality.
|
||||
* *IVtk_IShape* - Represents a 3D shape of arbitrary nature. Provides its ID property. Implementation of this interface should maintain unique IDs for all visualized shapes. These IDs can be easily converted into original shape objects at the application level.
|
||||
* *IVtk_IShapeData* - Represents faceted data. Provides methods for adding coordinates and cells (vertices, lines, triangles).
|
||||
* *IVtk_IShapeMesher* - Interface for faceting, i.e. constructing *IVtk_IShapeData* from *IVtk_IShape* input shape.
|
||||
* *IVtk_IShapePickerAlgo* - Algorithmic interface for interactive picking of shapes in a scene. Provides methods for finding shapes and their parts (sub-shapes) at a given location according to the chosen selection mode.
|
||||
* *IVtk_IView* Interface for obtaining view transformation parameters. It is used by *IVtk_IShapePickerAlgo*.
|
||||
|
||||
@subsection occt_vis_2_3 IVtkOCC package
|
||||
|
||||
**IVtkOCC** package contains the implementation of classes depending on OCCT:
|
||||
* *IVtkOCC_Shape* - Implementation of *IVtk_IShape* interface as a wrapper for *TopoDS_Shape*.
|
||||
* *IVtkOCC_ShapeMesher* - Implementation of *IVtk_IShapeMesher* interface for construction of facets from *TopoDS* shapes.
|
||||
* *IVtkOCC_ShapePickerAlgo* Implementation of interactive picking algorithm. It provides enabling/disabling of selection modes for shapes (*IVtk_IShape* instances) and picking facilities for a given position of cursor.
|
||||
* *IVtkOCC_ViewerSelector* - Interactive selector, which implements *Pick()* methods for the picking algorithm *IVtkOCC_ShapePickerAlgo* and connects to the visualization layer with help of abstract *IView* interface.
|
||||
|
||||
*IVtkOCC_ViewerSelector* is a descendant of OCCT native *SelectMgr_ViewerSelector*, so it implements OCCT selection mechanism for *IVtkVTK_View* (similarly to *StdSelect_ViewerSelector3D* which implements *SelectMgr_ViewerSelector* for OCCT native *V3d_View*). *IVtkOCC_ViewerSelector* encapsulates all projection transformations for the picking mechanism. These transformations are extracted from *vtkCamera* instance available via VTK Renderer. *IVtkOCC_ViewerSelector* operates with native OCCT *SelectMgr_Selection* entities. Each entity represents one selection mode of an OCCT selectable object. *ViewerSelector* is an internal class, so it is not a part of the public API.
|
||||
* *IVtkOCC_SelectableObject* - OCCT shape wrapper used in the picking algorithm for computation of selection primitives of a shape for a chosen selection mode.
|
||||
|
||||
@subsection occt_vis_2_4 IVtkVtk package
|
||||
**IVtkVTK** package contains implementation classes depending on VTK:
|
||||
* *IVtkVTK_ShapeData* - Implementation of *IVtk_IShapeData* interface for VTK polydata. This class also stores information related to sub-shape IDs and sub-shape mesh type *IVtk_MeshType* (free vertex, shared vertex, free edge, boundary edge, shared edge, wireframe face or shaded face). This information is stored in VTK data arrays for cells.
|
||||
* *IVtkVTK_View* - Implementation of *IVtk_IView* interface for VTK viewer. This implementation class is used to connect *IVtkOCC_ViewerSelector* to VTK renderer.
|
||||
|
||||
@subsection occt_vis_2_5 IVtkTools package
|
||||
**IVtkTools** package gives you a ready-to-use toolbox of algorithms facilitating the integration of OCCT shapes into visualization pipeline of VTK. This package contains the following classes:
|
||||
* *IVtkTools_ShapeDataSource* - VTK polygonal data source for OCCT shapes. It inherits *vtkPolyDataAlgorithm* class and provides a faceted representation of OCCT shape for visualization pipelines.
|
||||
* *IVtkTools_ShapeObject* - Auxiliary wrapper class for OCCT shapes to pass them through pipelines by means of VTK information keys.
|
||||
* *IVtkTools_ShapePicker* - VTK picker for shape actors. Uses OCCT selection algorithm internally.
|
||||
* *IVtkTools_DisplayModeFilter* - VTK filter for extracting cells of a particular mesh type according to a given display mode *IVtk_DisplayMode* (Wireframe or Shading).
|
||||
* *IVtkTools_SubPolyDataFilter* - VTK filter for extracting the cells corresponding to a given set of sub-shape IDs.
|
||||
|
||||
Additionally, *IVtkTools* package contains auxiliary methods in *IVtkTools* namespace. E.g. there is a convenience function populating *vtkLookupTable* instances to set up a color scheme for better visualization of sub-shapes.
|
||||
|
||||
@section occt_vis_3 Using high-level API (simple scenario)
|
||||
@subsection occt_vis_3_1 OCCT shape presentation in VTK viewer
|
||||
|
||||
To visualize an OCCT topological shape in VTK viewer, it is necessary to perform the following steps:
|
||||
|
||||
1. Create *IVtkOCC_Shape* instance (VIS wrapper for OCCT shape) and initialize it with *TopoDS_Shape* object containing the actual geometry:
|
||||
~~~~
|
||||
TopoDS_Shape aShape;
|
||||
|
||||
// Initialize aShape variable: e.g. load it from BREP file
|
||||
|
||||
IVtkOCC_Shape::Handle aShapeImpl = new IVtkOCC_Shape(aShape);
|
||||
~~~~
|
||||
2. Create VTK polygonal data source for the target OCCT topological shape and initialize it with created *IVtkOCC_Shape* instance. At this stage the faceter is implicitly plugged:
|
||||
~~~~
|
||||
vtkSmartPointer<IVtkTools_ShapeDataSource> DS = vtkSmartPointer<IVtkTools_ShapeDataSource>::New();
|
||||
|
||||
DS->SetShape(aShapeImpl);
|
||||
~~~~
|
||||
3. Visualize the loaded shape in usual VTK way starting a pipeline from the newly created specific source:
|
||||
~~~~
|
||||
vtkSmartPointer<vtkPolyDataMapper> Mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
|
||||
|
||||
Mapper->SetInputConnection(aDS->GetOutputPort());
|
||||
vtkSmartPointer<vtkActor> Actor = vtkSmartPointer<vtkActor>::New();
|
||||
|
||||
Actor->SetMapper(Mapper);
|
||||
~~~~
|
||||
|
||||
It is always possible to access the shape data source from VTK actor by means of dedicated methods from *IVtkTools_ShapeObject* class:
|
||||
~~~~
|
||||
IVtkTools_ShapeDataSource* DS = IVtkTools_ShapeObject::GetShapeSource(Actor);
|
||||
|
||||
IVtkOCC_Shape::Handle occShape = IVtkTools_ShapeObject::GetOccShape(Actor);
|
||||
~~~~
|
||||
|
||||
It is also possible to get a shape wrapper from the shape data source:
|
||||
~~~~
|
||||
IVtkOCC_Shape::Handle occShape = DS->GetShape();
|
||||
~~~~
|
||||
|
||||
@subsection occt_vis_3_2 Color schemes
|
||||
@subsubsection occt_vis_3_2_1 Default OCCT color scheme
|
||||
|
||||
To colorize different parts of a shape according to the default OCCT color scheme, it is possible to configure the corresponding VTK mapper using a dedicated auxiliary function of *IVtkTools* namespace:
|
||||
|
||||
~~~~
|
||||
IVtkTools::InitShapeMapper(Mapper);
|
||||
~~~~
|
||||
It is possible to get an instance of *vtkLookupTable class* with a default OCCT color scheme by means of the following method:
|
||||
|
||||
~~~~
|
||||
vtkLookupTable* Table = IVtkTools::InitLookupTable();
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_vis_3_2_2 Custom color scheme
|
||||
To set up application-specific colors for a shape presentation, use *InitShapeMapper* function with an additional argument passing a custom lookup table:
|
||||
|
||||
~~~~
|
||||
IVtkTools::InitShapeMapper(Mapper, Table);
|
||||
~~~~
|
||||
|
||||
@subsubsection occt_vis_3_2_3 Setting custom colors for sub-shapes
|
||||
|
||||
It is also possible to bind custom colors to any sub-shape type listed in *IVtk_MeshType* enumeration. For example, to access the color bound to *free edge* entities, the following calls are available in *IVtkTools* namespace:
|
||||
~~~~
|
||||
SetLookupTableColor(aLookupTable, MT_FreeEdge, R, G, B);
|
||||
SetLookupTableColor(aLookupTable, MT_FreeEdge, R, G, B, A);
|
||||
GetLookupTableColor(aLookupTable, MT_FreeEdge, R, G, B);
|
||||
GetLookupTableColor(aLookupTable, MT_FreeEdge, R, G, B, A);
|
||||
~~~~
|
||||
Here *R, G, B* are double values of red, green and blue components of a color from the range [0, 1]. The optional parameter *A* stands for the alpha value (the opacity) as a double from the same range [0, 1]. By default alpha value is 1, i.e. a color is not transparent.
|
||||
|
||||
@subsubsection occt_vis_3_2_4 Using color scheme of mapper
|
||||
|
||||
As VTK color mapping approach is based on associating scalar data arrays to VTK cells, the coloring of shape components can be turned on/off in the following way:
|
||||
|
||||
~~~~
|
||||
Mapper->ScalarVisibilityOn(); // use colors from lookup table
|
||||
Mapper->ScalarVisibilityOff(); // use a color of actor’s property
|
||||
~~~~
|
||||
|
||||
For example, the scalar-based coloring can be disabled to bind a single color to the entire VTK actor representing the shape.
|
||||
|
||||
@subsection occt_vis_3_3 Display modes
|
||||
The output of the shape data source can be presented in wireframe or shading display mode. A specific filter from class *IVtkTools_DisplayModeFilter* can be applied to select the display mode. The filter passes only the cells corresponding to the given mode. The set of available modes is defined by *IVtk_DisplayMode* enumeration.
|
||||
|
||||
@figure{/user_guides/vis/images/vis_image004.png}
|
||||
|
||||
For example, the shading representation can be obtained in the following way:
|
||||
|
||||
~~~~
|
||||
vtkSmartPointer<IVtkTools_ShapeDataSource> DS = vtkSmartPointer<IVtkTools_ShapeDataSource>::New();
|
||||
|
||||
vtkSmartPointer<IVtkTools_DisplayModeFilter> DMFilter = vtkSmartPointer<IVtkTools_DisplayModeFilter>::New();
|
||||
|
||||
DMFilter->AddInputConnection(DS->GetOutputPort());
|
||||
DMFilter->SetDisplayMode(DM_Shading);
|
||||
|
||||
vtkSmartPointer<vtkDataSetMapper> M = vtkSmartPointer<vtkDataSetMapper>::New();
|
||||
M->SetInputConnection(DMFilter->GetOutputPort());
|
||||
~~~~
|
||||
|
||||
By default, the display mode filter works in a wireframe mode.
|
||||
|
||||
TIP: to make the shading representation smooth, use additional *vtkPolyDataNormals* filter. This filter must be applied after the display mode filter.
|
||||
|
||||
@figure{/user_guides/vis/images/vis_image005.png}
|
||||
|
||||
@subsection occt_vis_3_4 Interactive selection
|
||||
*IVtkTools* package provides *IVtkTools_ShapePicker* class to perform selection of OCCT shapes and sub-shapes in VTK viewer and access the picking results. The typical usage of *IVtkTools_ShapePicker* tool consists in the following sequence of actions:
|
||||
1. Create a picker and set its renderer to your active VTK renderer:
|
||||
~~~~
|
||||
vtkSmartPointer<IVtkTools_ShapePicker> aPicker = vtkSmartPointer<IVtkTools_ShapePicker>::New();
|
||||
|
||||
aPicker->SetRenderer(aRenderer);
|
||||
~~~~
|
||||
2. Activate the desired selection mode by choosing the corresponding sub-shape types from *IVtk_SelectionMode* enumeration. For example, the following call allows selection of edges on all selectable shape actors of the renderer:
|
||||
~~~~
|
||||
aPicker->SetSelectionMode(SM_Edge);
|
||||
~~~~
|
||||
If it is necessary to limit selection by a particular shape actor, one can use the mentioned *SetSelectionMode* method with *IVtk_IShape* handle or *vtkActor* pointer as the first argument:
|
||||
~~~~
|
||||
IVtk_IShape::Handle aShape = new IVtkOCC_Shape(occShape);
|
||||
aPicker->SetSelectionMode(aShape, SM_Edge); // If shape handle is available
|
||||
aPicker->SetSelectionMode(anActor, SM_Edge); // If shape actor is available
|
||||
~~~~
|
||||
Different selection modes can be turned on/off for a picker at the same time independently from each other.
|
||||
~~~~
|
||||
aPicker->SetSelectionMode(SM_Edge);
|
||||
aPicker->SetSelectionMode(SM_Face);
|
||||
~~~~
|
||||
To turn off a selection mode, the additional optional Boolean parameter is used with *false* value, for example:
|
||||
~~~~
|
||||
aPicker->SetSelectionMode(aShape, SM_Edge, false);
|
||||
~~~~
|
||||
3. Call *Pick* method passing the mouse display coordinates:
|
||||
~~~~
|
||||
aPicker->Pick(x, y, 0);
|
||||
~~~~
|
||||
By default, the renderer passed in the step 1 is used. In order to perform pick operation for another renderer an additional optional parameter can be specified:
|
||||
~~~~
|
||||
aPicker->Pick(x, y, 0, aRenderer);
|
||||
~~~~
|
||||
4. Obtain the top-level picking results as a collection of picked VTK actors:
|
||||
~~~~
|
||||
vtkActorCollection* anActorCollection = aPicker->GetPickedActors();
|
||||
~~~~
|
||||
or as a collection of picked shape IDs:
|
||||
~~~~
|
||||
IVtk_ShapeIdList ids = aPicker->GetPickedShapesIds();
|
||||
~~~~
|
||||
These methods return a single top picked actor or a shape by default. To get all the picked actors or shapes it is necessary to send “true” value in the optional Boolean parameter:
|
||||
~~~~
|
||||
anActorCollection = aPicker->GetPickedActors(true);
|
||||
ids = aPicker->GetPickedShapesIds(true);
|
||||
~~~~
|
||||
5. Obtain the picked sub-shape IDs:
|
||||
~~~~
|
||||
IVtk_ShapeIdList subShapeIds = aPicker->GetPickedSubShapesIds(shapeId);
|
||||
~~~~
|
||||
This method also returns a single ID of a top-level picked sub-shape and has the same optional Boolean parameter to get all the picked sub-shapes of a shape:
|
||||
~~~~
|
||||
subShapeIds = aPicker->GetPickedSubShapesIds(shapeId, true);
|
||||
~~~~
|
||||
|
||||
It should be noted that it is more efficient to create a sole picker instance and feed it with the renderer only once. The matter is that the picking algorithm performs internal calculations each time the renderer or some of its parameters are changed. Therefore, it makes sense to minimize the number of such updates.
|
||||
|
||||
OCCT picking algorithm *IVtkTools_ShapePicker* calculates a new transformation matrix for building of projection each time some parameters of a view are changed. Likewise, the shape selection primitives for each selection mode are built once an appropriate selection mode is turned on for this shape in *SetSelectionMode* method.
|
||||
|
||||
WARNING: VIS picker essentially works on the initial topological data structures rather than on the actually visualized actors. This peculiarity allows VIS to take advantage of standard OCCT selection mechanism, but puts strict limitations on the corresponding visualization pipelines. Once constructed, the faceted shape representation should not be morphed or translated anyhow. Otherwise, the picking results will lose their associativity with the source geometry. E.g. you should never use *vtkTransform* filter, but rather apply OCCT isometric transformation on the initial model in order to work on already relocated facet. These limitations are often acceptable for CAD visualization. If not, consider usage of a custom VTK-style picker working on the actually visualized actors.
|
||||
|
||||
@figure{/user_guides/vis/images/vis_image006.png}
|
||||
|
||||
@subsubsection occt_vis_3_5 Selection of sub-shapes
|
||||
|
||||
*IVtkTools_SubPolyDataFilter* is a handy VTK filter class which allows extraction of polygonal cells corresponding to the sub-shapes of the initial shape. It can be used to produce a *vtkPolyData* object from the input *vtkPolyData* object, using selection results from *IVTkTools_ShapePicker* tool.
|
||||
|
||||
For example, sub-shapes can be represented in VTK viewer in the following way:
|
||||
|
||||
~~~~
|
||||
// Load a shape into data source (see 3.1)
|
||||
...
|
||||
vtkSmartPointer<IVtkTools_ShapeDataSource> DS = vtkSmartPointer<IVtkTools_ShapeDataSource>::New();
|
||||
|
||||
DS->SetShape(shapeImpl);
|
||||
...
|
||||
|
||||
// Create a new sub-polydata filter for sub-shapes filtering
|
||||
vtkSmartPointer<IVtkTools_SubPolyDataFilter> subShapesFilter = IVtkTools_SubPolyDataFilter::New();
|
||||
|
||||
// Set a shape source as an input of the subpolydata filter
|
||||
subShapesFilter->SetInputConnection(DS->GetOutputPort());
|
||||
|
||||
// Get all picked sub-shapes ids of the shape from a picker (see 3.4)
|
||||
IVtk_ShapeIdList subShapeIds = aPicker->GetPickedSubShapesIds(ds->GetId(), true);
|
||||
|
||||
// Set ids to the filter to pass only picked sub-shapes
|
||||
subShapesFilter->SetData(subShapeIds);
|
||||
subShapesFilter->Modified();
|
||||
|
||||
// Output the result into a mapper
|
||||
vtkSmartPointer<vtkPolyDataMapper> aMapper = vtkPolyDataMapper::New();
|
||||
aMapper->AddInputConnection(subShapesFilter->GetOutputPort());
|
||||
...
|
||||
~~~~
|
||||
|
||||
@section occt_vis_4 Using of low-level API (advanced scenario)
|
||||
@subsection occt_vis_4_1 Shape presentation
|
||||
The usage of low-level tools is justified in cases when the utilities from *IVtkTools* are not enough.
|
||||
|
||||
The low-level scenario of VIS usage in VTK pipeline is shown in the figure below. The Mesher component produces shape facet (VTK polygonal data) using implementation of *IShapeData* interface. Then result can be retrieved from this implementation as a *vtkPolyData* instance.
|
||||
|
||||
@figure{/user_guides/vis/images/vis_image007.png "Low-level VIS usage with VTK"}
|
||||
|
||||
The visualization pipeline for OCCT shape presentation can be initialized as follows:
|
||||
1. Create an instance of *IShape* class initialized by OCCT topological shape:
|
||||
~~~~
|
||||
TopoDS_Shape aShape;
|
||||
|
||||
// Load or create a TopoDS_Shape in the variable a Shape
|
||||
...
|
||||
IVtkOCC_Shape::Handle aShapeImpl = new IVtkOCC_Shape(aShape);
|
||||
~~~~
|
||||
2. Create an empty instance of IShapeData implementation for VTK:
|
||||
~~~~
|
||||
IVtk_IShapeData::Handle aDataImpl = new IVtkVTK_ShapeData();
|
||||
~~~~
|
||||
3 Create an instance of *IShapeMesher* implementation for OCCT (any faceter can be used at this stage):
|
||||
~~~~
|
||||
IVtk_IShapeMesher::Handle aMesher = new IVtkOCC_ShapeMesher();
|
||||
~~~~
|
||||
4 Triangulate the OCCT topological shape by means of the Mesher and access the result:
|
||||
~~~~
|
||||
aMesher->Build (aShapeImpl, aDataImpl);
|
||||
|
||||
vtkPolyData* aPolyData = aDataImpl->GetVtkPolyData();
|
||||
~~~~
|
||||
|
||||
The resulting *vtkPolyData* instance can be used for initialization of VTK pipelines.
|
||||
*IVtkVTK_ShapeData* object is used to keep and pass the mapping between sub-shapes, their mesh types and the resulting mesh cells through a pipeline. It stores sub-shape IDs and mesh type in VTK data arrays for each generated cell. As a result, the generated VTK cells get the following data arrays populated:
|
||||
* *SUBSHAPE_IDS* – array of *vtkIdTypeArray* type. It contains the shape IDs the corresponding cells were generated for. The name of this array is defined in *ARRNAME_SUBSHAPE_IDS* constant of *IVtkVTK_ShapeData* class.
|
||||
* *MESH_TYPES* – array of *vtkShortArray type*. It contains the type tags of the shape parts the corresponding cells were generated for. The name of this array is defined in *ARRNAME_MESH_TYPES* constant of *IVtkVTK_ShapeData* class.
|
||||
|
||||
@subsection occt_vis_4_2 Usage of OCCT picking algorithm
|
||||
|
||||
It is possible to create a custom VTK picker for interactive selection of OCCT 3D shapes using an instance of the picking algorithm *IVtk_IShapePickerAlgo*.
|
||||
|
||||
Picking algorithm uses an instance of viewer selector (OCCT term), which manages picking along with activation and deactivation of selection modes. VIS component implements OCCT selection principle in *IVtkOCC_ShapePickerAlgo* and *IVtkOCC_ViewerSelector* classes. *IVtkOCC_ViewerSelector* is an internal class that implements OCCT selection mechanism applied in *IVtkVTK_View*.
|
||||
|
||||
*IVtkOCC_ShapePickerAlgo* has to be used to activate/deactivate selection modes for shapes *IVtk_IShape*. *IVtkOCC_ShapePickerAlgo* is the implementation of *IVtk_IShapePickerAlgo* interface.
|
||||
|
||||
The typical usage of *IVtk_IShapePickerAlgo* consists in the following sequence of actions:
|
||||
1. Create an instance of the picker class:
|
||||
~~~~
|
||||
IVtkOCC_ShapePickerAlgo::Handle Picker = new IVtkOCC_ShapePickerAlgo();
|
||||
~~~~
|
||||
|
||||
2. Set an instance of *IVtk_IView* class to the algorithm in order to define the viewer parameters:
|
||||
~~~~
|
||||
IVtkVTK_View::Handle View = new IVtkVTK_View(Renderer);
|
||||
Picker->SetView(View);
|
||||
~~~~
|
||||
3. Activate the desired selection modes using values from *IVtk_SelectionMode* enumeration. For example, the following call allows selection of edges:
|
||||
~~~~
|
||||
TopoDS_Shape aShape;
|
||||
// Load or create a TopoDS_Shape in the variable a Shape
|
||||
...
|
||||
IVtk_IShape::Handle shapeImpl = new IVtkOCC_Shape(aShape);
|
||||
...
|
||||
myOccPickerAlgo->SetSelectionMode(occShape, SM_Edge);
|
||||
~~~~
|
||||
Different selection modes can be turned on/off for a picker at the same time independently from each other.
|
||||
To turn off a selection mode the additional optional Boolean parameter is used with *false* value, for example:
|
||||
~~~~
|
||||
myOccPickerAlgo->SetSelectionMode(occShape, SM_Edge, false);
|
||||
~~~~
|
||||
4. Call *Pick* method passing the mouse coordinates:
|
||||
~~~~
|
||||
myOccPickerAlgo->Pick(x, y);
|
||||
~~~~
|
||||
5. Obtain top-level picking results as IDs of the picked top-level shapes:
|
||||
~~~~
|
||||
IVtk_ShapeIdList ids = myOccPickerAlgo->ShapesPicked();
|
||||
~~~~
|
||||
6. Obtain IDs of the picked sub-shapes:
|
||||
~~~~
|
||||
IVtk_ShapeIdList subShapeIds
|
||||
= myOccPickerAlgo->SubShapesPicked(shapeId);
|
||||
~~~~
|
||||
|
||||
@section occt_vis_5 DRAW Test Harness
|
||||
|
||||
*TKIVtkDraw* toolkit contains classes for embedding VIS functionality into DRAW Test Harness with possibility of simple interactions, including detection and highlighting.
|
||||
* *IVtkDraw_HighlightAndSelectionPipeline* - Creates VTK pipeline with OCCT shape data source and properly initialized VIS filters.
|
||||
* *IVtkDraw_Interactor* - Controls simple interactive actions, such as detection and selection of the displayed shapes.
|
BIN
dox/user_guides/visualization/images/camera_perspective.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
dox/user_guides/visualization/images/point_cloud.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
dox/user_guides/visualization/images/stereo.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
dox/user_guides/visualization/images/view_frustum.png
Normal file
After Width: | Height: | Size: 151 KiB |
BIN
dox/user_guides/visualization/images/viewfrustumculling.png
Normal file
After Width: | Height: | Size: 71 KiB |