How to detect OF's platform & version by shell script

Hi, I’m trying to create a shell script that will be located inside my OF app and do something depending on the target platform & version.

For example, if the script file is in of_v0.9.8_osx_release/apps/myApps/exmptyExample, it will detect that the app is targeting OSX.

Is there any platform & version info in each OF release folder other than the folder’s name?
Thanks in advance!

When you compile your app, some constants are created for platform detection, with the format OF_TARGET_XXXXXX.

You can check the process on ofConstants.h

Hi, I’m trying to detect platform with a separate shell script without having to compile OF project.

you can use uname to detect the OS in a bash script

Thanks arturo, but what I want to achieve is for example, if you put a script into of_v0.9.8_osx_release, it should detect OSX, and if you put the script into of_v0.9.8_ios_release, it should detect iOS.

So I was wondering if there is a specific file that contains the platform info in each of these of_release folders.

not explicitly for this purpose but i guess you could check the library folders present in the distribution. I think tess2 is the only library that is present in all platforms so you could check libs/tess2/lib/* and whatever is in there is the platform for that download

1 Like

Thank you so much!