0028952: Configuration, CMake - define OCCT_NO_DEPRECATED while building OCCT by...
authorkgv <kgv@opencascade.com>
Wed, 26 Jul 2017 15:44:20 +0000 (18:44 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 28 Jul 2017 12:34:50 +0000 (15:34 +0300)
adm/cmake/occt_toolkit.cmake

index 06901e9..a78c1aa 100644 (file)
@@ -287,6 +287,14 @@ if (BUILD_SHARED_LIBS)
   target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
 endif()
 
+# suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+  if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.0)
+    add_definitions("-DOCCT_NO_DEPRECATED")
+    message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
+  endif()
+endif()
+
 # use Cotire to accelerate build via usage of precompiled headers
 if (BUILD_USE_PCH)
   if (WIN32)