mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
BundleUtilities: Disallow inclusion at configure time
This commit adds a new CMake policy, CMP0080, which prohibits the inclusion of BundleUtilities at configure time. The old behavior is to allow the inclusion.
This commit is contained in:
@@ -224,6 +224,20 @@ that are already also in the bundle... Anything that points to an
|
||||
external file causes this function to fail the verification.
|
||||
#]=======================================================================]
|
||||
|
||||
# Do not include this module at configure time!
|
||||
if(DEFINED CMAKE_GENERATOR)
|
||||
cmake_policy(GET CMP0080 _BundleUtilities_CMP0080)
|
||||
if(_BundleUtilities_CMP0080 STREQUAL "NEW")
|
||||
message(FATAL_ERROR "BundleUtilities cannot be included at configure time!")
|
||||
elseif(NOT _BundleUtilities_CMP0080 STREQUAL "OLD")
|
||||
message(AUTHOR_WARNING
|
||||
"Policy CMP0080 is not set: BundleUtilities prefers not to be included at configure time. "
|
||||
"Run \"cmake --help-policy CMP0080\" for policy details. "
|
||||
"Use the cmake_policy command to set the policy and suppress this warning."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# The functions defined in this file depend on the get_prerequisites function
|
||||
# (and possibly others) found in:
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user