[Cmake-commits] CMake branch, next, updated. v2.8.4-1670-g593bed5

David Cole david.cole at kitware.com
Thu Jun 2 12:10:50 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  593bed555dba903900195b73994b4f729ce2f6ad (commit)
       via  8f0667c1131d41d9f4a31544322530de92d90cb5 (commit)
      from  3b57bf4bf9cfb000d5bb9662f5664ec0b04fe458 (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=593bed555dba903900195b73994b4f729ce2f6ad
commit 593bed555dba903900195b73994b4f729ce2f6ad
Merge: 3b57bf4 8f0667c
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Thu Jun 2 12:10:46 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jun 2 12:10:46 2011 -0400

    Merge topic 'fix-BundleUtilities-cryptic-error-message' into next
    
    8f0667c BundleUtilities: Avoid a cryptic and unhelpful error message


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f0667c1131d41d9f4a31544322530de92d90cb5
commit 8f0667c1131d41d9f4a31544322530de92d90cb5
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Thu Jun 2 11:55:09 2011 -0400
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Thu Jun 2 11:55:09 2011 -0400

    BundleUtilities: Avoid a cryptic and unhelpful error message
    
    When the path to "resolved_embedded_item" was shorter than
    the path to the bundle being fixed up, fixup_bundle would
    fail with a cmake error like:
    
      "string end index: 110 is out of range 0 - 85"
    
    Detect when the path of resolved_embedded_item is too short
    to be embedded in the bundle, and report the proper error
    message, so the poor developer reading it has a snowball's
    chance of actually fixing the issue.

diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 44f2c20..5e4bf46 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -546,13 +546,25 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
   #
   get_dotapp_dir("${exepath}" exe_dotapp_dir)
   string(LENGTH "${exe_dotapp_dir}/" exe_dotapp_dir_length)
-  string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
-  if(NOT "${exe_dotapp_dir}/" STREQUAL "${item_substring}")
+  string(LENGTH "${resolved_embedded_item}" resolved_embedded_item_length)
+  set(path_too_short 0)
+  set(is_embedded 0)
+  if(${resolved_embedded_item_length} LESS ${exe_dotapp_dir_length})
+    set(path_too_short 1)
+  endif()
+  if(NOT path_too_short)
+    string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
+    if("${exe_dotapp_dir}/" STREQUAL "${item_substring}")
+      set(is_embedded 1)
+    endif()
+  endif()
+  if(NOT is_embedded)
     message("  exe_dotapp_dir/='${exe_dotapp_dir}/'")
     message("  item_substring='${item_substring}'")
     message("  resolved_embedded_item='${resolved_embedded_item}'")
     message("")
-    message("Install or copy the item into the bundle before calling fixup_bundle")
+    message("Install or copy the item into the bundle before calling fixup_bundle.")
+    message("Or maybe there's a typo or incorrect path in one of the args to fixup_bundle?")
     message("")
     message(FATAL_ERROR "cannot fixup an item that is not in the bundle...")
   endif()

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

Summary of changes:
 Modules/BundleUtilities.cmake |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list