summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/FindPkgConfig
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-03-18 15:48:56 -0400
committerBrad King <brad.king@kitware.com>2016-03-21 08:58:12 -0400
commit6f4f90548353d9e329bd4ddb2f7492788f28f0e1 (patch)
treeb445eeaec6dad0277545da2e6dd22c854f8d5385 /Tests/RunCMake/FindPkgConfig
parentb369959eb55dbea601315530185cb480c922cc77 (diff)
downloadcmake-6f4f90548353d9e329bd4ddb2f7492788f28f0e1.tar.gz
FindPkgConfig: set correctly named variables in cache (#15903)
The fix in commit v3.5.0-rc1~27^2 (FindPkgConfig: set standard variables in the cache, 2016-01-20) added the wrong variable name to the cache. The test was only testing that the cache variable existed, not that it also had the correct value. Update the test to ensure that the cache value matches the local variable value. Reported-by: Bernd Lörwald
Diffstat (limited to 'Tests/RunCMake/FindPkgConfig')
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake11
1 files changed, 6 insertions, 5 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
index 8d8d000991..d0046caa11 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
@@ -1,14 +1,15 @@
+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("${variable}"
+ get_property(value
CACHE "NCURSES_${variable}"
- PROPERTY TYPE
- SET)
- if (NOT ${variable})
- message(FATAL_ERROR "Failed to set cache entry for 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 ()