aboutsummaryrefslogtreecommitdiff
path: root/modules/FindFontconfig.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-12-02 21:49:01 +0000
committerAlexander Neundorf <neundorf@kde.org>2008-12-02 21:49:01 +0000
commitc379d4c4e0655fac2dadd4be57e2e5cd23d40572 (patch)
treeded75f12990a05a4578511ef667738fcadedc94b /modules/FindFontconfig.cmake
parent2272394b6ef05df4c4e8996b09aba0d411f249fc (diff)
downloadextra-cmake-modules-c379d4c4e0655fac2dadd4be57e2e5cd23d40572.tar.gz
extra-cmake-modules-c379d4c4e0655fac2dadd4be57e2e5cd23d40572.tar.bz2
-rework all uses of find_package(PkgConfig)/pkg_check_modules():
the prefix used for pkgconfig config (e.g. SQLITE) now *always* gets an additional "PC_" prefix, so the prefix used for pkgconfig is now "PC_SQLITE_". This avoids name clashes between variables defined by the pkgconfig macro and the find module and unwanted effects. *Never* use the _CFLAGS coming from pkgconfig, but always CFLAGS_OTHER, since these shouldn't contain the include directories. If the include directories would be in the DEFINITIONS variable this could clash with the results of find_path() for finding include dirs. *Always* use both foo_INCLUDEDIR, foo_INCLUDE_DIRS for searching the include dir, and also both foo_LIBDIR and foo_LIBRARY_DIRS for searching the libraries. These directories coming from pkgconfig are *never* used exclusively, but *always* additionally to the standard search dirs, either before them (then using the "HINTS" keyword) or after them (then using the "PATHS" keyword) I hope I didn't break (too much) stuff. At least on my system it all seems to work the same way as it did before, with and without pkgconfig. Alex svn path=/trunk/KDE/kdelibs/; revision=891805
Diffstat (limited to 'modules/FindFontconfig.cmake')
-rw-r--r--modules/FindFontconfig.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/FindFontconfig.cmake b/modules/FindFontconfig.cmake
index 10fd0734..268a61ae 100644
--- a/modules/FindFontconfig.cmake
+++ b/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
@@ -22,20 +23,22 @@ else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
- pkg_check_modules(FONTCONFIG fontconfig)
+ pkg_check_modules(PC_FONTCONFIG fontconfig)
- set(FONTCONFIG_DEFINITIONS ${FONTCONFIG_CFLAGS})
+ set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER})
endif (NOT WIN32)
find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
PATHS
- ${FONTCONFIG_INCLUDE_DIRS}
+ ${PC_FONTCONFIG_INCLUDEDIR}
+ ${PC_FONTCONFIG_INCLUDE_DIRS}
/usr/X11/include
)
find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
PATHS
- ${FONTCONFIG_LIBRARY_DIRS}
+ ${PC_FONTCONFIG_LIBDIR}
+ ${PC_FONTCONFIG_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)