2 # Once done this will define
4 # SQLITE_FOUND - system has Sqlite
5 # SQLITE_INCLUDE_DIR - the Sqlite include directory
6 # SQLITE_LIBRARIES - Link these to use Sqlite
7 # SQLITE_DEFINITIONS - Compiler switches required for using Sqlite
8 # Redistribution and use is allowed according to the terms of the BSD license.
9 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
13 # Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
15 # Redistribution and use is allowed according to the terms of the BSD license.
16 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
18 if ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )
20 SET(Sqlite_FIND_QUIETLY TRUE)
21 endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )
23 # use pkg-config to get the directories and then use these values
24 # in the FIND_PATH() and FIND_LIBRARY() calls
26 find_package(PkgConfig)
28 pkg_check_modules(PC_SQLITE sqlite3)
30 set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER})
33 FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h
35 ${PC_SQLITE_INCLUDEDIR}
36 ${PC_SQLITE_INCLUDE_DIRS}
39 FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3
42 ${PC_SQLITE_LIBRARY_DIRS}
45 include(FindPackageHandleStandardArgs)
46 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
48 # show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view
49 MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )