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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 project(OrthancSQLite)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 set(ORTHANC_PLUGIN_VERSION "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 set(ORTHANC_FRAMEWORK_VERSION "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 else()
287
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 284
diff changeset
14 set(ORTHANC_FRAMEWORK_VERSION "1.9.4")
180
5e604adfd41f back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 167
diff changeset
15 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 set(ENABLE_SQLITE_BACKEND ON)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 EmbedResources(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 SQLITE_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 Plugins/SQLiteIndex.cpp
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
38
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 ${AUTOGENERATED_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 add_definitions(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}"
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 #set_target_properties(OrthancSQLiteStorage PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 # VERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 # SOVERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 # COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 # )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 set_target_properties(OrthancSQLiteIndex PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 VERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 SOVERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 install(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 TARGETS OrthancSQLiteIndex # OrthancSQLiteStorage TODO
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 RUNTIME DESTINATION lib # Destination for Windows
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 add_executable(UnitTests
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 Plugins/SQLiteIndex.cpp
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 UnitTests/UnitTestsMain.cpp
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 ${GOOGLE_TEST_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 ${AUTOGENERATED_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 set_target_properties(UnitTests PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 )