Mercurial > hg > orthanc-databases
annotate MySQL/CMakeLists.txt @ 115:d4a995d2a726
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Jan 2019 20:14:41 +0100 |
parents | 7cac47fd4d09 |
children | 121ab36c87bd |
rev | line source |
---|---|
0 | 1 cmake_minimum_required(VERSION 2.8) |
2 project(OrthancMySQL) | |
3 | |
113 | 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() | |
112 | 10 set(ORTHANC_FRAMEWORK_VERSION "1.5.2") |
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 |
110
441a472bfd93
new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
93
diff
changeset
|
56 MYSQL_CREATE_INSTANCE ${CMAKE_SOURCE_DIR}/Plugins/CreateInstance.sql |
0 | 57 ) |
58 | |
59 add_library(OrthancMySQLIndex SHARED | |
38 | 60 ${INDEX_RESOURCES} |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
61 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
62 Plugins/IndexPlugin.cpp |
0 | 63 Plugins/MySQLIndex.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
64 |
0 | 65 ${DATABASES_SOURCES} |
66 ${AUTOGENERATED_SOURCES} | |
67 ) | |
68 | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
69 add_library(OrthancMySQLStorage SHARED |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
70 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
38 | 71 ${STORAGE_RESOURCES} |
17 | 72 Plugins/MySQLStorageArea.cpp |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
73 Plugins/StoragePlugin.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
74 |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
75 ${DATABASES_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
76 ${AUTOGENERATED_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
77 ) |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
78 |
0 | 79 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") |
80 | |
81 add_definitions( | |
82 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" | |
83 ) | |
84 | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
85 set_target_properties(OrthancMySQLStorage PROPERTIES |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
86 VERSION ${ORTHANC_PLUGIN_VERSION} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
87 SOVERSION ${ORTHANC_PLUGIN_VERSION} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
88 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
89 ) |
0 | 90 |
91 set_target_properties(OrthancMySQLIndex PROPERTIES | |
92 VERSION ${ORTHANC_PLUGIN_VERSION} | |
93 SOVERSION ${ORTHANC_PLUGIN_VERSION} | |
94 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 | |
95 ) | |
96 | |
97 install( | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
98 TARGETS OrthancMySQLIndex OrthancMySQLStorage |
0 | 99 RUNTIME DESTINATION lib # Destination for Windows |
100 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
101 ) | |
102 | |
103 | |
104 add_executable(UnitTests | |
105 Plugins/MySQLIndex.cpp | |
17 | 106 Plugins/MySQLStorageArea.cpp |
0 | 107 UnitTests/UnitTestsMain.cpp |
17 | 108 |
0 | 109 ${DATABASES_SOURCES} |
110 ${GOOGLE_TEST_SOURCES} | |
111 ${AUTOGENERATED_SOURCES} | |
112 ) | |
113 | |
114 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) | |
115 set_target_properties(UnitTests PROPERTIES | |
116 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0 | |
117 ) |