Skip to content

Commit 8a3a744

Browse files
authored
Fix paths for projects when not relative to OF folder (#332)
1 parent fb721b3 commit 8a3a744

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ofxProjectGenerator/src/projects/xcodeProject.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,15 @@ bool xcodeProject::createProjectFile(){
128128

129129
// make everything relative the right way.
130130
string relRoot = getOFRelPathFS(projectDir).string();
131-
131+
projectDir = projectDir.lexically_normal();
132+
133+
//projectDir is always absolute at the moment
134+
//so lets check if the projectDir is inside the OF folder - if it is not make the OF path absolute
135+
if( projectDir.string().rfind(getOFRoot(),0) != 0 ){
136+
relRoot = getOFRoot();
137+
}
132138
if (relRoot != "../../.."){
133-
134-
findandreplaceInTexfile(projectDir / projectName / ".xcodeproj/project.pbxproj", "../../..", relRoot);
139+
findandreplaceInTexfile(projectDir / (projectName + ".xcodeproj/project.pbxproj"), "../../..", relRoot);
135140
findandreplaceInTexfile(projectDir / "Project.xcconfig", "../../..", relRoot);
136141
if( target == "osx" ){
137142
findandreplaceInTexfile(projectDir / "Makefile", "../../..", relRoot);

0 commit comments

Comments
 (0)