File: CMakeLists.txt

package info (click to toggle)
vtk 5.0.2-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 51,080 kB
  • ctags: 67,442
  • sloc: cpp: 522,627; ansic: 221,292; tcl: 43,377; python: 14,072; perl: 3,102; java: 1,436; yacc: 1,033; sh: 469; lex: 248; makefile: 181; asm: 154
file content (262 lines) | stat: -rw-r--r-- 6,060 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
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
PROJECT (VTKFTGL)

#
# Dependency mask
#
INCLUDE_REGULAR_EXPRESSION(".*")

#
# Include path
#
INCLUDE_DIRECTORIES (
  ${VTKFTGL_SOURCE_DIR}/src
  ${VTKFTGL_BINARY_DIR}
)

#
# Collect the required libs
#
SET (VTKFTGL_LIBS "")

#
# Do not use the STL (portability issue)
#
SET (VTKFTGL_DO_NOT_USE_STL 1)

#
# Source files
#
SET (FTGL_SRCS
  src/FTBitmapGlyph.cpp
  src/FTBitmapGlyphRenderOpenGL.cpp
  src/FTCharmap.cpp
  src/FTFace.cpp
  src/FTFont.cpp
  src/FTGLBitmapFont.cpp
  src/FTGLBitmapFontRenderOpenGL.cpp
  src/FTGLPixmapFont.cpp
  src/FTGLPixmapFontRenderOpenGL.cpp
  src/FTGlyph.cpp
  src/FTGlyphContainer.cpp
  src/FTLibrary.cpp
  src/FTPixmapGlyph.cpp
  src/FTPixmapGlyphRenderOpenGL.cpp
  src/FTSize.cpp
)

#
# Do not use texture fonts (crash on Type1 fonts)
#
SET (VTKFTGL_DO_NOT_USE_TEXTURE_FONT 1)
IF (NOT VTKFTGL_DO_NOT_USE_TEXTURE_FONT)
  SET (FTGL_SRCS ${FTGL_SRCS}
    src/FTGLTextureFont.cpp
    src/FTTextureGlyph.cpp
  )
ENDIF (NOT VTKFTGL_DO_NOT_USE_TEXTURE_FONT)

#
# Do not use vector fonts (we only need pixmap and bitmaps and vector fonts
# needs glu). Might be an option at some point, but set it to 'true' for now.
#
SET (VTKFTGL_DO_NOT_USE_VECTORISER 1)
IF (NOT VTKFTGL_DO_NOT_USE_VECTORISER)
  SET (FTGL_SRCS ${FTGL_SRCS}
    src/FTExtrdGlyph.cpp
    src/FTGLExtrdFont.cpp
    src/FTGLOutlineFont.cpp
    src/FTGLPolygonFont.cpp
    src/FTOutlineGlyph.cpp
    src/FTPolyGlyph.cpp
  )
ENDIF (NOT VTKFTGL_DO_NOT_USE_VECTORISER)

#
# Support Mangle Mesa
#
IF (VTK_USE_MANGLED_MESA)
  SET (FTGL_SUPPORT_MANGLE_MESA 1)
  IF (FTGL_SUPPORT_MANGLE_MESA)
    SET (FTGL_SRCS ${FTGL_SRCS}
      src/FTBitmapGlyphRenderMesa.cpp
      src/FTGLBitmapFontRenderMesa.cpp
      src/FTGLPixmapFontRenderMesa.cpp
      src/FTPixmapGlyphRenderMesa.cpp
    )
  ENDIF (FTGL_SUPPORT_MANGLE_MESA)
ENDIF (VTK_USE_MANGLED_MESA)

#
# Shared/static lib settings)
#
IF (BUILD_SHARED_LIBS)
  SET (VTKFTGL_DLL 1)
ELSE (BUILD_SHARED_LIBS)
  SET (VTKFTGL_STATIC 1)
ENDIF (BUILD_SHARED_LIBS)

#
# Win32 flags (and shared/static lib settings)
#
IF (WIN32)
  # This will add -DUSE_STD_NAMESPACE and -DWIN32
  SET (VTKFTGL_WIN32_FLAGS 1)
ENDIF (WIN32)

#
# Unix flags
#
IF (UNIX)
  IF(CMAKE_SYSTEM MATCHES "HP-UX.*")
    SET (VTKFTGL_HPUX_SOURCE 1)
  ENDIF(CMAKE_SYSTEM MATCHES "HP-UX.*")
ENDIF (UNIX)

#
# Apple flags
#
IF (APPLE)
  IF(CMAKE_COMPILER_IS_GNUCXX)
    SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fpascal-strings")
  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF (APPLE)

#
# We need OpenGL
#
# Use GL library provided by parent VTK if possible.
#
IF(NOT OPENGL_FOUND)
  FIND_PACKAGE(OpenGL)
  IF (OPENGL_INCLUDE_PATH)
    INCLUDE_DIRECTORIES (${OPENGL_INCLUDE_PATH})
  ENDIF (OPENGL_INCLUDE_PATH)
ENDIF(NOT OPENGL_FOUND)
SET (VTKFTGL_LIBS "${VTKFTGL_LIBS};${OPENGL_gl_LIBRARY}")

#
# We obviously need FreeType
#
SET (VTKFTGL_LIBS "${VTKFTGL_LIBS};${VTK_FREETYPE_LIBRARIES}")

#
# Define the library (and install it)
#
ADD_LIBRARY (vtkftgl ${FTGL_SRCS})
TARGET_LINK_LIBRARIES(vtkftgl ${VTKFTGL_LIBS})

# Apply user-defined properties to the library target.
IF(VTK_LIBRARY_PROPERTIES)
  SET_TARGET_PROPERTIES(vtkftgl PROPERTIES ${VTK_LIBRARY_PROPERTIES})
ENDIF(VTK_LIBRARY_PROPERTIES)

IF(NOT VTK_INSTALL_NO_LIBRARIES)
  INSTALL_TARGETS (${VTK_INSTALL_LIB_DIR} vtkftgl)
ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)

#
# Do not cover this lib
#
CONFIGURE_FILE (${VTKFTGL_SOURCE_DIR}/.NoDartCoverage
                ${VTKFTGL_BINARY_DIR}/.NoDartCoverage)

#
# Create the configuration file
#
ADD_DEFINITIONS (-DVTKFTGL)
CONFIGURE_FILE(${VTKFTGL_SOURCE_DIR}/vtkftglConfig.h.in
               ${VTKFTGL_BINARY_DIR}/vtkftglConfig.h)

#
# Build examples (testing purposes)
# (Warning, they use Glut)
#
#OPTION (FTGL_BUILD_EXAMPLES "Build FTGL examples (warning: you need Glut)" OFF)
#MARK_AS_ADVANCED (FTGL_BUILD_EXAMPLES)
SET(FTGL_BUILD_EXAMPLES 0)

IF (FTGL_BUILD_EXAMPLES)

  #
  # Need GLU and GLUT
  #
  FIND_PACKAGE(GLU)
  FIND_PACKAGE(GLUT)

  IF (GLU_LIBRARY AND GLUT_LIBRARY)

    SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_LIBS}")

    IF (GLUT_INCLUDE_PATH)
      INCLUDE_DIRECTORIES (${GLUT_INCLUDE_PATH})
    ENDIF (GLUT_INCLUDE_PATH)
    SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};${GLUT_LIBRARY}")

    IF (GLU_INCLUDE_PATH)
      INCLUDE_DIRECTORIES (${GLU_INCLUDE_PATH})
    ENDIF (GLU_INCLUDE_PATH)
    SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};${GLU_LIBRARY}")

    #
    # Do we need X ?
    #
    IF (VTK_USE_X)
      SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};-lXt")
      FIND_LIBRARY (XMU_LIBRARY Xmu
        /usr/lib 
        /usr/local/lib 
        /opt/graphics/OpenGL/lib 
        /usr/openwin/lib 
        /usr/X11R6/lib
        /usr/contrib/X11R6/lib
      )
      MARK_AS_ADVANCED (XMU_LIBRARY)
      IF (XMU_LIBRARY)
        SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};${XMU_LIBRARY}")
      ENDIF (XMU_LIBRARY)
      SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};${CMAKE_X_LIBS}")
    ENDIF (VTK_USE_X)

    #
    # Win32 flags
    #
    IF (WIN32)
      # - Avoid the glutCreateMenu_ATEXIT_HACK pb.
      # - Sort-of a hack to avoid the bug in glut.h to avoid
      #   ambiguity between 'std::exit(int)' and 'std::exit(int)' in function
      ADD_DEFINITIONS (-DGLUT_DISABLE_ATEXIT_HACK)
      ADD_DEFINITIONS (-DGLUT_BUILDING_LIB)
    ENDIF (WIN32)

    #
    # Apple libraries.
    #
    IF (APPLE)
      SET (VTKFTGL_EXAMPLES_LIBS "-framework Cocoa" ${VTKFTGL_EXAMPLES_LIBS})
    ENDIF (APPLE)

    #
    # Link examples to FTGL and Freetype
    #
    SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};vtkftgl;${VTK_FREETYPE_LIBRARIES}")

    #
    # Example 1
    #
    SET(FTGL_DEMO_SRCS
      demo/tb.c
      demo/trackball.c
      demo/FTGLDemo.cpp
    )
    ADD_EXECUTABLE (ftgl_demo ${FTGL_DEMO_SRCS})
    TARGET_LINK_LIBRARIES(ftgl_demo ${VTKFTGL_EXAMPLES_LIBS})

    #
    # Example 2
    #
    ADD_EXECUTABLE (ftgl_demo2 demo/demo.cpp)
    TARGET_LINK_LIBRARIES(ftgl_demo2 ${VTKFTGL_EXAMPLES_LIBS})

  ENDIF (GLU_LIBRARY AND GLUT_LIBRARY)

ENDIF (FTGL_BUILD_EXAMPLES)