summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-02-20 21:09:10 (GMT)
committerBrad King <brad.king@kitware.com>2012-02-28 14:58:31 (GMT)
commit9c39bbd47420a74d50fab2b421baf630f13343ec (patch)
tree69d09abd443624a7b04a58012de12550a000399a /Source/cmFindPackageCommand.cxx
parentf310f6729149551ca73a853789413f9a36f86ced (diff)
downloadCMake-9c39bbd47420a74d50fab2b421baf630f13343ec.zip
CMake-9c39bbd47420a74d50fab2b421baf630f13343ec.tar.gz
CMake-9c39bbd47420a74d50fab2b421baf630f13343ec.tar.bz2
find_package: add CONFIG mode keyword alias for NO_MODULE
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx25
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index c3c037c..8e6debb 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -130,7 +130,8 @@ void cmFindPackageCommand::GenerateDocumentation()
"proceeds to Config mode.\n"
"The complete Config mode command signature is:\n"
" find_package(<package> [version] [EXACT] [QUIET]\n"
- " [[REQUIRED|COMPONENTS] [components...]] [NO_MODULE]\n"
+ " [[REQUIRED|COMPONENTS] [components...]]\n"
+ " [CONFIG|NO_MODULE]\n"
" [NO_POLICY_SCOPE]\n"
" [NAMES name1 [name2 ...]]\n"
" [CONFIGS config1 [config2 ...]]\n"
@@ -148,9 +149,10 @@ void cmFindPackageCommand::GenerateDocumentation()
" [CMAKE_FIND_ROOT_PATH_BOTH |\n"
" ONLY_CMAKE_FIND_ROOT_PATH |\n"
" NO_CMAKE_FIND_ROOT_PATH])\n"
- "The NO_MODULE option may be used to skip Module mode explicitly. "
- "It is also implied by use of options not specified in the reduced "
- "signature. "
+ "The CONFIG option may be used to skip Module mode explicitly and "
+ "switch to Config mode. It is synonymous to using NO_MODULE. "
+ "Config mode is also implied by use of options not specified in the "
+ "reduced signature. "
"\n"
"Config mode attempts to locate a configuration file provided by the "
"package to be found. A cache entry called <package>_DIR is created to "
@@ -442,6 +444,21 @@ bool cmFindPackageCommand
doing = DoingNone;
haveModeString = args[i];
}
+ else if(args[i] == "CONFIG")
+ {
+ if(!haveModeString.empty())
+ {
+ cmOStringStream e;
+ e << "given " << args[i] << ", but mode is already set to "
+ << haveModeString << ".";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+
+ this->UseFindModules = false;
+ doing = DoingNone;
+ haveModeString = args[i];
+ }
else if(args[i] == "NO_MODULE")
{
if(!haveModeString.empty())