aboutsummaryrefslogtreecommitdiff
path: root/example_packages/version_file/app/main.f90
diff options
context:
space:
mode:
authorSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2021-06-20 12:14:18 +0200
committerSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2021-06-20 12:14:18 +0200
commitb6b95dcc9d6563666c1358e6800cc9ff064f657c (patch)
treebe25dbaec76b8f18e9897334f5a6bceee131e7ae /example_packages/version_file/app/main.f90
parente6688d07c5658b1a26354be7d7aea68231679f05 (diff)
downloadfpm-b6b95dcc9d6563666c1358e6800cc9ff064f657c.tar.gz
fpm-b6b95dcc9d6563666c1358e6800cc9ff064f657c.zip
Allow reading version number from file
Diffstat (limited to 'example_packages/version_file/app/main.f90')
-rw-r--r--example_packages/version_file/app/main.f9013
1 files changed, 13 insertions, 0 deletions
diff --git a/example_packages/version_file/app/main.f90 b/example_packages/version_file/app/main.f90
new file mode 100644
index 0000000..f2ae87b
--- /dev/null
+++ b/example_packages/version_file/app/main.f90
@@ -0,0 +1,13 @@
+program stub
+ implicit none
+ logical :: exist
+ integer :: unit
+ character(len=100) :: line
+ inquire(file="VERSION", exist=exist)
+ if (.not.exist) error stop
+ open(file="VERSION", newunit=unit)
+ read(unit, '(a)') line
+ close(unit)
+
+ print '(*(a))', "File VERSION contains '", trim(line), "'"
+end program stub