Browse Source

Add documentation for the CMAKE_DISABLE_FIND_PACKAGE_<Name> switch

Alex
Alex Neundorf 14 years ago
parent
commit
a66df08543
2 changed files with 18 additions and 0 deletions
  1. 14 0
      Source/cmDocumentVariables.cxx
  2. 4 0
      Source/cmFindPackageCommand.cxx

+ 14 - 0
Source/cmDocumentVariables.cxx

@@ -718,6 +718,20 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "CMAKE_SYSTEM_PREFIX_PATH.", false,
      "Variables That Change Behavior");
 
+  cm->DefineProperty
+    ("CMAKE_DISABLE_FIND_PACKAGE_<PackageName>", cmProperty::VARIABLE,
+     "Variable for disabling find_package() calls.",
+     "Every non-REQUIRED find_package() call in a project can be disabled "
+     "by setting the variable CMAKE_DISABLE_FIND_PACKAGE_<PackageName> to "
+     "TRUE. This can be used to build a project without an optional package, "
+     "although that package is installed.\n"
+     "This switch should be used during the initial CMake run. Otherwise if "
+     "the package has already been found in a previous CMake run, the "
+     "variables which have been stored in the cache will still be there. "
+     "In the case it is recommended to remove the cache variables for "
+     "this package from the cache using the cache editor or cmake -U", false,
+     "Variables That Change Behavior");
+
   cm->DefineProperty
     ("CMAKE_USER_MAKE_RULES_OVERRIDE", cmProperty::VARIABLE,
      "Specify a CMake file that overrides platform information.",

+ 4 - 0
Source/cmFindPackageCommand.cxx

@@ -335,6 +335,10 @@ void cmFindPackageCommand::GenerateDocumentation()
   this->CommandDocumentation += this->GenericDocumentationPathsOrder;
   this->CommandDocumentation +=
     "\n"
+    "Every non-REQUIRED find_package() call can be disabled by setting the "
+    "variable CMAKE_DISABLE_FIND_PACKAGE_<package> to TRUE. See the "
+    "documentation for the CMAKE_DISABLE_FIND_PACKAGE_<package> variable for "
+    "more information.\n"
     "See the cmake_policy() command documentation for discussion of the "
     "NO_POLICY_SCOPE option."
     ;