From 0fd0acf2e3697fd98ad89f214e3c6acc22bc55e3 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 7 Jul 2016 12:33:24 +0300 Subject: [PATCH] GDCM: modified compilation scheme - renamed source files - guard the contents - always include --- modules/imgcodecs/CMakeLists.txt | 5 ----- modules/imgcodecs/src/{gdcm_dicom.cpp => grfmt_gdcm.cpp} | 6 +++++- modules/imgcodecs/src/{gdcm_dicom.hpp => grfmt_gdcm.hpp} | 6 ++++++ modules/imgcodecs/src/grfmts.hpp | 1 + modules/imgcodecs/src/loadsave.cpp | 3 --- 5 files changed, 12 insertions(+), 9 deletions(-) rename modules/imgcodecs/src/{gdcm_dicom.cpp => grfmt_gdcm.cpp} (99%) rename modules/imgcodecs/src/{gdcm_dicom.hpp => grfmt_gdcm.hpp} (98%) diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt index 1c7cc25..c614d79 100644 --- a/modules/imgcodecs/CMakeLists.txt +++ b/modules/imgcodecs/CMakeLists.txt @@ -63,11 +63,6 @@ endif() file(GLOB grfmt_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/grfmt*.hpp) file(GLOB grfmt_srcs ${CMAKE_CURRENT_LIST_DIR}/src/grfmt*.cpp) -if(HAVE_GDCM) - list(APPEND grfmt_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/gdcm_dicom.hpp) - list(APPEND grfmt_srcs ${CMAKE_CURRENT_LIST_DIR}/src/gdcm_dicom.cpp) -endif() - list(APPEND grfmt_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/bitstrm.hpp) list(APPEND grfmt_srcs ${CMAKE_CURRENT_LIST_DIR}/src/bitstrm.cpp) list(APPEND grfmt_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/rgbe.hpp) diff --git a/modules/imgcodecs/src/gdcm_dicom.cpp b/modules/imgcodecs/src/grfmt_gdcm.cpp similarity index 99% rename from modules/imgcodecs/src/gdcm_dicom.cpp rename to modules/imgcodecs/src/grfmt_gdcm.cpp index 58e38b9..7aecf35 100644 --- a/modules/imgcodecs/src/gdcm_dicom.cpp +++ b/modules/imgcodecs/src/grfmt_gdcm.cpp @@ -41,7 +41,9 @@ //M*/ #include "precomp.hpp" -#include "gdcm_dicom.hpp" +#include "grfmt_gdcm.hpp" + +#ifdef HAVE_GDCM #include @@ -214,3 +216,5 @@ bool DICOMDecoder::readData( Mat& csImage ) return(bOK); } } + +#endif \ No newline at end of file diff --git a/modules/imgcodecs/src/gdcm_dicom.hpp b/modules/imgcodecs/src/grfmt_gdcm.hpp similarity index 98% rename from modules/imgcodecs/src/gdcm_dicom.hpp rename to modules/imgcodecs/src/grfmt_gdcm.hpp index c9c5c23..8a8e100 100644 --- a/modules/imgcodecs/src/gdcm_dicom.hpp +++ b/modules/imgcodecs/src/grfmt_gdcm.hpp @@ -43,6 +43,10 @@ #ifndef _GDCM_DICOM_H_ #define _GDCM_DICOM_H_ +#include "cvconfig.h" + +#ifdef HAVE_GDCM + #include "grfmt_base.hpp" namespace cv @@ -68,4 +72,6 @@ protected: } +#endif + #endif/*_GDCM_DICOM_H_*/ diff --git a/modules/imgcodecs/src/grfmts.hpp b/modules/imgcodecs/src/grfmts.hpp index c9e3153..7db1ac9 100644 --- a/modules/imgcodecs/src/grfmts.hpp +++ b/modules/imgcodecs/src/grfmts.hpp @@ -54,5 +54,6 @@ #include "grfmt_webp.hpp" #include "grfmt_hdr.hpp" #include "grfmt_gdal.hpp" +#include "grfmt_gdcm.hpp" #endif/*_GRFMTS_H_*/ diff --git a/modules/imgcodecs/src/loadsave.cpp b/modules/imgcodecs/src/loadsave.cpp index c62b0bc..1c0b794 100644 --- a/modules/imgcodecs/src/loadsave.cpp +++ b/modules/imgcodecs/src/loadsave.cpp @@ -45,9 +45,6 @@ #include "precomp.hpp" #include "grfmts.hpp" -#ifdef HAVE_GDCM -#include "gdcm_dicom.hpp" -#endif #undef min #undef max #include -- 2.7.4