diff Resources/CMake/DcmtkConfiguration.cmake @ 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 b8322fe3bdba
children ee0d5abf7958
line wrap: on
line diff
--- 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)