summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-developer.7.rst4
-rw-r--r--Modules/FindSQLite3.cmake4
2 files changed, 6 insertions, 2 deletions
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index cebe8f9..fc7a27d 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -408,7 +408,9 @@ starting point.
.. code-block:: cmake
find_package(PkgConfig)
- pkg_check_modules(PC_Foo QUIET Foo)
+ if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_Foo QUIET Foo)
+ endif()
This should define some variables starting ``PC_Foo_`` that contain the
information from the ``Foo.pc`` file.
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake
index 308a444..e5fead7 100644
--- a/Modules/FindSQLite3.cmake
+++ b/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