CMake + Xcode --> rpath issue


I recently switched to root 6.02, after having updated my system to OSX 10.11.3 and started to experienced issues when trying to run my applications from Xcode (built using cmake -G Xcode). If I manually set the LD_RUNPATH_SEARCH_PATHS in the configuration of the Xcode project, then the applications run. But anytime, I run cmake again for my applications, the Xcode project is overwritten and I have to set the path again.
I tried both the binary and the compilation installations.

The error displayed in Xcode is :
dyld: Library not loaded: @rpath/
Referenced from: /Users/matkara/Codes/testRoot/build-xcode/Debug/testROOT
Reason: image not found
I tried to compile both my application and ROOT with the option : -DRPATH=ON but this had no effect.

Why is my Xcode project not aware of the location of the ROOT libraries?

Thank you for your advise,

Hi Matt,

This has to do with change in the OSX introduced with version 10.11 (which was released after ROOT v6.02).

Can you try v6.06/00 of ROOT as it is likely to solve the problem?


Try with a more recent version as suggested by Philippe.

The following works for me for a simple project depending on ROOT:

 curl -O
 tar -zxf event.tar.gz
 cd event
 mkdir build
 cd build/
 cmake .. -GXcode
 open event.xcodeproj
 -->select the "Main" schema
 -->Build and Run 

Thank you both of you
I was actually using ROOT 6.06, got confused in the version numbering
Yes this set of instructions works, adding the following command
to the CMakeLists.txt of the project made the difference
Thank you again