Browse Source

FindSQLite3: Guard calls to pkg_check_modules

This was missed in commit 25b947589a (Modules: Guard calls to
pkg_check_modules, 2024-08-07, v3.31.0-rc1~236^2).
Peter Kokot 1 year ago
parent
commit
674a987898
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Modules/FindSQLite3.cmake

+ 3 - 1
Modules/FindSQLite3.cmake

@@ -36,7 +36,9 @@ cmake_policy(PUSH)
 cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
 
 find_package(PkgConfig QUIET)
-pkg_check_modules(PC_SQLite3 QUIET sqlite3)
+if(PKG_CONFIG_FOUND)
+  pkg_check_modules(PC_SQLite3 QUIET sqlite3)
+endif()
 
 # Look for the necessary header
 find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h