FindPkgConfig_cache_variables.cmake 561 B

1234567891011121314151617
  1. cmake_minimum_required(VERSION 3.3)
  2. find_package(PkgConfig REQUIRED)
  3. pkg_check_modules(NCURSES QUIET ncurses)
  4. if (NCURSES_FOUND)
  5. foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
  6. get_property(value
  7. CACHE "NCURSES_${variable}"
  8. PROPERTY VALUE)
  9. if (NOT value STREQUAL NCURSES_${variable})
  10. message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}:\nexpected -->${value}<--\nreceived -->${NCURSES_${variable}}<--")
  11. endif ()
  12. endforeach ()
  13. else ()
  14. message(STATUS "skipping test; ncurses not found")
  15. endif ()