[Piglit] [PATCH 2/3] CMake: install bash completions

Dylan Baker baker.dylan.c at gmail.com
Thu Feb 11 02:23:33 UTC 2016


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 at intel.com>
---
 CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b822934..cc7929c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -208,6 +208,8 @@ find_package(PythonNumpy 1.6.2 REQUIRED)
 find_package(PythonMako 0.8.0 REQUIRED)
 find_package(PythonSix 1.4.0 REQUIRED)
 
+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
@@ -518,6 +520,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 ()
-- 
2.7.1



More information about the Piglit mailing list