[Cmake-commits] CMake branch, next, updated. v2.8.4-1814-g4be5c92

Alexander Neundorf neundorf at kde.org
Thu Jun 23 10:14:48 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4be5c9259dbcca7f7682ea4bc09a8ffa101f33bd (commit)
       via  4a50b5f2aaa6965f908f1a64c202cacf175eeb56 (commit)
       via  a66df0854361479bbfece06e4c0d9d975c084e71 (commit)
       via  6e1d3edb4d1e1b491df879a2764d8a24442795dc (commit)
      from  9bac8cb0359fc1e98464437ecb588100fc9798a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4be5c9259dbcca7f7682ea4bc09a8ffa101f33bd
commit 4be5c9259dbcca7f7682ea4bc09a8ffa101f33bd
Merge: 9bac8cb 4a50b5f
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Thu Jun 23 10:14:38 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jun 23 10:14:38 2011 -0400

    Merge topic 'DisableSwitchForFindPackage' into next
    
    4a50b5f Add a basic test for CMAKE_DISABLE_FIND_PACKAGE_<package>
    a66df08 Add documentation for the CMAKE_DISABLE_FIND_PACKAGE_<Name> switch
    6e1d3ed Add a switch to disable a find_package() call completely


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a50b5f2aaa6965f908f1a64c202cacf175eeb56
commit 4a50b5f2aaa6965f908f1a64c202cacf175eeb56
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Jun 16 22:42:00 2011 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Jun 23 11:09:54 2011 +0200

    Add a basic test for CMAKE_DISABLE_FIND_PACKAGE_<package>
    
    Alex

diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 87fe84e..0169ac9 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -75,7 +75,7 @@ ENDIF()
 
 # For purposes of the test wipe out previous find results.
 SET(PACKAGES
-  foo Foo Bar TFramework Tframework TApp Tapp Special
+  foo Foo Bar Blub TFramework Tframework TApp Tapp Special
   VersionedA VersionedB VersionedC VersionedD VersionedE
   WrongA WrongB WrongC WrongD
   wibbleA wibbleB
@@ -104,6 +104,8 @@ set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1)
 FIND_PACKAGE(foo NO_MODULE)
 FIND_PACKAGE(Foo CONFIGS FooConfig.cmake)
 FIND_PACKAGE(Bar)
+SET(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE)
+FIND_PACKAGE(Blub NO_MODULE)
 FIND_PACKAGE(TFramework CONFIGS TFrameworkConfig.cmake)
 FIND_PACKAGE(Tframework)
 FIND_PACKAGE(TApp)
@@ -169,6 +171,7 @@ ENDIF()
 SET(foo_EXPECTED "lib/foo-1.2/foo-config.cmake")
 SET(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake")
 SET(Bar_EXPECTED "lib/Bar/BarConfig.cmake")
+SET(Blub_MISSING "")
 SET(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake")
 SET(TFramework_EXPECTED
   "TFramework.framework/Versions/A/Resources/CMake/TFrameworkConfig.cmake")
diff --git a/Tests/FindPackageTest/lib/Blub/BlubConfig.cmake b/Tests/FindPackageTest/lib/Blub/BlubConfig.cmake
new file mode 100644
index 0000000..deffa57
--- /dev/null
+++ b/Tests/FindPackageTest/lib/Blub/BlubConfig.cmake
@@ -0,0 +1 @@
+# Test config file.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a66df0854361479bbfece06e4c0d9d975c084e71
commit a66df0854361479bbfece06e4c0d9d975c084e71
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Jun 16 22:13:00 2011 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Thu Jun 23 11:09:41 2011 +0200

    Add documentation for the CMAKE_DISABLE_FIND_PACKAGE_<Name> switch
    
    Alex

diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index ea25e60..4e75f9c 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -719,6 +719,20 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "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.",
      "CMake loads the specified file while enabling support for each "
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 554601d..9d1c220 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/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."
     ;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e1d3edb4d1e1b491df879a2764d8a24442795dc
commit 6e1d3edb4d1e1b491df879a2764d8a24442795dc
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Thu Jun 16 21:11:06 2011 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Tue Jun 21 21:18:23 2011 +0200

    Add a switch to disable a find_package() call completely
    
    As discussed, this adds a switch CMAKE_DISABLE_FIND_PACKAGE_<name>,
    which, when set to TRUE, keeps the find_package() command from executing.
    When the package is REQUIRED at the same time, an error is generated.
    
    Alex

diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 5f106bc..554601d 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -607,6 +607,24 @@ bool cmFindPackageCommand
       }
     }
 
+  std::string disableFindPackageVar = "CMAKE_DISABLE_FIND_PACKAGE_";
+  disableFindPackageVar += this->Name;
+  if(this->Makefile->IsOn(disableFindPackageVar.c_str()))
+    {
+    if (this->Required)
+      {
+      cmOStringStream e;
+      e << "for module " << this->Name << " called with REQUIRED, but "
+        << disableFindPackageVar
+        << " is enabled. A REQUIRED package cannot be disabled.";
+      this->SetError(e.str().c_str());
+      return false;
+      }
+
+    return true;
+    }
+
+
   this->SetModuleVariables(components);
 
   // See if there is a Find<package>.cmake module.

-----------------------------------------------------------------------

Summary of changes:
 Source/cmDocumentVariables.cxx                     |   14 ++++++++++++
 Source/cmFindPackageCommand.cxx                    |   22 ++++++++++++++++++++
 Tests/FindPackageTest/CMakeLists.txt               |    5 +++-
 .../Blub/BlubConfig.cmake}                         |    0
 4 files changed, 40 insertions(+), 1 deletions(-)
 copy Tests/FindPackageTest/{A/wibble-config.cmake => lib/Blub/BlubConfig.cmake} (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list