Skip to content

Use CMake's GNUInstallDirs

CMakeLists.txt currently hard-codes the install paths:

install(TARGETS armral DESTINATION lib)
install(
  DIRECTORY include/
  DESTINATION include
  FILES_MATCHING
  PATTERN "*.h")
install(FILES LICENSE.md THIRD_PARTY_LICENSES.md
        DESTINATION share/licenses/armral)

These may not be the correct paths, depending on the OS (for example, the library directory could be /usr/lib64, or something even more unusual).

If you use the GNUInstallDirs module (https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html) then the correct paths can be passed to CMake, and the install rules can use CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_INCLUDEDIR, and CMAKE_INSTALL_DATADIR.