summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindPkgConfig
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-06-22 14:11:16 (GMT)
committerBrad King <brad.king@kitware.com>2022-06-22 14:13:00 (GMT)
commit7e4adcac820d90bb431b374a07ee3d0c6cfe3f1f (patch)
tree2bc1c4e69b53d1df265c5a41aa9b1f5305195d87 /Tests/RunCMake/FindPkgConfig
parentaae6a67e5c850f0f4dd0be4bb7d645d48995f24c (diff)
downloadCMake-7e4adcac820d90bb431b374a07ee3d0c6cfe3f1f.zip
CMake-7e4adcac820d90bb431b374a07ee3d0c6cfe3f1f.tar.gz
CMake-7e4adcac820d90bb431b374a07ee3d0c6cfe3f1f.tar.bz2
FindPkgConfig: Revert "Populate _STATIC_LINK_LIBRARIES. Add STATIC_TARGET."
Revert commit 020976d637 (FindPkgConfig: Populate _STATIC_LINK_LIBRARIES. Add STATIC_TARGET., 2021-12-31, v3.24.0-rc1~105^2). Several regressions have been reported. Revert the feature pending further discussion and design work. Issue: #21714 Fixes: #23642
Diffstat (limited to 'Tests/RunCMake/FindPkgConfig')
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake138
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-stdout.txt5
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH.cmake19
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-stdout.txt6
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES.cmake53
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake53
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake1
7 files changed, 72 insertions, 203 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
index 04286cc..f149d99 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
@@ -1,59 +1,40 @@
-cmake_minimum_required(VERSION 3.17)
+cmake_minimum_required(VERSION 3.12)
project(FindPkgConfig_IMPORTED_TARGET C)
-set(shared_lib_prefix "")
-set(shared_lib_suffix ".lib")
-set(static_lib_prefix "lib")
-set(static_lib_suffix ".a")
-
-set(CMAKE_SHARED_LIBRARY_PREFIX ${shared_lib_prefix})
-set(CMAKE_SHARED_LIBRARY_SUFFIX ${shared_lib_suffix})
-set(CMAKE_STATIC_LIBRARY_PREFIX ${static_lib_prefix})
-set(CMAKE_STATIC_LIBRARY_SUFFIX ${static_lib_suffix})
-
find_package(PkgConfig REQUIRED)
+pkg_check_modules(NCURSES IMPORTED_TARGET QUIET ncurses)
-# to test multiple variations, we must pick unique prefix names (same-named targets are cached for re-use)
-set(prefix_uniquifiers 0 1)
-# whether to apply STATIC_TARGET argument
-set(static_target_args "" STATIC_TARGET)
-foreach (prefix_uniquifier static_target_arg IN ZIP_LISTS prefix_uniquifiers static_target_args)
- set(prefix "NCURSES${prefix_uniquifier}")
- message(STATUS "static_target_arg: ${static_target_arg}")
- pkg_check_modules(${prefix} IMPORTED_TARGET QUIET ${static_target_arg} ncurses)
-
- message(STATUS "source: ${CMAKE_CURRENT_SOURCE_DIR} bin ${CMAKE_CURRENT_BINARY_DIR}")
-
- if (${prefix}_FOUND)
- set(tgt PkgConfig::${prefix})
- message(STATUS "Verifying target \"${tgt}\"")
- if (NOT TARGET ${tgt})
- message(FATAL_ERROR "FindPkgConfig found ncurses, but did not create an imported target for it")
- endif ()
- set(prop_found FALSE)
- foreach (prop IN ITEMS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_LIBRARIES INTERFACE_COMPILE_OPTIONS)
- get_target_property(value ${tgt} ${prop})
- if (value)
- message(STATUS "Found property ${prop} on target: ${value}")
- set(prop_found TRUE)
- endif ()
- endforeach ()
- if (NOT prop_found)
- message(FATAL_ERROR "target ${tgt} found, but it has no properties")
+message(STATUS "source: ${CMAKE_CURRENT_SOURCE_DIR} bin ${CMAKE_CURRENT_BINARY_DIR}")
+
+if (NCURSES_FOUND)
+ set(tgt PkgConfig::NCURSES)
+ if (NOT TARGET ${tgt})
+ message(FATAL_ERROR "FindPkgConfig found ncurses, but did not create an imported target for it")
+ endif ()
+ set(prop_found FALSE)
+ foreach (prop IN ITEMS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_LIBRARIES INTERFACE_COMPILE_OPTIONS)
+ get_target_property(value ${tgt} ${prop})
+ if (value)
+ message(STATUS "Found property ${prop} on target: ${value}")
+ set(prop_found TRUE)
endif ()
- else ()
- message(STATUS "skipping test; ncurses not found")
+ endforeach ()
+ if (NOT prop_found)
+ message(FATAL_ERROR "target ${tgt} found, but it has no properties")
endif ()
-endforeach ()
+else ()
+ message(STATUS "skipping test; ncurses not found")
+endif ()
+
# Setup for the remaining package tests below
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH)
set(fakePkgDir ${CMAKE_CURRENT_BINARY_DIR}/pc-fakepackage)
foreach(i 1 2)
set(pname cmakeinternalfakepackage${i})
- file(WRITE ${fakePkgDir}/lib/${static_lib_prefix}${pname}${static_lib_suffix} "")
- file(WRITE ${fakePkgDir}/lib/${shared_lib_prefix}${pname}${shared_lib_suffix} "")
+ file(WRITE ${fakePkgDir}/lib/lib${pname}.a "")
+ file(WRITE ${fakePkgDir}/lib/${pname}.lib "")
file(WRITE ${fakePkgDir}/lib/pkgconfig/${pname}.pc
"Name: CMakeInternalFakePackage${i}
Description: Dummy package (${i}) for FindPkgConfig IMPORTED_TARGET test
@@ -85,52 +66,35 @@ unset(CMAKE_PREFIX_PATH)
unset(ENV{CMAKE_PREFIX_PATH})
set(ENV{CMAKE_PREFIX_PATH} ${fakePkgDir})
+pkg_check_modules(FakePackage2 REQUIRED QUIET IMPORTED_TARGET cmakeinternalfakepackage2)
+if (NOT TARGET PkgConfig::FakePackage2)
+ message(FATAL_ERROR "No import target for fake package 2 with prefix path")
+endif()
-# to test multiple variations, we must pick unique prefix names (same-named targets are cached for re-use)
-set(prefix_uniquifiers 0 1)
-# whether to apply STATIC_TARGET argument
-set(static_target_args "" STATIC_TARGET)
-# whether target properties are populated from the unqualified (i.e. shared library) series of vars, or the STATIC_ series of vars
-set(target_var_qualifiers "" STATIC_)
-set(lib_types shared static)
-foreach (prefix_uniquifier static_target_arg target_var_qualifier lib_type IN ZIP_LISTS prefix_uniquifiers static_target_args target_var_qualifiers lib_types)
- set(prefix "FakePackage2${prefix_uniquifier}")
- set(tgt "PkgConfig::${prefix}")
- pkg_check_modules(${prefix} REQUIRED QUIET IMPORTED_TARGET ${static_target_arg} cmakeinternalfakepackage2)
+# check that 2 library entries exist
+list(LENGTH FakePackage2_LINK_LIBRARIES fp2_nlibs)
+if (NOT fp2_nlibs EQUAL 2)
+ message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has ${fp2_nlibs} entries but should have exactly 2")
+endif()
- message(STATUS "Verifying library path resolution for lib type \"${lib_type}\"")
- if (NOT TARGET ${tgt})
- message(FATAL_ERROR "No import target for fake package 2 with prefix path")
- endif()
-
- set(link_libraries_var ${prefix}_${target_var_qualifier}LINK_LIBRARIES)
- # check that 2 library entries exist
- list(LENGTH ${link_libraries_var} fp2_nlibs)
- if (NOT fp2_nlibs EQUAL 2)
- message(FATAL_ERROR "${link_libraries_var} has ${fp2_nlibs} entries but should have exactly 2")
- endif()
-
- set(lib_leafname ${${lib_type}_lib_prefix}cmakeinternalfakepackage2${${lib_type}_lib_suffix})
- message(STATUS "Expecting library leafname \"${lib_leafname}\"")
- # check that the full library path is also returned
- list(GET ${link_libraries_var} 0 fp2_lib0)
- if (NOT fp2_lib0 STREQUAL "${fakePkgDir}/lib/${lib_leafname}")
- message(FATAL_ERROR "${link_libraries_var} has bad content on first run: ${${link_libraries_var}}")
- endif()
-
- # check that the library that couldn't be found still shows up
- list(GET ${link_libraries_var} 1 fp2_lib1)
- if (NOT fp2_lib1 STREQUAL "cmakeinternalfakepackage2-doesnotexist")
- message(FATAL_ERROR "${link_libraries_var} has bad content on first run: ${${link_libraries_var}}")
- endif()
-
- # the information in *_LINK_LIBRARIES is not cached, so ensure is also is present on second run
- unset(${link_libraries_var})
- pkg_check_modules(${prefix} REQUIRED QUIET IMPORTED_TARGET ${static_target_arg} cmakeinternalfakepackage2)
- if (NOT ${link_libraries_var} STREQUAL "${fakePkgDir}/lib/${lib_leafname};cmakeinternalfakepackage2-doesnotexist")
- message(FATAL_ERROR "${link_libraries_var} has bad content on second run: ${${link_libraries_var}}")
- endif()
-endforeach()
+# check that the full library path is also returned
+list(GET FakePackage2_LINK_LIBRARIES 0 fp2_lib0)
+if (NOT fp2_lib0 STREQUAL "${fakePkgDir}/lib/libcmakeinternalfakepackage2.a")
+ message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on first run: ${FakePackage2_LINK_LIBRARIES}")
+endif()
+
+# check that the library that couldn't be found still shows up
+list(GET FakePackage2_LINK_LIBRARIES 1 fp2_lib1)
+if (NOT fp2_lib1 STREQUAL "cmakeinternalfakepackage2-doesnotexist")
+ message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on first run: ${FakePackage2_LINK_LIBRARIES}")
+endif()
+
+# the information in *_LINK_LIBRARIES is not cached, so ensure is also is present on second run
+unset(FakePackage2_LINK_LIBRARIES)
+pkg_check_modules(FakePackage2 REQUIRED QUIET IMPORTED_TARGET cmakeinternalfakepackage2)
+if (NOT FakePackage2_LINK_LIBRARIES STREQUAL "${fakePkgDir}/lib/libcmakeinternalfakepackage2.a;cmakeinternalfakepackage2-doesnotexist")
+ message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on second run: ${FakePackage2_LINK_LIBRARIES}")
+endif()
set(pname fakelinkoptionspackage)
file(WRITE ${fakePkgDir}/lib/pkgconfig/${pname}.pc
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-stdout.txt b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-stdout.txt
index 8966ac3..539e5ef 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-stdout.txt
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-stdout.txt
@@ -1,6 +1,3 @@
-- ZOT_LIBRARIES='zot'
--- ZOT_LINK_LIBRARIES='[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-build/root/lib/dyprefix-zot-dysuffix'
+-- ZOT_LINK_LIBRARIES='[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-build/root/lib/prefix-zot-suffix'
-- ZOT_LDFLAGS='-L[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-build/root/lib;-lzot'
--- ZOT_STATIC_LIBRARIES='zot'
--- ZOT_STATIC_LINK_LIBRARIES='[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-build/root/lib/stprefix-zot-stsuffix'
--- ZOT_STATIC_LDFLAGS='-L[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH-build/root/lib;-lzot'
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH.cmake
index 536addc..1278c49 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LIBRARY_PATH.cmake
@@ -15,20 +15,10 @@ Version: 1.0
Libs: -L\${libdir} -lzot
")
-set(shared_lib_prefix "dyprefix-")
-set(shared_lib_suffix "-dysuffix")
-set(static_lib_prefix "stprefix-")
-set(static_lib_suffix "-stsuffix")
-
-set(CMAKE_SHARED_LIBRARY_PREFIX ${shared_lib_prefix})
-set(CMAKE_SHARED_LIBRARY_SUFFIX ${shared_lib_suffix})
-set(CMAKE_STATIC_LIBRARY_PREFIX ${static_lib_prefix})
-set(CMAKE_STATIC_LIBRARY_SUFFIX ${static_lib_suffix})
-
# Create a "library" file to find in libdir.
-foreach(variant shared static)
- file(WRITE "${LIB_DIR}/${${variant}_lib_prefix}zot${${variant}_lib_suffix}")
-endforeach()
+set(CMAKE_FIND_LIBRARY_PREFIXES "prefix-")
+set(CMAKE_FIND_LIBRARY_SUFFIXES "-suffix")
+file(WRITE "${LIB_DIR}/prefix-zot-suffix")
# 'pkg-config --libs' drops -L flags in PKG_CONFIG_SYSTEM_LIBRARY_PATH by default.
set(ENV{PKG_CONFIG_SYSTEM_LIBRARY_PATH} "${LIB_DIR}")
@@ -42,6 +32,3 @@ pkg_check_modules(ZOT REQUIRED zot)
message(STATUS "ZOT_LIBRARIES='${ZOT_LIBRARIES}'")
message(STATUS "ZOT_LINK_LIBRARIES='${ZOT_LINK_LIBRARIES}'")
message(STATUS "ZOT_LDFLAGS='${ZOT_LDFLAGS}'")
-message(STATUS "ZOT_STATIC_LIBRARIES='${ZOT_STATIC_LIBRARIES}'")
-message(STATUS "ZOT_STATIC_LINK_LIBRARIES='${ZOT_STATIC_LINK_LIBRARIES}'")
-message(STATUS "ZOT_STATIC_LDFLAGS='${ZOT_STATIC_LDFLAGS}'")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-stdout.txt b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-stdout.txt
deleted file mode 100644
index edf0262..0000000
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-stdout.txt
+++ /dev/null
@@ -1,6 +0,0 @@
--- IMM_LIBRARIES='imm'
--- IMM_LINK_LIBRARIES='[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-build/root/lib/dyprefix-imm-dysuffix'
--- IMM_LDFLAGS='-L[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-build/root/lib;-limm'
--- IMM_STATIC_LIBRARIES='imm;trns'
--- IMM_STATIC_LINK_LIBRARIES='[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-build/root/lib/stprefix-imm-stsuffix;[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-build/root/lib/stprefix-trns-stsuffix'
--- IMM_STATIC_LDFLAGS='-L[^']*/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES-build/root/lib;-limm;-ltrns'
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES.cmake
deleted file mode 100644
index bf4ee1e..0000000
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_LINK_LIBRARIES.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-find_package(PkgConfig REQUIRED)
-
-set(ROOT "${CMAKE_CURRENT_BINARY_DIR}/root")
-string(REPLACE " " "\\ " ESCAPED_ROOT "${ROOT}")
-set(LIB_DIR "${ROOT}/lib")
-set(PKGCONFIG_DIR "${LIB_DIR}/pkgconfig")
-
-file(WRITE "${PKGCONFIG_DIR}/imm.pc" "
-prefix=${ESCAPED_ROOT}
-libdir=\${prefix}/lib
-
-Name: Immediate
-Description: Dummy package to test *LINK_LIBRARIES support
-Version: 1.0
-Libs: -L\${libdir} -limm
-Libs.private: -ltrns
-")
-file(WRITE "${PKGCONFIG_DIR}/trns.pc" "
-prefix=${ESCAPED_ROOT}
-libdir=\${prefix}/lib
-
-Name: Transitive
-Description: Dummy package to test *LINK_LIBRARIES support
-Version: 1.0
-Libs: -L\${libdir} -ltrns
-")
-
-set(shared_lib_prefix "dyprefix-")
-set(shared_lib_suffix "-dysuffix")
-set(static_lib_prefix "stprefix-")
-set(static_lib_suffix "-stsuffix")
-
-set(CMAKE_SHARED_LIBRARY_PREFIX ${shared_lib_prefix})
-set(CMAKE_SHARED_LIBRARY_SUFFIX ${shared_lib_suffix})
-set(CMAKE_STATIC_LIBRARY_PREFIX ${static_lib_prefix})
-set(CMAKE_STATIC_LIBRARY_SUFFIX ${static_lib_suffix})
-
-# Create "library" files to find in libdir.
-foreach(lib imm trns)
- foreach(variant shared static)
- file(WRITE "${LIB_DIR}/${${variant}_lib_prefix}${lib}${${variant}_lib_suffix}")
- endforeach()
-endforeach()
-
-set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_DIR}")
-pkg_check_modules(IMM REQUIRED imm)
-
-message(STATUS "IMM_LIBRARIES='${IMM_LIBRARIES}'")
-message(STATUS "IMM_LINK_LIBRARIES='${IMM_LINK_LIBRARIES}'")
-message(STATUS "IMM_LDFLAGS='${IMM_LDFLAGS}'")
-message(STATUS "IMM_STATIC_LIBRARIES='${IMM_STATIC_LIBRARIES}'")
-message(STATUS "IMM_STATIC_LINK_LIBRARIES='${IMM_STATIC_LINK_LIBRARIES}'")
-message(STATUS "IMM_STATIC_LDFLAGS='${IMM_STATIC_LDFLAGS}'")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake
index 6c838a9..5501d9f 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake
@@ -1,5 +1,3 @@
-cmake_minimum_required(VERSION 3.17)
-
# Prepare environment to reuse bletch.pc
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-bletch/lib/pkgconfig" PC_PATH)
if(UNIX)
@@ -8,41 +6,24 @@ endif()
set(ENV{PKG_CONFIG_PATH} "${PC_PATH}")
find_package(PkgConfig REQUIRED)
+pkg_check_modules(Bletch IMPORTED_TARGET REQUIRED bletch-framework)
-# to test multiple variations, we must pick unique prefix names (same-named targets are cached for re-use)
-set(prefix_uniquifiers 0 1)
-# whether to apply STATIC_TARGET argument
-set(static_target_args "" STATIC_TARGET)
-# whether target properties are populated from the unqualified (i.e. shared library) series of vars, or the STATIC_ series of vars
-set(target_var_qualifiers "" STATIC_)
-foreach (prefix_uniquifier static_target_arg target_var_qualifier IN ZIP_LISTS prefix_uniquifiers static_target_args target_var_qualifiers)
- set(prefix "Bletch${prefix_uniquifier}")
- set(tgt "PkgConfig::${prefix}")
- pkg_check_modules(${prefix} IMPORTED_TARGET REQUIRED ${static_target_arg} bletch-framework)
- foreach (prop IN ITEMS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_OPTIONS INTERFACE_COMPILE_OPTIONS)
- get_target_property(prop_value ${tgt} ${prop})
- if (prop_value)
- message(SEND_ERROR "target property ${prop} should not be set, but is '${prop_value}'")
- endif ()
- endforeach ()
+if (Bletch_LDFLAGS_OTHER)
+ message(SEND_ERROR "Bletch_LDFLAGS_OTHER should be empty, but is '${Bletch_LDFLAGS_OTHER}'")
+endif ()
- # there is 1 target yet 2 series of variables.
- # if STATIC_TARGET is set, then the target will follow the STATIC_ qualified series of variables
- # (otherwise will follow the unqualified series of variables).
- get_target_property(prop_value ${tgt} INTERFACE_LINK_LIBRARIES)
- if (NOT prop_value STREQUAL ${prefix}_${target_var_qualifier}LINK_LIBRARIES)
- message(SEND_ERROR "target property INTERFACE_LINK_LIBRARIES has wrong value '${prop_value}'")
- endif ()
+if (NOT Bletch_LINK_LIBRARIES STREQUAL "-framework foo;-framework bar;bletch;-framework baz")
+ message(SEND_ERROR "Bletch_LINK_LIBRARIES has wrong value '${Bletch_LINK_LIBRARIES}'")
+endif ()
- foreach (var_qualifier IN ITEMS "" STATIC_)
- set (ldflags_var ${prefix}_${var_qualifier}LDFLAGS_OTHER)
- if (${ldflags_var})
- message(SEND_ERROR "${ldflags_var} should be empty, but is '${${ldflags_var}}'")
- endif ()
+foreach (prop IN ITEMS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_OPTIONS INTERFACE_COMPILE_OPTIONS)
+ get_target_property(prop_value PkgConfig::Bletch ${prop})
+ if (prop_value)
+ message(SEND_ERROR "target property ${prop} should not be set, but is '${prop_value}'")
+ endif ()
+endforeach ()
- set (linklibs_var ${prefix}_${var_qualifier}LINK_LIBRARIES)
- if (NOT ${linklibs_var} STREQUAL "-framework foo;-framework bar;bletch;-framework baz")
- message(SEND_ERROR "${linklibs_var} has wrong value '${${linklibs_var}}'")
- endif ()
- endforeach()
-endforeach()
+get_target_property(prop_value PkgConfig::Bletch INTERFACE_LINK_LIBRARIES)
+if (NOT prop_value STREQUAL Bletch_LINK_LIBRARIES)
+ message(SEND_ERROR "target property INTERFACE_LINK_LIBRARIES has wrong value '${prop_value}'")
+endif ()
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index f89b3b3..f479dcf 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -29,7 +29,6 @@ if (PKG_CONFIG_FOUND)
run_cmake(FindPkgConfig_GET_VARIABLE_PKGCONFIG_PATH)
run_cmake(FindPkgConfig_cache_variables)
run_cmake(FindPkgConfig_IMPORTED_TARGET)
- run_cmake(FindPkgConfig_LINK_LIBRARIES)
run_cmake(FindPkgConfig_VERSION_OPERATORS)
run_cmake(FindPkgConfig_GET_MATCHING_MODULE_NAME)
run_cmake(FindPkgConfig_empty_target)