# HG changeset patch # User Sebastien Jodogne # Date 1374061528 -7200 # Node ID 012b630280856f5536c70ebb23a7dc2e5ed3f374 # Parent ff34c51cd3ddb0bfa27b0b6a07a6187eee8e7617 CMake parameter for the location of DCMTK dictionaries diff -r ff34c51cd3dd -r 012b63028085 CMakeLists.txt --- a/CMakeLists.txt Wed Jul 17 12:48:29 2013 +0200 +++ b/CMakeLists.txt Wed Jul 17 13:45:28 2013 +0200 @@ -12,6 +12,7 @@ SET(STANDALONE_BUILD ON CACHE BOOL "Standalone build (all the resources are embedded, necessary for releases)") SET(ENABLE_SSL ON CACHE BOOL "Include support for SSL") SET(BUILD_UNIT_TESTS ON CACHE BOOL "Build the unit tests") +SET(DCMTK_DICTIONARY_DIR "/usr/share/dcmtk" CACHE PATH "Directory containing the DCMTK dictionaries \"dicom.dic\" and \"private.dic\" (ignored in standalone builds)") # Advanced parameters (for Debian packaging) SET(USE_DYNAMIC_JSONCPP OFF CACHE BOOL "Use the dynamic version of JsonCpp (only for Debian sid)") diff -r ff34c51cd3dd -r 012b63028085 OrthancServer/DicomProtocol/DicomServer.cpp --- a/OrthancServer/DicomProtocol/DicomServer.cpp Wed Jul 17 12:48:29 2013 +0200 +++ b/OrthancServer/DicomProtocol/DicomServer.cpp Wed Jul 17 13:45:28 2013 +0200 @@ -82,6 +82,8 @@ boost::filesystem::path p = directory; p = p / filename; + LOG(WARNING) << "Loading the external DICOM dictionary " << p; + if (!dictionary.loadDictionary(p.string().c_str())) { throw OrthancException(ErrorCode_InternalError); @@ -111,7 +113,7 @@ LoadEmbeddedDictionary(d, EmbeddedResources::DICTIONARY_PRIVATE); #elif defined(__linux) - std::string path = "/usr/share/dcmtk"; + std::string path = DCMTK_DICTIONARY_DIR; const char* env = std::getenv(DCM_DICT_ENVIRONMENT_VARIABLE); if (env != NULL) diff -r ff34c51cd3dd -r 012b63028085 Resources/CMake/DcmtkConfiguration.cmake --- a/Resources/CMake/DcmtkConfiguration.cmake Wed Jul 17 12:48:29 2013 +0200 +++ b/Resources/CMake/DcmtkConfiguration.cmake Wed Jul 17 13:45:28 2013 +0200 @@ -1,3 +1,5 @@ +add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") + if (${STATIC_BUILD}) SET(DCMTK_VERSION_NUMBER 360) SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)