comparison PostgreSQL/CMakeLists.txt @ 315:11641063ddb2

speed up compilation by sharing library between plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Jul 2021 18:29:27 +0200
parents 772fa76cddf8
children 1c2cd90418c9
comparison
equal deleted inserted replaced
314:64763998cdff 315:11641063ddb2
68 AutogeneratedTarget 68 AutogeneratedTarget
69 DEPENDS 69 DEPENDS
70 ${AUTOGENERATED_SOURCES} 70 ${AUTOGENERATED_SOURCES}
71 ) 71 )
72 72
73 add_library(FrameworkForPlugins STATIC
74 ${AUTOGENERATED_SOURCES}
75 ${DATABASES_SOURCES}
76 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
77 Plugins/PostgreSQLIndex.cpp
78 Plugins/PostgreSQLStorageArea.cpp
79 )
80
81 set_property(TARGET FrameworkForPlugins
82 PROPERTY POSITION_INDEPENDENT_CODE ON
83 )
84
73 add_library(OrthancPostgreSQLIndex SHARED 85 add_library(OrthancPostgreSQLIndex SHARED
74 ${INDEX_RESOURCES} 86 ${INDEX_RESOURCES}
75 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
76 Plugins/IndexPlugin.cpp 87 Plugins/IndexPlugin.cpp
77 Plugins/PostgreSQLIndex.cpp
78
79 ${DATABASES_SOURCES}
80 ${AUTOGENERATED_SOURCES}
81 ) 88 )
82 89
83 add_dependencies(OrthancPostgreSQLIndex AutogeneratedTarget)
84
85 add_library(OrthancPostgreSQLStorage SHARED 90 add_library(OrthancPostgreSQLStorage SHARED
86 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
87 ${STORAGE_RESOURCES} 91 ${STORAGE_RESOURCES}
88 Plugins/PostgreSQLStorageArea.cpp
89 Plugins/StoragePlugin.cpp 92 Plugins/StoragePlugin.cpp
90
91 ${DATABASES_SOURCES}
92 ${AUTOGENERATED_SOURCES}
93 ) 93 )
94 94
95 target_link_libraries(OrthancPostgreSQLIndex FrameworkForPlugins)
96 target_link_libraries(OrthancPostgreSQLStorage FrameworkForPlugins)
97
98 add_dependencies(OrthancPostgreSQLIndex AutogeneratedTarget)
95 add_dependencies(OrthancPostgreSQLStorage AutogeneratedTarget) 99 add_dependencies(OrthancPostgreSQLStorage AutogeneratedTarget)
96 100
97 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") 101 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
98 102
99 add_definitions( 103 add_definitions(