From fc6a5ce2221ea6bcc6782f665ea44c40e463755f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 6 May 2008 10:53:42 +0200 Subject: [PATCH] Add CMake 2.6 compatible FindSqlite3 module. --- cmake/Modules/FindSqlite3.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/Modules/FindSqlite3.cmake b/cmake/Modules/FindSqlite3.cmake index 5b775546d..fb724b27d 100644 --- a/cmake/Modules/FindSqlite3.cmake +++ b/cmake/Modules/FindSqlite3.cmake @@ -20,12 +20,15 @@ if (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls - include(UsePkgConfig) - - pkgconfig(sqlite3 _Sqlite3IncDir _Sqlite3LinkDir _Sqlite3LinkFlags _Sqlite3Cflags) - - set(SQLITE3_DEFINITIONS ${_Sqlite3Cflags}) - + if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + include(UsePkgConfig) + pkgconfig(sqlite3 _SQLITE3_INCLUDEDIR _SQLITE3_LIBDIR _SQLITE3_LDFLAGS _SQLITE3_CFLAGS) + else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(_SQLITE3 sqlite3) + endif (PKG_CONFIG_FOUND) + endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h