Skip to content

Commit

Permalink
cmake: Avoid path construction in pkg-config file
Browse files Browse the repository at this point in the history
Alternative fix for: #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]>
  • Loading branch information
jtojnar committed Jul 6, 2020
1 parent 565bf68 commit e400f02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libiio.pc.cmakein
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: libiio
Description: Library for interfacing IIO devices
Expand Down

0 comments on commit e400f02

Please sign in to comment.