-#-----------------------------------------------------------------------------\r
-# DICOM dictionary stuff\r
-\r
-\r
-INSTALL_FILES(${GDCM_DATA_DIR} FILES \r
- dicomV3.dic\r
- dicomVR.dic\r
- dicomTS.dic\r
- DicomDir.dic\r
-)\r
-\r
-# Nice trick to avoid creating a .h file each time we compile gdcm\r
-# Since CONFIGURE_FILE do a 'copy if different'\r
-# We have to write the file here since is contains 'DICOM_DICTIONARY'\r
-# Which is a variable afterward...\r
-#FILE(WRITE "/tmp/output.h.in" "@DICOM_DICTIONARY@" )\r
-\r
-# Following code contributing by Andy Cedilnik\r
-SET(INFILE "dicomV3.dic")\r
-\r
-FILE(READ "${INFILE}" ENT)\r
-\r
-STRING(REGEX REPLACE "\n" ";" ENT "${ENT}")\r
-SET(DICOM_DICTIONARY\r
-"//\r
-#include \"gdcmDicomDictionaryEntry.h\"\r
-\r
-static gdcmDicomDictionaryEntry[] =\r
-{")\r
-\r
-FOREACH(line ${ENT})\r
- STRING(REGEX REPLACE\r
- "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([A-Z]+) ([A-Z]+) (.*)([ \(RET\)]*)$"\r
- " { \\1, \\2, \"\\3\" , \"\\4\" , \"\\5\", \"\\6\"}," nline "${line}")\r
- SET(DICOM_DICTIONARY "${DICOM_DICTIONARY}\n${nline}")\r
-ENDFOREACH(line)\r
-\r
-SET(DICOM_DICTIONARY "${DICOM_DICTIONARY}\r
- 0\r
-};")\r
-\r
-# See above\r
-#CONFIGURE_FILE("/tmp/output.h.in" "/tmp/output.h")\r
-\r
-#MESSAGE("${DICOM_DICTIONARY}")\r
-\r
+#-----------------------------------------------------------------------------
+# DICOM dictionary stuff
+
+
+INSTALL_FILES(${GDCM_DATA_DIR} FILES
+ dicomV3.dic
+ dicomVR.dic
+ dicomTS.dic
+ DicomDir.dic
+)
+
+# Nice trick to avoid creating a .h file each time we compile gdcm
+# Since CONFIGURE_FILE do a 'copy if different'
+# We have to write the file here since is contains 'DICOM_DICTIONARY'
+# Which is a variable afterward...
+#FILE(WRITE "/tmp/output.h.in" "@DICOM_DICTIONARY@" )
+
+# Following code contributing by Andy Cedilnik
+SET(INFILE "dicomV3.dic")
+
+FILE(READ "${INFILE}" ENT)
+
+STRING(REGEX REPLACE "\n" ";" ENT "${ENT}")
+SET(DICOM_DICTIONARY
+ "void FillDefault()\n{"
+)
+
+FOREACH(line ${ENT})
+ STRING(REGEX REPLACE
+# "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([A-Z]+) ([A-Z]+) (.*)([ \(RET\)]*)$"
+ "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([0-9a-f][0-9a-f][0-9a-f][0-9a-f]) ([A-Z]+) ([A-Z?]+) (.*)$"
+# " { \\1, \\2, \"\\3\" , \"\\4\" , \"\\5\", \"\\6\"}," nline "${line}")
+# " { \\1, \\2, \"\\3\" , \"\\4\" , \"\\5\"}," nline "${line}")
+ " AddNewEntry( DictEntry ( 0x\\1, 0x\\2, \"\\3\" , \"\\4\" , \"\\5\"));" nline "${line}")
+ SET(DICOM_DICTIONARY "${DICOM_DICTIONARY}\n${nline}")
+ENDFOREACH(line)
+
+SET(DICOM_DICTIONARY "${DICOM_DICTIONARY} \n }")
+
+# See above
+CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/gdcmDefaultDict.h.in" "${GDCM_BINARY_DIR}/gdcmDefaultDict.h")
+
+#MESSAGE("${DICOM_DICTIONARY}")
+