summaryrefslogtreecommitdiffstats
path: root/Auxiliary/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-21 12:27:02 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-21 12:34:30 (GMT)
commit83bc79e2326247c4a73608c6c9723a8bd398cf96 (patch)
tree775ba23179d7cf7582d32eff53ab57454099ff7d /Auxiliary/CMakeLists.txt
parentd421274e3e11a0e6480358faa8a8e5cf48d7b3c2 (diff)
downloadCMake-83bc79e2326247c4a73608c6c9723a8bd398cf96.zip
CMake-83bc79e2326247c4a73608c6c9723a8bd398cf96.tar.gz
CMake-83bc79e2326247c4a73608c6c9723a8bd398cf96.tar.bz2
Auxiliary: Add options to control Vim and Emacs file installation
Since commit 2642f432ef (Aux: Install editor and bash files to more natural locations, 2020-03-30, v3.18.0-rc1~429^2) these files are installed by default into locations that are not CMake-specific but may be distro-specific. Add options for packagers to control these locations. Also rename the `CMAKE_BASH_COMP_DIR` option to follow our conventions. Fixes: #20993
Diffstat (limited to 'Auxiliary/CMakeLists.txt')
-rw-r--r--Auxiliary/CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/Auxiliary/CMakeLists.txt b/Auxiliary/CMakeLists.txt
index a833c79..c0aebef 100644
--- a/Auxiliary/CMakeLists.txt
+++ b/Auxiliary/CMakeLists.txt
@@ -1,4 +1,16 @@
-install(DIRECTORY vim/indent vim/syntax DESTINATION ${CMAKE_XDGDATA_DIR}/vim/vimfiles)
-install(FILES cmake-mode.el DESTINATION ${CMAKE_XDGDATA_DIR}/emacs/site-lisp)
+# Install Vim files to a typical system integration directory.
+# Packagers can set CMake_INSTALL_VIMFILES_DIR to control this.
+if(NOT CMake_INSTALL_VIMFILES_DIR)
+ set(CMake_INSTALL_VIMFILES_DIR ${CMAKE_XDGDATA_DIR}/vim/vimfiles)
+endif()
+install(DIRECTORY vim/indent vim/syntax DESTINATION ${CMake_INSTALL_VIMFILES_DIR})
+
+# Install Emacs files to a typical system integration directory.
+# Packagers can set CMake_INSTALL_EMACS_DIR to control this.
+if(NOT CMake_INSTALL_EMACS_DIR)
+ set(CMake_INSTALL_EMACS_DIR ${CMAKE_XDGDATA_DIR}/emacs/site-lisp)
+endif()
+install(FILES cmake-mode.el DESTINATION ${CMake_INSTALL_EMACS_DIR})
+
install(FILES cmake.m4 DESTINATION ${CMAKE_XDGDATA_DIR}/aclocal)
add_subdirectory (bash-completion)