summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2016-02-10 16:29:47 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2016-03-03 11:32:11 -0800
commit1b5fb027a0f7fcc84f58f18e06c8661fde17a34d (patch)
tree800264d6f64c91616542c93a607320cfbfac7f46 /CMakeLists.txt
parent0e1d7802c2c452be8f8637cff629f58263d78134 (diff)
CMake: install bash completions
This uses the bash-completion cmake file provided by bash-completions to install the file to the system (if one does a system install). Otherwise one can just copy the file to somewhere it will get sourced by their bashrc. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47941087d..6d7765c23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,6 +216,8 @@ else ()
find_package(PythonMako 0.8.0 REQUIRED)
endif (PYTHON_VERSION_STRING VERSION_GREATER 3.4.999999)
+find_package(bash-completion CONFIG)
+
# Default to compiling with debug information (`gcc -g`):
if(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug CACHE STRING
@@ -527,6 +529,13 @@ install (
REGEX "CMakeFiles|CMakeLists" EXCLUDE
)
+if (BASH_COMPLETION_FOUND)
+ install(
+ FILES completions/bash/piglit
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/${BASH_COMPLETION_COMPLETIONSDIR}/
+ )
+endif (BASH_COMPLETION_FOUND)
+
if (WIN32)
set (PYTHON_SUFFIX ".py")
else ()