Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMake/itkCompilerChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ if(NOT ITK_IGNORE_CMAKE_CXX17_CHECKS)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
endif()

# MSVC does not set __cplusplus correctly by default (returns 199711L
# regardless of the actual standard). /Zc:__cplusplus makes it report
# the true value. Required for third-party headers (e.g. DCMTK
# osconfig.h) that check __cplusplus >= 201103L at compile time.
# Available since VS2017 15.7 (MSVC 19.14); we require 19.20+.
if(MSVC AND NOT CMAKE_CXX_FLAGS MATCHES "/Zc:__cplusplus")
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
endif()
6 changes: 6 additions & 0 deletions Modules/ThirdParty/DCMTK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ else(ITK_USE_SYSTEM_DCMTK)
set(ITKDCMTK_LIBRARIES "${_ITKDCMTK_LIB_NAMES}")
#
# add all the embedded include directories to include dirs
# Skip internal JPEG codec libraries (ijg8, ijg12, ijg16) — they have
# no public headers and exporting non-existent paths in
# INTERFACE_INCLUDE_DIRECTORIES causes CMake errors in external modules.
foreach(lib ${_ITKDCMTK_LIB_NAMES})
if(lib MATCHES "^ijg")
continue()
endif()
# add to include list
list(APPEND ITKDCMTK_INCLUDE_DIRS
${ITKDCMTK_INCLUDE}/${lib}/include)
Expand Down
Loading