FindCups.cmake 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #=============================================================================
  10. # Copyright 2006-2009 Kitware, Inc.
  11. # Copyright 2006 Alexander Neundorf <[email protected]>
  12. #
  13. # Distributed under the OSI-approved BSD License (the "License");
  14. # see accompanying file Copyright.txt for details.
  15. #
  16. # This software is distributed WITHOUT ANY WARRANTY; without even the
  17. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. # See the License for more information.
  19. #=============================================================================
  20. # (To distributed this file outside of CMake, substitute the full
  21. # License text for the above reference.)
  22. INCLUDE(CheckLibraryExists)
  23. FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h )
  24. FIND_LIBRARY(CUPS_LIBRARIES NAMES cups )
  25. IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
  26. SET(CUPS_FOUND TRUE)
  27. # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
  28. CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
  29. IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
  30. SET(CUPS_FOUND FALSE)
  31. ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
  32. ELSE (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
  33. SET(CUPS_FOUND FALSE)
  34. ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
  35. IF (CUPS_FOUND)
  36. IF (NOT Cups_FIND_QUIETLY)
  37. MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}")
  38. ENDIF (NOT Cups_FIND_QUIETLY)
  39. ELSE (CUPS_FOUND)
  40. SET(CUPS_LIBRARIES )
  41. IF (Cups_FIND_REQUIRED)
  42. MESSAGE(FATAL_ERROR "Could NOT find Cups")
  43. ENDIF (Cups_FIND_REQUIRED)
  44. ENDIF (CUPS_FOUND)
  45. MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)