summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
blob: d0046caa1113a5f3c093a9c6c38102b506758da4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cmake_minimum_required(VERSION 3.3)

find_package(PkgConfig REQUIRED)
pkg_check_modules(NCURSES QUIET ncurses)

if (NCURSES_FOUND)
  foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
    get_property(value
      CACHE     "NCURSES_${variable}"
      PROPERTY  VALUE)
    if (NOT value STREQUAL NCURSES_${variable})
      message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}:\nexpected -->${value}<--\nreceived -->${NCURSES_${variable}}<--")
    endif ()
  endforeach ()
else ()
  message(STATUS "skipping test; ncurses not found")
endif ()