Salome HOME
Merge from V6_3_BR 15/07/2011
[modules/kernel.git] / salome_adm / cmake_files / FindPLATFORM.cmake
index a49a8c5072ec406108d9297339402659e91a245f..8f4bbbf9f8a6ef458fcc0a7c71cebeb270afa33e 100644 (file)
@@ -1,20 +1,20 @@
-#  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 MARK_AS_ADVANCED(ISSUE)
@@ -40,14 +40,27 @@ IF(NOT CMAKE_BUILD_TYPE)
   SET(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE})
 ENDIF(NOT CMAKE_BUILD_TYPE)
 
+IF(NOT CMAKE_BUILD_TYPE)
+  SET(CMAKE_BUILD_TYPE Release)
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
 IF(WINDOWS)
 ELSE(WINDOWS)
-  SET(TROLL_VAL $ENV{I_AM_A_TROLL_I_DO_NOT_FIX_${MODULE}_WARNINGS})
-  IF(X${TROLL_VAL} STREQUAL X1)
-  ELSE(X${TROLL_VAL} STREQUAL X1)
+  SET(ADD_WERROR ON)
+  SET(NAMES ACCEPT_SALOME_WARNINGS ACCEPT_${MODULE}_WARNINGS I_AM_A_TROLL_I_DO_NOT_FIX_${MODULE}_WARNINGS)
+  FOREACH(name ${NAMES})
+    SET(VAL $ENV{${name}})
+    IF(X${VAL} STREQUAL X0)
+      SET(ADD_WERROR ON)
+    ENDIF(X${VAL} STREQUAL X0)
+    IF(X${VAL} STREQUAL X1)
+      SET(ADD_WERROR OFF)
+    ENDIF(X${VAL} STREQUAL X1)
+  ENDFOREACH(name ${NAMES})
+  IF(ADD_WERROR)
     SET(CMAKE_C_FLAGS "-Werror")
     SET(CMAKE_CXX_FLAGS "-Werror")
-  ENDIF(X${TROLL_VAL} STREQUAL X1)
+  ENDIF(ADD_WERROR)
 ENDIF(WINDOWS)
 
 IF(CMAKE_BUILD_TYPE)