]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
Replace IN_LIST operator to avoid error when working with older versions of CMake vuzlov/suppress_warnings
authorvsr <vsr@opencascade.com>
Thu, 12 Nov 2020 09:09:08 +0000 (12:09 +0300)
committervsr <vsr@opencascade.com>
Thu, 12 Nov 2020 09:09:08 +0000 (12:09 +0300)
cmake/SalomeMacros.cmake
cmake/SalomeSetupPlatform.cmake

index d24b042896c47555fff784557065f7784eb0ffda..33078a936556b0642ecf2a84f7b8f3a3d9ddb42b 100644 (file)
@@ -27,7 +27,6 @@ IF(WIN32)
   CMAKE_POLICY(SET CMP0020 OLD) # Disable automatic linking to qtmain.lib
 ENDIF(WIN32)
 CMAKE_POLICY(SET CMP0053 NEW)   # For correct Qt 5 detection procedure
-CMAKE_POLICY(SET CMP0057 NEW)   # For IF(IN_LIST) operator
 IF(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
   CMAKE_POLICY(SET CMP0074 NEW) # Use ROOT variables when detecting packages
 ENDIF()
index 55ffc5d6d7d388c63c40eaf9f9f4c3dd5301887e..87cfdf1be29b566794084ad8439606cb9bf655ff 100644 (file)
@@ -111,10 +111,19 @@ ENDIF()
 #       specifying -DCMAKE_CXX_EXTENSIONS=OFF
 SET(SALOME_CXX_STANDARD 11 CACHE STRING "C++ standard to use")
 SET(_supported_standards 11 14 17 20)
-IF(NOT ${SALOME_CXX_STANDARD} IN_LIST _supported_standards)
+SET(_standard_ok FALSE)
+FOREACH(_standard ${_supported_standards})
+  IF(SALOME_CXX_STANDARD STREQUAL _standard)
+    SET(_standard_ok TRUE)
+    BREAK()
+  ENDIF()
+ENDFOREACH()
+IF(NOT _standard_ok)
   MESSAGE(FATAL_ERROR "Unsupported C++ standard: ${SALOME_CXX_STANDARD}; allowed values: ${_supported_standards}")
 ENDIF()
 UNSET(_supported_standards)
+UNSET(_standard)
+UNSET(_standard_ok)
 MESSAGE(STATUS "Setting C++ standard to ${SALOME_CXX_STANDARD}")
 SET(CMAKE_CXX_STANDARD ${SALOME_CXX_STANDARD})
 SET(CMAKE_CXX_STANDARD_REQUIRED ON)