mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 07:08:38 -05:00
Merge topic 'fixup_bundle_item-fix'
45ed314bff BundleUtilities: do not run install_name_tool on scripts
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5071
This commit is contained in:
@@ -894,11 +894,16 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
|
||||
# to install_name_tool:
|
||||
#
|
||||
if(changes)
|
||||
set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
|
||||
execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
|
||||
if(NOT install_name_tool_result EQUAL 0)
|
||||
string(REPLACE ";" "' '" msg "'${cmd}'")
|
||||
message(FATAL_ERROR "Command failed:\n ${msg}")
|
||||
# Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang)
|
||||
file(READ ${resolved_embedded_item} file_contents LIMIT 5)
|
||||
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}")
|
||||
execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
|
||||
if(NOT install_name_tool_result EQUAL 0)
|
||||
string(REPLACE ";" "' '" msg "'${cmd}'")
|
||||
message(FATAL_ERROR "Command failed:\n ${msg}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user