GNUInstallDirs can automatically set up
CMAKE_INSTALL_LIBDIR to point to an architecture-specific directory, e.g.
/usr/lib/x86_64-linux-gnu. It does this based on
CMAKE_LIBRARY_ARCHITECTURE as well as other factors.
In some cases, not only libraries, but headers are architecture-specific as well. What is the recommended way to handle this case?
While we can adjust the value of
CMAKE_INSTALL_INCLUDEDIR ourselves, this would need to be done in a way that mirrors
GNUInstallDirs’s behaviour with
CMAKE_INSTALL_LIBDIR, and that behaviour is complex and not well documented. See https://gitlab.kitware.com/cmake/cmake/-/issues/20565 It is also unclear to me whether there are differences between Linux distros in where they install arch-specific headers. Therefore I was hoping that
GNUInstallDirs already has features that can help us here.