@@ -185,7 +185,8 @@ cmake_comment_add_subdirectory() {
185185# @FUNCTION: cmake_punt_find_package
186186# @USAGE: [-f <filename>] <pkg> [<components>...]
187187# @DESCRIPTION:
188- # Default value for <filename> is CMakeLists.txt if not set.
188+ # Default value for <filename> is CMakeLists.txt if not set. If given a
189+ # directory instead, will try to modify a CMakeLists.txt below, if exists.
189190# In <filename> below current directory, remove a find_package(<pkg>) call.
190191# If given one or more <components>, remove those from COMPONENTS instead.
191192cmake_punt_find_package () {
@@ -206,7 +207,11 @@ cmake_punt_find_package() {
206207 shift ;;
207208 esac
208209
209- if [[ ! -e " ${filename} " ]]; then
210+ if [[ -d ${filename} ]]; then
211+ filename+=" /CMakeLists.txt"
212+ einfo " modifying ${filename} !"
213+ fi
214+ if [[ ! -e ${filename} ]]; then
210215 die " ${FUNCNAME[0]} : called on non-existing ${filename} "
211216 return
212217 fi
@@ -221,7 +226,7 @@ cmake_punt_find_package() {
221226
222227 # pcre2grep returns non-zero on no matches/error
223228 if [[ $? -ne 0 ]]; then
224- eqawarn " QA Notice: ${FUNCNAME[0] } (${pkg} , ${cmpnt} ) called, but no matches found!"
229+ eqawarn " QA Notice: ${FUNCNAME} (${pkg} , ${cmpnt} ) called, but no matches found!"
225230 continue
226231 fi
227232
0 commit comments