summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPino Toscano <pino@kde.org>2010-03-17 22:58:08 +0100
committerPino Toscano <pino@kde.org>2010-03-17 22:58:08 +0100
commit7f07a7dcea031f99a9a6d7c424184a2e69ee0062 (patch)
tree54d33f7c6f1ec8ef4365b49891bec41cb61a4e2b /cmake
parentbeee143ffbdc699ab19f10a01e5747200ea1927a (diff)
[CMake] update FindFontconfig.cmake with a more recent version
... present in KDE (as before)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindFontconfig.cmake15
1 files changed, 9 insertions, 6 deletions
diff --git a/cmake/modules/FindFontconfig.cmake b/cmake/modules/FindFontconfig.cmake
index c6a8c6ab..268a61ae 100644
--- a/cmake/modules/FindFontconfig.cmake
+++ b/cmake/modules/FindFontconfig.cmake
@@ -2,6 +2,7 @@
# Once done this will define
#
# FONTCONFIG_FOUND - system has Fontconfig
+# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers
# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG
# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG
@@ -21,22 +22,23 @@ else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
- include(UsePkgConfig)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_FONTCONFIG fontconfig)
- pkgconfig(fontconfig _FONTCONFIGIncDir _FONTCONFIGLinkDir _FONTCONFIGLinkFlags _FONTCONFIGCflags)
-
- set(FONTCONFIG_DEFINITIONS ${_FONTCONFIGCflags} CACHE INTERNAL "The compilation flags for fontconfig")
+ set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER})
endif (NOT WIN32)
find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
PATHS
- ${_FONTCONFIGIncDir}
+ ${PC_FONTCONFIG_INCLUDEDIR}
+ ${PC_FONTCONFIG_INCLUDE_DIRS}
/usr/X11/include
)
find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
PATHS
- ${_FONTCONFIGLinkDir}
+ ${PC_FONTCONFIG_LIBDIR}
+ ${PC_FONTCONFIG_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
@@ -45,3 +47,4 @@ else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
+