X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Dicts%2FCMakeLists.txt;h=e0f1797e44eb8bb921f73e46d7031a54071fdf26;hb=3859a1581c1955f8ad7b0cd70d595d7d24b3dacf;hp=a6e3a656ada29b6c35a0806e037c71f282bf21ea;hpb=586a3bf46d9d1d19e39f031b2a06914538a367f9;p=gdcm.git diff --git a/Dicts/CMakeLists.txt b/Dicts/CMakeLists.txt index a6e3a656..e0f1797e 100644 --- a/Dicts/CMakeLists.txt +++ b/Dicts/CMakeLists.txt @@ -5,21 +5,22 @@ # Generate our own 'DICOM' dictionary, based on the following dictionaries: SET(ALL_DICTS dicomV3.dic - Papyrus.dic - NIH.dic #the forbidden one... - dicomV3PhilipsIntera.dic + #Papyrus.dic + #NIH.dic #the forbidden one... + # SPI.dic + # PHILIPS-Intera.dic # uncomment me if you want + #GEMS.dic #Commented out to avoid polluting 'non GEMS' images + #GEMS-HiSpeed.dic + # GEMS-Advance.dic ) -# The following line make sure we are not appending on an already existing file -#FILE(WRITE "${GDCM_BINARY_DIR}/Dicts/gdcm.dic" "") -#FOREACH(dict ${ALL_DICTS}) -# FILE(READ "${GDCM_SOURCE_DIR}/Dicts/${dict}" dict_append) -# FILE(APPEND "${GDCM_BINARY_DIR}/Dicts/gdcm.dic" ${dict_append}) -#ENDFOREACH(dict) - # Better solution SET(TEST_DICT_BODY) FOREACH(dict ${ALL_DICTS}) + # Properly set dependencies, therefore `touch Philips-Intera.dic` does not rebuild + # but adding/removing a line in Philips-Intera.dic rebuild as expected + CONFIGURE_FILE("${GDCM_SOURCE_DIR}/Dicts/${dict}" + "${GDCM_BINARY_DIR}/Dicts/${dict}" COPYONLY IMMEDIATE) FILE(READ "${GDCM_SOURCE_DIR}/Dicts/${dict}" dict_append) SET(TEST_DICT_BODY "${TEST_DICT_BODY}\n${dict_append}") ENDFOREACH(dict) @@ -41,23 +42,9 @@ 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]+) ([1-9n-]+) (.*)$" " {0x\\1, 0x\\2, \"\\3\" , \"\\4\" , \"\\5\"}, " nline "${line}") - #MESSAGE( "${nline}" ) SET(DICOM_DATA_DICTIONARY "${DICOM_DATA_DICTIONARY}\n${nline}") ENDFOREACH(line) - -#FILE(READ "dicomV3PhilipsIntera.dic" ENT) -#STRING(REGEX REPLACE "\r?\n" ";" ENT "${ENT}") -#SET(DICOM_DATA_DICTIONARY "") -#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]+) ([1-9n-]+) (.*)$" -# " {0x\\1, 0x\\2, \"\\3\" , \"\\4\" , \"\\5\"}, " nline "${line}") -# #SET(DICOM_DATA_DICTIONARY "${DICOM_DATA_DICTIONARY}\n${nline}") -# MESSAGE( "${nline}" ) -#ENDFOREACH(line) - - SET(DICOM_DATA_DICTIONARY "${DICOM_DATA_DICTIONARY} \n {0,0,0,0,0}") #----------------------------------------------------------------------------- @@ -110,8 +97,8 @@ SET(DICOM_DIR_DICTIONARY "") FOREACH(line ${ENT_DIR}) STRING(REGEX REPLACE - "^(metaElem|patientElem|studyElem|serieElem|imageElem) *([a-f0-9]+) ([a-f0-9]+) [\"](.*)[\"](.*)$" - " {\"\\1\" , 0x\\2 , 0x\\3 , \"\\4\"}, \\5" nline "${line}") + "^(metaElem|patientElem|studyElem|serieElem|imageElem) *([a-f0-9]+) ([a-f0-9]+) [\"](.*)[\"] [\"](.*)[\"] (.*)$" + " {\"\\1\" , 0x\\2 , 0x\\3 , \"\\4\", \"\\5\"}, \\6" nline "${line}") SET(DICOM_DIR_DICTIONARY "${DICOM_DIR_DICTIONARY}\n${nline}") ENDFOREACH(line) @@ -119,11 +106,6 @@ ENDFOREACH(line) # ... Set the dictionnary SET(DICOM_DIR_DICTIONARY "${DICOM_DIR_DICTIONARY} \n {0,0,0,0}") -#FOREACH(file dicomV3.dic dicomTS.dic dicomVR.dic DicomDir.dic DictGroupName.dic) -# CONFIGURE_FILE("${GDCM_SOURCE_DIR}/Dicts/${file}" -# "${GDCM_BINARY_DIR}/Dicts/${file}.out") -#ENDFOREACH(file) - CONFIGURE_FILE("${GDCM_SOURCE_DIR}/src/gdcmDefaultDicts.cxx.in" "${GDCM_BINARY_DIR}/src/gdcmDefaultDicts.cxx" IMMEDIATE)