I have an Application that is based on the following sources:
1) A GUI based in Obj-C that does some lightweight processing and graphical display work.
2) A series of sub-programs written in Fortran, that are accessed via NSTask. These programs are legacy code and handle the bulk of scientific calculation for my app.
My current structure is this:
1) .App file lives in Applications folder.
2) Fortran binaries and their resource files live in a series of folders in Application Support.
My problem:
Managing binary signing and resources is a pain outside of Xcode, especially since each binary is currently being compiled and stored separately, and manually. Further, with the move to Apple Silicon I need to develop my Fortran applications away from Intel Fortran (which was shoddy to begin with, and got worse over time), relying instead on GNU Fortran which has an ARM version.
My solution:
I want to rearchitect this application to be more modern from the get-go. I want my Fortran binaries nested in my .App bundle, each with their own folder and capable of generating new sub folders and files. This keeps things nice and sandboxed, with the only external files being accessed now only being the user's save files and such.
I'm already working on recompiling all of the Fortran binaries, but I have run into a snag in Xcode. Since I am adding these fortran binaries in Xcode, I am adding a custom build phase for Fortran source files using gfortran in a build script. However after I add a command line type target (which to my understanding is an additional executable that the project must compile) the project seems to skip over it when I build. I can run my script directly from the main target by adding the source file to that project, but then the files go into some weird intermediate file directory and not the bundle itself. I suspect that this is as simple as just pointing the "output files" list to the bundle, but there doesn't seem to be any script variables for the bundle.
My question:
Am I doing this right? Should I make a target for each individual Fortran binary, or use the main target? Also how do I get the output binaries into the App's Resource folder?
1) A GUI based in Obj-C that does some lightweight processing and graphical display work.
2) A series of sub-programs written in Fortran, that are accessed via NSTask. These programs are legacy code and handle the bulk of scientific calculation for my app.
My current structure is this:
1) .App file lives in Applications folder.
2) Fortran binaries and their resource files live in a series of folders in Application Support.
My problem:
Managing binary signing and resources is a pain outside of Xcode, especially since each binary is currently being compiled and stored separately, and manually. Further, with the move to Apple Silicon I need to develop my Fortran applications away from Intel Fortran (which was shoddy to begin with, and got worse over time), relying instead on GNU Fortran which has an ARM version.
My solution:
I want to rearchitect this application to be more modern from the get-go. I want my Fortran binaries nested in my .App bundle, each with their own folder and capable of generating new sub folders and files. This keeps things nice and sandboxed, with the only external files being accessed now only being the user's save files and such.
I'm already working on recompiling all of the Fortran binaries, but I have run into a snag in Xcode. Since I am adding these fortran binaries in Xcode, I am adding a custom build phase for Fortran source files using gfortran in a build script. However after I add a command line type target (which to my understanding is an additional executable that the project must compile) the project seems to skip over it when I build. I can run my script directly from the main target by adding the source file to that project, but then the files go into some weird intermediate file directory and not the bundle itself. I suspect that this is as simple as just pointing the "output files" list to the bundle, but there doesn't seem to be any script variables for the bundle.
My question:
Am I doing this right? Should I make a target for each individual Fortran binary, or use the main target? Also how do I get the output binaries into the App's Resource folder?