From c379d4c4e0655fac2dadd4be57e2e5cd23d40572 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 2 Dec 2008 21:49:01 +0000 Subject: -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 --- modules/FindSqlite.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index 3dd53351..d010719f 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -20,19 +20,21 @@ endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) if( NOT WIN32 ) find_package(PkgConfig) - pkg_check_modules(SQLITE sqlite3) + pkg_check_modules(PC_SQLITE sqlite3) - set(SQLITE_DEFINITIONS ${SQLITE_CFLAGS}) + set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER}) endif( NOT WIN32 ) FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h PATHS - ${SQLITE_INCLUDE_DIRS} + ${PC_SQLITE_INCLUDEDIR} + ${PC_SQLITE_INCLUDE_DIRS} ) FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 PATHS - ${SQLITE_LIBRARY_DIRS} + ${PC_SQLITE_LIBDIR} + ${PC_SQLITE_LIBRARY_DIRS} ) include(FindPackageHandleStandardArgs) -- cgit v1.2.1