OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

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

Open alexshpilkin opened this issue 3 years ago • 0 comments

As per title: src/OpenColorIO/CMakeLists.txt has

set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${exec_prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
configure_file(res/OpenColorIO.pc.in ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc @ONLY)

and so can’t handle absolute paths in CMAKE_INSTALL_LIBDIR. This leads to broken .pc files on NixOS in particular. (Deriving includedir from exec_prefix and not prefix is also a bit suspect, but not the problem here.)

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.

alexshpilkin avatar May 18 '22 14:05 alexshpilkin