diff options
author | Brad King <brad.king@kitware.com> | 2012-02-28 14:51:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-02-28 15:01:44 (GMT) |
commit | d3651041e9f16876d227c757254256039d62d85b (patch) | |
tree | 749b74fe9142a703f802efc71653883064f72b5b /Source/cmDocumentVariables.cxx | |
parent | 31ead5f695182dbb96196f9795b6437e013c6567 (diff) | |
download | CMake-d3651041e9f16876d227c757254256039d62d85b.zip CMake-d3651041e9f16876d227c757254256039d62d85b.tar.gz CMake-d3651041e9f16876d227c757254256039d62d85b.tar.bz2 |
find_package: Optionally warn when implicitly using Config mode
Define variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE for use by a project
that wants to use an explicit mode in every call to find_package in
order to generate more specific failure messages. Word the warning
using the new CONFIG and MODULE mode keywords when the minimum required
version of CMake is new enough to have them. Otherwise word the warning
using the old NO_MODULE mode keyword.
Inspired-by: Alex Neundorf <neundorf@kde.org>
Diffstat (limited to 'Source/cmDocumentVariables.cxx')
-rw-r--r-- | Source/cmDocumentVariables.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 1cab2b5..f3125ce 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -746,6 +746,26 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables That Change Behavior"); cm->DefineProperty + ("CMAKE_FIND_PACKAGE_WARN_NO_MODULE", cmProperty::VARIABLE, + "Tell find_package to warn if called without an explicit mode.", + "If find_package is called without an explicit mode option " + "(MODULE, CONFIG or NO_MODULE) and no Find<pkg>.cmake module is " + "in CMAKE_MODULE_PATH then CMake implicitly assumes that the " + "caller intends to search for a package configuration file. " + "If no package configuration file is found then the wording " + "of the failure message must account for both the case that the " + "package is really missing and the case that the project has a " + "bug and failed to provide the intended Find module. " + "If instead the caller specifies an explicit mode option then " + "the failure message can be more specific." + "\n" + "Set CMAKE_FIND_PACKAGE_WARN_NO_MODULE to TRUE to tell find_package " + "to warn when it implicitly assumes Config mode. " + "This helps developers enforce use of an explicit mode in all calls " + "to find_package within a project.", false, + "Variables That Change Behavior"); + + cm->DefineProperty ("CMAKE_USER_MAKE_RULES_OVERRIDE", cmProperty::VARIABLE, "Specify a CMake file that overrides platform information.", "CMake loads the specified file while enabling support for each " |