Mercurial > hg > orthanc-databases
annotate MySQL/CMakeLists.txt @ 98:c24d05cb72c1 db-changes
closing db-changes branch
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Jan 2019 14:38:42 +0100 |
parents | 5571a6554db0 |
children | 441a472bfd93 |
rev | line source |
---|---|
0 | 1 cmake_minimum_required(VERSION 2.8) |
2 project(OrthancMySQL) | |
3 | |
52
842d4bf9524e
fix mainline version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
4 set(ORTHANC_PLUGIN_VERSION "mainline") |
0 | 5 |
6 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") | |
7 set(ORTHANC_FRAMEWORK_VERSION "mainline") | |
8 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") | |
9 else() | |
27
173176f8cef2
jobs branch has disappeared in orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
24
diff
changeset
|
10 set(ORTHANC_FRAMEWORK_VERSION "1.4.0") |
0 | 11 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") |
12 endif() | |
13 | |
14 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake) | |
15 | |
16 set(ENABLE_MYSQL_BACKEND ON) | |
17 | |
18 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake) | |
19 | |
38 | 20 |
21 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
22 execute_process( | |
23 COMMAND | |
24 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
25 ${ORTHANC_PLUGIN_VERSION} "MySQL storage area plugin" OrthancMySQLStorage.dll | |
26 "MySQL as a database back-end to Orthanc (storage area)" | |
27 ERROR_VARIABLE Failure | |
28 OUTPUT_FILE ${AUTOGENERATED_DIR}/StorageVersion.rc | |
29 ) | |
30 | |
31 if (Failure) | |
32 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
33 endif() | |
34 | |
35 execute_process( | |
36 COMMAND | |
37 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py | |
38 ${ORTHANC_PLUGIN_VERSION} "MySQL index plugin" OrthancMySQLIndex.dll | |
39 "MySQL as a database back-end to Orthanc (index)" | |
40 ERROR_VARIABLE Failure | |
41 OUTPUT_FILE ${AUTOGENERATED_DIR}/IndexVersion.rc | |
42 ) | |
43 | |
44 if (Failure) | |
45 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
46 endif() | |
47 | |
48 set(INDEX_RESOURCES ${AUTOGENERATED_DIR}/IndexVersion.rc) | |
49 set(STORAGE_RESOURCES ${AUTOGENERATED_DIR}/StorageVersion.rc) | |
50 endif() | |
51 | |
52 | |
0 | 53 EmbedResources( |
87
48d445f756db
new extension implemented for MySQL: GetLastChangeIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
69
diff
changeset
|
54 MYSQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql |
48d445f756db
new extension implemented for MySQL: GetLastChangeIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
69
diff
changeset
|
55 MYSQL_GET_LAST_CHANGE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/GetLastChangeIndex.sql |
0 | 56 ) |
57 | |
58 add_library(OrthancMySQLIndex SHARED | |
38 | 59 ${INDEX_RESOURCES} |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
60 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
61 Plugins/IndexPlugin.cpp |
0 | 62 Plugins/MySQLIndex.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
63 |
0 | 64 ${DATABASES_SOURCES} |
65 ${AUTOGENERATED_SOURCES} | |
66 ) | |
67 | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
68 add_library(OrthancMySQLStorage SHARED |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
69 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
38 | 70 ${STORAGE_RESOURCES} |
17 | 71 Plugins/MySQLStorageArea.cpp |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
72 Plugins/StoragePlugin.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
73 |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
74 ${DATABASES_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
75 ${AUTOGENERATED_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
76 ) |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
77 |
0 | 78 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") |
79 | |
80 add_definitions( | |
81 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" | |
82 ) | |
83 | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
84 set_target_properties(OrthancMySQLStorage PROPERTIES |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
85 VERSION ${ORTHANC_PLUGIN_VERSION} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
86 SOVERSION ${ORTHANC_PLUGIN_VERSION} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
87 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
88 ) |
0 | 89 |
90 set_target_properties(OrthancMySQLIndex PROPERTIES | |
91 VERSION ${ORTHANC_PLUGIN_VERSION} | |
92 SOVERSION ${ORTHANC_PLUGIN_VERSION} | |
93 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 | |
94 ) | |
95 | |
96 install( | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
97 TARGETS OrthancMySQLIndex OrthancMySQLStorage |
0 | 98 RUNTIME DESTINATION lib # Destination for Windows |
99 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
100 ) | |
101 | |
102 | |
103 add_executable(UnitTests | |
104 Plugins/MySQLIndex.cpp | |
17 | 105 Plugins/MySQLStorageArea.cpp |
0 | 106 UnitTests/UnitTestsMain.cpp |
17 | 107 |
0 | 108 ${DATABASES_SOURCES} |
109 ${GOOGLE_TEST_SOURCES} | |
110 ${AUTOGENERATED_SOURCES} | |
111 ) | |
112 | |
113 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) | |
114 set_target_properties(UnitTests PROPERTIES | |
115 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0 | |
116 ) |