@@ -148,6 +148,9 @@ void addPlatforms(const std::string & value) {
148148 else if (p == " linuxarmv7l" ) {
149149 targets.emplace_back (OF_TARGET_LINUXARMV7L);
150150 }
151+ else if (p == " linuxaarch64" ) {
152+ targets.emplace_back (OF_TARGET_LINUXAARCH64);
153+ }
151154 else if (p == " msys2" ) {
152155 targets.emplace_back (OF_TARGET_MINGW);
153156 }
@@ -213,28 +216,27 @@ void updateProject(const fs::path & path, ofTargetPlatform target, bool bConside
213216 // bConsiderParameterAddons = do we consider that the user could call update with a new set of addons
214217 // either we read the addons.make file, or we look at the parameter list.
215218 // if we are updating recursively, we *never* consider addons passed as parameters.
216-
217219 ofLogNotice () << " updating project " << path;
218- auto project = getTargetProject (target);
219220
220- if (!bDryRun) project->create (path, templateName);
221+ if (!bDryRun) {
222+ auto project = getTargetProject (target);
223+
224+ project->create (path, templateName);
221225
222- if (bConsiderParameterAddons && bAddonsPassedIn){
223- for (auto & addon: addons){
224- project->addAddon (addon);
226+ if (bConsiderParameterAddons && bAddonsPassedIn){
227+ for (auto & addon: addons){
228+ project->addAddon (addon);
229+ }
230+ }else {
231+ ofLogNotice () << " parsing addons.make" ;
232+ project->parseAddons ();
225233 }
226- }else {
227- ofLogNotice () << " parsing addons.make" ;
228- project->parseAddons ();
229- }
230234
231- if (!bDryRun){
232235 for (auto & srcPath : srcPaths){
233236 project->addSrcRecursively (srcPath);
234237 }
238+ project->save ();
235239 }
236-
237- if (!bDryRun) project->save ();
238240}
239241
240242void recursiveUpdate (const fs::path & path, ofTargetPlatform target) {
@@ -244,7 +246,7 @@ void recursiveUpdate(const fs::path & path, ofTargetPlatform target) {
244246 // second check if this is a folder that has src in it
245247 if (isGoodProjectPath (path)) {
246248 nProjectsUpdated++;
247- auto project = getTargetProject (target);
249+ // auto project = getTargetProject(target);
248250 updateProject (path, target, false );
249251 return ;
250252 } else {
@@ -483,100 +485,77 @@ int main(int argc, char** argv){
483485 else {
484486 mode = PG_MODE_CREATE;
485487 }
486-
487- // mode = PG_MODE_CREATE;
488+ mode = PG_MODE_CREATE;
488489
489490
490491 if (bVerbose){
491492 ofSetLogLevel (OF_LOG_VERBOSE);
492493 }
493494
494- if (mode == PG_MODE_CREATE) {
495- nProjectsCreated += 1 ;
496-
497- for (int i = 0 ; i < (int )targets.size (); i++) {
498- auto project = getTargetProject (targets[i]);
499- auto target = getTargetString (targets[i]);
500-
501-
495+ if (bRecursive) {
496+ for (auto & t : targets) {
502497 ofLogNotice () << " -----------------------------------------------" ;
503- ofLogNotice () << " setting OF path to: " << ofPath;
504- if (busingEnvVar){
505- ofLogNotice () << " from PG_OF_PATH environment variable" ;
506- }else {
507- ofLogNotice () << " from -o option" ;
508- }
509- ofLogNotice () << " target platform is: " << target;
510- ofLogNotice () << " project path is: " << projectPath;
511-
512- if (templateName!=" " ){
513- ofLogNotice () << " using additional template " << templateName;
514- }
498+ ofLogNotice () << " updating an existing project" ;
499+ ofLogNotice () << " target platform is: " << getTargetString (t);
515500
501+ recursiveUpdate (projectPath, t);
516502
517- ofLogNotice () << " setting up new project " << projectPath;
518- if (!bDryRun) project->create (projectPath, templateName);
519-
503+ ofLogNotice () << " project updated! " ;
504+ ofLogNotice () << " -----------------------------------------------" ;
505+ }
506+ } else {
507+ if (mode == PG_MODE_UPDATE && !isGoodProjectPath (projectPath)) {
508+ ofLogError () << " there's no src folder in this project path to update, maybe use create instead? (or use force to force updating)" ;
509+ } else {
510+ nProjectsCreated += 1 ;
520511
521- if (!bDryRun){
522- for (auto & addon: addons){
523- project->addAddon (addon);
524- }
525- for (auto & srcPath : srcPaths){
526- project->addSrcRecursively (srcPath);
512+ for (auto & t : targets) {
513+ ofLogNotice () << " -----------------------------------------------" ;
514+ ofLogNotice () << " setting OF path to: " << ofPath;
515+ if (busingEnvVar){
516+ ofLogNotice () << " from PG_OF_PATH environment variable" ;
517+ }else {
518+ ofLogNotice () << " from -o option" ;
527519 }
528- }
529- if (!bDryRun) project-> save () ;
520+ ofLogNotice () << " target platform is: " << getTargetString (t);
521+ ofLogNotice () << " project path is: " << projectPath ;
530522
531- ofLogNotice () << " project created! " ;
532- ofLogNotice () << " -----------------------------------------------" ;
533- consoleSpace ();
534- }
535- }
523+ if (templateName != " " ){
524+ ofLogNotice () << " using additional template " << templateName;
525+ }
536526
537- else if (mode == PG_MODE_UPDATE) {
538- if (!bRecursive) {
539- if (isGoodProjectPath (projectPath) || bForce) {
540- nProjectsUpdated += 1 ;
541-
542- for (int i = 0 ; i < (int )targets.size (); i++) {
543- ofLogNotice () << " -----------------------------------------------" ;
544- ofLogNotice () << " setting OF path to: " << ofPath;
545- if (busingEnvVar){
546- ofLogNotice () << " from PG_OF_PATH environment variable" ;
547- }else {
548- ofLogNotice () << " from -o option" ;
549- }
550- ofLogNotice () << " target platform is: " << getTargetString (targets[i]);
527+ ofLogNotice () << " setting up new project " << projectPath;
551528
552- if (templateName!=" " ){
553- ofLogNotice () << " using additional template " << templateName;
529+ if (mode == PG_MODE_UPDATE) {
530+
531+ updateProject (projectPath, t);
532+ ofLogNotice () << " project updated! " ;
533+
534+ } else {
535+
536+ if (!bDryRun){
537+ auto project = getTargetProject (t);
538+ project->create (projectPath, templateName);
539+ for (auto & addon: addons){
540+ project->addAddon (addon);
541+ }
542+ for (auto & srcPath : srcPaths){
543+ project->addSrcRecursively (srcPath);
544+ }
545+ project->save ();
554546 }
555- updateProject (projectPath,targets[i]);
556547
557- ofLogNotice () << " project updated! " ;
558- ofLogNotice () << " -----------------------------------------------" ;
559- consoleSpace ();
548+ ofLogNotice () << " project created! " ;
560549 }
561- }
562- else {
563- ofLogError () << " there's no src folder in this project path to update, maybe use create instead? (or use force to force updating)" ;
564- }
565- }
566- else {
567- for (int i = 0 ; i < (int )targets.size (); i++) {
568- ofLogNotice () << " -----------------------------------------------" ;
569- ofLogNotice () << " updating an existing project" ;
570- ofLogNotice () << " target platform is: " << getTargetString (targets[i]);
571-
572- recursiveUpdate (projectPath, targets[i]);
573-
574- ofLogNotice () << " project updated! " ;
575550 ofLogNotice () << " -----------------------------------------------" ;
551+ consoleSpace ();
576552 }
577553 }
554+
578555 }
579556
557+
558+
580559 consoleSpace ();
581560 float elapsedTime = ofGetElapsedTimef () - startTime;
582561 if (nProjectsCreated > 0 ) std::cout << nProjectsCreated << " project created " ;
0 commit comments