Use PRIVATE in TARGET_LINK_LIBRARIES for libnetcdf with cmake
The purpose of this is to make libz.so disappear from netCDFTargets.cmake. It it not actually needed there, but cmake puts it into the file if libnetcdf is linked with zlib without using PRIVATE which then might cause problems when using the cmake files to build another project. In this case, the libz.so caused problems building the fimex conda-forge package, , which uses the libnetcdf package; see https://github.com/conda-forge/libnetcdf-feedstock/issues/173.
This pull request is not ready to be accepted. The main issue is that I do not know how to test if this breaks static linking, and I cannot test on other platforms than conda-forge linux64 and Ubuntu 22.04. You might also prefer if to be split into several pull requests.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Thanks; taking a look at it. If you can sign the CLA, we'll get it merged when it's ready/available :).
Thanks. I will certainly need help going ahead with this. If you want me to split the PR into several PR, or to split the last commit, please let me know.
I am awaiting approval from my employer for signing the CLA.