1 #-----------------------------------------------------------------------------
\r
2 # DICOM dictionary stuff
\r
5 INSTALL_FILES(${GDCM_DATA_DIR} FILES
\r
12 # Nice trick to avoid creating a .h file each time we compile gdcm
\r
13 # Since CONFIGURE_FILE do a 'copy if different'
\r
14 # We have to write the file here since is contains 'DICOM_DICTIONARY'
\r
15 # Which is a variable afterward...
\r
16 #FILE(WRITE "/tmp/output.h.in" "@DICOM_DICTIONARY@" )
\r
18 # Following code contributing by Andy Cedilnik
\r
19 SET(INFILE "dicomV3.dic")
\r
21 FILE(READ "${INFILE}" ENT)
\r
23 STRING(REGEX REPLACE "\n" ";" ENT "${ENT}")
\r
24 SET(DICOM_DICTIONARY
\r
26 #include \"gdcmDicomDictionaryEntry.h\"
\r
28 static gdcmDicomDictionaryEntry[] =
\r
31 FOREACH(line ${ENT})
\r
32 STRING(REGEX REPLACE
\r
33 "^([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
34 " { \\1, \\2, \"\\3\" , \"\\4\" , \"\\5\", \"\\6\"}," nline "${line}")
\r
35 SET(DICOM_DICTIONARY "${DICOM_DICTIONARY}\n${nline}")
\r
38 SET(DICOM_DICTIONARY "${DICOM_DICTIONARY}
\r
43 #CONFIGURE_FILE("/tmp/output.h.in" "/tmp/output.h")
\r
45 #MESSAGE("${DICOM_DICTIONARY}")
\r