summaryrefslogtreecommitdiffstats
path: root/Tests/Wrapping/CMakeLists.txt
blob: e09a01562b74ffc70b27ebfd6ba98c8030c68493 (plain)
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
#
# Wrapping
#
PROJECT (Wrapping)

#
# Lib and exe path
#
SET (LIBRARY_OUTPUT_PATH 
     ${Wrapping_BINARY_DIR}/bin/ CACHE PATH 
     "Single output directory for building all libraries.")

SET (EXECUTABLE_OUTPUT_PATH 
     ${Wrapping_BINARY_DIR}/bin/ CACHE PATH 
     "Single output directory for building all executables.")

#
# Where will executable tests be written ?
#
IF (EXECUTABLE_OUTPUT_PATH)
  SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
ELSE (EXECUTABLE_OUTPUT_PATH)
  SET (CXX_TEST_PATH .)
ENDIF (EXECUTABLE_OUTPUT_PATH)

#
# Add exe
#
ADD_EXECUTABLE (wrapping wrapping.cxx)
ADD_EXECUTABLE (qtwrappingmain qtwrappingmain.cxx QTUI_S_SRCS)

#
# Test VTK wrappers
#
SOURCE_FILES (SRCS
  vtkExcluded
  vtkIncluded
)

WRAP_EXCLUDE_FILES (
  vtkExcluded
)

#
# Specify (empty) VTK hint files
#
FIND_FILE(VTK_WRAP_HINTS hints ${Wrapping_SOURCE_DIR})

#
# Wrap VTK -> Tcl
#
SET (VTK_WRAP_TCL "On")
SET (VTK_WRAP_TCL_EXE "echo")
VTK_WRAP_TCL (wraplibTCL TCL_SRCS SRCS)

#
# Wrap VTK -> Python
#
SET (VTK_WRAP_PYTHON "On")
SET (VTK_WRAP_PYTHON_EXE "echo")
VTK_WRAP_PYTHON (wraplibPython Python_SRCS SRCS)

#
# Wrap VTK -> Java
#
# VTK_WRAP_JAVA puts dependencie between wraplibJavaJavaClasses (in ALL)
# and each Java wrapped class (here, vtkIncluded, so let's create a dummy one
# so that the build succeeds.
#
SET (VTK_WRAP_JAVA "On")
SET (VTK_WRAP_JAVA_EXE "echo")
SET (VTK_PARSE_JAVA_EXE "echo")
SET (VTK_JAVA_HOME "${Wrapping_BINARY_DIR}/java")
VTK_WRAP_JAVA (wraplibJava Java_SRCS SRCS)
CONFIGURE_FILE(
  ${Wrapping_SOURCE_DIR}/dummy
  ${VTK_JAVA_HOME}/vtkIncluded.java
  COPYONLY IMMEDIATE)

#
# QT Wrappers
#

INCLUDE( ../../Modules/FindQt.cmake )
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ./ )

LINK_LIBRARIES( ${QT_LIBRARIES} )

SET (QT_WRAP_CPP "On")
SET (QT_MOC_EXE "echo")
QT_WRAP_CPP (wraplibQT QT_SRCS SRCS)

SET (QT_WRAP_UI "On")
SET (QT_UIC_EXE "echo")
SET (QTUI_SRCS
  qtwrapping.ui
)
QT_WRAP_UI (qtwrappingmain QTUI_H_SRCS QTUI_S_SRCS QTUI_SRCS)

#
# FLTK Wrappers
#
# Since FLTK_FLUID_EXE is supposed to create a .cxx/.h from a .fl/.fld,
# create an empty one so that the dependencies can be met.
#
SOURCE_FILES (FLTK_SRCS
  fltk1.fl
)
SET (FLTK_WRAP_UI "On")
SET (FLTK_FLUID_EXECUTABLE "echo")
FLTK_WRAP_UI (wraplibFLTK FLTK_SRCS)
ADD_LIBRARY (wraplibFLTK)
CONFIGURE_FILE(
  ${Wrapping_SOURCE_DIR}/fltk1.fl
  ${Wrapping_BINARY_DIR}/fltk1.cxx
  COPYONLY)

#
# Mangled Mesa
#
CONFIGURE_FILE(
  ${Wrapping_SOURCE_DIR}/dummy
  ${Wrapping_BINARY_DIR}/gl.h
  COPYONLY IMMEDIATE)
USE_MANGLED_MESA (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa)

#
# Instantiator
#
VTK_MAKE_INSTANTIATOR(vtkWraplibInstantiator 
                      Instantiator_SRCS
                      SRCS
                      EXPORT_MACRO VTK_WRAPLIB_EXPORT
                      HEADER_LOCATION ${Wrapping_BINARY_DIR}
                      GROUP_SIZE 5)

#
# ITK Tcl Wrapping
#
SET(CABLE "echo")
SET(CABLE_INCLUDE_DIR ${Wrapping_SOURCE_DIR})
ADD_LIBRARY(wrapITK)
ITK_WRAP_TCL(wrapITK itkWrapperConfig.cxx)
CONFIGURE_FILE(${Wrapping_SOURCE_DIR}/itkWrapperConfig.cxx
	       ${Wrapping_BINARY_DIR}/itkWrapperConfig_tcl.cxx
               COPYONLY IMMEDIATE)