Maitland,

        Here the patch against VTK 4.4 to support system lib freetype 6.
Steps:
1. Get VTK 4.4
   cvs up -r release-4-4 -dP
2. Copy cmake file into CMake subdir:
   cp /tmp/FindFREETYPE VTK/CMake
3. apply patch
   patch -p0 < /tmp/freetype.patch
4. Paranoid check:
   cd VTK/Utilities; \rm -r freetype
5. configure + build VTK (ccmake + make)

Let me know how it works.
Mathieu

#
# Find the native FREETYPE includes and library
# 

# This module defines
# FREETYPE_INCLUDE_DIR, where to find png.h, etc.
# FREETYPE_LIBRARIES, the libraries to link against to use PNG.
# FREETYPE_FOUND, If false, do not try to use FREETYPE.

# also defined, but not for general use are
# FREETYPE_LIBRARY, where to find the FREETYPE library.

FIND_PATH(FREETYPE_INCLUDE_DIR ft2build.h
  /usr/include
  /usr/local/include
)

FIND_LIBRARY(FREETYPE_LIBRARY freetype
  /usr/lib
  /usr/local/lib
)

IF (FREETYPE_LIBRARY)
  IF (FREETYPE_INCLUDE_DIR)
    SET(FREETYPE_FOUND "YES")
  ENDIF (FREETYPE_INCLUDE_DIR)
ENDIF (FREETYPE_LIBRARY)


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/VTK/VTK/CMakeLists.txt,v
retrieving revision 1.225.2.5
diff -u -3 -p -r1.225.2.5 CMakeLists.txt
--- CMakeLists.txt	24 Mar 2004 17:26:56 -0000	1.225.2.5
+++ CMakeLists.txt	12 Mar 2005 21:59:11 -0000
@@ -431,6 +431,7 @@ VTK_THIRD_PARTY_OPTION(JPEG jpeg)
 VTK_THIRD_PARTY_OPTION(PNG  png)
 VTK_THIRD_PARTY_OPTION(TIFF tiff)
 VTK_THIRD_PARTY_OPTION(EXPAT expat)
+VTK_THIRD_PARTY_OPTION(FREETYPE freetype)
 
 #-----------------------------------------------------------------------------
 # VTK requires special compiler flags on some platforms.
Index: VTKConfig.cmake.in
===================================================================
RCS file: /cvsroot/VTK/VTK/VTKConfig.cmake.in,v
retrieving revision 1.37
diff -u -3 -p -r1.37 VTKConfig.cmake.in
--- VTKConfig.cmake.in	22 Oct 2003 19:35:22 -0000	1.37
+++ VTKConfig.cmake.in	12 Mar 2005 21:59:11 -0000
@@ -98,6 +98,7 @@ SET(VTK_ZLIB_LIBRARIES "@VTK_ZLIB_LIBRAR
 SET(VTK_JPEG_LIBRARIES "@VTK_JPEG_LIBRARIES@")
 SET(VTK_TIFF_LIBRARIES "@VTK_TIFF_LIBRARIES@")
 SET(VTK_EXPAT_LIBRARIES "@VTK_EXPAT_LIBRARIES@")
+SET(VTK_FREETYPE_LIBRARIES "@VTK_FREETYPE_LIBRARIES@")
 
 # The VTK library dependencies.
 IF(NOT VTK_NO_LIBRARY_DEPENDS)
Index: Rendering/CMakeLists.txt
===================================================================
RCS file: /cvsroot/VTK/VTK/Rendering/CMakeLists.txt,v
retrieving revision 1.167
diff -u -3 -p -r1.167 CMakeLists.txt
--- Rendering/CMakeLists.txt	11 Dec 2003 21:28:56 -0000	1.167
+++ Rendering/CMakeLists.txt	12 Mar 2005 21:59:12 -0000
@@ -15,8 +15,11 @@ IF (JAVA_AWT_LIBRARY)
 ENDIF (JAVA_AWT_LIBRARY)
 SET(KIT_LIBS vtkGraphics vtkImaging vtkIO
   vtkftgl
-  vtkfreetype
+  freetype
 )
+INCLUDE_DIRECTORIES(
+  ${FREETYPE_INCLUDE_DIR}
+  )
 
 SET( Kit_SRCS
 vtkAbstractMapper3D.cxx
Index: Utilities/CMakeLists.txt
===================================================================
RCS file: /cvsroot/VTK/VTK/Utilities/CMakeLists.txt,v
retrieving revision 1.17
diff -u -3 -p -r1.17 CMakeLists.txt
--- Utilities/CMakeLists.txt	4 Sep 2003 17:43:36 -0000	1.17
+++ Utilities/CMakeLists.txt	12 Mar 2005 21:59:12 -0000
@@ -5,11 +5,12 @@ VTK_THIRD_PARTY_SUBDIR(PNG  png)
 VTK_THIRD_PARTY_SUBDIR(TIFF tiff)
 VTK_THIRD_PARTY_SUBDIR(EXPAT expat)
 VTK_THIRD_PARTY_SUBDIR(DICOMParser DICOMParser)
+VTK_THIRD_PARTY_SUBDIR(FREETYPE freetype)
 
 SUBDIRS(Doxygen)
 
 IF(VTK_USE_RENDERING)
-  SUBDIRS(freetype ftgl)
+  SUBDIRS(ftgl)
 ENDIF(VTK_USE_RENDERING)
 
 # This is the installed VTKConfig.cmake file configured at the top
Index: Utilities/ftgl/CMakeLists.txt
===================================================================
RCS file: /cvsroot/VTK/VTK/Utilities/ftgl/CMakeLists.txt,v
retrieving revision 1.28
diff -u -3 -p -r1.28 CMakeLists.txt
--- Utilities/ftgl/CMakeLists.txt	23 Sep 2003 20:44:08 -0000	1.28
+++ Utilities/ftgl/CMakeLists.txt	12 Mar 2005 21:59:12 -0000
@@ -11,8 +11,7 @@ INCLUDE_REGULAR_EXPRESSION(".*")
 INCLUDE_DIRECTORIES (
   ${VTKFTGL_SOURCE_DIR}/src
   ${VTKFTGL_BINARY_DIR}
-  ${VTKFREETYPE_SOURCE_DIR}/include
-  ${VTKFREETYPE_BINARY_DIR}
+  ${FREETYPE_INCLUDE_DIR}
 )
 
 #
@@ -145,7 +144,7 @@ SET (VTKFTGL_LIBS "${VTKFTGL_LIBS};${OPE
 #
 # We obviously need FreeType
 #
-SET (VTKFTGL_LIBS "${VTKFTGL_LIBS};vtkfreetype")
+SET (VTKFTGL_LIBS "${VTKFTGL_LIBS};freetype")
 
 #
 # Define the library (and install it)
@@ -238,7 +237,7 @@ IF (FTGL_BUILD_EXAMPLES)
     #
     # Link examples to FTGL and Freetype
     #
-    SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};vtkftgl;vtkfreetype")
+    SET (VTKFTGL_EXAMPLES_LIBS "${VTKFTGL_EXAMPLES_LIBS};vtkftgl;freetype")
 
     #
     # Example 1

Reply via email to