Mercurial > hg > orthanc-databases
annotate MySQL/CMakeLists.txt @ 50:f8a790919902 OrthancMySQL-1.1
set version
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Jul 2018 13:37:01 +0200 |
parents | 95f0f57f8920 |
children | 842d4bf9524e |
rev | line source |
---|---|
0 | 1 cmake_minimum_required(VERSION 2.8) |
2 project(OrthancMySQL) | |
3 | |
50 | 4 set(ORTHANC_PLUGIN_VERSION "1.1") |
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( |
54 MYSQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql | |
55 ) | |
56 | |
57 add_library(OrthancMySQLIndex SHARED | |
38 | 58 ${INDEX_RESOURCES} |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
59 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
60 Plugins/IndexPlugin.cpp |
0 | 61 Plugins/MySQLIndex.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
62 |
0 | 63 ${DATABASES_SOURCES} |
64 ${AUTOGENERATED_SOURCES} | |
65 ) | |
66 | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
67 add_library(OrthancMySQLStorage SHARED |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
68 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
38 | 69 ${STORAGE_RESOURCES} |
17 | 70 Plugins/MySQLStorageArea.cpp |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
71 Plugins/StoragePlugin.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
17
diff
changeset
|
72 |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
73 ${DATABASES_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
74 ${AUTOGENERATED_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
75 ) |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
76 |
0 | 77 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") |
78 | |
79 add_definitions( | |
80 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" | |
81 -DHAS_ORTHANC_EXCEPTION=1 | |
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 ) |