I am building a Fortran project that contains numerous include files (extension .inc
). These are not public include files, but rather implementation details which were generated by a template mechanism.
Where do these files belong?
Currently I am using this:
add_library(foo
src/foo.f90
src/foo_impl.inc
)
But I think alternatives such as:
# Alternative 1
add_library(foo
src/foo.f90
)
target_include_directories(foo PRIVATE src/)
or,
# Alternative 2
add_library(foo src/foo.f90)
target_sources(foo PRIVATE foo_impl.inc)
would also work.
What are the differences? Which option would be best, if the generation of the *.inc
were to be included in the CMake build?