From 094b42b6432650e3fbdfb803cf5f3dd94fd409fb Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 17 Nov 2024 12:04:08 -0500 Subject: [PATCH] CMP0020: Remove support for OLD behavior --- Help/policy/CMP0020.rst | 9 +++++---- Modules/FindQt4.cmake | 6 ++---- Source/cmPolicies.h | 2 +- Tests/Qt4Targets/CMakeLists.txt | 2 -- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Help/policy/CMP0020.rst b/Help/policy/CMP0020.rst index 0a4de5cc67..ceace31be3 100644 --- a/Help/policy/CMP0020.rst +++ b/Help/policy/CMP0020.rst @@ -1,6 +1,9 @@ CMP0020 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + Automatically link Qt executables to ``qtmain`` target on Windows. CMake 2.8.10 and lower required users of Qt to always specify a link @@ -21,7 +24,5 @@ The ``NEW`` behavior for this policy is to link executables to ``qtmain.lib`` automatically when they link to QtCore ``IMPORTED`` target. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11 -.. |WARNS_OR_DOES_NOT_WARN| replace:: warns -.. include:: STANDARD_ADVICE.txt - -.. include:: DEPRECATED.txt +.. |WARNED_OR_DID_NOT_WARN| replace:: warned +.. include:: REMOVED_EPILOGUE.txt diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 91b83c8465..6e1ffbcd85 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1080,23 +1080,21 @@ if (QT_QMAKE_EXECUTABLE AND set(_isExe $,EXECUTABLE>) set(_isWin32 $>) set(_isNotExcluded $>>) - set(_isPolicyNEW $) get_target_property(_configs Qt4::QtCore IMPORTED_CONFIGURATIONS) set_property(TARGET Qt4::QtCore APPEND PROPERTY INTERFACE_LINK_LIBRARIES - $<$:Qt4::qtmain> + $<$:Qt4::qtmain> ) foreach(_config ${_configs}) set_property(TARGET Qt4::QtCore APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} - $<$:Qt4::qtmain> + $<$:Qt4::qtmain> ) endforeach() unset(_configs) unset(_isExe) unset(_isWin32) unset(_isNotExcluded) - unset(_isPolicyNEW) endif() ####################################### diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 0f4275ad43..55c977e301 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -72,7 +72,7 @@ class cmMakefile; 11, NEW) \ SELECT(POLICY, CMP0020, \ "Automatically link Qt executables to qtmain target on Windows.", 2, \ - 8, 11, WARN) \ + 8, 11, NEW) \ SELECT( \ POLICY, CMP0021, \ "Fatal error on relative paths in INCLUDE_DIRECTORIES target property.", \ diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt index 47a640812d..6d5e34be34 100644 --- a/Tests/Qt4Targets/CMakeLists.txt +++ b/Tests/Qt4Targets/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.10) project(Qt4Targets) -cmake_policy(SET CMP0020 NEW) - find_package(Qt4 REQUIRED) set(CMAKE_AUTOMOC ON)