Skip to content

Commit 10d7334

Browse files
committed
doc
1 parent 6e78852 commit 10d7334

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

Install.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,34 @@ cmake --build build
5050
cmake --install build
5151
```
5252

53-
then to link into your existing program from the command line (if not using CMake FetchContent as is suggested):
53+
then to link into your existing program from the command line
54+
55+
using CMake from your project
56+
57+
```sh
58+
cmake -B build -Dh5fortran_DIR=~/lib/h5fortran/lib/cmake/h5fortran
59+
```
60+
61+
and in your CMakeLists.txt
62+
63+
```cmake
64+
find_package(h5fortran CONFIG)
65+
66+
if(h5fortran_FOUND)
67+
include(${h5fortran_DIR}/h5fortranTargets.cmake)
68+
else()
69+
include(FetchContent)
70+
FetchContent_Declare(h5fortran_proj
71+
GIT_REPOSITORY https://github.com/geospace-code/h5fortran.git
72+
GIT_TAG v3.0.1)
73+
FetchContent_MakeAvailable(h5fortran_proj)
74+
endif()
75+
```
76+
77+
if not using CMake FetchContent as is suggested:
5478

5579
```sh
56-
gfortran -I~/lib/h5fortran/include myprogram.f90 ~/lib/h5fortran/libh5fortran.a
80+
gfortran -I~/lib/h5fortran/include myprogram.f90 ~/lib/h5fortran/lib/libh5fortran.a
5781
```
5882

5983
### [optional] create distributable archive

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Compilers known to work include:
5353
* Gfortran ≥ 6
5454
* Intel compiler ≥ 19.1 / 2020
5555

56-
## Install
56+
## Build
5757

5858
Using CMake:
5959

0 commit comments

Comments
 (0)