Mercurial > hg > orthanc-databases
view PostgreSQL/CMakeLists.txt @ 10:3686ba3f9cdb
don't include password in connection string if it is empty; it's seems its not supported by some pg drivers
author | am@osimis.io |
---|---|
date | Mon, 09 Jul 2018 11:43:31 +0200 |
parents | 17bce6a07b2b |
children | 9774802fd05f |
line wrap: on
line source
cmake_minimum_required(VERSION 2.8) project(OrthancPostgreSQL) set(ORTHANC_PLUGIN_VERSION "mainline") if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") set(ORTHANC_FRAMEWORK_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") set(ORTHANC_FRAMEWORK_BRANCH "jobs") # TODO remove this else() set(ORTHANC_FRAMEWORK_VERSION "1.3.2") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake) set(ENABLE_POSTGRESQL_BACKEND ON) include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake) EmbedResources( POSTGRESQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql ) add_library(OrthancPostgreSQLIndex SHARED Plugins/PostgreSQLIndex.cpp Plugins/IndexPlugin.cpp ${DATABASES_SOURCES} ${AUTOGENERATED_SOURCES} ) add_library(OrthancPostgreSQLStorage SHARED Plugins/StoragePlugin.cpp ${DATABASES_SOURCES} ${AUTOGENERATED_SOURCES} ) message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}") add_definitions( -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" -DHAS_ORTHANC_EXCEPTION=1 ) set_target_properties(OrthancPostgreSQLStorage PROPERTIES VERSION ${ORTHANC_PLUGIN_VERSION} SOVERSION ${ORTHANC_PLUGIN_VERSION} COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 ) set_target_properties(OrthancPostgreSQLIndex PROPERTIES VERSION ${ORTHANC_PLUGIN_VERSION} SOVERSION ${ORTHANC_PLUGIN_VERSION} COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 ) install( TARGETS OrthancPostgreSQLIndex OrthancPostgreSQLStorage RUNTIME DESTINATION lib # Destination for Windows LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux ) add_executable(UnitTests Plugins/PostgreSQLIndex.cpp UnitTests/UnitTestsMain.cpp UnitTests/PostgreSQLTests.cpp ${DATABASES_SOURCES} ${GOOGLE_TEST_SOURCES} ${AUTOGENERATED_SOURCES} ) target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) set_target_properties(UnitTests PROPERTIES COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0 )