summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindPkgConfig/FindPkgConfig_empty_target.cmake
blob: fd774b9d65489a06089dec51b62fcfdf917ed622 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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()