CMake installation issues with vim and gedit syntax files - incorrect paths and missing files
I just noticed this commit and would like to comment on this:
First of all for some reason here ${CMAKE_INSTALL_DATAROOTDIR} does not evaluate to "share" here so the files end up in "/" (CMAKE_INSTALL_PREFIX does not seem to be considered as well in this case) instead of (/usr/)share which is probably not desired.
Apparently there is no default installation location for the vimfiles (Gentoo Linux puts them in /usr/share/vim/vimfiles and not /usr/share/vim), so if this is not configurable the will end up in the wrong directories even if ${CMAKE_INSTALL_DATAROOTDIR} evaluates to /usr/share
Additionally there is extras/vim/ftdetect/conkyrc.vim which probably should also be installed.
And there is extras/gedit/conky.lang) (gedit syntax highlighting) . For some reason its readme was moved to web/documents/syntax-highlighting.mdx about two years ago. It seems outdated anyway as with recent versions of gtksourceview these files should be placed in /usr/share/gtksourceview-4/language-specs/.
Originally posted by @billie80 in c67d8c2
The file is missing include(GNUInstallDirs) at the top (example from EagleLib). This should set CMAKE_INSTALL_DATAROOTDIR to correct default per-distro if it's not manually specified.
Autotools defaults to /usr/local/share instead of /usr/share because hand-compiled software shouldn't overwrite system files (installed by package managers). So we'll likely end up with /usr/local/share prefixed paths once GNUInstallDirs is included - that's expected; apps should handle both.
The file is missing
include(GNUInstallDirs)at the top (example from EagleLib). This should setCMAKE_INSTALL_DATAROOTDIRto correct default per-distro if it's not manually specified.
Thanks this fixes the install directory.
For vim there is still the question of /usr/share/vim/vimfiles or /usr/share/vim
Autotools defaults to
/usr/local/shareinstead of/usr/sharebecause hand-compiled software shouldn't overwrite system files (installed by package managers). So we'll likely end up with/usr/local/shareprefixed paths onceGNUInstallDirsis included - that's expected; apps should handle both.
The default of CMAKE_INSTALL_PREFIX is /usr/local and this is perfectly fine. Distro packagers just need to set it /usr or whatever is the desired path.
Looking at Arch package for ansible, /usr/share/vim/vimfiles is also used there. A lot of other sources reference that folder as well for system-wide syntax installs.
We could make it a build option that defaults to ${CMAKE_CURRENT_BINARY_DIR}/vim/vimfiles/syntax/conkyrc.vim and allow overriding. If someone makes it explicitly empty - skip installation.