changeset 734:8c29c1056d45

automatic search of the dicom dictionaries in CMake
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Feb 2014 16:55:09 +0100
parents 29982cfc5009
children ee0d5abf7958
files CMakeLists.txt LinuxCompilation.txt Resources/CMake/DcmtkConfiguration.cmake
diffstat 3 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Thu Feb 27 09:45:15 2014 +0100
+++ b/CMakeLists.txt	Fri Feb 28 16:55:09 2014 +0100
@@ -15,7 +15,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_CLIENT_LIBRARY ON CACHE BOOL "Build the client library")
-SET(DCMTK_DICTIONARY_DIR "/usr/share/dcmtk" CACHE PATH "Directory containing the DCMTK dictionaries \"dicom.dic\" and \"private.dic\" (only when using system version of DCMTK)") 
+SET(DCMTK_DICTIONARY_DIR "" CACHE PATH "Directory containing the DCMTK dictionaries \"dicom.dic\" and \"private.dic\" (only when using system version of DCMTK)") 
 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
 
--- a/LinuxCompilation.txt	Thu Feb 27 09:45:15 2014 +0100
+++ b/LinuxCompilation.txt	Fri Feb 28 16:55:09 2014 +0100
@@ -89,7 +89,6 @@
         -DUSE_SYSTEM_GOOGLE_LOG=OFF \
 	-DUSE_SYSTEM_MONGOOSE=OFF \
         -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
-        -DDCMTK_DICTIONARY_DIR:PATH=/usr/share/dcmtk \
 	~/Orthanc
 
 
@@ -105,7 +104,6 @@
 # cmake -DALLOW_DOWNLOADS=ON \
 	-DUSE_SYSTEM_MONGOOSE=OFF \
         -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
-        -DDCMTK_DICTIONARY_DIR:PATH=/usr/share/libdcmtk2 \
 	~/Orthanc
 
 Note: Have also a look at the official package:
@@ -159,7 +157,6 @@
         -DALLOW_DOWNLOADS=ON \
 	-DUSE_SYSTEM_MONGOOSE=OFF \
         -DUSE_GTEST_DEBIAN_SOURCE_PACKAGE=ON \
-        -DDCMTK_DICTIONARY_DIR:PATH=/usr/share/libdcmtk2 \
 	~/Orthanc
 
 
--- a/Resources/CMake/DcmtkConfiguration.cmake	Thu Feb 27 09:45:15 2014 +0100
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Fri Feb 28 16:55:09 2014 +0100
@@ -1,4 +1,17 @@
-add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
+# Lookup for DICOM dictionaries, if none is specified by the user
+if (DCMTK_DICTIONARY_DIR STREQUAL "")
+  find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
+    /usr/share/dcmtk
+    /usr/share/libdcmtk2
+    )
+
+  message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
+  add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
+else()
+  add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
+endif()
+
+
 
 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
   SET(DCMTK_VERSION_NUMBER 360)