Install Zsh completion.

This commit is contained in:
tastytea 2020-12-03 21:04:33 +01:00
parent f0c00ad825
commit 91373abfc5
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,6 @@ endif()
# Global build options.
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.")
option(BUILD_SHARED_LIBS "Build shared libraries." YES)
project (mastorss
VERSION 0.13.0
@ -19,6 +18,9 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Project build options.
option(WITH_MAN "Compile and install manpage." YES)
option(WITH_COMPLETIONS "Install Zsh completions." YES)
set(ZSH_COMPLETION_DIR "share/zsh/site-functions"
CACHE STRING "Installation directory for Zsh completions.")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -34,6 +36,10 @@ if(WITH_MAN)
add_subdirectory(man)
endif()
if(WITH_COMPLETIONS)
add_subdirectory(completions)
endif()
install(FILES watchwords.json
DESTINATION "${CMAKE_INSTALL_DATADIR}/mastorss")

View File

@ -0,0 +1 @@
install(FILES "_mastorss" DESTINATION "${ZSH_COMPLETION_DIR}")