# COMPILER variable
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
if (MSVC)
+ if (MSVC_VERSION LESS 1914)
+ message (AUTHOR_WARNING "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
+ endif()
+
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
set (COMPILER vc7)
elseif (MSVC_VERSION EQUAL 1400)
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
# Since Visual Studio 15 (2017), its version diverged from version of
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
- # we keep its id as "vc14" to be compatibille
+ # we keep its id as "vc14" to be compatible
set (COMPILER vc14)
else()
message (FATAL_ERROR "Unrecognized MSVC_VERSION")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+ message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
+ endif()
set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+ message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
+ endif()
set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
+ if(APPLE)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
+ message (AUTHOR_WARNING "Apple Clang version 11.0.0 or newer is required for C++17 support")
+ endif()
+ else()
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
+ message (AUTHOR_WARNING "Clang version 7.0 or newer is required for C++17 support")
+ endif()
+ endif()
set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.1.1)
+ message (AUTHOR_WARNING "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
+ endif()
set (COMPILER icc)
else()
+ message (AUTHOR_WARNING "Unknown compiler - please verify C++17 support")
set (COMPILER ${CMAKE_GENERATOR})
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
endif()