From 2e354a713af4c8169c6988df747db0e323e7b9bc Mon Sep 17 00:00:00 2001 From: Dimitre Date: Mon, 11 Nov 2024 20:30:09 -0300 Subject: [PATCH] v84 fix project::addAddon issue (#591) --- commandLine/src/defines.h | 2 +- commandLine/src/projects/VSCodeProject.h | 2 +- commandLine/src/projects/baseProject.cpp | 8 +++----- commandLine/src/projects/baseProject.h | 2 +- commandLine/src/projects/qtcreatorproject.h | 3 ++- commandLine/src/projects/xcodeProject.cpp | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/commandLine/src/defines.h b/commandLine/src/defines.h index 681e8b7f..a89c1366 100644 --- a/commandLine/src/defines.h +++ b/commandLine/src/defines.h @@ -1,5 +1,5 @@ #define OFPROJECTGENERATOR_MAJOR_VERSION "0" -#define OFPROJECTGENERATOR_MINOR_VERSION "83" +#define OFPROJECTGENERATOR_MINOR_VERSION "84" #define OFPROJECTGENERATOR_PATCH_VERSION "0" #define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION) diff --git a/commandLine/src/projects/VSCodeProject.h b/commandLine/src/projects/VSCodeProject.h index d70cb57e..bd87106b 100644 --- a/commandLine/src/projects/VSCodeProject.h +++ b/commandLine/src/projects/VSCodeProject.h @@ -28,7 +28,7 @@ class VSCodeProject: public baseProject { void addDefine(const std::string& define, LibType libType = RELEASE_LIB) override {} - void addAddon(ofAddon & addon) ; + void addAddon(ofAddon & addon) override; static std::string LOG_NAME; diff --git a/commandLine/src/projects/baseProject.cpp b/commandLine/src/projects/baseProject.cpp index 06ece6c9..c10394a3 100644 --- a/commandLine/src/projects/baseProject.cpp +++ b/commandLine/src/projects/baseProject.cpp @@ -304,10 +304,11 @@ bool baseProject::isAddonInCache(const string & addonPath, const string platform void baseProject::addAddon(const std::string& _addonName){ ofLogVerbose("baseProject::addAddon") << _addonName; - // alert( "baseProject::addAddon " + addonName ); +// alert( "baseProject::addAddon " + _addonName ); auto addonName = ofAddon::cleanName(_addonName); + // FIXME : not target, yes platform. //#ifdef TARGET_WIN32 // // std::replace( addonName.begin(), addonName.end(), '/', '\\' ); @@ -423,10 +424,7 @@ void baseProject::addAddon(const std::string& _addonName){ ofLogNotice() << "adding addon: " << addon.name; - - - - + // MARK: - SPECIFIC for each project. // XCode and VS override the base addAddon. other templates will use baseproject::addAddon(ofAddon... addAddon(addon); diff --git a/commandLine/src/projects/baseProject.h b/commandLine/src/projects/baseProject.h index 9a4d9923..6316e934 100644 --- a/commandLine/src/projects/baseProject.h +++ b/commandLine/src/projects/baseProject.h @@ -70,7 +70,7 @@ class baseProject { void addAddon(const std::string& addon); - void addAddon(ofAddon & addon); + virtual void addAddon(ofAddon & addon); virtual void addSrcRecursively(const fs::path & srcPath); virtual void restoreBackup(const fs::path & srcPath){}; diff --git a/commandLine/src/projects/qtcreatorproject.h b/commandLine/src/projects/qtcreatorproject.h index b7a5670a..b1f40422 100644 --- a/commandLine/src/projects/qtcreatorproject.h +++ b/commandLine/src/projects/qtcreatorproject.h @@ -19,12 +19,13 @@ class QtCreatorProject : public baseProject { void addAfterRule(const std::string& script) override {} void addDefine(const std::string& define, LibType libType = RELEASE_LIB) override {} + void addAddon(ofAddon & addon) override; + bool loadProjectFile() override; bool saveProjectFile() override; static std::string LOG_NAME; private: - void addAddon(ofAddon & addon); using baseProject::addAddon; std::set qbsProjectFiles; ofBuffer qbs; diff --git a/commandLine/src/projects/xcodeProject.cpp b/commandLine/src/projects/xcodeProject.cpp index 692f990c..05968613 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -611,7 +611,7 @@ void xcodeProject::addAfterRule(const string& rule){ // std::sort(addon.srcFiles.begin(), addon.srcFiles.end(), [](const fs::path & a, const fs::path & b) { // return a.string() < b.string(); // }); -void xcodeProject::addAddonLibs(const ofAddon& addon){ +void xcodeProject::addAddonLibs(const ofAddon& addon){ for (auto & e : addon.libs) { ofLogVerbose() << "adding addon libs: " << e.path; addLibrary(e);