-1

I am running xcodebuild to build my project via command line and the strange thing is that the intermediate build files and the object files from the build folder contain hardcoded absolute paths from my machine. I think that xcodebuild does that automatically.

Is there a way to make them relative? I searched quite long for this but without success.

I need this because I want to transfer the entire project on another machine and to run some xcode unit tests via xcodebuild with the test parameter without rebuilding the project, so as a result I need to transfer the build files also on that machine. The problem is that the paths from the previous machine (on which the build was made) are present in the build files and .o files and it doesn't match the current machine path.

Example:
Build machine project path: /Users/MyBuildUser/BuildFolder/XcodeProject
Test machine project path (the transfer location): /Users/MyTestUser/TestFolder/XcodeProject
Paths such as: /Users/MyBuildUser/BuildFolder/XcodeProject/Sources/Source.h

Dan
  • 59
  • 7

2 Answers2

0

The paths can be set in Xcode > Preferences > Locations via the Advanced... button:

From there select Custom > Relative to Derived Data or Relative to Workspace.

enter image description here

l'L'l
  • 44,951
  • 10
  • 95
  • 146
0

The problem was about the way I generated the project. The generation is done using CMake. By default, CMake uses absolute paths everywhere and this prohibits generated content to be moved from a workstation to another as described here:

How to tell CMake to use relative paths

Dan
  • 59
  • 7