[cmake-developers] fix-OSX-bundle-rpaths-and-Qt5 topic

clinton at elemtech.com clinton at elemtech.com
Thu Oct 9 10:16:16 EDT 2014



----- Original Message -----
> Adam,
> 
> On 10/08/2014 12:17 PM, Clinton Stimpson wrote:
> > Yeah.  I'm curious if changes to BundleUtilities.cmake in fix-OSX-bundle-
> > rpaths-and-Qt5 will gracefully handle the BundleUtilities test case with
> > @rpath on OS X 10.5.  Perhaps it'll recognize there is no need to change
> > rpaths.
> 
> The BundleUtilities test still fails on OS X 10.5:
> 
>  http://open.cdash.org/testDetails.php?test=285651145&build=3522021
>  -- 6/10: fixing up
>  '/.../Tests/BundleUtilities/testdir1/testbundleutils1.app/Contents/MacOS/testbundleutils1'
>  install_name_tool: more than one input file specified
>  (/.../Tests/BundleUtilities/testdir1 and -delete_rpath)
>  Usage: install_name_tool [-change old new] ... [-id name] input
> 
> Clinton's changes in his rpath-osx-10_6 extension topic to yours teach
> other uses of -delete_rpath to warn on OS X 10.5 and skip deletion.
> I think something similar will be needed here.  Please investigate.
> 
> Meanwhile, on my local OS X 10.9 machine I added this patch:
> 
> diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
> index eedab44..80e5d3b 100644
> --- a/Modules/BundleUtilities.cmake
> +++ b/Modules/BundleUtilities.cmake
> @@ -755,6 +755,7 @@ function(fixup_bundle_item resolved_embedded_item exepath
> dirs)
>    #
>    if(changes)
>      execute_process(COMMAND install_name_tool ${changes}
>      "${resolved_embedded_item}")
> +    message(STATUS "CHANGE install_name_tool ${changes}
> \"${resolved_embedded_item}\"")
>    endif()
>  endfunction()
> 
> From the test output I can see that it is trying to delete several
> rpath entries that do not exist and therefore do not need deletion.
> How is the list chosen for each binary?
> 

Brad,

When I do the same message(), I don't see deletion of rpaths which do not exist.
I see deletions of rpaths which do exist as defined in the CMakeLists.txt file:
set_target_properties(testbundleutils1 module1 PROPERTIES
                      INSTALL_RPATH "${CMAKE_CURRENT_BINARY_DIR}/testdir1"
                      BUILD_WITH_INSTALL_RPATH 1)

But, I'm wondering if INSTALL_RPATH should only be effective on OS X if MACOSX_RPATH is set.
Currently MACOSX_RPATH determines whether a target uses @rpath for its id, which can result in rpaths for a consumer.
In other words, whether a target has rpaths is determined by the use of @rpath in its dependencies.
What do you think about the case of INSTALL_RPATH?

Clint



More information about the cmake-developers mailing list