summaryrefslogtreecommitdiff
path: root/Modules/BundleUtilities.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2018-09-12 13:33:04 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2018-09-19 11:23:08 -0400
commiteedd91ab085d551d7953f8bb6fe01fd5540af004 (patch)
tree06c48354c007001780a079d2a6b86fd7bdd822bc /Modules/BundleUtilities.cmake
parentfd28ea35ca5f62e52d030288bf60ca6fe769cb96 (diff)
downloadcmake-eedd91ab085d551d7953f8bb6fe01fd5540af004.tar.gz
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.
Diffstat (limited to 'Modules/BundleUtilities.cmake')
-rw-r--r--Modules/BundleUtilities.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 191149cdbd..31db25a1a6 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -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:
#