Переглянути джерело

CMP0020: Remove support for OLD behavior

Brad King 1 рік тому
батько
коміт
094b42b643

+ 5 - 4
Help/policy/CMP0020.rst

@@ -1,6 +1,9 @@
 CMP0020
 CMP0020
 -------
 -------
 
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 Automatically link Qt executables to ``qtmain`` target on Windows.
 Automatically link Qt executables to ``qtmain`` target on Windows.
 
 
 CMake 2.8.10 and lower required users of Qt to always specify a link
 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.
 automatically when they link to QtCore ``IMPORTED`` target.
 
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11
 .. |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

+ 2 - 4
Modules/FindQt4.cmake

@@ -1080,23 +1080,21 @@ if (QT_QMAKE_EXECUTABLE AND
     set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
     set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
     set(_isWin32 $<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>)
     set(_isWin32 $<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>)
     set(_isNotExcluded $<NOT:$<BOOL:$<TARGET_PROPERTY:QT4_NO_LINK_QTMAIN>>>)
     set(_isNotExcluded $<NOT:$<BOOL:$<TARGET_PROPERTY:QT4_NO_LINK_QTMAIN>>>)
-    set(_isPolicyNEW $<TARGET_POLICY:CMP0020>)
     get_target_property(_configs Qt4::QtCore IMPORTED_CONFIGURATIONS)
     get_target_property(_configs Qt4::QtCore IMPORTED_CONFIGURATIONS)
     set_property(TARGET Qt4::QtCore APPEND PROPERTY
     set_property(TARGET Qt4::QtCore APPEND PROPERTY
         INTERFACE_LINK_LIBRARIES
         INTERFACE_LINK_LIBRARIES
-          $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt4::qtmain>
+          $<$<AND:${_isExe},${_isWin32},${_isNotExcluded}>:Qt4::qtmain>
     )
     )
     foreach(_config ${_configs})
     foreach(_config ${_configs})
       set_property(TARGET Qt4::QtCore APPEND PROPERTY
       set_property(TARGET Qt4::QtCore APPEND PROPERTY
         IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
         IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
-          $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt4::qtmain>
+          $<$<AND:${_isExe},${_isWin32},${_isNotExcluded}>:Qt4::qtmain>
       )
       )
     endforeach()
     endforeach()
     unset(_configs)
     unset(_configs)
     unset(_isExe)
     unset(_isExe)
     unset(_isWin32)
     unset(_isWin32)
     unset(_isNotExcluded)
     unset(_isNotExcluded)
-    unset(_isPolicyNEW)
   endif()
   endif()
 
 
   #######################################
   #######################################

+ 1 - 1
Source/cmPolicies.h

@@ -72,7 +72,7 @@ class cmMakefile;
          11, NEW)                                                             \
          11, NEW)                                                             \
   SELECT(POLICY, CMP0020,                                                     \
   SELECT(POLICY, CMP0020,                                                     \
          "Automatically link Qt executables to qtmain target on Windows.", 2, \
          "Automatically link Qt executables to qtmain target on Windows.", 2, \
-         8, 11, WARN)                                                         \
+         8, 11, NEW)                                                          \
   SELECT(                                                                     \
   SELECT(                                                                     \
     POLICY, CMP0021,                                                          \
     POLICY, CMP0021,                                                          \
     "Fatal error on relative paths in INCLUDE_DIRECTORIES target property.",  \
     "Fatal error on relative paths in INCLUDE_DIRECTORIES target property.",  \

+ 0 - 2
Tests/Qt4Targets/CMakeLists.txt

@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.10)
 
 
 project(Qt4Targets)
 project(Qt4Targets)
 
 
-cmake_policy(SET CMP0020 NEW)
-
 find_package(Qt4 REQUIRED)
 find_package(Qt4 REQUIRED)
 
 
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTOMOC ON)