Skip to content

Commit f9a2e13

Browse files
authored
Merge pull request #6059 from thewtex/release-5.4-update-gdcm
Release 5.4 update gdcm
2 parents 22f6d27 + 19559f5 commit f9a2e13

316 files changed

Lines changed: 12617 additions & 6432 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Modules/ThirdParty/GDCM/UpdateFromUpstream.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ readonly paths="
3333
Utilities/gdcm_openjpeg.h
3434
Utilities/gdcmopenjpeg
3535
Utilities/gdcmrle
36-
Utilities/gdcmutfcpp
3736
Utilities/gdcmuuid
3837
Utilities/gdcm_uuid.h
3938
Utilities/gdcm_zlib.h

Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt

Lines changed: 78 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
cmake_minimum_required(VERSION 3.9.2 FATAL_ERROR)
1+
set(GDCM_MAX_VALIDATED_CMAKE_VERSION "3.13.4")
22

3-
set(GDCM_MAX_VALIDATED_CMAKE_VERSION "3.13.1")
4-
if("${CMAKE_VERSION}" VERSION_LESS_EQUAL "${GDCM_MAX_VALIDATED_CMAKE_VERSION}")
5-
# As of 2018-12-04 GDCM has been validated to build with cmake version 3.13.1 new policies.
6-
# Set and use the newest cmake policies that are validated to work
7-
set(GDCM_CMAKE_POLICY_VERSION "${CMAKE_VERSION}")
8-
else()
9-
set(GDCM_CMAKE_POLICY_VERSION "${GDCM_MAX_VALIDATED_CMAKE_VERSION}")
10-
endif()
11-
cmake_policy(VERSION ${GDCM_CMAKE_POLICY_VERSION})
3+
# Set minimum required version of CMake, and policy version
4+
cmake_minimum_required(VERSION 3.9.2...${GDCM_MAX_VALIDATED_CMAKE_VERSION} FATAL_ERROR) # travis-ci wants 3.9.2
125

136
# GDCM version 3.0.0 will only support C++11 and greater
147
if(CMAKE_CXX_STANDARD EQUAL "98" )
@@ -17,7 +10,7 @@ endif()
1710
#----------------------------------------------------------------------------
1811

1912
project(GDCM
20-
VERSION 3.0.24
13+
VERSION 3.2.5
2114
LANGUAGES CXX C
2215
)
2316
## NOTE: the "DESCRIPTION" feature of project() was introduced in cmake 3.10.0
@@ -125,20 +118,39 @@ if(BUILD_SHARED_LIBS)
125118
endif()
126119

127120
#-----------------------------------------------------------------------------
128-
if(NOT EXECUTABLE_OUTPUT_PATH)
129-
set(EXECUTABLE_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
130-
mark_as_advanced(EXECUTABLE_OUTPUT_PATH)
121+
# Compatibility with older usage of EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH.
122+
# This should be removed in the future.
123+
if(EXECUTABLE_OUTPUT_PATH)
124+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
125+
message(WARNING "EXECUTABLE_OUTPUT_PATH is deprecated. Use CMAKE_RUNTIME_OUTPUT_DIRECTORY instead.")
131126
endif()
132-
if(NOT LIBRARY_OUTPUT_PATH)
133-
set(LIBRARY_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
134-
mark_as_advanced(LIBRARY_OUTPUT_PATH)
127+
if(LIBRARY_OUTPUT_PATH)
128+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
129+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
130+
message(WARNING "LIBRARY_OUTPUT_PATH is deprecated. Use CMAKE_LIBRARY_OUTPUT_DIRECTORY and CMAKE_ARCHIVE_OUTPUT_DIRECTORY instead.")
135131
endif()
136132

137-
# TODO: The following should be used for CMake 3 and beyond,
138-
# EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH are deprecated
139-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
140-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
141-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
133+
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
134+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
135+
endif()
136+
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
137+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
138+
endif()
139+
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
140+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
141+
endif()
142+
143+
# Set for legacy internal usage of EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH
144+
if (NOT EXECUTABLE_OUTPUT_PATH)
145+
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
146+
endif()
147+
if (NOT LIBRARY_OUTPUT_PATH)
148+
if (BUILD_SHARED_LIBS)
149+
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
150+
else()
151+
set(LIBRARY_OUTPUT_PATH ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
152+
endif()
153+
endif()
142154

143155
#-----------------------------------------------------------------------------
144156
# Adding GDCM_DATA_ROOT
@@ -187,6 +199,10 @@ macro(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
187199
endif()
188200
endmacro()
189201

202+
if(UNIX)
203+
include(GNUInstallDirs)
204+
endif()
205+
190206
#include(${GDCM_SOURCE_DIR}/CMake/gdcmPlatformCxxTests.cmake)
191207
#
192208
#GDCM_PLATFORM_CXX_TEST(GDCM_CXX_HAS_FUNCTION
@@ -524,7 +540,7 @@ if(GDCM_STANDALONE)
524540
endif()
525541
if(NOT DEFINED GDCM_DEFAULT_JAVA_VERSION)
526542
# override with cmake -DGDCM_DEFAULT_JAVA_VERSION:STRING=1.5 if you dare
527-
set(GDCM_DEFAULT_JAVA_VERSION 1.7)
543+
set(GDCM_DEFAULT_JAVA_VERSION 1.8)
528544
endif()
529545
if(GDCM_WRAP_JAVA)
530546
set(GDCM_JAVA_SOURCE_VERSION "${GDCM_DEFAULT_JAVA_VERSION}" CACHE STRING "javac source version")
@@ -696,23 +712,45 @@ if(GDCM_STANDALONE)
696712
)
697713

698714
# documented at https://vtk.org/doc/nightly/html/group__module.html
699-
vtk_module_build(
700-
MODULES ${vtkgdcm_modules}
701-
INSTALL_EXPORT GDCM
702-
ARCHIVE_DESTINATION "${GDCM_INSTALL_LIB_DIR}"
703-
HEADERS_DESTINATION "${GDCM_INSTALL_INCLUDE_DIR}/vtk${vtk_version_suffix}"
704-
CMAKE_DESTINATION "${GDCM_INSTALL_PACKAGE_DIR}"
705-
LICENSE_DESTINATION "${GDCM_INSTALL_DATA_DIR}/vtkgdcm-${GDCM_SHORT_VERSION}"
706-
HIERARCHY_DESTINATION "${GDCM_INSTALL_LIB_DIR}/vtk${vtk_version_suffix}/hierarchy/vtkgdcm"
707-
LIBRARY_NAME_SUFFIX "${vtkgdcm_library_suffix}"
708-
VERSION "${GDCM_VERSION}"
709-
SOVERSION "1"
710-
# TODO: these are probably not set as they should be
711-
#USE_EXTERNAL "${GDCM_USE_EXTERNAL}"
712-
#TEST_DATA_TARGET vtkgdcmData
713-
#TEST_INPUT_DATA_DIRECTORY "${vtkgdcm_test_data_directory_input}"
714-
#TEST_OUTPUT_DATA_DIRECTORY "${vtkgdcm_test_data_directory_output}"
715-
)
715+
if(VTK_VERSION VERSION_LESS 9.3)
716+
vtk_module_build(
717+
MODULES ${vtkgdcm_modules}
718+
INSTALL_EXPORT GDCM
719+
ARCHIVE_DESTINATION "${GDCM_INSTALL_LIB_DIR}"
720+
HEADERS_DESTINATION "${GDCM_INSTALL_INCLUDE_DIR}/vtk${vtk_version_suffix}"
721+
CMAKE_DESTINATION "${GDCM_INSTALL_PACKAGE_DIR}"
722+
LICENSE_DESTINATION "${GDCM_INSTALL_DATA_DIR}/vtkgdcm-${GDCM_SHORT_VERSION}"
723+
#SPDX_DESTINATION "${GDCM_INSTALL_DATA_DIR}/vtkgdcm-${GDCM_SHORT_VERSION}"
724+
HIERARCHY_DESTINATION "${GDCM_INSTALL_LIB_DIR}/vtk${vtk_version_suffix}/hierarchy/vtkgdcm"
725+
LIBRARY_NAME_SUFFIX "${vtkgdcm_library_suffix}"
726+
VERSION "${GDCM_VERSION}"
727+
SOVERSION "1"
728+
# TODO: these are probably not set as they should be
729+
#USE_EXTERNAL "${GDCM_USE_EXTERNAL}"
730+
#TEST_DATA_TARGET vtkgdcmData
731+
#TEST_INPUT_DATA_DIRECTORY "${vtkgdcm_test_data_directory_input}"
732+
#TEST_OUTPUT_DATA_DIRECTORY "${vtkgdcm_test_data_directory_output}"
733+
)
734+
else()
735+
vtk_module_build(
736+
MODULES ${vtkgdcm_modules}
737+
INSTALL_EXPORT GDCM
738+
ARCHIVE_DESTINATION "${GDCM_INSTALL_LIB_DIR}"
739+
HEADERS_DESTINATION "${GDCM_INSTALL_INCLUDE_DIR}/vtk${vtk_version_suffix}"
740+
CMAKE_DESTINATION "${GDCM_INSTALL_PACKAGE_DIR}"
741+
LICENSE_DESTINATION "${GDCM_INSTALL_DATA_DIR}/vtkgdcm-${GDCM_SHORT_VERSION}"
742+
SPDX_DESTINATION "${GDCM_INSTALL_DATA_DIR}/vtkgdcm-${GDCM_SHORT_VERSION}"
743+
HIERARCHY_DESTINATION "${GDCM_INSTALL_LIB_DIR}/vtk${vtk_version_suffix}/hierarchy/vtkgdcm"
744+
LIBRARY_NAME_SUFFIX "${vtkgdcm_library_suffix}"
745+
VERSION "${GDCM_VERSION}"
746+
SOVERSION "1"
747+
# TODO: these are probably not set as they should be
748+
#USE_EXTERNAL "${GDCM_USE_EXTERNAL}"
749+
#TEST_DATA_TARGET vtkgdcmData
750+
#TEST_INPUT_DATA_DIRECTORY "${vtkgdcm_test_data_directory_input}"
751+
#TEST_OUTPUT_DATA_DIRECTORY "${vtkgdcm_test_data_directory_output}"
752+
)
753+
endif()
716754

717755
if(VTKGDCM_WRAP_PYTHON)
718756
find_package(PythonInterp ${VTK_PYTHON_VERSION} QUIET)

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmASN1.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool ASN1::ParseDump(const char *array, size_t length)
7373
BIO *out=NULL;
7474

7575
out=BIO_new(BIO_s_file());
76-
assert( out );
76+
gdcm_assert( out );
7777
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
7878
if (!ASN1_parse_dump(out,(const unsigned char*)array,length,indent,dump) )
7979
{

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmBoxRegion.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Region *BoxRegion::Clone() const
6767

6868
bool BoxRegion::Empty() const
6969
{
70-
assert( 0 );
70+
gdcm_assert( 0 );
7171
return false;
7272
}
7373

@@ -146,14 +146,14 @@ BoxRegion BoxRegion::BoundingBox(BoxRegion const & b1, BoxRegion const & b2 )
146146

147147
BoxRegion::BoxRegion(const BoxRegion& b)
148148
{
149-
assert( b.Internals );
149+
gdcm_assert( b.Internals );
150150
Internals = new BoxRegionInternals;
151151
*Internals = *b.Internals;
152152
}
153153

154154
void BoxRegion::operator=(const BoxRegion& b)
155155
{
156-
assert( b.Internals );
156+
gdcm_assert( b.Internals );
157157
*Internals = *b.Internals;
158158
}
159159

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmCAPICryptographicMessageSyntax.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ bool CAPICryptographicMessageSyntax::Decrypt(char *output, size_t &outlen, const
313313
keyBlob.header.reserved = 0;
314314
keyBlob.header.aiKeyAlg = GetAlgIdByObjId(cekAlg->pszObjId);
315315
keyBlob.cbKeySize = cekLen;
316-
assert(cekLen <= 32);
316+
gdcm_assert(cekLen <= 32);
317317
memcpy(keyBlob.rgbKeyData, cek, cekLen);
318318

319319
if (!CryptImportKey(hProv, (unsigned char*)&keyBlob, sizeof(keyBlob), 0, 0, &hCEK))
@@ -480,7 +480,7 @@ void CAPICryptographicMessageSyntax::ReverseBytes(unsigned char* data, DWORD len
480480

481481
bool CAPICryptographicMessageSyntax::LoadFile(const char * filename, unsigned char* & buffer, DWORD & bufLen)
482482
{
483-
assert( !buffer );
483+
gdcm_assert( !buffer );
484484
FILE * f = fopen(filename, "rb");
485485
if (f == NULL)
486486
{

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmCommand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class MemberCommand : public Command
115115
T* m_This;
116116
TMemberFunctionPointer m_MemberFunction;
117117
TConstMemberFunctionPointer m_ConstMemberFunction;
118-
MemberCommand():m_MemberFunction(nullptr),m_ConstMemberFunction(nullptr) {}
118+
MemberCommand():m_This(nullptr),m_MemberFunction(nullptr),m_ConstMemberFunction(nullptr) {}
119119
~MemberCommand() override= default;
120120

121121
};

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmCryptoFactory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ CryptoFactory* CryptoFactory::GetFactoryInstance(CryptoLib id)
6161
gdcmErrorMacro( "No crypto factory registered with id " << (int)id );
6262
return nullptr;
6363
}
64-
assert(it->second);
64+
gdcm_assert(it->second);
6565
return it->second;
6666
}
6767

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmDataEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DataEvent : public AnyEvent
2929
typedef AnyEvent Superclass;
3030
DataEvent(const char *bytes = nullptr, size_t len = 0):Bytes(bytes),Length(len) {}
3131
~DataEvent() override = default;
32-
DataEvent(const Self&s) : AnyEvent(s){};
32+
DataEvent(const Self&s) : AnyEvent(s), Bytes(nullptr), Length(0) {}
3333
void operator=(const Self&) = delete;
3434

3535
const char * GetEventName() const override { return "DataEvent"; }

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmDirectory.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ unsigned int Directory::Explore(FilenameType const &name, bool recursive)
6868
if ('\\' == dirName[dirName.size() - 1])
6969
dirName = dirName.substr(0, dirName.size() - 1);
7070
if ('/' != dirName[dirName.size() - 1]) dirName.push_back('/');
71-
assert( '/' == dirName[dirName.size()-1] );
71+
gdcm_assert( '/' == dirName[dirName.size()-1] );
7272
const std::wstring firstfile = dirName+L"*";
7373
HANDLE hFile = FindFirstFileW(firstfile.c_str(), &fileData);
7474

@@ -106,7 +106,7 @@ unsigned int Directory::Explore(FilenameType const &name, bool recursive)
106106
#else
107107
std::string fileName;
108108
std::string dirName = name;
109-
// assert( System::FileIsDirectory( dirName ) );
109+
// gdcm_assert( System::FileIsDirectory( dirName ) );
110110
Directories.push_back(dirName);
111111
// Real POSIX implementation: scandir is a BSD extension only, and doesn't
112112
// work on debian for example
@@ -127,7 +127,7 @@ unsigned int Directory::Explore(FilenameType const &name, bool recursive)
127127
struct stat buf;
128128
dirent *d;
129129
if ('/' != dirName[dirName.size()-1]) dirName.push_back('/');
130-
assert( '/' == dirName[dirName.size()-1] );
130+
gdcm_assert( '/' == dirName[dirName.size()-1] );
131131
for (d = readdir(dir); d; d = readdir(dir))
132132
{
133133
fileName = dirName + d->d_name;
@@ -152,7 +152,7 @@ unsigned int Directory::Explore(FilenameType const &name, bool recursive)
152152
|| strcmp( d->d_name, ".." ) == 0
153153
|| d->d_name[0] == '.' ) // discard any hidden dir
154154
continue;
155-
assert( d->d_name[0] != '.' ); // hidden directory ??
155+
gdcm_assert( d->d_name[0] != '.' ); // hidden directory ??
156156
if ( recursive )
157157
{
158158
nFiles += Explore( fileName, recursive);

Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmDirectory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public :
5656

5757
/// Set/Get the file names within the directory
5858
FilenamesType const &GetFilenames() const {
59-
assert( !(Toplevel.empty()) && "Need to call Explore first" );
59+
gdcm_assert( !(Toplevel.empty()) && "Need to call Explore first" );
6060
return Filenames; }
6161

6262
/// Return the Directories traversed

0 commit comments

Comments
 (0)