File: vtkImplicitArrays.cmake

package info (click to toggle)
vtk9 9.5.2%2Bdfsg3-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 205,984 kB
  • sloc: cpp: 2,336,570; ansic: 327,116; python: 111,200; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; makefile: 181; javascript: 165; objc: 153; tcl: 59
file content (43 lines) | stat: -rw-r--r-- 1,398 bytes parent folder | download | duplicates (2)
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
# This file generates vtkImplicitArrays subclass for concrete type,
# like `vtkConstanteDoubleArray` or `vtkIdTypeCompositeArray`.
#
# Generated classes are not templated thus they can be wrapped.

# Configure `.in` class files depending on the requested backend
# and the concrete c++ type.
macro(_generate_implicit_array_specialization backend vtk_type concrete_type)
  # used inside .in files
  set(VTK_TYPE_NAME "${vtk_type}")
  set(CONCRETE_TYPE "${concrete_type}")

  set(_className "vtk${backend}${VTK_TYPE_NAME}Array")

  configure_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/vtk${backend}TypedArray.h.in"
    "${CMAKE_CURRENT_BINARY_DIR}/${_className}.h"
    @ONLY)

  configure_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/vtk${backend}TypedArray.cxx.in"
    "${CMAKE_CURRENT_BINARY_DIR}/${_className}.cxx"
    @ONLY)

  # append generated files to current module headers and sources
  list(APPEND headers
    "${CMAKE_CURRENT_BINARY_DIR}/${_className}.h")
  list(APPEND sources
    "${CMAKE_CURRENT_BINARY_DIR}/${_className}.cxx")

  unset(VTK_TYPE_NAME)
  unset(CONCRETE_TYPE)
  unset(_className)
endmacro()

include(vtkTypeLists)

foreach(backend IN ITEMS Constant Affine Indexed Composite)
  foreach (type IN LISTS vtk_numeric_types)
    vtk_type_to_camel_case("${type}" cased_type)
    _generate_implicit_array_specialization("${backend}" "${cased_type}" "${type}")
  endforeach()
endforeach()