summaryrefslogtreecommitdiffstats
path: root/src/svnqt/cmakemodules/FindSqlite.cmake
blob: 3c50d3372a28032a79d6ca6fc3d82ed63c8e9b83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
IF (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
    SET(SQLITE_FOUND TRUE)
ELSE (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
 INCLUDE(UsePkgConfig)
 PKGCONFIG(sqlite3 _sqliteincdir _sqlitelibdir _sqlitelinkflags _sqlitecflags)

 FIND_PATH(SQLITE_INCLUDE_DIR sqlite3.h
   ${_sqliteincdir}
   /usr/include
   /usr/local/include
  )
 FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3
   PATHS
   ${_sqlitelibdir}
   /usr/lib
   /usr/local/lib
 )

 IF (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
   SET(SQLITE_FOUND TRUE)
 ENDIF (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)

 IF (SQLITE_FOUND)
   MESSAGE(STATUS "Found sqlite3: ${SQLITE_LIBRARIES}")
 ELSE (SQLITE_FOUND)
   MESSAGE(STATUS "Could not find sqlite3")
   ADD_DEFINITIONS(-DNO_SQLITE3)
 ENDIF (SQLITE_FOUND)

 MARK_AS_ADVANCED(SQLITE_LIBRARIES SQLITE_INCLUDE_DIR)

ENDIF (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)