1414
1515
1616void ofAddon::getFrameworksRecursively (const fs::path & path, string platform) {
17- // alert ("getFrameworksRecursively " + path.string(), 34);
17+ // alert ("getFrameworksRecursively for " + platform + " : " + path.string(), 34);
1818 if (!fs::exists (path) || !fs::is_directory (path)) return ;
1919
2020 for (const auto & f : dirList (path)) {
2121 if (fs::is_directory (f)) {
2222 if (f.extension () == " .framework" || f.extension () == " .xcframework" ) {
23+ // alert ("found XCF " + f.string(), 31);
2324 bool platformFound = false ;
25+
26+ // if (ofIsStringInString(platform), f.string()) {
2427 if (!platform.empty () && f.string ().find (platform) != std::string::npos) {
2528 platformFound = true ;
2629 }
30+
2731 if (platformFound) {
2832 if (f.extension () == " .framework" ) {
2933 frameworks.emplace_back (f.string ());
@@ -770,11 +774,11 @@ void ofAddon::addToFolder(const fs::path& path, const fs::path & parentFolder){
770774}
771775
772776void ofAddon::parseLibsPath (const fs::path & libsPath, const fs::path & parentFolder) {
773- // alert ("parseLibsPath " + libsPath.string(), 35);
774777 if (!fs::exists (libsPath)) {
775778// alert("file not found " + libsPath.string(), 35);
776779 return ;
777780 }
781+ // alert ("parseLibsPath " + libsPath.string() + ", parent=" + parentFolder.string(), 35);
778782
779783
780784 if (platform == " osx" || platform == " macos" ){
@@ -787,13 +791,14 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo
787791// getXCFrameworksRecursively(libsPath, "macos");
788792// getXCFrameworksRecursively(libsPath, "osx");
789793
794+ // FIXME: This is not needed when we get libraries right.
795+ // if it was needed the best was change to std::set.
790796 removeDuplicates (libs);
791797 removeDuplicates (libFiles);
792798 removeDuplicates (frameworks);
793799 removeDuplicates (xcframeworks);
794800
795- }else {
796-
801+ } else {
797802 getLibsRecursively (libsPath, libFiles, libs, platform);
798803 }
799804
@@ -834,15 +839,7 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo
834839 s = fixPath (s);
835840// alert("fixpath after " + ofPathToString(s));
836841 addToFolder (s, parentFolder);
837- // fs::path folder;
838- // if (isLocalAddon) {
839- // folder = fs::path { "local_addons" } / fs::relative(s.parent_path(), parentFolder);
840- // } else {
841- // folder = fs::relative(s.parent_path(), getOFRoot());
842-
843- // }
844842 srcFiles.emplace_back (s);
845- // filesToFolders[s] = folder;
846843 }
847844
848845 // so addons will never be system.
@@ -853,40 +850,21 @@ void ofAddon::parseLibsPath(const fs::path & libsPath, const fs::path & parentFo
853850 size_t foundWindowsPath = f.find (' \\ ' );
854851 if (foundUnixPath==string::npos &&
855852 foundWindowsPath==string::npos){
856- bIsSystemFramework = true ; // we have no "path" so we are system
853+ bIsSystemFramework = true ; // we have no "path" so we are system
857854 }
858855
859856 if (bIsSystemFramework){
860857 ; // do we need to do anything here?
861858 } else {
862- // 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
863- // fs::path rel = fs::relative (f, isLocalAddon ? pathToProject : pathToOF);
864- // fs::path folder = rel.parent_path();
865- //
866- // if (isLocalAddon) {
867- // fs::path fFS { f };
868- // folder = fs::path { "local_addons" } / fs::relative(fFS.parent_path(), parentFolder);
869- // }
870- //
871- // filesToFolders[f] = folder;
872859 addToFolder (f, parentFolder);
873860 }
874861 }
875862
876863 for (const auto & f : xcframeworks) {
877-
878- // fs::path rel = fs::relative(f, isLocalAddon ? pathToProject : pathToOF);
879- // fs::path folder = rel.parent_path();
880- //
881- // if (isLocalAddon) {
882- // fs::path fFS { f };
883- // folder = fs::path { "local_addons" } / fs::relative(fFS.parent_path(), parentFolder);
884- // }
885- //
886- // filesToFolders[f] = folder;
887864 addToFolder (f, parentFolder);
888865 }
889866}
867+
890868string ofAddon::cleanName (const string& name){
891869 auto addonName = name;
892870#ifdef TARGET_WIN32
0 commit comments