99aa0c5a60dd73bccac30180236e725c5e456594
[occt.git] / adm / cmake / tcl.cmake
1 # tcl
2
3 if (NOT DEFINED INSTALL_TCL)
4   set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
5 endif()
6
7 # tcl directory
8 if (NOT DEFINED 3RDPARTY_TCL_DIR)
9   set (3RDPARTY_TCL_DIR "" CACHE PATH "The directory containing tcl")
10 endif()
11
12 # tcl include directory
13 if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
14   set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
15 endif()
16
17 # tk include directory
18 if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
19   set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
20 endif()
21
22 # tcl library file (with absolute path)
23 if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
24   set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library"  FORCE)
25 endif()
26
27 # tcl library directory
28 if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
29   set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
30 endif()
31
32 # tk library file (with absolute path)
33 if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
34   set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "tk library" FORCE)
35 endif()
36
37 # tk library directory
38 if (NOT DEFINED 3RDPARTY_TK_LIBRARY_DIR)
39   set (3RDPARTY_TK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tk library")
40 endif()
41
42 # tcl shared library (with absolute path)
43 if (WIN32)
44   if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
45     set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
46   endif()
47 endif()
48
49 # tcl shared library directory
50 if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
51   set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
52 endif()
53
54 # tk shared library (with absolute path)
55 if (WIN32)
56   if (NOT DEFINED 3RDPARTY_TK_DLL OR NOT 3RDPARTY_TK_DLL_DIR)
57     set (3RDPARTY_TK_DLL "" CACHE FILEPATH "tk shared library" FORCE)
58   endif()
59 endif()
60
61 # tk shared library directory
62 if (WIN32 AND NOT DEFINED 3RDPARTY_TK_DLL_DIR)
63   set (3RDPARTY_TK_DLL_DIR "" CACHE FILEPATH "The directory containing tk shared library")
64 endif()
65
66 # search for tcl in user defined directory
67 if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
68   FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
69   if (TCL_DIR_NAME)
70     set (3RDPARTY_TCL_DIR "${3RDPARTY_DIR}/${TCL_DIR_NAME}" CACHE PATH "The directory containing tcl" FORCE)
71   endif()
72 endif()
73
74 # define paths for default engine
75 if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
76   set (TCL_INCLUDE_PATH "${3RDPARTY_TCL_DIR}/include")
77 endif()
78
79 # check tcl/tk include dir, library dir and shared library dir
80 macro (DIR_SUBDIR_FILE_FIT LIBNAME)
81   if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
82     # tcl/tk include dir
83     if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
84       string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
85       if (NOT DOES_PATH_CONTAIN)
86         set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
87       endif()
88     else()
89       set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
90     endif()
91
92     # tcl/tk library dir
93     if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
94
95       string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
96       if (NOT DOES_PATH_CONTAIN)
97         set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
98       endif()
99     else()
100       set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
101     endif()
102
103     # tcl/tk shared library dir
104     if (WIN32)
105       if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
106         string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL_DIR}")
107         if (NOT DOES_PATH_CONTAIN)
108           set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
109         endif()
110       else()
111         set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
112       endif()
113     endif()
114   endif()
115
116   # check tcl/tk library
117   if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
118     if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
119       string (REGEX MATCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY}")
120
121       if (NOT DOES_PATH_CONTAIN)
122         set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
123       endif()
124     else()
125       set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
126     endif()
127   else()
128     set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
129   endif()
130
131   # check tcl/tk shared library
132   if (WIN32)
133     if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
134       if (3RDPARTY_${LIBNAME}_DLL AND EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
135         string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DLL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL}")
136
137         if (NOT DOES_PATH_CONTAIN)
138           set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
139         endif()
140       else()
141         set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
142       endif()
143     else()
144       set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
145     endif()
146   endif()
147 endmacro()
148
149
150 DIR_SUBDIR_FILE_FIT(TCL)
151 DIR_SUBDIR_FILE_FIT(TK)
152
153
154 # use default (CMake) TCL search
155 find_package(TCL)
156
157 foreach (LIBNAME TCL TK)
158   string (TOLOWER "${LIBNAME}" LIBNAME_L)
159
160   # tcl/tk include dir
161   if (NOT 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
162     if (${LIBNAME}_INCLUDE_PATH AND EXISTS "${${LIBNAME}_INCLUDE_PATH}")
163       set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "${${LIBNAME}_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
164     endif()
165   endif()
166
167   # tcl/tk dir and library
168   if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
169     if (${LIBNAME}_LIBRARY AND EXISTS "${${LIBNAME}_LIBRARY}")
170       set (3RDPARTY_${LIBNAME}_LIBRARY "${${LIBNAME}_LIBRARY}" CACHE FILEPATH "${LIBNAME} library" FORCE)
171
172       if (NOT 3RDPARTY_${LIBNAME}_LIBRARY_DIR)
173         get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
174         set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
175       endif()
176     endif()
177   endif()
178
179
180   if (WIN32)
181     if (NOT 3RDPARTY_${LIBNAME}_DLL)
182         set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
183
184         set (DLL_FOLDER_FOR_SEARCH "")
185         if (3RDPARTY_${LIBNAME}_DLL_DIR)
186           set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
187         elseif (3RDPARTY_TCL_DIR)
188           set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
189         elseif (3RDPARTY_${LIBNAME}_LIBRARY_DIR)
190           get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
191           set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
192         endif()
193
194         set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
195         find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}86 ${LIBNAME_L}85
196                                               PATHS "${DLL_FOLDER_FOR_SEARCH}"
197                                               NO_DEFAULT_PATH)
198     endif()
199   endif()
200
201   DIR_SUBDIR_FILE_FIT(${LIBNAME})
202
203
204   # tcl/tk dir and library
205   if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
206     set (3RDPARTY_${LIBNAME}_LIBRARY "3RDPARTY_${LIBNAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${LIBNAME} library" FORCE)
207     find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
208                                               PATHS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}"
209                                               NO_DEFAULT_PATH)
210
211     # search in another place if previous search doesn't find anything
212     find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
213                                               PATHS "${3RDPARTY_TCL_DIR}/lib"
214                                               NO_DEFAULT_PATH)
215
216
217     if (NOT 3RDPARTY_${LIBNAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
218       set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
219     endif()
220
221     if (NOT 3RDPARTY_${LIBNAME}_LIBRARY_DIR AND 3RDPARTY_${LIBNAME}_LIBRARY)
222       get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
223       set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
224     endif()
225   endif()
226
227   set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "")
228   if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
229     get_filename_component (${LIBNAME}_LIBRARY_NAME "${3RDPARTY_${LIBNAME}_LIBRARY}" NAME)
230     string(REGEX REPLACE "^.*${LIBNAME_L}([0-9]\\.*[0-9]).*$" "\\1" ${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_LIBRARY_NAME}")
231
232     if (NOT "${${LIBNAME}_LIBRARY_VERSION}" STREQUAL "${${LIBNAME}_LIBRARY_NAME}")
233       set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_LIBRARY_VERSION}")
234     else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
235       message (STATUS "Info: ${LIBNAME} version isn't found")
236     endif()
237   endif()
238
239   set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "")
240   if (3RDPARTY_${LIBNAME}_LIBRARY_VERSION)
241     string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_${LIBNAME}_MAJOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
242     string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_${LIBNAME}_MINOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
243     set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_${LIBNAME}_MAJOR_VERSION}.${3RDPARTY_${LIBNAME}_MINOR_VERSION}")
244   endif()
245
246   if (WIN32)
247     if (NOT 3RDPARTY_${LIBNAME}_DLL)
248         set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
249
250         set (DLL_FOLDER_FOR_SEARCH "")
251         if (3RDPARTY_${LIBNAME}_DLL_DIR)
252           set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
253         elseif (3RDPARTY_TCL_DIR)
254           set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
255         else()
256           get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
257           set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
258         endif()
259
260         set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
261         find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}
262                                               PATHS "${DLL_FOLDER_FOR_SEARCH}"
263                                               NO_DEFAULT_PATH)
264
265         if (NOT 3RDPARTY_${LIBNAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
266           set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
267         endif()
268
269         if (NOT 3RDPARTY_${LIBNAME}_DLL_DIR AND 3RDPARTY_${LIBNAME}_DLL)
270           get_filename_component (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL}" PATH)
271           set (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
272         endif()
273     endif()
274   endif()
275
276   # include found paths to common variables
277   if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
278     list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
279   else()
280     list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
281   endif()
282
283   if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
284     list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
285   else()
286     list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_LIBRARY_DIR})
287   endif()
288
289   if (WIN32)
290     if (3RDPARTY_${LIBNAME}_DLL OR EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
291       list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
292     else()
293       list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_DLL_DIR)
294     endif()
295   endif()
296 endforeach()
297
298 # install tcltk
299 if (INSTALL_TCL)
300   # include occt macros. compiler_bitness, os_wiht_bit, compiler
301   OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
302
303   OCCT_MAKE_OS_WITH_BITNESS()
304   OCCT_MAKE_COMPILER_SHORT_NAME()
305
306   if (WIN32)
307     # tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
308
309     # collect and install all dlls from tcl/tk dll dirs
310     file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
311     file (GLOB TK_DLLS  "${3RDPARTY_TK_DLL_DIR}/*.dll")
312     install (FILES ${TCL_DLLS} ${TK_DLLS}
313              CONFIGURATIONS Release
314              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
315     install (FILES ${TCL_DLLS} ${TK_DLLS}
316              CONFIGURATIONS RelWithDebInfo
317              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
318     install (FILES ${TCL_DLLS} ${TK_DLLS}
319              CONFIGURATIONS Debug
320              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
321   else()
322     get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
323     install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
324              CONFIGURATIONS Release
325              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
326     install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
327              CONFIGURATIONS RelWithDebInfo
328              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
329     install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
330              CONFIGURATIONS Debug
331              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
332
333     get_filename_component(3RDPARTY_TK_LIBRARY_REALPATH ${3RDPARTY_TK_LIBRARY} REALPATH)
334     install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
335              CONFIGURATIONS Release
336              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
337     install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
338              CONFIGURATIONS RelWithDebInfo
339              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
340     install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
341              CONFIGURATIONS Debug
342              DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
343   endif()
344
345   if (TCL_TCLSH_VERSION)
346     # tcl is required to install in lib folder (without)
347     install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8"                    DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
348     install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
349     install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}"  DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
350   else()
351     message (STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.")
352     message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
353   endif()
354
355   set (USED_3RDPARTY_TCL_DIR "")
356 else()
357   # the library directory for using by the executable
358   if (WIN32)
359     set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
360   else()
361     set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
362   endif()
363 endif()
364
365 mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TK_LIBRARY 3RDPARTY_TCL_DLL 3RDPARTY_TK_DLL)
366
367 # unset all redundant variables
368 #TCL
369 OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
370 OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
371 OCCT_CHECK_AND_UNSET (TCL_TCLSH)
372 #TK
373 OCCT_CHECK_AND_UNSET (TK_LIBRARY)
374 OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
375 OCCT_CHECK_AND_UNSET (TK_WISH)