From 5072598f0795f44e157bef8423feda7de24c5504 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 30 Dec 2018 15:17:35 +0100 Subject: BundleUtilites: Don't use hardcoded name for install_name_tool --- Modules/BundleUtilities.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 10e5510..d5c47f8 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -877,9 +877,13 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) 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}) + # Only if install_name_tool supports -delete_rpath: # - execute_process(COMMAND install_name_tool + execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} OUTPUT_VARIABLE install_name_tool_usage ERROR_VARIABLE install_name_tool_usage ) @@ -897,7 +901,7 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) # to install_name_tool: # if(changes) - set(cmd install_name_tool ${changes} "${resolved_embedded_item}") + 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}'") -- cgit v0.12