2007-08-19 05:51:53 -06:00
|
|
|
# - Find sqlite3
|
|
|
|
# Find the native SQLite3 includes and library
|
|
|
|
#
|
|
|
|
# SQLITE3_INCLUDE_DIR - where to find sqlite3.h
|
|
|
|
# SQLITE3_LIBRARIES - List of libraries when using SQLite3.
|
|
|
|
# SQLITE3_FOUND - True if SQLite3 found.
|
|
|
|
|
|
|
|
IF (SQLITE3_INCLUDE_DIR)
|
|
|
|
# Already in cache, be silent
|
2007-08-27 14:02:18 -06:00
|
|
|
SET(SQLite3_FIND_QUIETLY TRUE)
|
2007-08-19 05:51:53 -06:00
|
|
|
ENDIF (SQLITE3_INCLUDE_DIR)
|
|
|
|
|
|
|
|
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
|
|
|
|
/usr/local/include/sqlite3
|
|
|
|
/usr/local/include
|
|
|
|
/usr/include/sqlite3
|
|
|
|
/usr/include
|
2007-09-27 14:34:10 -06:00
|
|
|
${CMAKE_SOURCE_DIR}/sqlite3
|
2007-08-19 05:51:53 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
SET(SQLITE3_NAMES sqlite3)
|
|
|
|
FIND_LIBRARY(SQLITE3_LIBRARY
|
|
|
|
NAMES ${SQLITE3_NAMES}
|
2007-09-27 14:34:10 -06:00
|
|
|
PATHS /usr/local/lib /usr/lib
|
|
|
|
${CMAKE_SOURCE_DIR}/sqlite3
|
2007-08-19 05:51:53 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
IF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
|
|
|
|
SET(SQLITE3_FOUND TRUE)
|
|
|
|
SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY} )
|
|
|
|
ELSE (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
|
|
|
|
SET(SQLITE3_FOUND FALSE)
|
|
|
|
SET( SQLITE3_LIBRARIES )
|
|
|
|
ENDIF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
|
|
|
|
|
|
|
|
IF (SQLITE3_FOUND)
|
2007-08-27 14:02:18 -06:00
|
|
|
IF (NOT SQLite3_FIND_QUIETLY)
|
2007-08-19 05:51:53 -06:00
|
|
|
MESSAGE(STATUS "Found SQLite3: ${SQLITE3_LIBRARY}")
|
2007-08-27 14:02:18 -06:00
|
|
|
ENDIF (NOT SQLite3_FIND_QUIETLY)
|
2007-08-19 05:51:53 -06:00
|
|
|
ELSE (SQLITE3_FOUND)
|
2007-08-27 14:02:18 -06:00
|
|
|
IF (SQLite3_FIND_REQUIRED)
|
2007-08-19 05:51:53 -06:00
|
|
|
MESSAGE(STATUS "Looked for SQLite3 libraries named ${SQLITE3_NAMES}.")
|
|
|
|
MESSAGE(FATAL_ERROR "Could NOT find SQLite3 library")
|
2007-08-27 14:02:18 -06:00
|
|
|
ENDIF (SQLite3_FIND_REQUIRED)
|
2007-08-19 05:51:53 -06:00
|
|
|
ENDIF (SQLITE3_FOUND)
|
|
|
|
|
|
|
|
MARK_AS_ADVANCED(
|
|
|
|
SQLITE3_LIBRARY
|
|
|
|
SQLITE3_INCLUDE_DIR
|
2007-08-27 14:02:18 -06:00
|
|
|
)
|