FindMir.cmake 923 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Try to find Mir on a Unix system
  2. #
  3. # This will define:
  4. #
  5. # MIR_FOUND - System has Mir
  6. # MIR_LIBRARIES - Link these to use Mir
  7. # MIR_INCLUDE_DIR - Include directory for Mir
  8. # MIR_DEFINITIONS - Compiler switches required for using Mir
  9. if (NOT WIN32)
  10. find_package (PkgConfig)
  11. pkg_check_modules (PKG_MIR QUIET mirclient)
  12. set(MIR_DEFINITIONS ${PKG_MIR_CFLAGS_OTHER})
  13. find_path(MIR_INCLUDE_DIR
  14. NAMES xkbcommon/xkbcommon.h
  15. HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
  16. )
  17. find_library(MIR_LIBRARY
  18. NAMES mirclient
  19. HINTS ${PKG_MIR_LIBRARIES} ${MIR_LIBRARY_DIRS}
  20. )
  21. set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS})
  22. set (MIR_LIBRARIES ${MIR_LIBRARY})
  23. include (FindPackageHandleStandardArgs)
  24. find_package_handle_standard_args (MIR DEFAULT_MSG
  25. MIR_LIBRARIES
  26. MIR_INCLUDE_DIR
  27. )
  28. mark_as_advanced (MIR_LIBRARIES MIR_INCLUDE_DIR)
  29. endif ()