annotate Resources/CMake/SQLiteConfiguration.cmake @ 681:3bdb5db8e839 query-retrieve

generalization of query/retrieve
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 24 Jan 2014 17:40:45 +0100
parents d775a3cb5a06
children ee0d5abf7958
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
634
d775a3cb5a06 refactoring of CMake scripts
jodogne
parents: 553
diff changeset
1 if (STATIC_BUILD OR NOT USE_SYSTEM_SQLITE)
123
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
2 SET(SQLITE_SOURCES_DIR ${CMAKE_BINARY_DIR}/sqlite-amalgamation-3071300)
411
5f6d75cd4b46 md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
3 DownloadPackage(
5f6d75cd4b46 md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
4 "5fbeff9645ab035a1f580e90b279a16d"
5f6d75cd4b46 md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
5 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/sqlite-amalgamation-3071300.zip"
553
27d32fc6209a simplifications to cmake, use a digest of boost 1.54.0 thanks bcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 411
diff changeset
6 "${SQLITE_SOURCES_DIR}")
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
7
123
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
8 list(APPEND THIRD_PARTY_SOURCES
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
9 ${SQLITE_SOURCES_DIR}/sqlite3.c
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
10 )
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
11
123
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
12 add_definitions(
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
13 # For SQLite to run in the "Serialized" thread-safe mode
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
14 # http://www.sqlite.org/threadsafe.html
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
15 -DSQLITE_THREADSAFE=1
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
16 -DSQLITE_OMIT_LOAD_EXTENSION # Disable SQLite plugins
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
17 )
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
18
123
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
19 include_directories(
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
20 ${SQLITE_SOURCES_DIR}
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
21 )
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
22
123
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
23 source_group(ThirdParty\\SQLite REGULAR_EXPRESSION ${SQLITE_SOURCES_DIR}/.*)
411
5f6d75cd4b46 md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
24
123
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
25 else()
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
26 CHECK_INCLUDE_FILE_CXX(sqlite3.h HAVE_SQLITE_H)
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
27 if (NOT HAVE_SQLITE_H)
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
28 message(FATAL_ERROR "Please install the libsqlite3-dev package")
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
29 endif()
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
30
194
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
31 # Autodetection of the version of SQLite
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
32 file(STRINGS "/usr/include/sqlite3.h" SQLITE_VERSION_NUMBER1 REGEX "#define SQLITE_VERSION_NUMBER.*$")
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
33 string(REGEX REPLACE "#define SQLITE_VERSION_NUMBER(.*)$" "\\1" SQLITE_VERSION_NUMBER ${SQLITE_VERSION_NUMBER1})
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
34
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
35 message("Detected version of SQLite: ${SQLITE_VERSION_NUMBER}")
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
36
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
37 IF (${SQLITE_VERSION_NUMBER} LESS 3007000)
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
38 # "sqlite3_create_function_v2" is not defined in SQLite < 3.7.0
634
d775a3cb5a06 refactoring of CMake scripts
jodogne
parents: 553
diff changeset
39 message(FATAL_ERROR "SQLite version must be above 3.7.0. Please set the CMake variable USE_SYSTEM_SQLITE to OFF.")
194
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
40 ENDIF()
0186ac92810c fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 147
diff changeset
41
123
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
42 link_libraries(sqlite3)
7350aff15193 dynamic sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
43 endif()