Mercurial > hg > orthanc
annotate Resources/CMake/SQLiteConfiguration.cmake @ 926:cecce673f22f mac
move
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 28 Feb 2014 10:05:31 +0100 |
parents | d775a3cb5a06 |
children | ee0d5abf7958 |
rev | line source |
---|---|
634 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_SQLITE) |
123 | 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 | 7 |
123 | 8 list(APPEND THIRD_PARTY_SOURCES |
9 ${SQLITE_SOURCES_DIR}/sqlite3.c | |
10 ) | |
8 | 11 |
123 | 12 add_definitions( |
13 # For SQLite to run in the "Serialized" thread-safe mode | |
14 # http://www.sqlite.org/threadsafe.html | |
15 -DSQLITE_THREADSAFE=1 | |
16 -DSQLITE_OMIT_LOAD_EXTENSION # Disable SQLite plugins | |
17 ) | |
8 | 18 |
123 | 19 include_directories( |
20 ${SQLITE_SOURCES_DIR} | |
21 ) | |
8 | 22 |
123 | 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 | 25 else() |
26 CHECK_INCLUDE_FILE_CXX(sqlite3.h HAVE_SQLITE_H) | |
27 if (NOT HAVE_SQLITE_H) | |
28 message(FATAL_ERROR "Please install the libsqlite3-dev package") | |
29 endif() | |
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 | 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 | 42 link_libraries(sqlite3) |
43 endif() |