[CMake] iOS CMAKE_INSTALL_COMBINED breaks RPath settings

Curtis Mahieu curtpm at gmail.com
Mon Oct 1 10:58:47 EDT 2018


I'm using CMake 3.12.2  and having an issue with cmake messing up the
RPaths for the final outputted shard Frameworks after doing a cmake --build
. --target install

The output of my build is three shared Frameworks A, B and C

A is the common library that B and C link against.

     A
     /\
   B  C


When ONLY building for iphoneos or iphonesimulator then the RPaths seem to
come out correct
with the following settings :

set(CMAKE_OSX_SYSROOT "iphoneos")
set(CMAKE_OSX_ARCHITECTURES "arm64;armv7;i386;x86_64" CACHE STRING "iOS
supported archs" FORCE)

set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "@executable_path/Frameworks;@loader_path
/Framework")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
set(CMAKE_INSTALL_NAME_DIR "@rpath")
set(CMAKE_IOS_INSTALL_COMBINED FALSE)

running "otool -L framework/B.framework/B" gives :
out/framework/B.framework/B (architecture armv7):
@rpath/B.framework/B
@rpath/A.framework/A
out/framework/B.framework/B (architecture arm64):
@rpath/B.framework/B
@rpath/A.framework/A

However when running the same build with:
set(CMAKE_IOS_INSTALL_COMBINED TRUE)

running "otool -L framework/B.framework/B" gives :
{FULL_PATH_TO_BUILD_DIR}/Release-iphonesimulator/B.framework/B
{FULL_PATH_TO_BUILD_DIR}/Release-iphonesimulator/A.framework/A

What happened to my RPath settings?
And why are the links to the simulator versions only?

Thanks,
Curtis Mahieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181001/33563633/attachment-0001.html>


More information about the CMake mailing list