Mercurial > hg > orthanc-databases
annotate PostgreSQL/CMakeLists.txt @ 24:17f849b2af34
sharing plugin initialization code
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Jul 2018 12:17:39 +0200 |
parents | 9774802fd05f |
children | 173176f8cef2 |
rev | line source |
---|---|
0 | 1 cmake_minimum_required(VERSION 2.8) |
2 project(OrthancPostgreSQL) | |
3 | |
4 set(ORTHANC_PLUGIN_VERSION "mainline") | |
5 | |
6 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") | |
7 set(ORTHANC_FRAMEWORK_VERSION "mainline") | |
8 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") | |
9 set(ORTHANC_FRAMEWORK_BRANCH "jobs") # TODO remove this | |
10 else() | |
11 set(ORTHANC_FRAMEWORK_VERSION "1.3.2") | |
12 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") | |
13 endif() | |
14 | |
15 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake) | |
16 | |
17 set(ENABLE_POSTGRESQL_BACKEND ON) | |
18 | |
19 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake) | |
20 | |
21 EmbedResources( | |
22 POSTGRESQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql | |
23 ) | |
24 | |
25 add_library(OrthancPostgreSQLIndex SHARED | |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
14
diff
changeset
|
26 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
14
diff
changeset
|
27 Plugins/IndexPlugin.cpp |
0 | 28 Plugins/PostgreSQLIndex.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
14
diff
changeset
|
29 |
0 | 30 ${DATABASES_SOURCES} |
31 ${AUTOGENERATED_SOURCES} | |
32 ) | |
33 | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
34 add_library(OrthancPostgreSQLStorage SHARED |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
14
diff
changeset
|
35 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp |
14
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
36 Plugins/PostgreSQLStorageArea.cpp |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
37 Plugins/StoragePlugin.cpp |
24
17f849b2af34
sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
14
diff
changeset
|
38 |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
39 ${DATABASES_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
40 ${AUTOGENERATED_SOURCES} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
41 ) |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
42 |
0 | 43 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") |
44 | |
45 add_definitions( | |
46 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" | |
47 -DHAS_ORTHANC_EXCEPTION=1 | |
48 ) | |
49 | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
50 set_target_properties(OrthancPostgreSQLStorage PROPERTIES |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
51 VERSION ${ORTHANC_PLUGIN_VERSION} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
52 SOVERSION ${ORTHANC_PLUGIN_VERSION} |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
53 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 |
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
54 ) |
0 | 55 |
56 set_target_properties(OrthancPostgreSQLIndex PROPERTIES | |
57 VERSION ${ORTHANC_PLUGIN_VERSION} | |
58 SOVERSION ${ORTHANC_PLUGIN_VERSION} | |
59 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 | |
60 ) | |
61 | |
62 install( | |
2
17bce6a07b2b
storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
63 TARGETS OrthancPostgreSQLIndex OrthancPostgreSQLStorage |
0 | 64 RUNTIME DESTINATION lib # Destination for Windows |
65 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
66 ) | |
67 | |
68 | |
69 add_executable(UnitTests | |
70 Plugins/PostgreSQLIndex.cpp | |
14
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
71 Plugins/PostgreSQLStorageArea.cpp |
9774802fd05f
PostgreSQLStorageArea working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2
diff
changeset
|
72 UnitTests/PostgreSQLTests.cpp |
0 | 73 UnitTests/UnitTestsMain.cpp |
74 ${DATABASES_SOURCES} | |
75 ${GOOGLE_TEST_SOURCES} | |
76 ${AUTOGENERATED_SOURCES} | |
77 ) | |
78 | |
79 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) | |
80 set_target_properties(UnitTests PROPERTIES | |
81 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0 | |
82 ) |