FindQt5Keychain.cmake 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # (c) 2014 Copyright ownCloud GmbH
  2. # Redistribution and use is allowed according to the terms of the BSD license.
  3. # For details see the accompanying COPYING* file.
  4. # - Try to find QtKeychain
  5. # Once done this will define
  6. # QTKEYCHAIN_FOUND - System has QtKeychain
  7. # QTKEYCHAIN_INCLUDE_DIRS - The QtKeychain include directories
  8. # QTKEYCHAIN_LIBRARIES - The libraries needed to use QtKeychain
  9. # QTKEYCHAIN_DEFINITIONS - Compiler switches required for using LibXml2
  10. # When we build our own Qt we also need to build QtKeychain with it
  11. # so that it doesn't pull a different Qt version. For that reason
  12. # first look in the Qt lib directory for QtKeychain.
  13. get_target_property(_QTCORE_LIB_PATH Qt5::Core IMPORTED_LOCATION_RELEASE)
  14. get_filename_component(QT_LIB_DIR "${_QTCORE_LIB_PATH}" DIRECTORY)
  15. find_path(QTKEYCHAIN_INCLUDE_DIR
  16. NAMES
  17. keychain.h
  18. HINTS
  19. ${QT_LIB_DIR}/../include
  20. PATH_SUFFIXES
  21. qt5keychain
  22. )
  23. find_library(QTKEYCHAIN_LIBRARY
  24. NAMES
  25. qt5keychain
  26. lib5qtkeychain
  27. HINTS
  28. ${QT_LIB_DIR}
  29. PATHS
  30. /usr/lib
  31. /usr/lib/${CMAKE_ARCH_TRIPLET}
  32. /usr/local/lib
  33. /opt/local/lib
  34. ${CMAKE_LIBRARY_PATH}
  35. ${CMAKE_INSTALL_PREFIX}/lib
  36. )
  37. include(FindPackageHandleStandardArgs)
  38. # handle the QUIETLY and REQUIRED arguments and set QTKEYCHAIN_FOUND to TRUE
  39. # if all listed variables are TRUE
  40. find_package_handle_standard_args(Qt5Keychain DEFAULT_MSG
  41. QTKEYCHAIN_LIBRARY QTKEYCHAIN_INCLUDE_DIR)
  42. mark_as_advanced(QTKEYCHAIN_INCLUDE_DIR QTKEYCHAIN_LIBRARY)