@@ -210,22 +210,27 @@ bool xcodeProject::loadProjectFile() { //base
210210 addCommand (" # ---- PG VERSION " + getPGVersion ());
211211 addCommand (" Add :_OFProjectGeneratorVersion string " + getPGVersion ());
212212
213- renameProject ();
214- // MARK: just to return something.
215- return true ;
216- }
217-
218- // FIXME: mover pra dentro do loadProjectfile
219- void xcodeProject::renameProject () { // base
220- // FIXME: review BUILT_PRODUCTS_DIR
221- addCommand (" Set :objects:" + buildConfigurationListUUID + " :name " + projectName);
213+ // Rename Project
214+ addCommand (" Set :objects:" + buildConfigurationListUUID + " :name string " + projectName);
222215
223216 // Just OSX here, debug app naming.
224217 if (target == " osx" ) {
225218 // TODO: Hardcode to variable
226219 // FIXME: Debug needed in name?
227- addCommand (" Set :objects:E4B69B5B0A3A1756003C02F2:path " + projectName + " Debug.app" );
220+ addCommand (" Set :objects:E4B69B5B0A3A1756003C02F2:path string " + projectName + " Debug.app" );
228221 }
222+
223+ // if ofRoot is not relative to the project path,
224+ // set correct addons and openFrameworks folders
225+ if (!ofIsPathInPath (fs::current_path (), getOFRoot ())) {
226+ addCommand (" Set :objects:" + folderUUID[" openFrameworks" ] + " :path string " + getOFRoot ().string () + " /libs/openFrameworks" );
227+ addCommand (" Set :objects:" + folderUUID[" openFrameworks" ] + " :sourceTree string <absolute>" );
228+
229+ addCommand (" Set :objects:" + folderUUID[" addons" ] + " :path string " + getOFRoot ().string () + " /addons" );
230+ addCommand (" Set :objects:" + folderUUID[" addons" ] + " :sourceTree string <absolute>" );
231+ }
232+
233+ return true ;
229234}
230235
231236fs::path getPathTo (fs::path path, string limit) {
@@ -916,6 +921,7 @@ bool xcodeProject::saveProjectFile() {
916921 // if (cols[0] == "Set") {
917922 try {
918923 json::json_pointer p { json::json_pointer (thispath) };
924+ // alert (thispath, 95);
919925
920926 if (cols[2 ] == " string" ) {
921927 // find position after find word
@@ -947,7 +953,7 @@ bool xcodeProject::saveProjectFile() {
947953
948954 } else {
949955 thispath = thispath.substr (0 , thispath.length () - 1 );
950- // cout << thispath << endl ;
956+ // alert ( thispath, 95) ;
951957 json::json_pointer p = json::json_pointer (thispath);
952958 try {
953959 // Fixing XCode one item array issue
0 commit comments