Skip to content
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

cmake: Avoid path construction in pkg-config file #564

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Jul 6, 2020

Alternative fix for: #563

It is not generally true that CMAKE_INSTALL_<dir> variables are relative paths. Absolute paths will cause things like this to appear:

includedir=${prefix}//nix/store/87zhscw1p08nqm73ls2sd82zmr1a8rni-libiio-0.21-dev/include

It would be best if the paths were relative to ${prefix} pkg-config variable so that they could be overridden but since that is not easy to do in CMake, we will just use absolute paths.

libiio does not expect other project to install artefacts to its installation paths so non-overriddable paths should no do much harm.

Alternative fix for: analogdevicesinc#563

It is not generally true that `CMAKE_INSTALL_<dir>` variables are relative paths:

https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files

Absolute paths will cause things like this to appear:

    includedir=${prefix}//nix/store/87zhscw1p08nqm73ls2sd82zmr1a8rni-libiio-0.21-dev/include

It would be best if the paths were relative to `${prefix}` pkg-config variable so that they could be overridden:

https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/

but since that is not easy to do in CMake, we will just use absolute paths.

libiio does not expect other project to install artefacts to its installation paths so non-overriddable paths should no do much harm.

Signed-off-by: Jan Tojnar <[email protected]>
@commodo
Copy link
Contributor

commodo commented Jul 7, 2020

i prefer this for now;
many thanks for this PR;
if we can find a use-case for #563 we can re-visit that;

thanks again :)

@rgetz
Copy link
Contributor

rgetz commented Jul 7, 2020

Thanks for the review, and patch. I will merge this one, and close the other...

-Robin

@rgetz rgetz merged commit 0150c31 into analogdevicesinc:master Jul 7, 2020
@jtojnar jtojnar deleted the fix-pc-abs branch December 10, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants