changeset 494:012b63028085

CMake parameter for the location of DCMTK dictionaries
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Jul 2013 13:45:28 +0200
parents ff34c51cd3dd
children 5bb96a6100c0 7f7a2d174acb
files CMakeLists.txt OrthancServer/DicomProtocol/DicomServer.cpp Resources/CMake/DcmtkConfiguration.cmake
diffstat 3 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)")
--- 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)
--- 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)