Skip to content

Commit df32987

Browse files
committed
Run pkg-config only when needed
1 parent 21bd317 commit df32987

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include-or-build-gtest.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ set(prefix __ld_gtest)
99
# 1.11.0 introduced various matchers that can be used with EXPECT_THAT (e.g., ThrowsMessage)
1010
set(required_version 1.11.0)
1111

12-
pkg_check_modules(${prefix} gtest>=${required_version} IMPORTED_TARGET)
13-
1412
if(TARGET gtest)
1513
__cmake_scripts_log("target gtest found, not setting up again")
1614
else()
15+
pkg_check_modules(${prefix} gtest>=${required_version} IMPORTED_TARGET)
16+
1717
if(${prefix}_FOUND)
1818
__cmake_scripts_log("Using system gtest")
1919
add_library(gtest ALIAS PkgConfig::${prefix})

0 commit comments

Comments
 (0)