FindReadline.cmake 1.0 KB

12345678910111213141516171819202122232425
  1. # - Try to find Readline
  2. # Once done this will define
  3. # READLINE_FOUND - System has readline
  4. # READLINE_INCLUDE_DIRS - The readline include directories
  5. # READLINE_LIBRARIES - The libraries needed to use readline
  6. # READLINE_DEFINITIONS - Compiler switches required for using readline
  7. find_package ( PkgConfig )
  8. pkg_check_modules ( PC_READLINE QUIET readline )
  9. set ( READLINE_DEFINITIONS ${PC_READLINE_CFLAGS_OTHER} )
  10. find_path ( READLINE_INCLUDE_DIR readline/readline.h
  11. HINTS ${PC_READLINE_INCLUDEDIR} ${PC_READLINE_INCLUDE_DIRS}
  12. PATH_SUFFIXES readline )
  13. find_library ( READLINE_LIBRARY NAMES readline
  14. HINTS ${PC_READLINE_LIBDIR} ${PC_READLINE_LIBRARY_DIRS} )
  15. set ( READLINE_LIBRARIES ${READLINE_LIBRARY} )
  16. set ( READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIR} )
  17. include ( FindPackageHandleStandardArgs )
  18. # handle the QUIETLY and REQUIRED arguments and set READLINE_FOUND to TRUE
  19. # if all listed variables are TRUE
  20. find_package_handle_standard_args ( Readline DEFAULT_MSG READLINE_LIBRARY READLINE_INCLUDE_DIR )