mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 22:59:56 -05:00
Merge topic 'policy-cleanup'
b010a1fb1dHelp: Update try_compile list of automatic policies5e9b40b6a5Help: Update cmake-buildsystem(7) TARGET_POLICY example to a newer policy9ffbc0e628Tests/RunCMake/cmake_minimum_required: Generalize deprecated version case name0eca249ac7Tests/RunCMake: Update more cmake_minimum_required versions to 3.10a8cf033a74Tests/RunCMake/return: Use newer cmake_minimum_required VERSION Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !10178
This commit is contained in:
@@ -335,8 +335,21 @@ Other Behavior Settings
|
||||
:module:`CheckPIESupported` module must be called before using the
|
||||
``try_compile`` command.
|
||||
|
||||
The current settings of :policy:`CMP0065` and :policy:`CMP0083` are propagated
|
||||
through to the generated test project.
|
||||
Some policies are set automatically in the generated test project
|
||||
as needed to honor the state of the calling project:
|
||||
|
||||
* :policy:`CMP0065`
|
||||
* :policy:`CMP0083`
|
||||
* :policy:`CMP0091`
|
||||
* :policy:`CMP0104`
|
||||
* :policy:`CMP0123`
|
||||
* :policy:`CMP0126`
|
||||
* :policy:`CMP0128`
|
||||
* :policy:`CMP0136`
|
||||
* :policy:`CMP0141`
|
||||
* :policy:`CMP0155`
|
||||
* :policy:`CMP0157`
|
||||
* :policy:`CMP0181`
|
||||
|
||||
.. versionadded:: 3.32
|
||||
The current setting of :policy:`CMP0181` policy is propagated through to the
|
||||
|
||||
@@ -960,20 +960,20 @@ on the consumer:
|
||||
target_compile_definitions(lib1 INTERFACE
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:LIB1_WITH_EXE>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:LIB1_WITH_SHARED_LIB>
|
||||
$<$<TARGET_POLICY:CMP0041>:CONSUMER_CMP0041_NEW>
|
||||
$<$<TARGET_POLICY:CMP0182>:CONSUMER_CMP0182_NEW>
|
||||
)
|
||||
|
||||
add_executable(exe1 exe1.cpp)
|
||||
target_link_libraries(exe1 lib1)
|
||||
|
||||
cmake_policy(SET CMP0041 NEW)
|
||||
cmake_policy(SET CMP0182 NEW)
|
||||
|
||||
add_library(shared_lib shared_lib.cpp)
|
||||
target_link_libraries(shared_lib lib1)
|
||||
|
||||
The ``exe1`` executable will be compiled with ``-DLIB1_WITH_EXE``, while the
|
||||
``shared_lib`` shared library will be compiled with ``-DLIB1_WITH_SHARED_LIB``
|
||||
and ``-DCONSUMER_CMP0041_NEW``, because policy :policy:`CMP0041` is
|
||||
and ``-DCONSUMER_CMP0182_NEW``, because policy :policy:`CMP0182` is
|
||||
``NEW`` at the point where the ``shared_lib`` target is created.
|
||||
|
||||
The ``BUILD_INTERFACE`` expression wraps requirements which are only used when
|
||||
|
||||
Reference in New Issue
Block a user