[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2250-g26d2380

Alexander Neundorf neundorf at kde.org
Wed Feb 20 14:10:04 EST 2013


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  26d2380d3a1090170b4607217db7558576983e5d (commit)
       via  11d0c662069e3fd74cb908f714274eeb05f1a14d (commit)
      from  c46387bcc87cf55718e30f2013b5164cb8858fe2 (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=26d2380d3a1090170b4607217db7558576983e5d
commit 26d2380d3a1090170b4607217db7558576983e5d
Merge: c46387b 11d0c66
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Wed Feb 20 14:09:59 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 20 14:09:59 2013 -0500

    Merge topic 'ExportFileGenerator_GenerateNicerErrorCheckingCode' into next
    
    11d0c66 export files: rewrite the code for checking required targets


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11d0c662069e3fd74cb908f714274eeb05f1a14d
commit 11d0c662069e3fd74cb908f714274eeb05f1a14d
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Mon Feb 11 22:18:48 2013 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Feb 20 20:09:45 2013 +0100

    export files: rewrite the code for checking required targets
    
    Instead of generating a whole bunch of repeated if-statements
    now a foreach()-loop is generated in the targets-file.
    Also now a comment is inserted in the generated file if no
    targets from other export sets are used, so if somebody looks
    at the file he can see whether the information about missing
    imported targets has been generated or not.
    
    Alex

diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index ef4ea38..e55f168 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -754,29 +754,46 @@ void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os,
 {
   if (missingTargets.empty())
     {
+    os << "# This file does not depend on other imported targets which have\n"
+          "# been exported from the same project but in a separate "
+            "export set.\n\n";
     return;
     }
   os << "# Make sure the targets which have been exported in some other \n"
-        "# export set exist.\n";
+        "# export set exist.\n"
+        "unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)\n"
+        "foreach(_target ";
   std::set<std::string> emitted;
   for(unsigned int i=0; i<missingTargets.size(); ++i)
     {
     if (emitted.insert(missingTargets[i]).second)
       {
-      os << "if(NOT TARGET \"" << missingTargets[i] << "\" )\n"
-        << "  if(CMAKE_FIND_PACKAGE_NAME)\n"
-        << "    set( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)\n"
-        << "    set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "
-        << "\"Required imported target \\\"" << missingTargets[i]
-        << "\\\" not found ! \")\n"
-        << "  else()\n"
-        << "    message(FATAL_ERROR \"Required imported target \\\""
-        << missingTargets[i] << "\\\" not found ! \")\n"
-        << "  endif()\n"
-        << "endif()\n";
+      os << "\"" << missingTargets[i] <<  "\" ";
       }
     }
-  os << "\n";
+  os << ")\n"
+        "  if(NOT TARGET \"${_target}\" )\n"
+        "    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets \""
+        "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets} ${_target}\")"
+        "\n"
+        "  endif()\n"
+        "endforeach()\n"
+        "\n"
+        "if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)\n"
+        "  if(CMAKE_FIND_PACKAGE_NAME)\n"
+        "    set( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)\n"
+        "    set( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "
+        "\"The following imported targets are "
+        "referenced, but are missing: "
+                 "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}\")\n"
+        "  else()\n"
+        "    message(FATAL_ERROR \"The following imported targets are "
+        "referenced, but are missing: "
+                "${${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets}\")\n"
+        "  endif()\n"
+        "endif()\n"
+        "unset(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE_targets)\n"
+        "\n";
 }
 
 

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

Summary of changes:
 Source/cmExportFileGenerator.cxx |   43 ++++++++++++++++++++++++++-----------
 1 files changed, 30 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list