Permalink
Browse files

Add config for cmake to bash-completion.

This will allow projects using cmake to get information about
bash-completion. This works much like pkg-config files.
  • Loading branch information...
1 parent 6cb7f96 commit 94b7e63f6d525a029efac07e20f4102fe8563a71 @GArik GArik committed Mar 18, 2012
Showing with 40 additions and 2 deletions.
  1. +2 −0 .gitignore
  2. +10 −1 Makefile.am
  3. +7 −0 bash-completion-config-version.cmake.in
  4. +11 −0 bash-completion-config.cmake.in
  5. +10 −1 configure.ac
View
@@ -14,3 +14,5 @@ doc/*.xml
doc/html*
bash_completion.sh
bash-completion.pc
+bash-completion-config.cmake
+bash-completion-config-version.cmake
View
@@ -11,6 +11,10 @@ profile_DATA = bash_completion.sh
pkgconfigdir = $(datadir)/pkgconfig
pkgconfig_DATA = bash-completion.pc
+cmakeconfigdir = $(datadir)/cmake/$(PACKAGE)/
+cmakeconfig_DATA = bash-completion-config.cmake \
+ bash-completion-config-version.cmake
+
bash_completion.sh: bash_completion.sh.in Makefile
sed -e 's|@pkgdatadir[@]|$(pkgdatadir)|' <$(srcdir)/$@.in >$@
@@ -22,6 +26,11 @@ EXTRA_DIST = CHANGES $(sysconf_DATA) $(pkgdata_DATA) bash_completion.sh.in \
install-data-hook:
tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \
sed -e 's|=/etc/bash_completion\.d|=$(compatdir)|' \
- $(DESTDIR)$(pkgdatadir)/bash_completion > $$tmpfile && \
+ $(DESTDIR)$(pkgdatadir)/bash_completion > $$tmpfile && \
cat $$tmpfile > $(DESTDIR)$(pkgdatadir)/bash_completion && \
+ sed -e 's|\$${prefix}|$(prefix)|' \
+ $(DESTDIR)$(datadir)/cmake/$(PACKAGE)/bash-completion-config.cmake \
+ > $$tmpfile && \
+ cat $$tmpfile > \
+ $(DESTDIR)$(datadir)/cmake/$(PACKAGE)/bash-completion-config.cmake && \
rm $$tmpfile
@@ -0,0 +1,7 @@
+set (PACKAGE_VERSION "@VERSION@")
+if (NOT ${PACKAGE_FIND_VERSION} VERSION_GREATER ${PACKAGE_VERSION})
+ set (PACKAGE_VERSION_COMPATIBLE 1)
+ if (${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION})
+ set (PACKAGE_VERSION_EXACT 1)
+ endif ()
+endif ()
@@ -0,0 +1,11 @@
+# config file for bash-completion
+# http://bash-completion.alioth.debian.org/
+
+set (BASH_COMPLETION_VERSION "@VERSION@")
+
+set (BASH_COMPLETION_PREFIX "@prefix@")
+set (BASH_COMPLETION_COMPATDIR "@compatdir@")
+set (BASH_COMPLETION_COMPLETIONSDIR "@datarootdir@/@PACKAGE@/completions")
+set (BASH_COMPLETION_HELPERSDIR "@datarootdir@/@PACKAGE@/helpers")
+
+set (BASH_COMPLETION_FOUND "TRUE")
View
@@ -4,5 +4,14 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip -Wall -Werror])
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_SUBST(compatdir, $sysconfdir/bash_completion.d)
-AC_CONFIG_FILES([Makefile completions/Makefile doc/Makefile helpers/Makefile test/Makefile bash-completion.pc])
+AC_CONFIG_FILES([
+Makefile
+completions/Makefile
+doc/Makefile
+helpers/Makefile
+test/Makefile
+bash-completion.pc
+bash-completion-config.cmake
+bash-completion-config-version.cmake
+])
AC_OUTPUT

0 comments on commit 94b7e63

Please sign in to comment.