File: FindCups.cmake

package info (click to toggle)
cmake 2.8.2%2Bdfsg.1-0%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 33,480 kB
  • ctags: 24,561
  • sloc: cpp: 132,113; ansic: 118,916; yacc: 3,246; xml: 2,420; sh: 2,206; lex: 1,023; awk: 731; makefile: 509; python: 228; lisp: 204; f90: 105; perl: 99; fortran: 72; tcl: 55; asm: 28; php: 25; ruby: 22; java: 20
file content (56 lines) | stat: -rw-r--r-- 1,989 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# - Try to find the Cups printing system
# Once done this will define
#
#  CUPS_FOUND - system has Cups
#  CUPS_INCLUDE_DIR - the Cups include directory
#  CUPS_LIBRARIES - Libraries needed to use Cups
#  Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which 
#  features this function (i.e. at least 1.1.19)

#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
#  License text for the above reference.)

INCLUDE(CheckLibraryExists)

FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h )

FIND_LIBRARY(CUPS_LIBRARIES NAMES cups )

IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
   SET(CUPS_FOUND TRUE)

   # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
   CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
   IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
      SET(CUPS_FOUND FALSE)
   ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)

ELSE  (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
   SET(CUPS_FOUND FALSE)
ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)

IF (CUPS_FOUND)
   IF (NOT Cups_FIND_QUIETLY)
      MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}")
   ENDIF (NOT Cups_FIND_QUIETLY)
ELSE (CUPS_FOUND)
   SET(CUPS_LIBRARIES )
   IF (Cups_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could NOT find Cups")
   ENDIF (Cups_FIND_REQUIRED)
ENDIF (CUPS_FOUND)
  
  
MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)