diff --git a/commandLine/src/addons/ofAddon.cpp b/commandLine/src/addons/ofAddon.cpp index 23fb020f..80c24850 100644 --- a/commandLine/src/addons/ofAddon.cpp +++ b/commandLine/src/addons/ofAddon.cpp @@ -14,16 +14,20 @@ void ofAddon::getFrameworksRecursively(const fs::path & path, string platform) { -// alert ("getFrameworksRecursively " + path.string(), 34); +// alert ("getFrameworksRecursively for " + platform + " : " + path.string(), 34); if (!fs::exists(path) || !fs::is_directory(path)) return; for (const auto & f : dirList(path)) { if (fs::is_directory(f)) { if (f.extension() == ".framework" || f.extension() == ".xcframework") { +// alert ("found XCF " + f.string(), 31); bool platformFound = false; + +// if (ofIsStringInString(platform), f.string()) { if (!platform.empty() && f.string().find(platform) != std::string::npos) { platformFound = true; } + if(platformFound) { if (f.extension() == ".framework") { frameworks.emplace_back(f.string()); @@ -770,11 +774,11 @@ void ofAddon::addToFolder(const fs::path& path, const fs::path & parentFolder){ } void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFolder) { -// alert ("parseLibsPath " + libsPath.string(), 35); if (!fs::exists(libsPath)) { // alert("file not found " + libsPath.string(), 35); return; } +// alert ("parseLibsPath " + libsPath.string() + ", parent=" + parentFolder.string(), 35); if (platform == "osx" || platform == "macos"){ @@ -787,13 +791,14 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo // getXCFrameworksRecursively(libsPath, "macos"); // getXCFrameworksRecursively(libsPath, "osx"); + // FIXME: This is not needed when we get libraries right. + // if it was needed the best was change to std::set. removeDuplicates(libs); removeDuplicates(libFiles); removeDuplicates(frameworks); removeDuplicates(xcframeworks); - }else{ - + } else { getLibsRecursively(libsPath, libFiles, libs, platform); } @@ -834,15 +839,7 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo s = fixPath(s); // alert("fixpath after " + ofPathToString(s)); addToFolder(s, parentFolder); -// fs::path folder; -// if (isLocalAddon) { -// folder = fs::path { "local_addons" } / fs::relative(s.parent_path(), parentFolder); -// } else { -// folder = fs::relative(s.parent_path(), getOFRoot()); - -// } srcFiles.emplace_back(s); -// filesToFolders[s] = folder; } // so addons will never be system. @@ -853,40 +850,21 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo size_t foundWindowsPath = f.find('\\'); if (foundUnixPath==string::npos && foundWindowsPath==string::npos){ - bIsSystemFramework = true; // we have no "path" so we are system + bIsSystemFramework = true; // we have no "path" so we are system } if (bIsSystemFramework){ ; // do we need to do anything here? } else { - // if addon is local, it is relative to the project folder, and if it is not, it is related to the project folder, ex: addons/ofxSvg -// fs::path rel = fs::relative (f, isLocalAddon ? pathToProject : pathToOF); -// fs::path folder = rel.parent_path(); -// -// if (isLocalAddon) { -// fs::path fFS { f }; -// folder = fs::path { "local_addons" } / fs::relative(fFS.parent_path(), parentFolder); -// } -// -// filesToFolders[f] = folder; addToFolder(f, parentFolder); } } for (const auto & f : xcframeworks) { - -// fs::path rel = fs::relative(f, isLocalAddon ? pathToProject : pathToOF); -// fs::path folder = rel.parent_path(); -// -// if (isLocalAddon) { -// fs::path fFS { f }; -// folder = fs::path { "local_addons" } / fs::relative(fFS.parent_path(), parentFolder); -// } -// -// filesToFolders[f] = folder; addToFolder(f, parentFolder); } } + string ofAddon::cleanName(const string& name){ auto addonName = name; #ifdef TARGET_WIN32 diff --git a/commandLine/src/defines.h b/commandLine/src/defines.h index f32fd57d..60a52241 100644 --- a/commandLine/src/defines.h +++ b/commandLine/src/defines.h @@ -1,5 +1,5 @@ #define OFPROJECTGENERATOR_MAJOR_VERSION "0" -#define OFPROJECTGENERATOR_MINOR_VERSION "85" +#define OFPROJECTGENERATOR_MINOR_VERSION "86" #define OFPROJECTGENERATOR_PATCH_VERSION "0" #define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION) diff --git a/commandLine/src/projects/baseProject.cpp b/commandLine/src/projects/baseProject.cpp index 0749f3f7..79900364 100644 --- a/commandLine/src/projects/baseProject.cpp +++ b/commandLine/src/projects/baseProject.cpp @@ -576,21 +576,14 @@ void baseProject::addAddon(ofAddon & addon){ addAddonHeadersrcFiles(addon); - addAddonDefines(addon); - addAddonFrameworks(addon); // addAddonXCFrameworks(addon); - copyAddonData(addon); - addAddonProps(addon); - } - - void baseProject::addAddonLibsPaths(const ofAddon& addon){ if(addon.libsPaths.size()){ ofLogWarning("baseProject::addAddonLibsPaths") << "this is not implemented!"; @@ -600,6 +593,7 @@ void baseProject::addAddonLibsPaths(const ofAddon& addon){ } } + void baseProject::addAddonIncludePaths(const ofAddon& addon){ for (auto & e : addon.includePaths) { ofLogVerbose("baseProject") << "----------------------------------------------------------------"; diff --git a/commandLine/src/projects/xcodeProject.cpp b/commandLine/src/projects/xcodeProject.cpp index c46ff8c8..c20a1656 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -487,7 +487,7 @@ void xcodeProject::addCompileFlagsForMMFile(const fs::path & srcFile) { void xcodeProject::addFramework(const fs::path & path, const fs::path & folder, bool isRelativeToSDK){ ofLogVerbose() << "Adding framework " << ofPathToString(path) << " folder: " << folder; - // alert( "xcodeProject::addFramework " + ofPathToString(path) + " : " + ofPathToString(folder) , 33); +// alert( "xcodeProject::addFramework " + ofPathToString(path) + " : " + ofPathToString(folder) , 33); // path = the full path (w name) of this framework // folder = the path in the addon (in case we want to add this to the file browser -- we don't do that for system libs); @@ -641,9 +641,16 @@ void xcodeProject::addAddonSrcFiles(ofAddon& addon){ void xcodeProject::addAddonFrameworks(const ofAddon& addon){ ofLogVerbose("xcodeProject::addAddonFrameworks") << addon.name; - for (auto & f : addon.frameworks) { + std::vector allFrameworks; + allFrameworks.reserve( addon.frameworks.size() + addon.xcframeworks.size() ); + allFrameworks.insert( allFrameworks.end(), addon.frameworks.begin(), addon.frameworks.end() ); + allFrameworks.insert( allFrameworks.end(), addon.xcframeworks.begin(), addon.xcframeworks.end() ); + + for (auto & f : allFrameworks) { +// for (auto & f : addon.frameworks) { ofLogVerbose() << "adding addon frameworks: " << f; - +// alert ("ADD ADDON FRAMEWORKS " + f, 33); + auto path = f; // The only addon I've found using fixed path to system Frameworks is ofxCoreLocation // https://github.com/robotconscience/ofxCoreLocation/blob/533ee4b0d380a4a1aafbe1c5923ae66c26b92d53/addon_config.mk#L32