diff options
author | Brad King <brad.king@kitware.com> | 2023-02-21 13:38:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-02-21 13:38:59 (GMT) |
commit | 70ecc3c36a6deece28504389a696606338857eae (patch) | |
tree | 2f13bcb6e6267df2ffcdacf03c83945435123d8f /Modules | |
parent | 03ebceb1a38066401fd6fd70d749e75d100ba923 (diff) | |
parent | 1430f7f5741a4c608cddfe4d4da34466b0f1489e (diff) | |
download | CMake-70ecc3c36a6deece28504389a696606338857eae.zip CMake-70ecc3c36a6deece28504389a696606338857eae.tar.gz CMake-70ecc3c36a6deece28504389a696606338857eae.tar.bz2 |
Merge topic 'BundleUtilities-chmod-later' into release-3.26
1430f7f574 BundleUtilities: Avoid unnecessary chmod in fixup_bundle_item
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8232
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/BundleUtilities.cmake | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 0beff04..5307901 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -870,10 +870,6 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) endif() endforeach() - if(BU_CHMOD_BUNDLE_ITEMS) - execute_process(COMMAND chmod u+w "${resolved_embedded_item}") - endif() - # CMAKE_INSTALL_NAME_TOOL may not be set if executed in script mode # Duplicated from CMakeFindBinUtils.cmake find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) @@ -903,6 +899,9 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) if(NOT "${resolved_embedded_item}" MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" AND NOT file_contents MATCHES "^#!") set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}") + if(BU_CHMOD_BUNDLE_ITEMS) + execute_process(COMMAND chmod u+w "${resolved_embedded_item}") + endif() execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result) if(NOT install_name_tool_result EQUAL 0) string(REPLACE ";" "' '" msg "'${cmd}'") |