Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Aug 16, 2020
1 parent 6e78852 commit 10d7334
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
28 changes: 26 additions & 2 deletions Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,34 @@ cmake --build build
cmake --install build
```

then to link into your existing program from the command line (if not using CMake FetchContent as is suggested):
then to link into your existing program from the command line

using CMake from your project

```sh
cmake -B build -Dh5fortran_DIR=~/lib/h5fortran/lib/cmake/h5fortran
```

and in your CMakeLists.txt

```cmake
find_package(h5fortran CONFIG)
if(h5fortran_FOUND)
include(${h5fortran_DIR}/h5fortranTargets.cmake)
else()
include(FetchContent)
FetchContent_Declare(h5fortran_proj
GIT_REPOSITORY https://github.com/geospace-code/h5fortran.git
GIT_TAG v3.0.1)
FetchContent_MakeAvailable(h5fortran_proj)
endif()
```

if not using CMake FetchContent as is suggested:

```sh
gfortran -I~/lib/h5fortran/include myprogram.f90 ~/lib/h5fortran/libh5fortran.a
gfortran -I~/lib/h5fortran/include myprogram.f90 ~/lib/h5fortran/lib/libh5fortran.a
```

### [optional] create distributable archive
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Compilers known to work include:
* Gfortran ≥ 6
* Intel compiler ≥ 19.1 / 2020

## Install
## Build

Using CMake:

Expand Down

0 comments on commit 10d7334

Please sign in to comment.