Move the addition of -Wno-deprecated-copy to CGAL_Qt5 setup

That way:
  - that will work, even if CGAL CXX_FLAGS are copied (when hte CMake
    options `CGAL_DEV_MODE` or `RUNNING_CGAL_AUTO_TEST` are `ON`),
  - that will affect all CGAL Qt5 demos at once.
This commit is contained in:
Laurent Rineau 2019-02-06 11:47:44 +01:00
parent ff4f13e82c
commit 2455affba0
2 changed files with 8 additions and 5 deletions

View File

@ -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 )

View File

@ -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()