Skip to content

Commit 7c2b880

Browse files
committed
Avoid influencing policies in outer scope in CMake config
1 parent 097f4bd commit 7c2b880

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/templates/Config.cmake.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ set(@META_PROJECT_VARNAME_UPPER@_QT_RESOURCES @QT_RESOURCES@)
3535
# define mapping from CMake targets to pkg-config module names
3636
@TARGET_TO_PKG_CONFIG_MODULE_NAME_MAPPING@
3737

38+
# save policies before modifying them e.g. though the inclusion of 3rdParty
39+
cmake_policy(PUSH)
40+
3841
# define additional find_package arguments for required CMake-packages
3942
@ADDITIONAL_ARGUMENTS_FOR_REQUIRED_CMAKE_PACKAGES@
4043
# define library config, add imported target
@@ -155,3 +158,6 @@ function(use_@META_PROJECT_VARNAME@)
155158
set(STATIC_LIBRARIES_QT_RESOURCES "${STATIC_LIBRARIES_QT_RESOURCES};${@META_PROJECT_VARNAME_UPPER@_QT_RESOURCES}" PARENT_SCOPE)
156159
endif()
157160
endfunction()
161+
162+
# restore policies
163+
cmake_policy(POP)

0 commit comments

Comments
 (0)