1 # - Try to find the Cups printing system
2 # Once done this will define
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)
10 # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
12 # Redistribution and use is allowed according to the terms of the BSD license.
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
16 INCLUDE(CheckLibraryExists)
18 FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h )
20 FIND_LIBRARY(CUPS_LIBRARIES NAMES cups )
22 IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
25 # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
26 CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
27 IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
29 ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
31 ELSE (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
33 ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
36 IF (NOT Cups_FIND_QUIETLY)
37 MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}")
38 ENDIF (NOT Cups_FIND_QUIETLY)
41 IF (Cups_FIND_REQUIRED)
42 MESSAGE(FATAL_ERROR "Could NOT find Cups")
43 ENDIF (Cups_FIND_REQUIRED)
47 MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)