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
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(OrthancPostgreSQL)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 set(ORTHANC_PLUGIN_VERSION "mainline")
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 set(ORTHANC_FRAMEWORK_BRANCH "jobs") # TODO remove this
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 else()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 set(ORTHANC_FRAMEWORK_VERSION "1.3.2")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 set(ENABLE_POSTGRESQL_BACKEND ON)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 EmbedResources(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 POSTGRESQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 Plugins/PostgreSQLIndex.cpp
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 14
diff changeset
29
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 ${AUTOGENERATED_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 add_definitions(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}"
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 -DHAS_ORTHANC_EXCEPTION=1
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 set_target_properties(OrthancPostgreSQLIndex PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 VERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 SOVERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 install(
2
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
63 TARGETS OrthancPostgreSQLIndex OrthancPostgreSQLStorage
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 RUNTIME DESTINATION lib # Destination for Windows
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 )
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 add_executable(UnitTests
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 UnitTests/UnitTestsMain.cpp
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 ${GOOGLE_TEST_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 ${AUTOGENERATED_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 set_target_properties(UnitTests PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 )