# HG changeset patch # User Sebastien Jodogne # Date 1638877312 -3600 # Node ID ad51ab8e1b2ff80c8d6dc19aa0bdc99ba9369fe7 # Parent 793b8f9c9d52664522b03da605cd36218947b9e7 stop forcing C++11 in CMake diff -r 793b8f9c9d52 -r ad51ab8e1b2f Resources/Orthanc/CMake/DownloadOrthancFramework.cmake --- a/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Tue Dec 07 12:01:56 2021 +0100 +++ b/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Tue Dec 07 12:41:52 2021 +0100 @@ -501,35 +501,6 @@ message(FATAL_ERROR "Please install the libjsoncpp-dev package") endif() - # Switch to the C++11 standard if the version of JsonCpp is 1.y.z - # (same as variable JSONCPP_CXX11 in the source code of Orthanc) - if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h) - file(STRINGS - "${JSONCPP_INCLUDE_DIR}/json/version.h" - JSONCPP_VERSION_MAJOR1 REGEX - ".*define JSONCPP_VERSION_MAJOR.*") - - if (NOT JSONCPP_VERSION_MAJOR1) - message(FATAL_ERROR "Unable to extract the major version of JsonCpp") - endif() - - string(REGEX REPLACE - ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1" - JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1}) - message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}") - - if (JSONCPP_VERSION_MAJOR GREATER 0) - message("Switching to C++11 standard, as version of JsonCpp is >= 1.0.0") - if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - endif() - endif() - else() - message("Unable to detect the major version of JsonCpp, assuming < 1.0.0") - endif() - # Look for Orthanc framework shared library include(CheckCXXSymbolExists)