CMakeLists.txt 2.77 KB
Newer Older
1
# Allow the user to customize their build with some local options
2
include(${VTK_SOURCE_DIR}/Wrapping/Tools/LocalUserOptions.cmake OPTIONAL)
3

4
# vtkParse.tab.c has #line markers that break #include with double quotes.
5 6 7
include_directories(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
8
  ${VTK_BINARY_DIR}/Common/Core
9
  ${VTK_SOURCE_DIR}/Common/Core
10
  ${VTK_BINARY_DIR}/Utilities/KWSys)
11

12
set(VTK_PARSE_SOURCES
13 14 15 16
  vtkParse.h
  vtkParseType.h
  vtkParse.tab.c
  vtkParseData.c
17
  vtkParseMain.c
18
  vtkParseExtras.c
19
  vtkParseMangle.c
20
  vtkParseMerge.c
21 22
  vtkParseString.c
  vtkParseHierarchy.c
23 24 25
  vtkParsePreprocess.c
  vtkWrap.c
  vtkWrapText.c
26 27
)

28 29 30 31 32 33
set_source_files_properties(
  vtkParse.h
  vtkParseType.h
  HEADER_FILE_ONLY
)

34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
# get absolute path of each header for install rules
set(VTK_PARSE_HEADERS)
foreach(arg ${VTK_PARSE_SOURCES})
  get_filename_component(src "${arg}" ABSOLUTE)
  string(REGEX REPLACE "\\.c$" ".h" hdr "${src}")
  if("${hdr}" MATCHES "\\.h$" AND EXISTS "${hdr}")
    list(APPEND VTK_PARSE_HEADERS "${hdr}")
  endif()
endforeach()

# Create a module, but the wrapper tools module is atypical so a lot of
# customization is done here.
set(${vtk-module}_LIBRARIES ${vtk-module})
vtk_module_impl()

49
# Wrapper tools must be statically linked
50 51
vtk_add_library(${vtk-module} STATIC ${VTK_PARSE_SOURCES})
vtk_module_export_info()
52

53 54 55 56 57 58
if(NOT VTK_INSTALL_NO_DEVELOPMENT)
  install(FILES ${VTK_PARSE_HEADERS}
    DESTINATION ${VTK_INSTALL_INCLUDE_DIR}
    COMPONENT Development
    )
endif()
59

Brad King's avatar
Brad King committed
60 61 62
set_property(SOURCE vtkParseMain.c PROPERTY COMPILE_DEFINITIONS
  VTK_PARSE_VERSION="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")

63 64
if(NOT CMAKE_CROSSCOMPILING)

65 66 67
  add_executable(vtkWrapHierarchy vtkWrapHierarchy.c)
  target_link_libraries(vtkWrapHierarchy vtkWrappingTools)
  vtk_compile_tools_target(vtkWrapHierarchy)
Ken Martin's avatar
Ken Martin committed
68

69 70 71 72 73
  add_executable(vtkWrapTcl vtkWrapTcl.c)
  target_link_libraries(vtkWrapTcl vtkWrappingTools)
  add_executable(vtkWrapTclInit vtkWrapTclInit.c)
  vtk_compile_tools_target(vtkWrapTcl)
  vtk_compile_tools_target(vtkWrapTclInit)
Ken Martin's avatar
Ken Martin committed
74

75 76 77 78
  add_executable(vtkWrapPython
    vtkWrapPython.c
    vtkWrapPythonClass.c
    vtkWrapPythonConstant.c
79
    vtkWrapPythonEnum.c
80 81
    vtkWrapPythonMethod.c
    vtkWrapPythonMethodDef.c
David Gobbi's avatar
David Gobbi committed
82
    vtkWrapPythonNamespace.c
83 84 85 86
    vtkWrapPythonOverload.c
    vtkWrapPythonTemplate.c
    vtkWrapPythonType.c
  )
87 88 89 90 91 92 93 94 95 96 97
  target_link_libraries(vtkWrapPython vtkWrappingTools)
  add_executable(vtkWrapPythonInit vtkWrapPythonInit.c)
  vtk_compile_tools_target(vtkWrapPython)
  vtk_compile_tools_target(vtkWrapPythonInit)

  add_executable(vtkParseJava vtkParseJava.c)
  target_link_libraries(vtkParseJava vtkWrappingTools)
  add_executable(vtkWrapJava vtkWrapJava.c)
  target_link_libraries(vtkWrapJava vtkWrappingTools)
  vtk_compile_tools_target(vtkParseJava)
  vtk_compile_tools_target(vtkWrapJava)
98 99

endif()