zxing.pc.in: fix when CMAKE_INSTALL_<dir> is absolute#468
zxing.pc.in: fix when CMAKE_INSTALL_<dir> is absolute#468axxel merged 1 commit intozxing-cpp:masterfrom bjornfor:fix-pc-file-cmake-variables
Conversation
pkg-config files are not designed to be relocatable, so the only thing we need to do is using CMAKE_INSTALL_FULL_<dir> to avoid broken path concatenation when CMAKE_INSTALL_<dir> is already absolute (like in Nixpkgs). https://cmake.org/cmake/help/v3.25/module/GNUInstallDirs.html Fixes #335
|
Amended to fix s/xzing/zxing/ typo. |
|
Thanks! |
|
Just noticed, looking at a test-run of Ideas? |
|
Oh, sorry, I should have tested before submitting. I think we need to update the cmake code that generates the final .pc file too. Will submit fix later today. |
* cleanup zxing.pc * define the project version on the library level, not the top level, makes sure the ZXVersion.h is generated properly also for all the wrappers. * also fixes issue seemingly introduced with #468
|
Thanks. Your fix works but I don't understand why it is required because a) the formerly used non-FULL versions should be defined iff the FULL versions are and b) the fix that has been used and working on the NixOS side was exactly what your original PR did. Anyway, I reorganized the .pc file and CMakeConfig generation and this takes also care of the missing GNUInstallDirs include. That said, I'd appreciate if you could test the code especially with respect to those changes. I don't have a setup that properly tests the validity of the generated .pc file. |
I think cmake itself defines
|
pkg-config files are not designed to be relocatable, so the only thing
we need to do is using
CMAKE_INSTALL_FULL_<dir>to avoid broken pathconcatenation when
CMAKE_INSTALL_<dir>is already absolute (like inNixpkgs).
https://cmake.org/cmake/help/v3.25/module/GNUInstallDirs.html
Fixes #335