Skip to content

Commit 8c6a247

Browse files
committed
Test TARGET PkgConfig::
1 parent 4412ff9 commit 8c6a247

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

chapter-03/recipe-09/c-example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pkg_search_module(
1515
IMPORTED_TARGET
1616
)
1717

18-
if(ZeroMQ_FOUND)
18+
if(TARGET PkgConfig::ZeroMQ)
1919
message(STATUS "Found ZeroMQ")
2020
endif()
2121

chapter-05/recipe-08/c-example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
88

99
find_package(PkgConfig REQUIRED QUIET)
1010
pkg_search_module(UUID REQUIRED uuid IMPORTED_TARGET)
11-
if(UUID_FOUND)
11+
if(TARGET PkgConfig::UUID)
1212
message(STATUS "Found libuuid")
1313
endif()
1414

chapter-09/recipe-01/fortran-uuid-example/src/interfaces/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FortranCInterface_VERIFY()
33

44
find_package(PkgConfig REQUIRED QUIET)
55
pkg_search_module(UUID REQUIRED uuid IMPORTED_TARGET)
6-
if(UUID_FOUND)
6+
if(TARGET PkgConfig::UUID)
77
message(STATUS "Found libuuid")
88
endif()
99
find_package(Backtrace REQUIRED)

chapter-10/recipe-01/cxx-example/src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
find_package(PkgConfig QUIET)
33
if(PKG_CONFIG_FOUND)
44
pkg_search_module(UUID uuid IMPORTED_TARGET)
5-
if(UUID_FOUND)
5+
if(TARGET PkgConfig::UUID)
66
message(STATUS "Found libuuid")
7+
set(UUID_FOUND TRUE)
78
endif()
89
endif()
910

chapter-10/recipe-02/cxx-example/src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
find_package(PkgConfig QUIET)
33
if(PKG_CONFIG_FOUND)
44
pkg_search_module(UUID uuid IMPORTED_TARGET)
5-
if(UUID_FOUND)
5+
if(TARGET PkgConfig::UUID)
66
message(STATUS "Found libuuid")
7+
set(UUID_FOUND TRUE)
78
endif()
89
endif()
910

chapter-10/recipe-03/cxx-example/src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
find_package(PkgConfig QUIET)
33
if(PKG_CONFIG_FOUND)
44
pkg_search_module(UUID uuid IMPORTED_TARGET)
5-
if(UUID_FOUND)
5+
if(TARGET PkgConfig::UUID)
66
message(STATUS "Found libuuid")
7+
set(UUID_FOUND TRUE)
78
endif()
89
endif()
910

0 commit comments

Comments
 (0)