Subversion Repositories Scribus

Rev

Rev 5138 | 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
 
5148 cbradney 21
FIND_PATH(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
5138 cbradney 22
${_fontconfigIncDir}
23
/usr/include
24
/usr/local/include
25
PATH_SUFFIXES
26
fontconfig
27
)
28
# quick hack as the above finds it nicely but our source includes the libart_lgpl text at the moment
29
#STRING(REGEX REPLACE "/libart_lgpl" "" FONTCONFIG_INCLUDE_DIR ${FONTCONFIG_INCLUDE_DIR})
30
FIND_LIBRARY(FONTCONFIG_LIBRARY NAMES fontconfig
31
  PATHS /usr/lib /usr/local/lib
32
)
33
 
34
# MESSAGE(STATUS "fclib ${FONTCONFIG_LIBRARY}")
35
# MESSAGE(STATUS "fcinclude ${FONTCONFIG_INCLUDE_DIR}")
36
 
37
 
38
IF (FONTCONFIG_LIBRARY)
39
  IF (FONTCONFIG_INCLUDE_DIR)
40
    SET( FONTCONFIG_FOUND "YES" )
41
    SET( FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY} )
42
	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)
43
# 	EXEC_PROGRAM(${FONTCONFIG_CONFIG} ARGS --libs OUTPUT_VARIABLE FONTCONFIG_LIBS)
44
# 	EXEC_PROGRAM(${FONTCONFIG_CONFIG} ARGS --cflags OUTPUT_VARIABLE FONTCONFIG_CFLAGS)
45
#  	MESSAGE(STATUS ${FONTCONFIG_LIBS})
46
#  	MESSAGE(STATUS ${FONTCONFIG_CFLAGS})
47
  ENDIF (FONTCONFIG_INCLUDE_DIR)
48
ENDIF (FONTCONFIG_LIBRARY)