give netcdf a finder
ClosedPublic

Authored by sitter on Apr 29 2019, 9:55 AM.

Details

Summary

netcdf may be built with either cmake or autotools. as it turns out the
autotools install will not have a cmake config, so finding it exclusively
via the config is not possible.

instead use a finder which wraps a find_package(config) call and fall
back to manual finding iff the config isn't found.

the finder defines the same target as the config would, making them
interchangeable.

Test Plan

builds with both operation modes

Diff Detail

Repository
R262 LabPlot
Branch
netcdf-find
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11379
Build 11397: arc lint + arc unit
sitter created this revision.Apr 29 2019, 9:55 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptApr 29 2019, 9:55 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
sitter requested review of this revision.Apr 29 2019, 9:55 AM
sgerlach accepted this revision.Apr 30 2019, 8:40 AM

Is it possible to detect the version of NetCDF found? If i recall correctly i have already seen cmake modules that are able to get the NetCDF library version.

This revision is now accepted and ready to land.Apr 30 2019, 8:40 AM

Certainly. Do we need it for something? We could just use the version from the package-config file and forward it out of the finder as a very simple way to get the version.

It's good to know which version is used (if you have several versions or do not know the system LP is compiled on). Sometimes we get error messages depending on the version of netcdf (or any other library) used.
If the pc-file is reliable (and always available) that would be a good idea.

.pc should be always available, if it turns out that assumption is wrong we can always throw more detection code at it :)

sitter updated this revision to Diff 57240.Apr 30 2019, 9:04 AM

pick up version from .pc

sgerlach accepted this revision.Apr 30 2019, 9:22 AM
This revision was automatically updated to reflect the committed changes.