-
Notifications
You must be signed in to change notification settings - Fork 111
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
Relocatable pkg-config and coin-config files #437
Comments
I just am on the way to prepare point releases (simage 1.8.1, coin 4.0.1, soqt 1.6.1, ...) and therefore also update the .pc files. Starting with simage is this still present in the current simage.pc file? In my understanding of the pkg-config format the prefix is set at build time to the content of the CMAKE_INSTALL_PREFIX variable. As every distribution has its own place where coin|simage|soqt might be installed this should be sufficient. Am I going wrong here? Another follow up: According to the man pages of pkg-config from Ubuntu:
My understanding of this is, that if we make everything in the |
The updated pkg-config files in simage look much better, all path variables are now defined relative to Regarding the $ cmake -DCMAKE_INSTALL_PREFIX=/usr
$ make DESTDIR=/tmp install
$ cat /tmp/usr/lib/x86_64-linux-gnu/pkgconfig/simage.pc
prefix=/usr
...
$ PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=/tmp/usr/lib/x86_64-linux-gnu/pkgconfig pkg-config --libs simage
-L/usr/lib/x86_64-linux-gnu -lsimage
$ PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=/tmp/usr/lib/x86_64-linux-gnu/pkgconfig pkg-config --libs simage --define-prefix
-L/tmp/usr/lib/lib/x86_64-linux-gnu -lsimage Here, the option $ PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=/tmp/usr/lib/x86_64-linux-gnu/pkgconfig pkg-config --libs simage
-L/tmp/usr/lib/x86_64-linux-gnu/pkgconfig/../../../lib/x86_64-linux-gnu -lsimage
$ PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=/tmp/usr/lib/x86_64-linux-gnu/pkgconfig pkg-config --libs simage --define-prefix
-L/tmp/usr/lib/lib/x86_64-linux-gnu -lsimage Another example that uses $ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/stow
$ make install
$ cat /usr/local/lib/pkgconfig/simage.pc
prefix=/usr/local/stow/simage
...
$ stow simage
$ pkg-config --libs simage
-L/usr/local/stow/simage/lib -lsimage
$ pkg-config --libs simage --define-prefix
-L/usr/local/lib -lsimage Again, the option $ pkg-config --libs simage
-L/usr/local/lib/pkgconfig/../../lib -lsimage
$ pkg-config --libs simage --define-prefix
-L/usr/local/lib -lsimage |
Thank you for the valuable explanations and the research about the behavior. I checked the |
As can be seen in the examples above, this is not always correct, With an installation into |
The files
Coin.pc
used by pkg-config andcoin.cfg
used by coin-config contain absolute paths which prevent an installation from being moved to another location, even though the latter includes a comment regarding a moveable package. This is also the case for simage, SoQt etc.The CMake config files are already relocatable, as
PACKAGE_PREFIX_DIR
is calculated relative to these files via@PACKAGE_INIT@
. Something similar could be achieved inCoin.pc
by using settingprefix
to${pcfiledir}
, see Helping C/C++ Packages be Relocatable. The other variables however would also need to be updated to be relative toprefix
.coin-config already seems to calculate
prefix
based on its location, however the other variables are not defined relative to this.The text was updated successfully, but these errors were encountered: