forked from Doc-Cirrus/orthanc-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·101 lines (80 loc) · 3.16 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
# Copyright (C) 2017-2021 Osimis S.A., Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.8)
project(OrthancSQLite)
set(ORTHANC_PLUGIN_VERSION "mainline")
set(ORTHANC_OPTIMAL_VERSION_MAJOR 1)
set(ORTHANC_OPTIMAL_VERSION_MINOR 9)
set(ORTHANC_OPTIMAL_VERSION_REVISION 2)
if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
set(ORTHANC_FRAMEWORK_VERSION "mainline")
set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
else ()
set(ORTHANC_FRAMEWORK_VERSION "1.9.6")
set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
endif ()
include(${CMAKE_SOURCE_DIR}/Resources/CMake/DatabasesPluginParameters.cmake)
set(ENABLE_SQLITE_BACKEND ON)
include(${CMAKE_SOURCE_DIR}/Resources/CMake/DatabasesPluginConfiguration.cmake)
EmbedResources(
SQLITE_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql
)
add_custom_target(
AutogeneratedTarget
DEPENDS
${AUTOGENERATED_SOURCES}
)
add_library(OrthancSQLiteIndex SHARED
${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
MongoDB/Plugins/IndexPlugin.cpp
MongoDB/Plugins/MongoDBIndex.cpp
${DATABASES_SOURCES}
${AUTOGENERATED_SOURCES}
)
add_dependencies(OrthancSQLiteIndex AutogeneratedTarget)
message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
add_definitions(
-DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}"
)
#set_target_properties(OrthancSQLiteStorage PROPERTIES
# VERSION ${ORTHANC_PLUGIN_VERSION}
# SOVERSION ${ORTHANC_PLUGIN_VERSION}
# COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
# )
set_target_properties(OrthancSQLiteIndex PROPERTIES
VERSION ${ORTHANC_PLUGIN_VERSION}
SOVERSION ${ORTHANC_PLUGIN_VERSION}
COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
)
install(
TARGETS OrthancSQLiteIndex # OrthancSQLiteStorage TODO
RUNTIME DESTINATION lib # Destination for Windows
LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
)
add_executable(UnitTests
MongoDB/Plugins/MongoDBIndex.cpp
MongoDB/UnitTests/UnitTestsMain.cpp
${DATABASES_SOURCES}
${GOOGLE_TEST_SOURCES}
${AUTOGENERATED_SOURCES}
)
add_dependencies(UnitTests AutogeneratedTarget)
target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
set_target_properties(UnitTests PROPERTIES
COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
)