Alternatives to CMake - vmagnin/gtk-fortran GitHub Wiki
The Fortran Package Manager fpm
gtk-fortran (>=4.2) can be used as a fpm dependency. See the tutorial How to use fpm to build a gtk-fortran project. This is the easiest way to discover gtk-fortran.
alt_build_test.sh
script
The You can alternatively use the src/alt_build_test.sh
bash script to compile and run the gtk-fortran files and examples, using GFortran by default. It uses the directory build/byscript/
To use another compiler, use the following syntax: $ FC='mycompiler' ./alt_build_test.sh
Limitations
- This script was tested in Ubuntu, but you may have to adapt it to your distribution.
- It does not substitute the
@..@
strings ingtkf-sketcher.f90
, andgtk-fortran.f90
, unlike CMake. - It does not build the PLplot examples.
Direct compilation
If you know which gtk-fortran files are needed, you can also simply compile and run each example as follow, from the src/ directory
:
$ gfortran glib-auto.f90 cairo-auto.f90 gdk-auto.f90 gdk-pixbuf-auto.f90 gtk.f90 ../examples/julia_pixbuf.f90 $(pkg-config --cflags --libs gtk4)
$ ./a.out
For GTK 3, it's --libs gtk+-3.0