# HG changeset patch # User Sebastien Jodogne # Date 1632148705 -7200 # Node ID 76affd6404310862779966a91ae7f3b038f80301 # Parent d745ea3db32c4c171f06158ac2c845db4455cc83 fix build against system-wide Orthanc framework diff -r d745ea3db32c -r 76affd640431 CMakeLists.txt --- a/CMakeLists.txt Mon Sep 20 16:10:42 2021 +0200 +++ b/CMakeLists.txt Mon Sep 20 16:38:25 2021 +0200 @@ -41,10 +41,7 @@ # Advanced parameters to fine-tune linking against system libraries set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") -set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") -set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") set(ORTHANC_FRAMEWORK_STATIC OFF CACHE BOOL "If linking against the Orthanc framework system library, indicates whether this library was statically linked") -mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) mark_as_advanced(ORTHANC_FRAMEWORK_STATIC) @@ -54,7 +51,7 @@ if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") if (ORTHANC_FRAMEWORK_USE_SHARED) include(FindBoost) - find_package(Boost COMPONENTS thread) + find_package(Boost COMPONENTS filesystem thread) if (NOT Boost_FOUND) message(FATAL_ERROR "Unable to locate Boost on this system") @@ -64,6 +61,12 @@ endif() link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES}) + + set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") + set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") + mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) + include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake) + else() include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) @@ -154,6 +157,8 @@ add_dependencies(UnitTests AutogeneratedTarget) +target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) + message("Setting the version of the library to ${ORTHANC_PLUGIN_VERSION}") diff -r d745ea3db32c -r 76affd640431 Sources/IndexerDatabase.h --- a/Sources/IndexerDatabase.h Mon Sep 20 16:10:42 2021 +0200 +++ b/Sources/IndexerDatabase.h Mon Sep 20 16:38:25 2021 +0200 @@ -19,6 +19,7 @@ #pragma once +#include // To have ORTHANC_ENABLE_SQLITE defined #include #include