diff options
Diffstat (limited to 'Tests/RunCMake/FindPkgConfig')
3 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_empty_target.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_empty_target.cmake new file mode 100644 index 0000000..fd774b9 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_empty_target.cmake @@ -0,0 +1,13 @@ +# Prepare environment to reuse empty.pc +file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-empty/lib/pkgconfig" PC_PATH) +if(UNIX) + string(REPLACE "\\ " " " PC_PATH "${PC_PATH}") +endif() +set(ENV{PKG_CONFIG_PATH} "${PC_PATH}") + +find_package(PkgConfig REQUIRED) +pkg_search_module(Empty REQUIRED empty IMPORTED_TARGET) + +if(NOT Empty_MODULE_NAME STREQUAL "empty") + message(FATAL_ERROR "Wrong value for Empty_MODULE_NAME. Expected: empty, got: ${Empty_MODULE_NAME}") +endif() diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake index 4e6eef6..e7f008c 100644 --- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake @@ -29,4 +29,5 @@ if (PKG_CONFIG_FOUND) run_cmake(FindPkgConfig_IMPORTED_TARGET) run_cmake(FindPkgConfig_VERSION_OPERATORS) run_cmake(FindPkgConfig_GET_MATCHING_MODULE_NAME) + run_cmake(FindPkgConfig_empty_target) endif () diff --git a/Tests/RunCMake/FindPkgConfig/pc-empty/lib/pkgconfig/empty.pc b/Tests/RunCMake/FindPkgConfig/pc-empty/lib/pkgconfig/empty.pc new file mode 100644 index 0000000..954c5f8 --- /dev/null +++ b/Tests/RunCMake/FindPkgConfig/pc-empty/lib/pkgconfig/empty.pc @@ -0,0 +1,5 @@ +Name: Empty +Description: Dummy package to test empty target +Version: 1.0 +Libs: +Cflags: |