mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Tests: Add case covering FindPkgConfig creation of empty targets
This commit is contained in:
@@ -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()
|
@@ -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 ()
|
||||
|
@@ -0,0 +1,5 @@
|
||||
Name: Empty
|
||||
Description: Dummy package to test empty target
|
||||
Version: 1.0
|
||||
Libs:
|
||||
Cflags:
|
Reference in New Issue
Block a user