SethMMorton / cmake_fortran_template

A template directory structure for a Fortran project using CMake as the build system.
MIT License
125 stars 27 forks source link

Update to Modern CMake style #3

Open SethMMorton opened 5 years ago

SethMMorton commented 5 years ago

The CMake style in this template is not the preferred style anymore. The CMake folks are advocating for "Modern CMake" (https://cliutils.gitlab.io/modern-cmake/, https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1), which from my understanding attempts to define everything in terms of targets and is less procedural.

I do not like providing examples to users that are using an obsolete style or do not use the best the language has to offer. I would like this template to be updated to use a more modern CMake style.

Unfortunately, I no longer use CMake (or Fortan for that matter) so I am not in a position to be updating the code to conform to best-practices. I am hoping some altruistic soul will stumble upon this issue and then create a Pull Request to make this template more modern.

emanspeaks commented 5 years ago

If you'd be interested, you could transfer ownership of this project to me. Alternatively, you could add me as a maintainer. If you don't want to be actively involved in this going forward, then I am happy to take it over from you.

SethMMorton commented 5 years ago

I'll give this a thought. Thanks for the offer.

SethMMorton commented 4 years ago

@emanspeaks It's been so long since you opened that PR, and realistically I am no longer in the Fortran or CMake game, so I don't want any lag on my part to delay further progress. I'm going to add you as a collaborator to this project so that you can contribute unhindered by me.

emanspeaks commented 4 years ago

Awesome, thanks! And no worries, you haven't been the hangup on this, I had to shelve my Fortran project at work I was originally developing the PR alongside, but in the coming weeks I will likely be picking it up again and can try to push through the final work to get that PR merged. This is an important project, so I will do my best to keep going!

Leonard-Reuter commented 3 years ago

@emanspeaks Some time ago, I also created a cmake fortran template, that has a running unit test suite and handles the modules file via the custom function add_fortran_library() instead of putting all of them into the same directory. Feel free to copy what you want. I see too many Fortran projects with bad Cmake builds...

aqeelahmed168 commented 3 years ago

Here is a small demo to build multiple modules with latest CMake (v 3.5+) for Fortran 2008 https://github.com/aqeelahmed168/oneDimHeatTransfer_cmake_demo