-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have CMake and Make backends #69
Comments
I don't understand why generate CMake of Make files. If fpm is smart enough to generate a correct CMake or Makefile for an arbitrary package, would it not be smart enough to simply build the package on its own? I thought that the value of enabling CMake or Make backend is when fpm is not smart enough yet to build the package on its own, but is just smart enough to detect an existing |
Let me see if I can explain it better. We should assume that The other assumption is that the goal has never been to call an existing So with these assumptions, yes, you can just use |
Okay, I understand now. The use case for this is when a developer releases a new package, they can use fpm to emit configuration files for different build systems. For example, datetime-fortran started with a manual Makefile. Then Zaak wrote a CMakeLists.txt, and Michael modernized it later. Mark wrote an autotools config. Now it can be built in these different ways. If I had fpm back then, I could just have done something like:
and be done with it. |
Yes exactly. And not just be done with it, but you can keep using In fact |
So, the idea here is that, not only should FPM be able to use "non"-FPM packages, it should also be able to generate "non"-FPM packages? I think this may be inviting a lot of requests for special cases. We might end up constantly chasing users who aren't willing to actually use FPM as intended. I'm not saying it isn't doable or worth considering. If we limit the scope to saying these other build systems must functionally produce exactly what FPM itself would do it might not be too bad, but then I don't think that actually reaches many people that we wouldn't have already convinced to switch over. On the other hand it might provide a slightly smoother transition path. Make these tweaks to your current build system so FPM can use. Then get all your user's to adjust to that. Then stop maintaining that build system yourself and let FPM do it. I'll have to think about this for a while. |
I made a joke a year ago, and we may actually do it. I share the same concerns as Brad. Mainly that this effort may not be closely aligned with FPM itself. In other words, it would be helping users to not use FPM. On the other side, if this would help many packages support multiple build systems, it would improve their portability, a long-term Fortran goal. |
From a practical perspective, we already use both CMake and manual Makefiles for |
Ok, let's at least finish a beta version that just supports standard FPM projects before we start tackling this one though. |
I agree. I only posted it here to keep it in mind. |
I think this feature will be great in particular when you want to distribute a code:
lauvergn (alias gardhor) |
What would be a good behavior for the end user for the cmake backend? Perhaps
and it would create (or override) proper What about dependencies? One way could be to create proper @LKedward, @milancurcic what do you think? |
@certik I currently working on a meson backend for fpm built upon #266 and #257, once either of the PRs is merged I can get this branch from its currently transitional state into a stable form and publish it for testing. I have a (somewhat) working model for CMake as well, but this is far more involved to get a proper dependencies handling compared to meson, therefore I won't push any of those until I'm done with meson generator. |
Hello, I'm hacking a bit with fortran, and I like the CMakeLists.txt for my projects, because it allows me to use CLion and the fortran plugin. I'd also like to see if I can learn my way around fpm implementation and maybe contribute small things, so if anyone has a hacked together CMakeLists.txt file that builds this repository, please let me know. I'm adding my vote for cmake backend. Thanks for fpm, it looks neat. |
Currently the Haskell based fpm is compiling things directly, just like Cargo does it. That's the best default. (The "archived" Rust based fpm was generating CMake.)
However, until
fpm
is everywhere used by everybody, it would be super helpful to have a CMake and pure Make backends. That way we can move packages likestdlib
or any of my own packages into usingfpm
, and yet not require it from the users --- they would continue using CMake or Make.Also by generating the CMake / Make automatically, it will be a lot easier to maintain those in
stdlib
for example.Since
fpm
knows (or should know) everything about the Fortran project, it can generate 100% robust CMake and Make files, following the latest practices for CMake / Make, human readable, etc.I am thinking having these backends would be beneficial for many purposes, such as debugging, anyway. We should also have a Ninja backend.
The text was updated successfully, but these errors were encountered: