FindLibTermkey.cmake 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. # - Try to find libtermkey
  2. # Once done this will define
  3. # LIBTERMKEY_FOUND - System has libtermkey
  4. # LIBTERMKEY_INCLUDE_DIRS - The libtermkey include directories
  5. # LIBTERMKEY_LIBRARIES - The libraries needed to use libtermkey
  6. find_package(PkgConfig)
  7. if (PKG_CONFIG_FOUND)
  8. pkg_check_modules(PC_LIBTERMKEY QUIET termkey)
  9. endif()
  10. set(LIBTERMKEY_DEFINITIONS ${PC_LIBTERMKEY_CFLAGS_OTHER})
  11. find_path(LIBTERMKEY_INCLUDE_DIR termkey.h
  12. PATHS ${PC_LIBTERMKEY_INCLUDEDIR} ${PC_LIBTERMKEY_INCLUDE_DIRS})
  13. list(APPEND LIBTERMKEY_NAMES termkey)
  14. find_library(LIBTERMKEY_LIBRARY NAMES ${LIBTERMKEY_NAMES}
  15. HINTS ${PC_LIBTERMKEY_LIBDIR} ${PC_LIBTERMKEY_LIBRARY_DIRS})
  16. set(LIBTERMKEY_LIBRARIES ${LIBTERMKEY_LIBRARY})
  17. set(LIBTERMKEY_INCLUDE_DIRS ${LIBTERMKEY_INCLUDE_DIR})
  18. include(FindPackageHandleStandardArgs)
  19. # handle the QUIETLY and REQUIRED arguments and set LIBTERMKEY_FOUND to TRUE
  20. # if all listed variables are TRUE
  21. find_package_handle_standard_args(LibTermkey DEFAULT_MSG
  22. LIBTERMKEY_LIBRARY LIBTERMKEY_INCLUDE_DIR)
  23. mark_as_advanced(LIBTERMKEY_INCLUDE_DIR LIBTERMKEY_LIBRARY)