This file is indexed.

/usr/lib/cmake/paraview/vtkTclTkMacros.cmake is in paraview-dev 5.1.2+dfsg1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# ----------------------------------------------------------------------------
# VTK_GET_TCL_TK_VERSION
# Return the major/minor version of the Tcl/Tk library used by VTK.
#
# in: tcl_tk_major_version: name of the var the major version is written to
#     tcl_tk_minor_version: name of the var the minor version is written to
#
# ex: VTK_GET_TCL_TK_VERSION ("TCL_TK_MAJOR_VERSION" "TCL_TK_MINOR_VERSION")
#     SET (TCL_TK_VERSION "${TCL_TK_MAJOR_VERSION}.${TCL_TK_MINOR_VERSION}")

MACRO (VTK_GET_TCL_TK_VERSION tcl_tk_major_version tcl_tk_minor_version)

  # Try to find the current Tcl/Tk version by matching TK_INTERNAL_PATH
  # or TCL_LIBRARY against some version numbers

  SET (${tcl_tk_major_version} "")
  SET (${tcl_tk_minor_version} "")
  IF (TK_INTERNAL_PATH)
    SET (try_tk_internal_path ${TK_INTERNAL_PATH})
  ELSE ()
    SET (try_tk_internal_path ${VTK_TK_INTERNAL_DIR})
  ENDIF ()
  FOREACH (tcl_tk_minor_version_try "2" "3" "4" "5" "6")
    IF ("${try_tk_internal_path}" MATCHES "tk8\\.?${tcl_tk_minor_version_try}")
      SET (${tcl_tk_major_version} "8")
      SET (${tcl_tk_minor_version} ${tcl_tk_minor_version_try})
    ENDIF ()
    IF ("${TCL_LIBRARY}" MATCHES "tcl8\\.?${tcl_tk_minor_version_try}")
      SET (${tcl_tk_major_version} "8")
      SET (${tcl_tk_minor_version} ${tcl_tk_minor_version_try})
    ENDIF ()
    IF ("${TCL_INCLUDE_PATH}" MATCHES "tcl8\\.?${tcl_tk_minor_version_try}")
      SET (${tcl_tk_major_version} "8")
      SET (${tcl_tk_minor_version} ${tcl_tk_minor_version_try})
    ENDIF ()
    # Mac
    IF ("${TCL_INCLUDE_PATH}" MATCHES "Tcl.*8\\.${tcl_tk_minor_version_try}")
      SET (${tcl_tk_major_version} "8")
      SET (${tcl_tk_minor_version} ${tcl_tk_minor_version_try})
    ENDIF ()
  ENDFOREACH ()

  FOREACH(dir ${TCL_INCLUDE_PATH})
    IF(EXISTS "${dir}/tcl.h")
      FILE(READ "${dir}/tcl.h" tcl_include_file)
      STRING(REGEX REPLACE
        ".*#define TCL_VERSION[ \t]*\"([0-9][0-9]*\\.[0-9][0-9]*)\".*" "\\1"
        tcl_include_file "${tcl_include_file}")
      IF(${tcl_include_file} MATCHES "^[0-9]*\\.[0-9]*$")
        STRING(REGEX REPLACE "^([0-9]*)\\.([0-9]*)$" "\\1" ${tcl_tk_major_version}
          "${tcl_include_file}")
        STRING(REGEX REPLACE "^([0-9]*)\\.([0-9]*)$" "\\2" ${tcl_tk_minor_version}
          "${tcl_include_file}")
      ENDIF()
    ENDIF()
  ENDFOREACH()

ENDMACRO ()

# ----------------------------------------------------------------------------
# VTK_GET_TCL_SUPPORT_FILES, VTK_GET_TK_SUPPORT_FILES
# Get a list of Tcl/Tk support files for a given Tcl/Tk repository.
# Tcl/Tk support files are additional files that are mandatory for Tcl/Tk
# to work properly. Linking against Tcl/Tk shared/static library is just
# not enough, Tcl/Tk needs to access those files at run-time.
# A typical Tcl/Tk installation will store support files in sub-directories
# inside the Tcl/Tk lib directory, organized by version number.
# Example:
#    c:/tcl/lib/tcl8.4
#    c:/tcl/lib/tcl8.3
#    c:/tcl/lib/tk8.4
#    c:/tcl/lib/tk8.3
# A typical source repository is organized differently:
#    c:/tcl8.4.5/library
#    c:/tk8.4.5/library
# Given the path to the Tcl support lib dir, VTK_GET_TCL_SUPPORT_FILES will
# return the corresponding list of support files.
# Given the path to the Tk support lib dir, VTK_GET_TK_SUPPORT_FILES will
# return the corresponding list of support files.
#
# in: support_lib_dir: path to the Tcl (or Tk) support lib dir
#     list:            name of the var the list is written to

MACRO (VTK_GET_TCL_SUPPORT_FILES tcl_support_lib_dir list)

  # Tcl support files (*.tcl + encoding + tclIndex, etc.)

  FILE (GLOB TCL_SUPPORT_FILES_TCL  "${tcl_support_lib_dir}/*.tcl")
  FILE (GLOB TCL_SUPPORT_FILES_ENC  "${tcl_support_lib_dir}/encoding/*.enc")
  FILE (GLOB TCL_SUPPORT_FILES_MSGS "${tcl_support_lib_dir}/msgs/*.msg")
  SET (${list}
    "${tcl_support_lib_dir}/tclIndex"
    ${TCL_SUPPORT_FILES_TCL}
    ${TCL_SUPPORT_FILES_ENC}
    ${TCL_SUPPORT_FILES_MSGS}
    )

ENDMACRO ()

MACRO (VTK_GET_TK_SUPPORT_FILES tk_support_lib_dir list)

  # Tk support files (*.tcl + tclIndex, etc.)

  FILE (GLOB TK_SUPPORT_FILES_TCL  "${tk_support_lib_dir}/*.tcl")
  FILE (GLOB TK_SUPPORT_FILES_MSGS "${tk_support_lib_dir}/msgs/*.msg")
  FILE (GLOB TK_SUPPORT_FILES_TTK  "${tk_support_lib_dir}/ttk/*.tcl")
  SET (${list}
    "${tk_support_lib_dir}/tclIndex"
    ${TK_SUPPORT_FILES_TCL}
    ${TK_SUPPORT_FILES_MSGS}
    ${TK_SUPPORT_FILES_TTK}
    )

ENDMACRO ()

# ----------------------------------------------------------------------------
# VTK_COPY_TCL_TK_SUPPORT_FILES
# Copy (or install) Tcl/Tk support files to a specific location.
# See VTK_GET_TCL_SUPPORT_FILES for more info about support files.
# Given the paths to the Tcl and Tk support lib dirs, this macro will
# copy (or install) the appropriate support files to destination dirs,
# recreating the subdirs.
# This macro takes an optional last parameter, if set to INSTALL the
# files will be scheduled for installation (using CMake's INSTALL)
# instead of copied.
#
# in: tcl_support_lib_dir:  path to the Tcl support lib dir
#     tcl_support_lib_dest: destination dir for the Tcl support lib files
#     tk_support_lib_dir:   path to the Tk support lib dir
#     tk_support_lib_dest:  destination dir for the Tk support lib files
#     INSTALL:              optional parameter (install files instead of copy)
#
# ex: VTK_COPY_TCL_TK_SUPPORT_FILES (
#       "c:/tcl/lib/tcl8.4" "d:/vtk-bin/TclTk/lib/tcl8.4"
#       "c:/tcl/lib/tk8.4" "d:/vtk-bin/TclTk/lib/tk8.4")
#     this will copy support files from:
#       c:/tcl/lib/tcl8.4
#       c:/tcl/lib/tk8.4
#     to:
#       d:/vtk-bin/TclTk/lib/tcl8.4
#       d:/vtk-bin/TclTk/lib/tk8.4

MACRO (VTK_COPY_TCL_TK_SUPPORT_FILES tcl_support_lib_dir tcl_support_lib_dest tk_support_lib_dir tk_support_lib_dest)

  # Get the support files and copy them to dest dir
  # Check if EXISTS to work around CONFIGURE_FILE bug (if file does not
  # exist, it would create the subdirs anyway)

  VTK_GET_TCL_SUPPORT_FILES(${tcl_support_lib_dir} "TCL_SUPPORT_FILES")
  STRING(REGEX REPLACE "^/" "" tcl_support_lib_dest_cm24 "${tcl_support_lib_dest}")
  STRING(REGEX REPLACE "^/" "" tk_support_lib_dest_cm24 "${tk_support_lib_dest}")
  FOREACH (file ${TCL_SUPPORT_FILES})
    IF (EXISTS ${file})
      STRING (REGEX REPLACE "${tcl_support_lib_dir}/" "" filebase ${file})
      IF ("${ARGV4}" STREQUAL "INSTALL")
        GET_FILENAME_COMPONENT(dir ${filebase} PATH)
        INSTALL(FILES "${file}"
          DESTINATION "${tcl_support_lib_dest_cm24}/${dir}"
          COMPONENT RuntimeLibraries)
      ELSE ()
        CONFIGURE_FILE (${file} "${tcl_support_lib_dest}/${filebase}" COPYONLY)
      ENDIF ()
    ENDIF ()
  ENDFOREACH ()

  VTK_GET_TK_SUPPORT_FILES(${tk_support_lib_dir} "TK_SUPPORT_FILES")
  FOREACH (file ${TK_SUPPORT_FILES})
    IF (EXISTS ${file})
      STRING (REGEX REPLACE "${tk_support_lib_dir}/" "" filebase ${file})
      IF ("${ARGV4}" STREQUAL "INSTALL")
        GET_FILENAME_COMPONENT(dir ${filebase} PATH)
        INSTALL(FILES "${file}"
          DESTINATION "${tk_support_lib_dest_cm24}/${dir}"
          COMPONENT RuntimeLibraries)
      ELSE ()
        CONFIGURE_FILE (${file} "${tk_support_lib_dest}/${filebase}" COPYONLY)
      ENDIF ()
    ENDIF ()
  ENDFOREACH ()

ENDMACRO ()

# ----------------------------------------------------------------------------
# VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR
# Front-end to VTK_COPY_TCL_TK_SUPPORT_FILES, this macro will
# copy (or install) the appropriate Tcl/Tk support files to a directory.
# The Tcl/Tk version is retrieved automatically and used to create
# the subdirectories (see example below)
# This macro takes an optional last parameter, if set to INSTALL the
# files will be scheduled for installation (using CMake's INSTALL)
# instead of copied.
#
# in: tcl_support_lib_dir: path to the Tcl support lib dir
#     tk_support_lib_dir:  path to the Tk support lib dir
#     target_dir:          target directory
#     INSTALL:             optional parameter (install files instead of copy)
#
# ex: VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR (
#        "c:/tcl/lib/tcl8.4" "c:/tcl/lib/tk8.4" "d:/vtk-bin/lib")
#     if this project is configured to use TclTk 8.4, this will copy support
#     files from:
#       c:/tcl/lib/tcl8.4
#       c:/tcl/lib/tk8.4
#     to:
#       d:/vtk-bin/lib/tcl8.4
#       d:/vtk-bin/lib/tk8.4

MACRO (VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR tcl_support_lib_dir tk_support_lib_dir target_dir)
  VTK_GET_TCL_TK_VERSION ("TCL_TK_MAJOR_VERSION" "TCL_TK_MINOR_VERSION")
  IF (TCL_TK_MAJOR_VERSION AND TCL_TK_MINOR_VERSION)
    SET (TCL_TK_VERSION "${TCL_TK_MAJOR_VERSION}.${TCL_TK_MINOR_VERSION}")
    VTK_COPY_TCL_TK_SUPPORT_FILES (
      "${tcl_support_lib_dir}"
      "${target_dir}/tcl${TCL_TK_VERSION}"
      "${tk_support_lib_dir}"
      "${target_dir}/tk${TCL_TK_VERSION}"
      "${ARGV3}"
      )
  ENDIF ()

ENDMACRO ()

# ----------------------------------------------------------------------------
# VTK_COPY_TCL_TK_SUPPORT_FILES_TO_BUILD_DIR
# Front-end to VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR, this macro will copy the
# appropriate Tcl/Tk support files to a project build directory.
# The support files will be copied simultaneously to all configuration
# sub-directories (Release, RelInfo, Debug, etc.) if needed.
# The Tcl/Tk version is retrieved automatically and used to create
# the subdirectories (see example below)
#
# in: tcl_support_lib_dir: path to the Tcl support lib dir
#     tk_support_lib_dir:  path to the Tk support lib dir
#     build_dir:           project build dir
#     dir:                 relative subdir inside the build dir, into which the
#                          support files will be copied.
#
# ex: VTK_COPY_TCL_TK_SUPPORT_FILES_TO_BUILD_DIR (
#        "c:/tcl/lib/tcl8.4" "c:/tcl/lib/tk8.4" "d:/vtk-bin" "TclTk/lib")
#     if this project is configured to use TclTk 8.4, this will copy support
#     files from:
#       c:/tcl/lib/tcl8.4
#       c:/tcl/lib/tk8.4
#     to:
#       d:/vtk-bin/TclTk/lib/tcl8.4
#       d:/vtk-bin/TclTk/lib/tk8.4
#     or (if configuration types are supported by the generator):
#       d:/vtk-bin/Release/TclTk/lib/tcl8.4
#       d:/vtk-bin/Release/TclTk/lib/tk8.4
#       d:/vtk-bin/Debug/TclTk/lib/tcl8.4
#       d:/vtk-bin/Debug/TclTk/lib/tk8.4
#       etc.

MACRO (VTK_COPY_TCL_TK_SUPPORT_FILES_TO_BUILD_DIR tcl_support_lib_dir tk_support_lib_dir build_dir dir)

  # For each configuration type (Debug, RelInfo, Release, etc.)
  # Copy the TclTk support files to the corresponding sub-directory inside
  # the build dir

  IF (CMAKE_CONFIGURATION_TYPES)
    SET (CONFIG_TYPES ${CMAKE_CONFIGURATION_TYPES})
  ELSE ()
    SET (CONFIG_TYPES .)
  ENDIF ()
  FOREACH (config ${CONFIG_TYPES})
    VTK_COPY_TCL_TK_SUPPORT_FILES_TO_DIR (
      "${tcl_support_lib_dir}"
      "${tk_support_lib_dir}"
      "${build_dir}/${config}/${dir}"
      )
  ENDFOREACH ()

ENDMACRO ()