]> Creatis software - gdcm.git/blob - Dicts/CMakeLists.txt
ENH: update jpeg lib with ls patch and 2 bugfix patch
[gdcm.git] / Dicts / CMakeLists.txt
1 #-----------------------------------------------------------------------------\r
2 # DICOM dictionary stuff\r
3 \r
4 \r
5 INSTALL_FILES(${GDCM_DATA_DIR} FILES \r
6   dicomV3.dic\r
7   dicomVR.dic\r
8   dicomTS.dic\r
9   DicomDir.dic\r
10 )\r
11 \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
17 \r
18 # Following code contributing by Andy Cedilnik\r
19 SET(INFILE "dicomV3.dic")\r
20 \r
21 FILE(READ "${INFILE}" ENT)\r
22 \r
23 STRING(REGEX REPLACE "\n" ";" ENT "${ENT}")\r
24 SET(DICOM_DICTIONARY\r
25 "//\r
26 #include \"gdcmDicomDictionaryEntry.h\"\r
27 \r
28 static gdcmDicomDictionaryEntry[] =\r
29 {")\r
30 \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
36 ENDFOREACH(line)\r
37 \r
38 SET(DICOM_DICTIONARY "${DICOM_DICTIONARY}\r
39    0\r
40 };")\r
41 \r
42 # See above\r
43 #CONFIGURE_FILE("/tmp/output.h.in" "/tmp/output.h")\r
44 \r
45 #MESSAGE("${DICOM_DICTIONARY}")\r
46 \r