[CMake] Identifying whether NetCDF is one library or several

Ateljevich, Eli eli at water.ca.gov
Fri Jul 6 14:57:34 EDT 2012


Hi -
A couple years ago, the NetCDF crew separated out their Fortran library, producing netcdf for the C API and the Fortran netcdff with an extra "f". At one point in the history the number of libraries was an option, so that a given version could be built either way. The problem for me is that this doesn't really distinguish how well they will work for my project, I just want it to link.

The simplest option would be to not bail if the second library is not found, but rather print a warning that leaves the user some hints to diagnose the problem if they get a bunch of linker errors. At the other end of the spectrum I would search for a particular symbol in the first (netcdf) library if the second library is not found.

Any advice on how to proceed with that? Do I have to generate and run a small executable in FindNetCDF.cmake? Is there another way?

Thanks,
Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120706/8dff8815/attachment.htm>


More information about the CMake mailing list