[Cmake-commits] CMake branch, next, updated. v2.8.2-282-g3511928
David Cole
david.cole at kitware.com
Tue Jul 27 12:31:58 EDT 2010
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 351192818efc1749e6f60b5849b6a223d54e99ee (commit)
via 979972f98895cf804d2b606162f0f8f40fbd1da9 (commit)
from 90306982023f838d8754d3ec19f2aede30539a9d (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=351192818efc1749e6f60b5849b6a223d54e99ee
commit 351192818efc1749e6f60b5849b6a223d54e99ee
Merge: 9030698 979972f
Author: David Cole <david.cole at kitware.com>
AuthorDate: Tue Jul 27 12:31:54 2010 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 27 12:31:54 2010 -0400
Merge topic 'fix-issue-10020' into next
979972f Copy Resources in Frameworks during fixup_bundle (#10020)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=979972f98895cf804d2b606162f0f8f40fbd1da9
commit 979972f98895cf804d2b606162f0f8f40fbd1da9
Author: David Cole <david.cole at kitware.com>
AuthorDate: Fri Jul 23 17:16:12 2010 -0400
Commit: David Cole <david.cole at kitware.com>
CommitDate: Tue Jul 27 12:25:11 2010 -0400
Copy Resources in Frameworks during fixup_bundle (#10020)
By default, if an embedded item is a framework, copy its
main dylib file explicitly, and then also its Resources
if it has any.
Inspect a variable, BU_COPY_FULL_FRAMEWORK_CONTENTS, and
if it's ON, copy the entire framework into the bundle.
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index d9c41f4..4d3baf8 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -13,6 +13,7 @@
# set_bundle_key_values
# get_bundle_keys
# copy_resolved_item_into_bundle
+# copy_resolved_framework_into_bundle
# fixup_bundle_item
# fixup_bundle
# copy_and_fixup_bundle
@@ -433,6 +434,59 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
endfunction(copy_resolved_item_into_bundle)
+# copy_resolved_framework_into_bundle
+#
+# Copy a resolved framework into the bundle if necessary. Copy is not necessary
+# if the resolved_item is "the same as" the resolved_embedded_item.
+#
+# By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you want full
+# frameworks embedded in your bundles, set BU_COPY_FULL_FRAMEWORK_CONTENTS to
+# ON before calling fixup_bundle. By default,
+# copy_resolved_framework_into_bundle copies the framework dylib itself plus
+# any framework Resources.
+#
+function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
+ if(WIN32)
+ # ignore case on Windows
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
+ else()
+ set(resolved_item_compare "${resolved_item}")
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
+ endif()
+
+ if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}")
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
+ else()
+ if(BU_COPY_FULL_FRAMEWORK_CONTENTS)
+ # Full Framework (everything):
+ get_filename_component(resolved_dir "${resolved_item}" PATH)
+ get_filename_component(resolved_dir "${resolved_dir}/../.." ABSOLUTE)
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_item}" PATH)
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_dir}/../.." ABSOLUTE)
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_dir}' '${resolved_embedded_dir}'")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_dir}" "${resolved_embedded_dir}")
+ else()
+ # Framework lib itself:
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
+
+ # Plus Resources, if they exist:
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_resources "${resolved_item}")
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_embedded_resources "${resolved_embedded_item}")
+ if(EXISTS "${resolved_resources}")
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
+ endif()
+ endif()
+ endif()
+
+ if(UNIX AND NOT APPLE)
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
+ endif(UNIX AND NOT APPLE)
+endfunction(copy_resolved_framework_into_bundle)
+
+
# fixup_bundle_item
#
# Get the direct/non-system prerequisites of the resolved embedded item. For each
@@ -528,8 +582,14 @@ function(fixup_bundle app libs dirs)
endif(show_status)
if(${${key}_COPYFLAG})
- copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
- "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ set(item "${${key}_ITEM}")
+ if(item MATCHES "[^/]+\\.framework/")
+ copy_resolved_framework_into_bundle("${${key}_RESOLVED_ITEM}"
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ else()
+ copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ endif()
endif(${${key}_COPYFLAG})
endforeach(key)
-----------------------------------------------------------------------
Summary of changes:
Modules/BundleUtilities.cmake | 64 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 62 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list