Mercurial > hg > orthanc-databases
annotate SQLite/CMakeLists.txt @ 311:5f0d5f849944
fix unit tests if resuning the same database
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 14 Jul 2021 09:30:49 +0200 |
parents | 772fa76cddf8 |
children | ae4c0c7b2254 |
rev | line source |
---|---|
0 | 1 cmake_minimum_required(VERSION 2.8) |
2 project(OrthancSQLite) | |
3 | |
4 set(ORTHANC_PLUGIN_VERSION "mainline") | |
5 | |
129
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
93
diff
changeset
|
6 set(ORTHANC_OPTIMAL_VERSION_MAJOR 1) |
275
b6ddd7b7e8ca
updated ORTHANC_OPTIMAL_VERSION macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
180
diff
changeset
|
7 set(ORTHANC_OPTIMAL_VERSION_MINOR 9) |
b6ddd7b7e8ca
updated ORTHANC_OPTIMAL_VERSION macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
180
diff
changeset
|
8 set(ORTHANC_OPTIMAL_VERSION_REVISION 2) |
129
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
93
diff
changeset
|
9 |
0 | 10 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") |
11 set(ORTHANC_FRAMEWORK_VERSION "mainline") | |
12 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") | |
13 else() | |
287 | 14 set(ORTHANC_FRAMEWORK_VERSION "1.9.4") |
180 | 15 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") |
0 | 16 endif() |
17 | |
18 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake) | |
19 | |
20 set(ENABLE_SQLITE_BACKEND ON) | |
21 | |
22 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake) | |
23 | |
24 EmbedResources( | |
25 SQLITE_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql | |
26 ) | |
27 | |
155
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
28 add_custom_target( |
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
29 AutogeneratedTarget |
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
30 DEPENDS |
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
31 ${AUTOGENERATED_SOURCES} |
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
32 ) |
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
33 |
0 | 34 add_library(OrthancSQLiteIndex SHARED |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
35 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
36 Plugins/IndexPlugin.cpp |
0 | 37 Plugins/SQLiteIndex.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
38 |
0 | 39 ${DATABASES_SOURCES} |
40 ${AUTOGENERATED_SOURCES} | |
41 ) | |
42 | |
155
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
43 add_dependencies(OrthancSQLiteIndex AutogeneratedTarget) |
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
44 |
0 | 45 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") |
46 | |
47 add_definitions( | |
48 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" | |
49 ) | |
50 | |
51 #set_target_properties(OrthancSQLiteStorage PROPERTIES | |
52 # VERSION ${ORTHANC_PLUGIN_VERSION} | |
53 # SOVERSION ${ORTHANC_PLUGIN_VERSION} | |
54 # COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 | |
55 # ) | |
56 | |
57 set_target_properties(OrthancSQLiteIndex PROPERTIES | |
58 VERSION ${ORTHANC_PLUGIN_VERSION} | |
59 SOVERSION ${ORTHANC_PLUGIN_VERSION} | |
60 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 | |
61 ) | |
62 | |
63 install( | |
64 TARGETS OrthancSQLiteIndex # OrthancSQLiteStorage TODO | |
65 RUNTIME DESTINATION lib # Destination for Windows | |
66 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
67 ) | |
68 | |
69 add_executable(UnitTests | |
70 Plugins/SQLiteIndex.cpp | |
71 UnitTests/UnitTestsMain.cpp | |
72 ${DATABASES_SOURCES} | |
73 ${GOOGLE_TEST_SOURCES} | |
74 ${AUTOGENERATED_SOURCES} | |
75 ) | |
76 | |
155
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
77 add_dependencies(UnitTests AutogeneratedTarget) |
23cf7def8e44
use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
129
diff
changeset
|
78 |
0 | 79 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) |
80 set_target_properties(UnitTests PROPERTIES | |
81 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0 | |
82 ) |