fixup_bundle tries and fails to copy system libraries into bundle on macOS
https://discourse.cmake.org/t/lost-with-getting-cpack-to-make-a-macos-bundle/2102/5
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: changing install names or rpaths can't be redone for: /Users/be/mixxx/cmake_build/Mixxx.app/Contents/Frameworks/libmacho.dylib (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
CMake Error at /nix/store/z7qvx6wbvmjvs767g06h03pkzr5aqn6i-cmake-3.18.2/share/cmake-3.18/Modules/BundleUtilities.cmake:901 (message):
Command failed:
'/usr/bin/install_name_tool' '-change' '/usr/lib/system/libcompiler_rt.dylib' '@executable_path/../Frameworks/libcompiler_rt.dylib' '-change' '/usr/lib/system/libdyld.dylib' '@executable_path/../Frameworks/libdyld.dylib' '-change' '/usr/lib/system/libsystem_c.dylib' '@executable_path/../Frameworks/libsystem_c.dylib' '-change' '/usr/lib/system/libsystem_kernel.dylib' '@executable_path/../Frameworks/libsystem_kernel.dylib' '-change' '/usr/lib/system/libsystem_malloc.dylib' '@executable_path/../Frameworks/libsystem_malloc.dylib' '-id' '@executable_path/../Frameworks/libmacho.dylib' '/Users/be/mixxx/cmake_build/Mixxx.app/Contents/Frameworks/libmacho.dylib'
Call Stack (most recent call first):
/nix/store/z7qvx6wbvmjvs767g06h03pkzr5aqn6i-cmake-3.18.2/share/cmake-3.18/Modules/BundleUtilities.cmake:975 (fixup_bundle_item)
/Users/be/mixxx/cmake_build/cmake_install.cmake:94 (fixup_bundle)
I had to hack around this by adding:
function(gp_resolved_file_type_override file type)
if(file MATCHES "^(/usr/lib)")
set(type "system" PARENT_SCOPE)
endif()
endfunction()
to my install(CODE
script which should not need to exist.
I am not sure if /usr/lib
should be added to the list of system paths for only macOS or all Unixy OSes.