CMake/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
Ben Boeckel 40249bccdf FindPkgConfig: set standard variables in the cache
Fixes a regression introduced when the code was simplified to use the
variable queries.

Fixes #15903.

Reported-by: Bernd Lörwald
2016-01-21 10:38:30 -05:00

17 lines
453 B
CMake

find_package(PkgConfig REQUIRED)
pkg_check_modules(NCURSES QUIET ncurses)
if (NCURSES_FOUND)
foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
get_property("${variable}"
CACHE "NCURSES_${variable}"
PROPERTY TYPE
SET)
if (NOT ${variable})
message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}")
endif ()
endforeach ()
else ()
message(STATUS "skipping test; ncurses not found")
endif ()