From 0e66eafe5a5e3ab68cea6f69b64fbe9eaa5d3326 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 10 Oct 2016 23:30:34 +0400 Subject: [PATCH] OS X: correctly parse output of otool -D. In the past this relied on otool -XD not printing the name of the library itself, only the install name, but that doesn't work anymore as of 10.12. --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 482c308..cb20397 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -213,8 +213,9 @@ if(APPLE) get_filename_component(name ${lib} NAME) set(target ${CMAKE_CURRENT_BINARY_DIR}/solvespace.app/Contents/MacOS/${name}) - execute_process(COMMAND otool -XD ${lib} + execute_process(COMMAND otool -D ${lib} OUTPUT_VARIABLE canonical_lib OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REGEX REPLACE "^.+:\n" "" canonical_lib ${canonical_lib}) add_custom_command(TARGET solvespace POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${lib} ${target} COMMAND install_name_tool -change ${canonical_lib} @executable_path/${name}