Subversion Repositories Scribus

Rev

Rev 10815 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5138 cbradney 1
#
2
# Find the native FREETYPE includes and library
3
#
4
 
5
# This module defines
6
# FREETYPE_INCLUDE_DIR, where to find ft2build.h, ftheader.h, ...
7
# FREETYPE_LIBRARIES, the libraries to link against to use FREETYPE.
8
# FREETYPE_FOUND, If false, do not try to use FREETYPE.
9
 
10
# also defined, but not for general use are
11
# FREETYPE_LIBRARY, where to find the FREETYPE library.
12
 
9411 cbradney 13
IF (BUILD_OSX_BUNDLE)
14
  FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h
15
    /opt/local/include/
10762 cbradney 16
    NO_CMAKE_SYSTEM_PATH
9411 cbradney 17
  )
18
ELSE (BUILD_OSX_BUNDLE)
19
  FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h
20
    /usr/include/
21
    /usr/local/include/
10762 cbradney 22
    NO_CMAKE_SYSTEM_PATH
9411 cbradney 23
  )
24
ENDIF (BUILD_OSX_BUNDLE)
5138 cbradney 25
 
26
 
9411 cbradney 27
IF (BUILD_OSX_BUNDLE)
28
  FIND_PATH(FREETYPE_INCLUDE_DIR_FTHEADER freetype/config/ftheader.h
29
    /opt/local/include/freetype2
10762 cbradney 30
    NO_CMAKE_SYSTEM_PATH
9411 cbradney 31
  )
32
ELSE (BUILD_OSX_BUNDLE)
33
  FIND_PATH(FREETYPE_INCLUDE_DIR_FTHEADER freetype/config/ftheader.h
34
    /usr/include/freetype2
35
    /usr/local/include/freetype2
10762 cbradney 36
    NO_CMAKE_SYSTEM_PATH
9411 cbradney 37
  )
38
ENDIF (BUILD_OSX_BUNDLE)
5138 cbradney 39
 
10818 craig 40
SET(FREETYPE_LIBRARY_NAMES_DEBUG ${FREETYPE_LIBRARY_NAMES_DEBUG} freetyped)
41
SET(FREETYPE_LIBRARY_NAMES_RELEASE ${FREETYPE_LIBRARY_NAMES_RELEASE} freetype)
9411 cbradney 42
 
10818 craig 43
IF(BUILD_OSX_BUNDLE)
44
  SET(FREETYPE_LIB_PATHS /opt/local/lib)
45
ELSE(BUILD_OSX_BUNDLE)
46
  SET(FREETYPE_LIB_PATHS /usr/lib /usr/local/lib)
47
ENDIF(BUILD_OSX_BUNDLE)
48
 
49
FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE ${FREETYPE_LIBRARY_NAMES_RELEASE} ${FREETYPE_LIBRARY_NAMES}
50
  PATHS
51
  ${FREETYPE_LIB_PATHS}
52
  NO_CMAKE_SYSTEM_PATH)
53
FIND_LIBRARY(FREETYPE_LIBRARY_DEBUG ${FREETYPE_LIBRARY_NAMES_DEBUG}
54
  PATHS
55
  ${FREETYPE_LIB_PATHS}
56
  NO_CMAKE_SYSTEM_PATH)
57
 
58
INCLUDE(LibraryDebugAndRelease)
59
SET_LIBRARY_FROM_DEBUG_AND_RELEASE(FREETYPE)
60
 
9678 cbradney 61
# MESSAGE(STATUS "ft lib ${FREETYPE_LIBRARY}")
62
# MESSAGE(STATUS "ft2 build ${FREETYPE_INCLUDE_DIR_FT2BUILD}")
63
# MESSAGE(STATUS "ft header ${FREETYPE_INCLUDE_DIR_FTHEADER}")
9411 cbradney 64
 
5138 cbradney 65
SET(FREETYPE_FIND_QUIETLY 1)
66
 
67
IF (FREETYPE_LIBRARY)
68
  IF (NOT FREETYPE_FIND_QUIETLY)
69
    MESSAGE(STATUS "Found Freetype2: ${FREETYPE_LIBRARY}")
70
  ENDIF (NOT FREETYPE_FIND_QUIETLY)
71
  IF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
72
    SET( FREETYPE_FOUND "YES" )
73
    SET( FREETYPE_INCLUDE_DIR
74
      ${FREETYPE_INCLUDE_DIR_FT2BUILD}
75
      ${FREETYPE_INCLUDE_DIR_FTHEADER} )
76
    SET( FREETYPE_LIBRARIES ${FREETYPE_LIBRARY} )
5171 cbradney 77
    FIND_PROGRAM(FREETYPE_CONFIG NAMES freetype-config PATHS ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin /usr/nekoware/bin /usr/X11/bin)
78
    EXEC_PROGRAM(${FREETYPE_CONFIG} ARGS --libs OUTPUT_VARIABLE LIBFREETYPE_LIBS)
79
    EXEC_PROGRAM(${FREETYPE_CONFIG} ARGS --cflags OUTPUT_VARIABLE LIBFREETYPE_CFLAGS)
5138 cbradney 80
  ENDIF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
9411 cbradney 81
ENDIF (FREETYPE_LIBRARY)