Salome HOME
CoTech 126.2: Use SalomeMacros.cmake from CONFIGURATION repository
[modules/shaper.git] / CMakeCommon / Common.cmake
index 849d1c6d7817d7a8627df108607ed21de860f10a..4ad9e74b0381cccbc75022a004aa29f10a0cf8e7 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+# Copyright (C) 2014-2020  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -57,3 +57,14 @@ IF(UNIX)
     #MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
   ENDIF(CMAKE_COMPILER_IS_GNUCC)
 ENDIF(UNIX)
+
+# Set highest warnings level
+IF(MSVC)
+  IF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
+    string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  else()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+  endif()
+ELSE()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+ENDIF()