[Cmake-commits] CMake branch, next, updated. v3.5.2-1010-gfd11289

Brad King brad.king at kitware.com
Tue Apr 19 13:26:53 EDT 2016


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  fd11289f48d52302cf433cfe2a800120a4766f35 (commit)
       via  26c92d50fd79eada348aaf7ff4190db2b8c47028 (commit)
      from  e2559d1d4c41819cb3e1f1353249b19f041e3732 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd11289f48d52302cf433cfe2a800120a4766f35
commit fd11289f48d52302cf433cfe2a800120a4766f35
Merge: e2559d1 26c92d5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 19 13:26:52 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 19 13:26:52 2016 -0400

    Merge topic 'BundleUtilities-optional-exclude' into next
    
    26c92d50 BundleUtilities: Add optional parameter to ignore specified files


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26c92d50fd79eada348aaf7ff4190db2b8c47028
commit 26c92d50fd79eada348aaf7ff4190db2b8c47028
Author:     Roman Wüger <roman.wueger at gmx.at>
AuthorDate: Tue Apr 19 07:59:06 2016 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 19 13:20:15 2016 -0400

    BundleUtilities: Add optional parameter to ignore specified files

diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 4b52afa..cfb6450 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -52,6 +52,9 @@
 # Then clear all the keys and call verify_app on the final bundle to
 # ensure that it is truly standalone.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
@@ -67,6 +70,9 @@
 # analysis tools on it.  Calls "message(FATAL_ERROR" if the application
 # is not verified.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
@@ -140,6 +146,9 @@
 # all of them and copy prerequisite libs into the bundle and then do
 # appropriate install_name_tool fixups.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
@@ -196,6 +205,9 @@
 # bundle are contained within the bundle or are "system" libraries,
 # presumed to exist everywhere.
 #
+# As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
+# which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
+#
 # ::
 #
 #   VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
@@ -525,6 +537,11 @@ endfunction()
 function(get_bundle_keys app libs dirs keys_var)
   set(${keys_var} PARENT_SCOPE)
 
+  set(options)
+  set(oneValueArgs)
+  set(multiValueArgs IGNORE_ITEM)
+  cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+
   get_bundle_and_executable("${app}" bundle executable valid)
   if(valid)
     # Always use the exepath of the main bundle executable for @executable_path
@@ -554,10 +571,24 @@ function(get_bundle_keys app libs dirs keys_var)
       set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 0 "${main_rpaths}")
 
       set(prereqs "")
-      get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}" "${main_rpaths}")
-      foreach(pr ${prereqs})
-        set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1 "${main_rpaths}")
-      endforeach()
+      set(ignoreFile FALSE)
+      get_filename_component(prereq_filename ${lib} NAME)
+      if(NOT "${CFG_IGNORE_ITEM}" STREQUAL "" )
+        foreach(item ${CFG_IGNORE_ITEM})
+            if("${item}" STREQUAL "${prereq_filename}")
+              set(ignoreFile TRUE)
+            endif()
+        endforeach()
+      endif()
+
+      if(NOT ignoreFile)
+        get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}" "${main_rpaths}")
+        foreach(pr ${prereqs})
+          set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1 "${main_rpaths}")
+        endforeach()
+      else()
+        message(STATUS "Ignoring file: ${prereq_filename}")
+      endif()
     endforeach()
 
     # For each executable found in the bundle, accumulate keys as we go.
@@ -583,10 +614,24 @@ function(get_bundle_keys app libs dirs keys_var)
       # Add each prerequisite to the keys:
       #
       set(prereqs "")
-      get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}" "${exe_rpaths}")
-      foreach(pr ${prereqs})
-        set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1 "${exe_rpaths}")
-      endforeach()
+      set(ignoreFile FALSE)
+      get_filename_component(prereq_filename ${exe} NAME)
+      if(NOT "${CFG_IGNORE_ITEM}" STREQUAL "" )
+        foreach(item ${CFG_IGNORE_ITEM})
+            if("${item}" STREQUAL "${prereq_filename}")
+              set(ignoreFile TRUE)
+            endif()
+        endforeach()
+      endif()
+
+      if(NOT ignoreFile)
+        get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}" "${exe_rpaths}")
+        foreach(pr ${prereqs})
+          set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1 "${exe_rpaths}")
+        endforeach()
+      else()
+        message(STATUS "Ignoring file: ${prereq_filename}")
+      endif()
     endforeach()
 
     # Propagate values to caller's scope:
@@ -798,12 +843,19 @@ function(fixup_bundle app libs dirs)
   message(STATUS "  libs='${libs}'")
   message(STATUS "  dirs='${dirs}'")
 
+  set(options)
+  set(oneValueArgs)
+  set(multiValueArgs IGNORE_ITEM)
+  cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+
+  message(STATUS "  ignoreItems='${CFG_IGNORE_ITEM}'")
+
   get_bundle_and_executable("${app}" bundle executable valid)
   if(valid)
     get_filename_component(exepath "${executable}" PATH)
 
     message(STATUS "fixup_bundle: preparing...")
-    get_bundle_keys("${app}" "${libs}" "${dirs}" keys)
+    get_bundle_keys("${app}" "${libs}" "${dirs}" keys IGNORE_ITEM "${CFG_IGNORE_ITEM}")
 
     message(STATUS "fixup_bundle: copying...")
     list(LENGTH keys n)
@@ -857,7 +909,7 @@ function(fixup_bundle app libs dirs)
     clear_bundle_keys(keys)
 
     message(STATUS "fixup_bundle: verifying...")
-    verify_app("${app}")
+    verify_app("${app}" IGNORE_ITEM "${CFG_IGNORE_ITEM}")
   else()
     message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
   endif()
@@ -877,6 +929,11 @@ function(verify_bundle_prerequisites bundle result_var info_var)
   set(info "")
   set(count 0)
 
+  set(options)
+  set(oneValueArgs)
+  set(multiValueArgs IGNORE_ITEM)
+  cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+
   get_bundle_main_executable("${bundle}" main_bundle_exe)
 
   get_bundle_all_executables("${bundle}" file_list)
@@ -887,37 +944,53 @@ function(verify_bundle_prerequisites bundle result_var info_var)
       message(STATUS "executable file ${count}: ${f}")
 
       set(prereqs "")
-      get_prerequisites("${f}" prereqs 1 1 "${exepath}" "")
+      set(ignoreFile FALSE)
+      get_filename_component(prereq_filename ${f} NAME)
+
+      if(NOT "${CFG_IGNORE_ITEM}" STREQUAL "" )
+        foreach(item ${CFG_IGNORE_ITEM})
+            if("${item}" STREQUAL "${prereq_filename}")
+              set(ignoreFile TRUE)
+            endif()
+        endforeach()
+      endif()
 
-      # On the Mac,
-      # "embedded" and "system" prerequisites are fine... anything else means
-      # the bundle's prerequisites are not verified (i.e., the bundle is not
-      # really "standalone")
-      #
-      # On Windows (and others? Linux/Unix/...?)
-      # "local" and "system" prereqs are fine...
-      #
-      set(external_prereqs "")
+      if(NOT ignoreFile)
+        get_prerequisites("${f}" prereqs 1 1 "${exepath}" "")
 
-      foreach(p ${prereqs})
-        set(p_type "")
-        gp_file_type("${f}" "${p}" p_type)
+        # On the Mac,
+        # "embedded" and "system" prerequisites are fine... anything else means
+        # the bundle's prerequisites are not verified (i.e., the bundle is not
+        # really "standalone")
+        #
+        # On Windows (and others? Linux/Unix/...?)
+        # "local" and "system" prereqs are fine...
+        #
 
-        if(APPLE)
-          if(NOT "${p_type}" STREQUAL "embedded" AND NOT "${p_type}" STREQUAL "system")
-            set(external_prereqs ${external_prereqs} "${p}")
-          endif()
-        else()
-          if(NOT "${p_type}" STREQUAL "local" AND NOT "${p_type}" STREQUAL "system")
-            set(external_prereqs ${external_prereqs} "${p}")
+        set(external_prereqs "")
+
+        foreach(p ${prereqs})
+          set(p_type "")
+          gp_file_type("${f}" "${p}" p_type)
+
+          if(APPLE)
+            if(NOT "${p_type}" STREQUAL "embedded" AND NOT "${p_type}" STREQUAL "system")
+              set(external_prereqs ${external_prereqs} "${p}")
+            endif()
+          else()
+            if(NOT "${p_type}" STREQUAL "local" AND NOT "${p_type}" STREQUAL "system")
+              set(external_prereqs ${external_prereqs} "${p}")
+            endif()
           endif()
-        endif()
-      endforeach()
+        endforeach()
 
-      if(external_prereqs)
-        # Found non-system/somehow-unacceptable prerequisites:
-        set(result 0)
-        set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
+        if(external_prereqs)
+          # Found non-system/somehow-unacceptable prerequisites:
+          set(result 0)
+          set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
+        endif()
+      else()
+        message(STATUS "Ignoring file: ${prereq_filename}")
       endif()
   endforeach()
 
@@ -947,6 +1020,11 @@ function(verify_app app)
   set(verified 0)
   set(info "")
 
+  set(options)
+  set(oneValueArgs)
+  set(multiValueArgs IGNORE_ITEM)
+  cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+
   get_bundle_and_executable("${app}" bundle executable valid)
 
   message(STATUS "===========================================================================")
@@ -957,7 +1035,7 @@ function(verify_app app)
 
   # Verify that the bundle does not have any "external" prerequisites:
   #
-  verify_bundle_prerequisites("${bundle}" verified info)
+  verify_bundle_prerequisites("${bundle}" verified info IGNORE_ITEM "${CFG_IGNORE_ITEM}")
   message(STATUS "verified='${verified}'")
   message(STATUS "info='${info}'")
   message(STATUS "")

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

Summary of changes:
 Modules/BundleUtilities.cmake |  152 +++++++++++++++++++++++++++++++----------
 1 file changed, 115 insertions(+), 37 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list