diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2018-09-12 17:33:04 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2018-09-19 15:23:08 (GMT) |
commit | eedd91ab085d551d7953f8bb6fe01fd5540af004 (patch) | |
tree | 06c48354c007001780a079d2a6b86fd7bdd822bc /Modules | |
parent | fd28ea35ca5f62e52d030288bf60ca6fe769cb96 (diff) | |
download | CMake-eedd91ab085d551d7953f8bb6fe01fd5540af004.zip CMake-eedd91ab085d551d7953f8bb6fe01fd5540af004.tar.gz CMake-eedd91ab085d551d7953f8bb6fe01fd5540af004.tar.bz2 |
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')
-rw-r--r-- | Modules/BundleUtilities.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 191149c..31db25a 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: # |