wdas / SeExpr

SeExpr is an embeddable, arithmetic expression language that enables flexible artistic control and customization in creating computer graphics images. Example uses include procedural geometry synthesis, image synthesis, simulation control, crowd animation, and geometry deformation. https://wdas.github.io/SeExpr
https://www.disneyanimation.com/open-source/seexpr/
Other
406 stars 86 forks source link

pkg-config file is broken when CMAKE_INSTALL_LIBDIR is absolute #106

Closed alexshpilkin closed 2 years ago

alexshpilkin commented 2 years ago

As per title: src/build/seexpr2.pc.in has

prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@

and so can’t handle absolute paths in CMAKE_INSTALL_LIBDIR. 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.

davvid commented 2 years ago

Thanks for the pointers. If I'm understanding correctly, libdir=@CMAKE_INSTALL_FULL_LIBDIR@ would be the correct setup, is that correct?

alexshpilkin commented 2 years ago

@davvid That is the simplest solution, except it sacrifices relocatability, which some people apparently depend on. I don’t actually know if this is important here; if so, the solution from KDE (use a separate variable, check with if (IS_ABSOLUTE ...) and either prepend ${prefix}/ or leave as is) can be used.

davvid commented 2 years ago

Checking if the libdir is absolute and then conditionally prepending sounds like the way to go.

davvid commented 2 years ago

https://github.com/wdas/SeExpr/commit/b2656fbacf59eb8e2bcee8aefb39d40eb76ec94b added the IS_ABSOLUTE checks and variables used by https://github.com/wdas/SeExpr/commit/aad54f0dfe0de173e2c4e7d3c7df3b1a61e5ab31