From 90126a4ded3f67846f22cc53061d6d6d91ca54c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 29 Apr 2021 10:28:28 +0200 Subject: [PATCH] CMake: avoid warnings with CMake 3.10+ and CMAKE_AUTOMOC set. Co-authored-by: Andy Maloney --- CMakeLists.txt | 6 ++++++ doc/changelog.dox | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 593c31166..dfa87394c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,12 @@ if(HUNTER_ENABLED) include(${CMAKE_CURRENT_LIST_DIR}/package/hunter/HunterInit.cmake) endif() +# If CMAKE_AUTOMOC is set, all uses of corrade_add_resource() would otherwise +# complain on 3.10 that AUTOMOC is not processing GENERATED files +if(POLICY CMP0071) + cmake_policy(SET CMP0071 NEW) +endif() + project(Magnum CXX) if(HUNTER_ENABLED) diff --git a/doc/changelog.dox b/doc/changelog.dox index 9626ca85d..0f31439ec 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -359,6 +359,8 @@ See also: same effect. See @ref building-cross-android, @ref platforms-android and [mosra/magnum#310](https://github.com/mosra/magnum/issues/310) for more information. +- Suppressing a CMake policy-related warning if the global `CMAKE_AUTOMOC` is + set on CMake 3.10+ (see [mosra/magnum#504](https://github.com/mosra/magnum/pull/504)) @subsection changelog-latest-bugfixes Bug fixes