Blob Blame Raw
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93a2a24..7076a45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -305,7 +305,7 @@ IF(GDCM_USE_SYSTEM_OPENJPEG)
   # For some reason I cannot specify the version I want.
   # FIND_PACKAGE(OpenJPEG 2.0 REQUIRED)
   # oh well we should handle both 1.0 and 2.0 anyway...
-  #FIND_PACKAGE(OpenJPEG REQUIRED)
+  FIND_PACKAGE(OpenJPEG REQUIRED)
   SET(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES})
 ELSE(GDCM_USE_SYSTEM_OPENJPEG)
   SET(GDCM_OPENJPEG_LIBRARIES gdcmopenjpeg)
@@ -758,6 +758,11 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
   set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
     "All of the tools you'll ever need to develop software using GDCM")
 
+  if(CMAKE_VERSION VERSION_EQUAL 2.8.3)
+    # The following is needed for CMake 2.8.3 and above to preserve backward compat
+    set(CPACK_MONOLITHIC_INSTALL 1)
+  endif(CMAKE_VERSION VERSION_EQUAL 2.8.3)
+  
   # It doesn't make sense to install the headers without the libraries
   # (because you could never use the headers!), so make the headers component
   # depend on the libraries component.
diff --git a/Source/Common/gdcmConfigure.h.in b/Source/Common/gdcmConfigure.h.in
index a203235..534845a 100644
--- a/Source/Common/gdcmConfigure.h.in
+++ b/Source/Common/gdcmConfigure.h.in
@@ -63,8 +63,7 @@
 #ifndef GDCM_USE_SYSTEM_OPENJPEG
 #define OPENJPEG_MAJOR_VERSION 2
 #else
-//#define OPENJPEG_MAJOR_VERSION @OPENJPEG_MAJOR_VERSION@
-#define OPENJPEG_MAJOR_VERSION 2
+#define OPENJPEG_MAJOR_VERSION @OPENJPEG_MAJOR_VERSION@
 #endif //GDCM_USE_SYSTEM_OPENJPEG
 
 #ifndef OPENJPEG_MAJOR_VERSION
diff --git a/Source/Common/gdcmCryptographicMessageSyntax.cxx b/Source/Common/gdcmCryptographicMessageSyntax.cxx
index ec48f40..054d72a 100644
--- a/Source/Common/gdcmCryptographicMessageSyntax.cxx
+++ b/Source/Common/gdcmCryptographicMessageSyntax.cxx
@@ -102,8 +102,8 @@ public:
     ::X509 *ret = sk_X509_value(recips, i);
     return ret;
   }
-  void SetPrivateKey(::EVP_PKEY* pkey) {
-    this->pkey = pkey;
+  void SetPrivateKey(::EVP_PKEY* thepkey) {
+    this->pkey = thepkey;
   }
   ::EVP_PKEY* GetPrivateKey() const {
     return pkey;
diff --git a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
index 4c6d95b..3b6c1b6 100644
--- a/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
+++ b/Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx
@@ -446,6 +446,7 @@ bool JPEG2000Codec::Decode(std::istream &is, std::ostream &os)
     return false;
     }
 
+  int reversible;
 #if OPENJPEG_MAJOR_VERSION == 1
   /* catch events using our callbacks and give a local context */
   opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, NULL);
@@ -484,7 +485,6 @@ bool JPEG2000Codec::Decode(std::istream &is, std::ostream &os)
   /* setup the decoder decoding parameters using user parameters */
   opj_setup_decoder(dinfo, &parameters);
   bool bResult;
-  int reversible;
   OPJ_INT32 l_tile_x0,l_tile_y0;
   OPJ_UINT32 l_tile_width,l_tile_height,l_nb_tiles_x,l_nb_tiles_y;
   bResult = opj_read_header(
@@ -586,7 +586,7 @@ bool JPEG2000Codec::Decode(std::istream &is, std::ostream &os)
   unsigned long len = Dimensions[0]*Dimensions[1] * (PF.GetBitsAllocated() / 8) * image->numcomps;
   char *raw = new char[len];
   //assert( len == fsrc->len );
-  for (unsigned int compno = 0; compno < image->numcomps; compno++)
+  for (unsigned int compno = 0; compno < (unsigned int)image->numcomps; compno++)
     {
     opj_image_comp_t *comp = &image->comps[compno];