diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index 67aa9ff64a1..11a5922ccf6 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -16,11 +16,6 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -if( (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND - (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "9" OR ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "9") ) - set(CMAKE_CXX_FLAGS "-Wno-deprecated-copy ${CMAKE_CXX_FLAGS}") -endif() - # Include this package's headers first include_directories( BEFORE ./ ./include ) diff --git a/Installation/cmake/modules/CGAL_SetupCGAL_Qt5Dependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGAL_Qt5Dependencies.cmake index 2ab430f9200..37903ecbbb7 100644 --- a/Installation/cmake/modules/CGAL_SetupCGAL_Qt5Dependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGAL_Qt5Dependencies.cmake @@ -118,5 +118,13 @@ function(CGAL_setup_CGAL_Qt5_dependencies target) target_link_libraries( ${target} ${keyword} CGAL::Qt5_moc_and_resources) endif() target_link_libraries( ${target} ${keyword} Qt5::OpenGL Qt5::Svg Qt5::Xml) + + # Remove -Wdeprecated-copy, for g++ >= 9.0, because Qt5, as of + # version 5.12, has a lot of [-Wdeprecated-copy] warnings. + if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9" ) + target_compile_options( ${target} ${keyword} "-Wno-deprecated-copy" ) + endif() + endfunction()