@@ -164,6 +164,8 @@ bool isFolderNotCurrentPlatform(const string & folderName, const string & platfo
164
164
" msys2" ,
165
165
" vs" ,
166
166
" ios" ,
167
+ " macos" ,
168
+ " tvos" ,
167
169
" linux" ,
168
170
" linux64" ,
169
171
" linuxarmv6l" ,
@@ -198,12 +200,6 @@ void getFoldersRecursively(const fs::path & path, std::vector < fs::path > & fol
198
200
199
201
// TODO: This can be converted to recursive_directory, but we have to review if the function isFolderNotCurrentPlatform works correctly in this case.
200
202
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
-
207
203
// TODO: disable recursion pending... it is not recursive yet.
208
204
if ((path.extension () != " .framework" ) || (path.extension () != " .xcframework" )) {
209
205
for (const auto & entry : fs::directory_iterator (path)) {
@@ -224,20 +220,32 @@ void getFrameworksRecursively(const fs::path & path, std::vector < string > & fr
224
220
for (const auto & f : dirList (path)) {
225
221
if (fs::is_directory (f)) {
226
222
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
+ }
228
230
}
229
231
}
230
232
}
231
233
}
232
234
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) {
234
236
// alert("getXCFrameworksRecursively " + path.string(), 34);
235
237
if (!fs::exists (path) || !fs::is_directory (path)) return ;
236
238
237
239
for (const auto & f : dirList (path)) {
238
240
if (fs::is_directory (f)) {
239
241
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
+ }
241
249
}
242
250
}
243
251
}
@@ -297,8 +305,6 @@ void getLibsRecursively(const fs::path & path, std::vector < fs::path > & libFil
297
305
continue ;
298
306
} else {
299
307
auto stem = f.stem ();
300
-
301
- // cout << "STEM " << stem << endl;
302
308
auto archFound = std::find (LibraryBinary::archs.begin (), LibraryBinary::archs.end (), stem);
303
309
if (archFound != LibraryBinary::archs.end ()) {
304
310
arch = *archFound;
@@ -321,24 +327,15 @@ void getLibsRecursively(const fs::path & path, std::vector < fs::path > & libFil
321
327
}
322
328
}
323
329
}
330
+
331
+ if (!platform.empty () && f.string ().find (platform) != std::string::npos) {
332
+ platformFound = true ;
333
+ }
324
334
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 " ||
326
336
(ext == " .dll" && platform != " vs" )){
327
337
if (platformFound){
328
- // libLibs.emplace_back( f, arch, target );
329
338
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
- }
342
339
}
343
340
} else if (ext == " .h" || ext == " .hpp" || ext == " .c" || ext == " .cpp" || ext == " .cc" || ext == " .cxx" || ext == " .m" || ext == " .mm" ){
344
341
libFiles.emplace_back (f);
0 commit comments