summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindPkgConfig
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-01-20 19:38:05 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2016-01-21 15:38:30 (GMT)
commit40249bccdf9c66453433da3608da9cc89cbee675 (patch)
treee5388af73d141307be4132dc301942652322ab00 /Tests/RunCMake/FindPkgConfig
parentd8bced813cdd0c3eb7c2e3e150f513da04ded513 (diff)
downloadCMake-40249bccdf9c66453433da3608da9cc89cbee675.zip
CMake-40249bccdf9c66453433da3608da9cc89cbee675.tar.gz
CMake-40249bccdf9c66453433da3608da9cc89cbee675.tar.bz2
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
Diffstat (limited to 'Tests/RunCMake/FindPkgConfig')
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake16
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake1
2 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
new file mode 100644
index 0000000..8d8d000
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
@@ -0,0 +1,16 @@
+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 ()
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index bb04aa2..24089e0 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -14,4 +14,5 @@ endif()
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
run_cmake(FindPkgConfig_GET_VARIABLE)
+ run_cmake(FindPkgConfig_cache_variables)
endif ()