~ubuntu-branches/ubuntu/saucy/texworks/saucy

« back to all changes in this revision

Viewing changes to CMake/Modules/FindFontconfig.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA
  • Date: 2011-08-18 11:22:40 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110818112240-d2vmclt5llf8vano
Tags: 0.5~svn930-1
New upstream release (rev 930).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - Try to find Fontconfig
 
2
# Once done this will define
 
3
#
 
4
#  FONTCONFIG_FOUND - system has Fontconfig
 
5
#  FONTCONFIG_INCLUDE_DIR - the Fontconfig include directory
 
6
#  FONTCONFIG_LIBRARIES - Link these to use Fontconfig
 
7
# Redistribution and use is allowed according to the terms of the BSD license.
 
8
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
9
#
 
10
 
 
11
 
 
12
if ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES )
 
13
   # in cache already
 
14
   SET(Fontconfig_FIND_QUIETLY TRUE)
 
15
endif ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES )
 
16
 
 
17
# use pkg-config to get the directories and then use these values
 
18
# in the FIND_PATH() and FIND_LIBRARY() calls
 
19
if( NOT WIN32 )
 
20
  find_package(PkgConfig)
 
21
 
 
22
  pkg_check_modules(FONTCONFIG_PKG QUIET fontconfig)
 
23
endif( NOT WIN32 )
 
24
 
 
25
FIND_PATH(FONTCONFIG_INCLUDE_DIR NAMES fontconfig/fontconfig.h
 
26
  PATHS
 
27
    /usr/local/include
 
28
    /usr/X11/include
 
29
    /usr/include
 
30
  HINTS
 
31
    ${FONTCONFIG_PKG_INCLUDE_DIRS} # Generated by pkg-config
 
32
)
 
33
 
 
34
FIND_LIBRARY(FONTCONFIG_LIBRARIES NAMES fontconfig ${FONTCONFIG_PKG_LIBRARIES}
 
35
  PATHS
 
36
    /usr/local
 
37
    /usr/X11
 
38
    /usr
 
39
  HINTS
 
40
    ${FONTCONFIG_PKG_LIBRARY_DIRS} # Generated by pkg-config
 
41
  PATH_SUFFIXES
 
42
    lib64
 
43
    lib
 
44
)
 
45
 
 
46
include(FindPackageHandleStandardArgs)
 
47
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
 
48
 
 
49
# show the FONTCONFIG_INCLUDE_DIR and FONTCONFIG_LIBRARIES variables only in the advanced view
 
50
MARK_AS_ADVANCED(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARIES )
 
51