diff options
author | Brad King <brad.king@kitware.com> | 2016-01-22 14:25:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-01-22 14:25:27 (GMT) |
commit | 666487a402310ea69ac20b1d6dceb20746d16f6a (patch) | |
tree | 09e5738788f4bf43b098e244437d1f95e5c6419a /Tests | |
parent | f81ccc575331b4e184622b192deac2865931de19 (diff) | |
parent | 40249bccdf9c66453433da3608da9cc89cbee675 (diff) | |
download | CMake-666487a402310ea69ac20b1d6dceb20746d16f6a.zip CMake-666487a402310ea69ac20b1d6dceb20746d16f6a.tar.gz CMake-666487a402310ea69ac20b1d6dceb20746d16f6a.tar.bz2 |
Merge topic 'fix-pkg_search_module-cache'
40249bcc FindPkgConfig: set standard variables in the cache
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake | 16 | ||||
-rw-r--r-- | Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake | 1 |
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 () |