-
Notifications
You must be signed in to change notification settings - Fork 156
Fix handling of libyaml in CMake build #1822
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
base: main
Are you sure you want to change the base?
Conversation
|
Note, we could also get rid of - find_package(libyaml REQUIRED)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(YAML REQUIRED IMPORTED_TARGET "yaml-0.1") |
rem1776
left a comment
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!
No issues here with using pkg-config instead if you would like to include that change. |
|
Looks good and works on my system but is failing in our CI testing. I'll take a look and try to get it passing as it should, its probably from the github workflow messing with the shell. |
uramirez8707
left a comment
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.
Thank you for fixing this.
Description
In the CMake build, when using
WITH_YAML:libyaml${libTgt}) just copies the object files and the link dependencies are not propagated anyway:Thus, though the FMS library compiles, when I try to build an executable, I see:
This PR tries to fix this by:
${libTgt}, rather than${libTgt}_c, againstlibyamllibyamlas a dependency toFMSConfig.cmakeInstallingUPDATE: libyaml is now found usingFindlibyaml.cmakealongside the exported configurationpkg-configsoFindlibyaml.cmakehas been removed.How Has This Been Tested?
With these changes I am able to install our ocean model with FMS yaml support, where previously I wasn't.
Checklist:
make distcheckpasses