szaghi / FLAP

Fortran command Line Arguments Parser for poor people
150 stars 34 forks source link

Using FiNeR as a library in a cmake project #90

Closed schwabfk closed 4 years ago

schwabfk commented 4 years ago

Dear @szaghi,

I recently started using Fortran for a project and stumbled across your libraries, especially FiNeR (and maybe in the future I'll use FLAP as well).

At the moment, the project is managed with cmake (v3.17) and I have trouble using FiNeR in my project. I tried it two ways:

a) via add_subdirectory (which is advised in your file headers):

b) via FetchContent:

Do you have an idea how to solve these problem? Perhaps also someone else with more cmake experience has an idea. As I said, I'm also no expert in this field.

Best regards!

EDIT: For my way of doing it b) I proceeded a little bit more, but latest now I am also stuck on the namespace problem. The error message is (but not only for the fortran_tester):

The target name "fortran_tester::doc" is reserved or not valid for certain
CMake features, such as generator expressions, and may result in undefined
behavior.
schwabfk commented 4 years ago

Sorry, just saw that I accidentally posted this as an FLAP issue. I'll close this and re-open it for FiNeR.