From: ibs Date: Mon, 16 Sep 2013 13:17:59 +0000 (+0400) Subject: Setting Warning Level for Windows (MSVC) to /W4 and Linux -Wall X-Git-Tag: V6_7_0_beta~139 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=d5aedb2c6dec3bc9981c3700078a443a26734df3 Setting Warning Level for Windows (MSVC) to /W4 and Linux -Wall --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e035a5c538..f765036cdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,17 @@ IF(WIN32) ENDIF() ENDIF() +# set warning level 4 +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() +elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +endif() + SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")