Add option to replace TPL absolute paths with library names #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should help with relocatability: instead of generating
eccodes-config.cmake with an absolute path to Third Party Libraries
(TPLs) (e.g. /lib/x86_64-linux-gnu/libm.so.6) we use the library
name instead (e.g. -lm).
We also use library names in eccodes-targets.cmake and eccodes.pc.
The motivation is so that we can distribute packages with conda-forge.
Without this change, the conda-forge build leaves its build path in the
files above. When we come to build another package downstream, e.g.
Magics, we are unable to find the ecCodes libraries because the absolute
paths to the TPLs are no longer valid. Using library names instead lets
cmake find the TPLs on the downstream build system.
We currently use -lpthreads instead of an absolute path, so hopefully
doing the same for the other TPLs isn't too controversial.