Merge pull request #776 from askebm/cmake-targets-fix

Use correct makefile for target completion
This commit is contained in:
Shohei YOSHIDA 2021-01-16 19:26:12 +09:00 committed by GitHub
commit 00c7e28e4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ _cmake_targets() {
then
# `make help` doesn't work for Makefiles in general, but for CMake generated Makefiles it does.
i=1
for target in $(make help | \grep -e "\.\.\." | sed "s/\.\.\. //" | sed "s/ (the default.*//") ; do
for target in $(make -f $1/Makefile help | \grep -e "\.\.\." | sed "s/\.\.\. //" | sed "s/ (the default.*//") ; do
targets[$i]=$target
(( i = $i + 1 ))
done