FindCups.cmake 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # - Try to find the Cups printing system
  2. # Once done this will define
  3. #
  4. # CUPS_FOUND - system has Cups
  5. # CUPS_INCLUDE_DIR - the Cups include directory
  6. # CUPS_LIBRARIES - Libraries needed to use Cups
  7. # Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
  8. # features this function (i.e. at least 1.1.19)
  9. # Copyright (c) 2006, Alexander Neundorf, <[email protected]>
  10. #
  11. # Redistribution and use is allowed according to the terms of the BSD license.
  12. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  13. INCLUDE(CheckLibraryExists)
  14. FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h )
  15. FIND_LIBRARY(CUPS_LIBRARIES NAMES cups )
  16. IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
  17. SET(CUPS_FOUND TRUE)
  18. # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
  19. CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
  20. IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
  21. SET(CUPS_FOUND FALSE)
  22. ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
  23. ELSE (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
  24. SET(CUPS_FOUND FALSE)
  25. ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
  26. IF (CUPS_FOUND)
  27. IF (NOT Cups_FIND_QUIETLY)
  28. MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}")
  29. ENDIF (NOT Cups_FIND_QUIETLY)
  30. ELSE (CUPS_FOUND)
  31. SET(CUPS_LIBRARIES )
  32. IF (Cups_FIND_REQUIRED)
  33. MESSAGE(FATAL_ERROR "Could NOT find Cups")
  34. ENDIF (Cups_FIND_REQUIRED)
  35. ENDIF (CUPS_FOUND)
  36. MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)