Juris Vencels <[email protected]> writes:

> Hi,
>
> I am using PETSc Fortran interface and FindPETSc.cmake script to find PETSc.
> https://github.com/jedbrown/cmake-modules/blob/master/FindPETSc.cmake

Correct me if I'm wrong, but it doesn't sound like your question has
anything to do with this cmake module.

> PETSc from WEB has folder include folder:
>      include/finclude
>
> while PETSc from git has folder:
>      include/petsc-finclude
>
> Is there a way to make it compatible between different versions?

You could create a symlink for that directory (but that's a terrible
hack if you send your code to other people).  You can guard it with the
preprocessor:

#if PETSC_VERSION_LT(3,6,0)
  #include <finclude/petscxyz.h>
#else
  #include <petsc-finclude/petscxyz.h>
#endif


Note that you could define a path splicing macro so that you could write

#include PETSC_FORTRAN_INCLUDE(petscxyz.h)

but CMake's dependency analysis would fail (I think).

Attachment: signature.asc
Description: PGP signature

Reply via email to