comparison CMake_Modules/FindSqlite3.cmake @ 1:aae83c0a771d

Refactor: -Rename all Db to DB. Add setup script Add support for Sqlite3 in configuration.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Mon, 20 Aug 2012 17:32:58 +0200
parents
children
comparison
equal deleted inserted replaced
0:a3834af36579 1:aae83c0a771d
1 # - find Sqlite 3
2 # SQLITE3_INCLUDE_DIR - Where to find Sqlite 3 header files (directory)
3 # SQLITE3_LIBRARIES - Sqlite 3 libraries
4 # SQLITE3_LIBRARY_RELEASE - Where the release library is
5 # SQLITE3_LIBRARY_DEBUG - Where the debug library is
6 # SQLITE3_FOUND - Set to TRUE if we found everything (library, includes and executable)
7
8 # Copyright (c) 2010 Pau Garcia i Quiles, <pgquiles@elpauer.org>
9 #
10 # Redistribution and use is allowed according to the terms of the BSD license.
11 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
12 #
13 # Generated by CModuler, a CMake Module Generator - http://gitorious.org/cmoduler
14
15 IF( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY_RELEASE AND SQLITE3_LIBRARY_DEBUG )
16 SET(SQLITE3_FIND_QUIETLY TRUE)
17 ENDIF( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY_RELEASE AND SQLITE3_LIBRARY_DEBUG )
18
19 FIND_PATH( SQLITE3_INCLUDE_DIR sqlite3.h )
20
21 FIND_LIBRARY(SQLITE3_LIBRARY_RELEASE NAMES sqlite3 )
22
23 FIND_LIBRARY(SQLITE3_LIBRARY_DEBUG NAMES sqlite3 sqlite3d HINTS /usr/lib/debug/usr/lib/ )
24
25 IF( SQLITE3_LIBRARY_RELEASE OR SQLITE3_LIBRARY_DEBUG AND SQLITE3_INCLUDE_DIR )
26 SET( SQLITE3_FOUND TRUE )
27 ENDIF( SQLITE3_LIBRARY_RELEASE OR SQLITE3_LIBRARY_DEBUG AND SQLITE3_INCLUDE_DIR )
28
29 IF( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
30 # if the generator supports configuration types then set
31 # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
32 IF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
33 SET( SQLITE3_LIBRARIES optimized ${SQLITE3_LIBRARY_RELEASE} debug ${SQLITE3_LIBRARY_DEBUG} )
34 ELSE( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
35 # if there are no configuration types and CMAKE_BUILD_TYPE has no value
36 # then just use the release libraries
37 SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_RELEASE} )
38 ENDIF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
39 ELSEIF( SQLITE3_LIBRARY_RELEASE )
40 SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_RELEASE} )
41 ELSE( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
42 SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY_DEBUG} )
43 ENDIF( SQLITE3_LIBRARY_DEBUG AND SQLITE3_LIBRARY_RELEASE )
44
45 IF( SQLITE3_FOUND )
46 IF( NOT SQLITE3_FIND_QUIETLY )
47 MESSAGE( STATUS "Found Sqlite3 header file in ${SQLITE3_INCLUDE_DIR}")
48 MESSAGE( STATUS "Found Sqlite3 libraries: ${SQLITE3_LIBRARIES}")
49 ENDIF( NOT SQLITE3_FIND_QUIETLY )
50 ELSE(SQLITE3_FOUND)
51 IF( SQLITE3_FIND_REQUIRED)
52 MESSAGE( FATAL_ERROR "Could not find Sqlite3" )
53 ELSE( SQLITE3_FIND_REQUIRED)
54 MESSAGE( STATUS "Optional package Sqlite3 was not found" )
55 ENDIF( SQLITE3_FIND_REQUIRED)
56 ENDIF(SQLITE3_FOUND)