-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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)
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(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(ADD_WERROR)
+ENDIF(WINDOWS)
+
IF(CMAKE_BUILD_TYPE)
IF(WINDOWS)
MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES)
SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE)
ELSE(WINDOWS)
+ IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(CMAKE_C_FLAGS_DEBUG "-g")
+ SET(CMAKE_CXX_FLAGS_DEBUG "-g")
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
IF(CMAKE_BUILD_TYPE STREQUAL Release)
- SET(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
- SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
+ SET(CMAKE_C_FLAGS_RELEASE "-O1 -DNDEBUG")
+ SET(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG")
ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
ENDIF(WINDOWS)
ENDIF(CMAKE_BUILD_TYPE)
SET(PLATFORM_LIBADD)
IF(WINDOWS)
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0)
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_CRT_SECURE_NO_WARNINGS) # To disable windows warnings for strcpy, fopen, ...
+ SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SCL_SECURE_NO_WARNINGS) # To disable windows warnings std::copy, std::transform, ...
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT)
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile
SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM
SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Ws2_32.lib)
SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Userenv.lib) # At least for GEOM suit
ELSE(WINDOWS)
+ # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wparentheses)
+ # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wreturn-type)
+ # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wmissing-declarations)
+ # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wunused)
+ # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wall)
SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl)
ENDIF(WINDOWS)
-SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4)
+SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4)
# SET(PLATFORM_CPPFLAGS)
# # # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT -D_CRT_SECURE_NO_WARNINGS)