X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Dicts%2FCMakeLists.txt;h=f6ba194f262695f8b5fd5b403f4c19b3375a8684;hb=58c32763102f7533e55c8673bdff8b221ea28aa8;hp=f0f600d51e0fcc215d709fd648719a28d3a3a4d3;hpb=60e65481d7049408ccf463cc51a5c0475a7b62c7;p=gdcm.git diff --git a/Dicts/CMakeLists.txt b/Dicts/CMakeLists.txt index f0f600d5..f6ba194f 100644 --- a/Dicts/CMakeLists.txt +++ b/Dicts/CMakeLists.txt @@ -5,21 +5,27 @@ # Generate our own 'DICOM' dictionary, based on the following dictionaries: SET(ALL_DICTS dicomV3.dic - Papyrus.dic - NIH.dic #the forbidden one... + #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" "") +# 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) - FILE(APPEND "${GDCM_BINARY_DIR}/Dicts/gdcm.dic" ${dict_append}) + SET(TEST_DICT_BODY "${TEST_DICT_BODY}\n${dict_append}") ENDFOREACH(dict) - -FOREACH(test 1.dic 2.dic 3.dic) - FILE(READ "${GDCM_SOURCE_DIR}/Dicts/${test}" test_append) - FILE(APPEND "${GDCM_BINARY_DIR}/Dicts/test.dic" ${test_append}) -ENDFOREACH(test) +CONFIGURE_FILE("${GDCM_SOURCE_DIR}/Dicts/gdcm.dic.in" + "${GDCM_BINARY_DIR}/Dicts/gdcm.dic" @ONLY IMMEDIATE) #----------------------------------------------------------------------------- # Nice trick to avoid creating a .h file each time we compile gdcm @@ -28,7 +34,7 @@ ENDFOREACH(test) # Which is a variable afterward... # Following code contributing by Andy Cedilnik (Kitware) -FILE(READ "gdcm.dic" ENT) +FILE(READ "${GDCM_BINARY_DIR}/Dicts/gdcm.dic" ENT) STRING(REGEX REPLACE "\r?\n" ";" ENT "${ENT}") SET(DICOM_DATA_DICTIONARY "") @@ -91,30 +97,28 @@ 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) #----------------------------------------------------------------------------- # ... 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) +SET(DICOM_DIR_DICTIONARY "${DICOM_DIR_DICTIONARY} \n {0,0,0,0,0}") -CONFIGURE_FILE("${GDCM_SOURCE_DIR}/src/gdcmDefaultDicts.cxx.in" +CONFIGURE_FILE("${GDCM_SOURCE_DIR}/src/gdcmDefaultDicts.cxx.in" "${GDCM_BINARY_DIR}/src/gdcmDefaultDicts.cxx" IMMEDIATE) #----------------------------------------------------------------------------- -INSTALL_FILES(${GDCM_DATA_DIR} .dic - dicomV3 - dicomVR - dicomTS - DicomDir - DictGroupName - gdcm -) +# For now GDCM_INSTALL_NO_DICTIONARY is a hidden variables +IF(NOT GDCM_INSTALL_NO_DICTIONARY) + INSTALL_FILES(${GDCM_INSTALL_DATA_DIR} .dic + dicomV3 + dicomVR + dicomTS + DicomDir + DictGroupName + gdcm + ) +ENDIF(NOT GDCM_INSTALL_NO_DICTIONARY)