\r
\r
INSTALL_FILES(${GDCM_DATA_DIR} FILES \r
- dicomV3.dic \r
- dicomVR.dic \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