-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add CMake support #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I don't know enough about compiling on Windows to judge the PR, but it does seem to me that if we support it, we better test it too! Let me ping @astrofrog since we may as well move away from travis at the same time (for which we'll run out of free minutes at some point). |
cmake.config.h.in
Outdated
@@ -0,0 +1,73 @@ | |||
/* config.h.in. Generated from configure.ac by autoheader. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is autogenerated, does it have to be included?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overlooked updating this comment when I translated the generated file to cmake format. Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, no problem!
@ajtribick - on second thought, there is no strict need to couple the move from travis to github actions to this PR, so if you are able to set up travis to test on windows too, that would be good enough ( |
Ok, I've added the Windows build with CMake+VS2017. As I understand it, the Travis environment does not currently have VS2019 installed by default, and I didn't want to overcomplicate things if you're going to be migrating to GitHub Actions in the near future. It would also be possible to add Linux CMake builds, if you want me to add those let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Approving too. Though let's wait with merging a few days to give @astrofrog a chance to have a look as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me too!
Currently we are building releases with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release instructions in RELEASE.rst should be updated if we want to keep the version of the package in sync between autotools and cmake
cmake.erfa.pc.in
Outdated
|
||
Name: Erfa | ||
Description: Essential Routines for Fundamental Astronomy | ||
Version: @ERFA_VERSION@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need another .pc file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, looks like it's possible to use the existing one (unlike config.h.in
, where there are some formatting differences). Updated.
I've updated |
If you consider that can be useful, please do. Not in |
Hello!I‘m a new windows user of VS2022, and I'd like to add 'erfa.h' into my project and use it, what should I do ? Would mind give me some suggestions? Many thanks! |
Sorry, forgot this was still open when I did a bit of spring cleaning of my repositories. In any case, this isn't something I need right now as the Python version is sufficient for the project I was using erfa in. |
@astrofrog, @sergiopasra, @mhvk I think that this would be a very nice addition to liberfa. What is missing to finalize and merge? |
Yes, it does seem useful, but there were some last comments from @sergiopasra about how to mention this in the release instructions. More generally, since I don't use or know |
Thanks @mhvk |
OK, reopened |
What is the status of this PR? It looks like it was down to the last little bits, but it hasn't ended up being merged. #32 (comment) reminded me that it would be useful to have! |
This PR was found to still work well on windows, though with a small comment. It would be good to revive it! @ajtribick - your branch actually seems to have disappeared, although I think we still have here everything we need. |
@mhvk The macro definition - only valid of coure, when LIBERFA_SHARED is defined:
This is, how I implemented my Windows build of ERFA shared library. BR, Ladislav |
@mhvk, actually I do not have too much time n this period but, as I have already said, I'm very interested in having a new build system so I will try to help as much as I can. Regarding the windows question I have 2 comments:
Finally, if we decide to go on with this PR, please let me know if there is a branch on which we/I can work on, otherwise I will create one on my fork. cheers |
@mhvk - for my original use case of getting this to build on Windows, Meson is definitely capable of meeting that requirement and had it been in the project when I raised this I would have done this PR as a Meson update instead. My general feeling is that when it comes to CMake vs Meson, a project should pick one rather than trying to maintain both. Given this project has now picked Meson, this feels much less like a useful change to me. |
OK, @laheller - would |
@laheller - now that I was reminded of erfa/.github/workflows/ci_workflows.yml Lines 77 to 94 in dcef368
|
@mhvk since we now have meson, probably we can close this PR |
Yes, indeed, |
Possibly of relevance to #32 - I wanted to be able to build this on Windows more easily, and I'm generally using CMake for my C++ projects on Linux. I've translated most of the automake build to CMake (minus generation of the .la libtool file), including generating the required files to allow both
find_package(erfa)
and including the library sources in the project, either way you end up with anerfa::erfa
target which can be provided totarget_link_libraries
.