2009-05-07 19:04:48 +04:00
|
|
|
# - Try to find SQLite3
|
2008-05-05 19:32:11 +04:00
|
|
|
# Once done this will define
|
2008-02-27 20:56:47 +03:00
|
|
|
#
|
2009-05-07 19:04:48 +04:00
|
|
|
# SQLITE3_FOUND - system has SQLite3
|
|
|
|
# SQLITE3_INCLUDE_DIRS - the SQLite3 include directory
|
|
|
|
# SQLITE3_LIBRARIES - Link these to use SQLite3
|
|
|
|
# SQLITE3_DEFINITIONS - Compiler switches required for using SQLite3
|
2008-02-27 20:56:47 +03:00
|
|
|
#
|
2013-07-13 11:17:40 +04:00
|
|
|
# Copyright (c) 2009-2013 Andreas Schneider <asn@cryptomilk.org>
|
2008-02-27 20:56:47 +03:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the New
|
|
|
|
# BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
if (UNIX)
|
|
|
|
find_package(PkgConfig)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(_SQLITE3 sqlite3)
|
|
|
|
endif (PKG_CONFIG_FOUND)
|
|
|
|
endif (UNIX)
|
2009-05-07 19:04:48 +04:00
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
find_path(SQLITE3_INCLUDE_DIR
|
2008-05-05 19:32:11 +04:00
|
|
|
NAMES
|
2013-07-13 11:17:40 +04:00
|
|
|
sqlite3.h
|
2008-05-05 19:32:11 +04:00
|
|
|
PATHS
|
2013-07-13 11:17:40 +04:00
|
|
|
${_SQLITE3_INCLUDEDIR}
|
|
|
|
)
|
2008-02-27 20:56:47 +03:00
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
find_library(SQLITE3_LIBRARY
|
2008-05-05 19:32:11 +04:00
|
|
|
NAMES
|
2013-07-13 11:17:40 +04:00
|
|
|
sqlite3
|
2008-05-05 19:32:11 +04:00
|
|
|
PATHS
|
2013-07-13 11:17:40 +04:00
|
|
|
${_SQLITE3_LIBDIR}
|
|
|
|
)
|
2008-02-27 20:56:47 +03:00
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
set(SQLITE3_INCLUDE_DIRS
|
2008-05-05 19:32:11 +04:00
|
|
|
${SQLITE3_INCLUDE_DIR}
|
2013-07-13 11:17:40 +04:00
|
|
|
)
|
2008-02-27 20:56:47 +03:00
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
if (SQLITE3_LIBRARY)
|
2008-05-05 19:32:11 +04:00
|
|
|
set(SQLITE3_LIBRARIES
|
2013-07-13 11:17:40 +04:00
|
|
|
${SQLITE3_LIBRARIES}
|
|
|
|
${SQLITE3_LIBRARY}
|
2008-05-05 19:32:11 +04:00
|
|
|
)
|
2013-07-13 11:17:40 +04:00
|
|
|
endif (SQLITE3_LIBRARY)
|
2008-05-05 19:32:11 +04:00
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
if (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
|
|
|
|
set(SQLite3_VERSION _SQLITE3_VERSION)
|
|
|
|
endif (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
|
2008-05-05 19:32:11 +04:00
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS)
|
2008-05-05 19:32:11 +04:00
|
|
|
|
2013-07-13 11:17:40 +04:00
|
|
|
# show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
|
|
|
|
mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
|
2008-02-27 20:56:47 +03:00
|
|
|
|