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
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(OrthancMySQL)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
113
7cac47fd4d09 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 112
diff changeset
4 set(ORTHANC_PLUGIN_VERSION "mainline")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 set(ORTHANC_FRAMEWORK_VERSION "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 else()
112
f73050ad32b4 OrthancMySQL-2.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 110
diff changeset
10 set(ORTHANC_FRAMEWORK_VERSION "1.5.2")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 set(ENABLE_MYSQL_BACKEND ON)
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/DatabasesPluginConfiguration.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
20
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
21 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
22 execute_process(
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
23 COMMAND
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
24 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
25 ${ORTHANC_PLUGIN_VERSION} "MySQL storage area plugin" OrthancMySQLStorage.dll
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
26 "MySQL as a database back-end to Orthanc (storage area)"
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
27 ERROR_VARIABLE Failure
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
28 OUTPUT_FILE ${AUTOGENERATED_DIR}/StorageVersion.rc
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
29 )
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
30
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
31 if (Failure)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
32 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
33 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
34
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
35 execute_process(
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
36 COMMAND
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
37 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
38 ${ORTHANC_PLUGIN_VERSION} "MySQL index plugin" OrthancMySQLIndex.dll
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
39 "MySQL as a database back-end to Orthanc (index)"
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
40 ERROR_VARIABLE Failure
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
41 OUTPUT_FILE ${AUTOGENERATED_DIR}/IndexVersion.rc
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
42 )
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
43
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
44 if (Failure)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
45 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
46 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
47
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
48 set(INDEX_RESOURCES ${AUTOGENERATED_DIR}/IndexVersion.rc)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
49 set(STORAGE_RESOURCES ${AUTOGENERATED_DIR}/StorageVersion.rc)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
50 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
51
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
52
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 add_library(OrthancMySQLIndex SHARED
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 Plugins/MySQLIndex.cpp
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 17
diff changeset
64
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 ${AUTOGENERATED_SOURCES}
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
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
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
71 ${STORAGE_RESOURCES}
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 add_definitions(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}"
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 set_target_properties(OrthancMySQLIndex PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 VERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 SOVERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 install(
2
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
98 TARGETS OrthancMySQLIndex OrthancMySQLStorage
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 RUNTIME DESTINATION lib # Destination for Windows
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 add_executable(UnitTests
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 Plugins/MySQLIndex.cpp
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
106 Plugins/MySQLStorageArea.cpp
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 UnitTests/UnitTestsMain.cpp
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
108
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 ${GOOGLE_TEST_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 ${AUTOGENERATED_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 set_target_properties(UnitTests PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 )