File: CreateLanguageSupport.cmake

package info (click to toggle)
insighttoolkit4 4.13.3withdata-dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 489,260 kB
  • sloc: cpp: 557,342; ansic: 146,850; fortran: 34,788; python: 16,572; sh: 2,187; lisp: 2,070; tcl: 993; java: 362; perl: 200; makefile: 129; csh: 81; pascal: 69; xml: 19; ruby: 10
file content (62 lines) | stat: -rw-r--r-- 1,920 bytes parent folder | download | duplicates (7)
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
macro(ADD_TCL_TYPEMAP simple_name cpp_name swig_name template_params)
  # write me
endmacro()

macro(TCL_SUPPORT_CONFIGURE_FILES)
  # write me
endmacro()

macro(END_WRAPPER_LIBRARY_TCL)

  set(cpp_files )

  set(modules )

  foreach(source ${WRAPPER_LIBRARY_SWIG_INPUTS})

    get_filename_component(base_name ${source} NAME_WE)
    string(REGEX REPLACE "^wrap_" "" group_name "${base_name}")

    # create the swig interface for all the groups in the module
    #
    set(interface_file "${WRAPPER_MASTER_INDEX_OUTPUT_DIR}/${base_name}.i")
    set(lib ${group_name}Tcl)
    set(cpp_file "${CMAKE_CURRENT_BINARY_DIR}/${base_name}Tcl.cpp")

    add_custom_command(
      OUTPUT ${cpp_file}
      COMMAND swig -c++ -tcl -fcompact -O -Werror -w508 -w312 -w314 -w509 -w302 -w362
      -w365 -w366 -w367 -w368 -w378 -w503 # operator???, to be suppressed later...
      -l${WrapITK_SOURCE_DIR}/Tcl/tcl.i
      -o ${cpp_file}
#      -I${WRAPPER_MASTER_INDEX_OUTPUT_DIR}
      -outdir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
      ${interface_file}
      WORKING_DIRECTORY ${WRAPPER_MASTER_INDEX_OUTPUT_DIR}/tcl
      DEPENDS ${interface_file} ${WrapITK_SOURCE_DIR}/Tcl/tcl.i
    )
    add_custom_target(${base_name}SwigTcl DEPENDS ${cpp_file})

    list(APPEND cpp_files ${cpp_file})

    list(APPEND modules ${group_name})

    add_library(${lib} SHARED ${cpp_file})
    set_target_properties(${lib} PROPERTIES PREFIX "")
    target_link_libraries(${lib} ${WRAPPER_LIBRARY_LINK_LIBRARIES} ${TCL_LIBRARY})

  endforeach()

#  add_library(${WRAPPER_LIBRARY_NAME}Tcl MODULE ${cpp_files})
#  set_target_properties(${WRAPPER_LIBRARY_NAME}Tcl PROPERTIES PREFIX "_")
#  target_link_libraries( ${WRAPPER_LIBRARY_NAME}Tcl
#    ${WRAPPER_LIBRARY_LINK_LIBRARIES}
#    ${TCL_LIBRARY}
#  )

  add_custom_target(${WRAPPER_LIBRARY_NAME}SwigTcl DEPENDS ${cpp_files})

  add_custom_target(${WRAPPER_LIBRARY_NAME}Tcl DEPENDS ${modules})


endmacro()