Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
5138 cbradney 1
#
2
# Find the native FONTCONFIG includes and library
3
#
4
 
5
# This module defines
6
# FONTCONFIG_INCLUDE_DIR, where to find art*.h etc
7
# FONTCONFIG_LIBRARY, the libraries to link against to use FONTCONFIG.
8
# FONTCONFIG_FOUND, If false, do not try to use FONTCONFIG.
9
# LIBFONTCONFIG_LIBS, link information
10
# LIBFONTCONFIG_CFLAGS, cflags for include information
11
 
12
 
13
INCLUDE(UsePkgConfig)
14
 
15
# use pkg-config to get the directories and then use these values
16
# in the FIND_PATH() and FIND_LIBRARY() calls
17
PKGCONFIG(fontconfig _fontconfigIncDir _fontconfigLinkDir _fontconfigLinkFlags _fontconfigCflags)
18
 
19
SET(FONTCONFIG_LIBS ${_fontconfigCflags})
20
 
9487 cbradney 21
IF(BUILD_OSX_BUNDLE)
22
  FIND_PATH(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
23
    /opt/local/include
24
    NO_DEFAULT_PATH
25
  )
26
  FIND_LIBRARY(FONTCONFIG_LIBRARY NAMES fontconfig
27
    PATHS /opt/local/lib
28
    NO_DEFAULT_PATH
29
  )
30
ELSE(BUILD_OSX_BUNDLE)
31
  FIND_PATH(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
32
    ${_fontconfigIncDir}
33
    /usr/include
34
    /usr/local/include
35
    PATH_SUFFIXES
36
    fontconfig
37
  )
38
  # quick hack as the above finds it nicely but our source includes the libart_lgpl text at the moment
39
  #STRING(REGEX REPLACE "/libart_lgpl" "" FONTCONFIG_INCLUDE_DIR ${FONTCONFIG_INCLUDE_DIR})
40
  FIND_LIBRARY(FONTCONFIG_LIBRARY NAMES fontconfig
41
    PATHS /usr/lib /usr/local/lib
42
  )
43
ENDIF(BUILD_OSX_BUNDLE)
5138 cbradney 44
 
9487 cbradney 45
 
5138 cbradney 46
# MESSAGE(STATUS "fclib ${FONTCONFIG_LIBRARY}")
47
# MESSAGE(STATUS "fcinclude ${FONTCONFIG_INCLUDE_DIR}")
48
 
49
 
50
IF (FONTCONFIG_LIBRARY)
51
  IF (FONTCONFIG_INCLUDE_DIR)
52
    SET( FONTCONFIG_FOUND "YES" )
53
    SET( FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY} )
54
	FIND_PROGRAM(FONTCONFIG_CONFIG NAMES fontconfig-config PATHS ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin /usr/nekoware/bin /usr/X11/bin)
55
# 	EXEC_PROGRAM(${FONTCONFIG_CONFIG} ARGS --libs OUTPUT_VARIABLE FONTCONFIG_LIBS)
56
# 	EXEC_PROGRAM(${FONTCONFIG_CONFIG} ARGS --cflags OUTPUT_VARIABLE FONTCONFIG_CFLAGS)
57
#  	MESSAGE(STATUS ${FONTCONFIG_LIBS})
58
#  	MESSAGE(STATUS ${FONTCONFIG_CFLAGS})
59
  ENDIF (FONTCONFIG_INCLUDE_DIR)
9487 cbradney 60
ENDIF (FONTCONFIG_LIBRARY)