Mercurial > hg > orthanc
diff OrthancFramework/Resources/CMake/DcmtkConfigurationStatic-3.6.7.cmake @ 5075:a342e561c29d
fix MSVC2008 build
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 16 Aug 2022 12:46:46 +0200 |
parents | b23a4bb18065 |
children | 0ea402b4d901 |
line wrap: on
line diff
--- a/OrthancFramework/Resources/CMake/DcmtkConfigurationStatic-3.6.7.cmake Tue Aug 16 11:06:39 2022 +0200 +++ b/OrthancFramework/Resources/CMake/DcmtkConfigurationStatic-3.6.7.cmake Tue Aug 16 12:46:46 2022 +0200 @@ -64,6 +64,23 @@ message(FATAL_ERROR "Error while patching a file") endif() + if (MSVC) + # Older versions of Microsoft Visual Studio (notably MSVC2008) + # don't like void usage of function arguments in C source files, + # in order to avoid a warning about unused arguments. This patch + # removes such usages that were not present in DCMTK <= 3.6.6. + execute_process( + COMMAND ${PATCH_EXECUTABLE} -p0 -N -i + ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.7-visual-studio.patch + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE Failure + ) + + if (Failure) + message(FATAL_ERROR "Error while patching a file") + endif() + endif() + configure_file( ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-dcdict_orthanc.cc ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict_orthanc.cc