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

pkg-config file is broken when CMAKE_INSTALL_{INCLUDE,LIB}DIR is absolute #336

Open
alexshpilkin opened this issue May 18, 2022 · 1 comment
Labels

Comments

@alexshpilkin
Copy link

Describe the issue

As per title: tinyobjloader.pc.in has

prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@TINYOBJLOADER_LIBRARY_DIR@
includedir=${prefix}/@TINYOBJLOADER_INCLUDE_DIR@

where TINYOBJLOADER_{LIBRARY,INCLUDE}_DIR is set in CMakeLists.txt to the value of CMAKE_INSTALL_{LIB,INCLUDE}DIR, so it is unable to handle absolute paths being passed in the latter (unusual but valid per documentation of GNUInstallDirs). This leads to broken .pc files on NixOS in particular.

See “Concatenating paths when building pkg-config files” for a thorough discussion of the problem and a suggested fix, or KDE’s extra-cmake-modules for a simpler approach.

Environment

  • TinyObjLoader version: 1.0.7 (inspection confirms issue exists on master as well)
  • OS: Linux localhost 5.15.36 #1-NixOS SMP Wed Apr 27 12:39:02 UTC 2022 x86_64 GNU/Linux
  • Compiler: CMake 3.22.3, GCC 11.2.0, GNU binutils 2.38
@syoyo
Copy link
Collaborator

syoyo commented May 20, 2022

pkg-config file is not maintained and I have no idea to fix/improve it. Your PR is much appreciated!

@syoyo syoyo added the wontfix label Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants