@@ -164,6 +164,8 @@ bool isFolderNotCurrentPlatform(const string & folderName, const string & platfo
164164 " msys2" ,
165165 " vs" ,
166166 " ios" ,
167+ " macos" ,
168+ " tvos" ,
167169 " linux" ,
168170 " linux64" ,
169171 " linuxarmv6l" ,
@@ -198,12 +200,6 @@ void getFoldersRecursively(const fs::path & path, std::vector < fs::path > & fol
198200
199201 // TODO: This can be converted to recursive_directory, but we have to review if the function isFolderNotCurrentPlatform works correctly in this case.
200202
201- // for (const auto & entry : fs::recursive_directory_iterator(path)) {
202- // auto f = entry.path();
203- // if (f.filename().c_str()[0] == '.') continue;
204- // if (f.extension() == ".framework") continue;
205- // }
206-
207203 // TODO: disable recursion pending... it is not recursive yet.
208204 if ((path.extension () != " .framework" ) || (path.extension () != " .xcframework" )) {
209205 for (const auto & entry : fs::directory_iterator (path)) {
@@ -224,20 +220,32 @@ void getFrameworksRecursively(const fs::path & path, std::vector < string > & fr
224220 for (const auto & f : dirList (path)) {
225221 if (fs::is_directory (f)) {
226222 if (f.extension () == " .framework" ) {
227- frameworks.emplace_back (f.string ());
223+ bool platformFound = false ;
224+ if (!platform.empty () && f.string ().find (platform) != std::string::npos) {
225+ platformFound = true ;
226+ }
227+ if (platformFound) {
228+ frameworks.emplace_back (f.string ());
229+ }
228230 }
229231 }
230232 }
231233}
232234
233- void getXCFrameworksRecursively (const fs::path & path, std::vector<string> & frameworks , string platform) {
235+ void getXCFrameworksRecursively (const fs::path & path, std::vector<string> & xcframeworks , string platform) {
234236// alert("getXCFrameworksRecursively " + path.string(), 34);
235237 if (!fs::exists (path) || !fs::is_directory (path)) return ;
236238
237239 for (const auto & f : dirList (path)) {
238240 if (fs::is_directory (f)) {
239241 if (f.extension () == " .xcframework" ) {
240- frameworks.emplace_back (f.string ());
242+ bool platformFound = false ;
243+ if (!platform.empty () && f.string ().find (platform) != std::string::npos) {
244+ platformFound = true ;
245+ }
246+ if (platformFound) {
247+ xcframeworks.emplace_back (f.string ());
248+ }
241249 }
242250 }
243251 }
@@ -297,8 +305,6 @@ void getLibsRecursively(const fs::path & path, std::vector < fs::path > & libFil
297305 continue ;
298306 } else {
299307 auto stem = f.stem ();
300-
301- // cout << "STEM " << stem << endl;
302308 auto archFound = std::find (LibraryBinary::archs.begin (), LibraryBinary::archs.end (), stem);
303309 if (archFound != LibraryBinary::archs.end ()) {
304310 arch = *archFound;
@@ -321,24 +327,15 @@ void getLibsRecursively(const fs::path & path, std::vector < fs::path > & libFil
321327 }
322328 }
323329 }
330+
331+ if (!platform.empty () && f.string ().find (platform) != std::string::npos) {
332+ platformFound = true ;
333+ }
324334
325- if (ext == " .a" || ext == " .lib" || ext == " .dylib" || ext == " .so" || ext == " .xcframework" ||
335+ if (ext == " .a" || ext == " .lib" || ext == " .dylib" || ext == " .so" || ext == " .xcframework" || ext == " .framework " ||
326336 (ext == " .dll" && platform != " vs" )){
327337 if (platformFound){
328- // libLibs.emplace_back( f, arch, target );
329338 libLibs.push_back ({ f.string (), arch, target });
330-
331- // TODO: THEO hack
332- if ( platform == " ios" ){ // this is so we can add the osx libs for the simulator builds
333- string currentPath = f.string ();
334- // TODO: THEO double hack this is why we need install.xml - custom ignore ofxOpenCv
335- if ( currentPath.find (" ofxOpenCv" ) == string::npos ){
336- ofStringReplace (currentPath, " ios" , " osx" );
337- if ( fs::exists (currentPath) ){
338- libLibs.push_back ({ currentPath, arch, target });
339- }
340- }
341- }
342339 }
343340 } else if (ext == " .h" || ext == " .hpp" || ext == " .c" || ext == " .cpp" || ext == " .cc" || ext == " .cxx" || ext == " .m" || ext == " .mm" ){
344341 libFiles.emplace_back (f);
0 commit comments