Add CMake 2.6 compatible FindSqlite3 module.

This commit is contained in:
Andreas Schneider 2008-05-06 10:53:42 +02:00
parent 7e9cf16825
commit fc6a5ce222

View file

@ -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