[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs
From: Alexander Neundorf <neundorf () kde ! org>
Date: 2006-11-30 21:15:13
Message-ID: 1164921313.991299.27360.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 609455 by neundorf:
the logic which for dealing with ippDeleteAttribute was buggy:
when invoked the second time, CUPS_FOUND became true even although ippDeleteAttribute \
didn't exist, since in this case only the include dir and the lib variables were \
checked
additionally (in order to sync back to cmake cvs) don't always fail if \
ippDeleteAttribute doesn't exist, but make this optional (enabled in \
kdeprint/CMakeLists.txt by setting CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE)
Alex
M +30 -34 cmake/modules/FindCups.cmake
M +3 -0 kdeprint/CMakeLists.txt
--- trunk/KDE/kdelibs/cmake/modules/FindCups.cmake #609454:609455
@@ -4,48 +4,44 @@
# CUPS_FOUND - system has Cups
# CUPS_INCLUDE_DIR - the Cups include directory
# CUPS_LIBRARIES - Libraries needed to use Cups
-# CUPS_DEFINITIONS - Compiler switches required for using 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 (c) 2006, Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
+INCLUDE(CheckLibraryExists)
- # in cache already
- SET(CUPS_FOUND TRUE)
+FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h )
-else (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
+FIND_LIBRARY(CUPS_LIBRARIES NAMES cups )
- FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h
- /usr/include
- /usr/local/include
- )
+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)
- FIND_LIBRARY(CUPS_LIBRARIES NAMES cups
- PATHS
- /usr/lib
- /usr/local/lib
- )
+MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
- if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
- # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
- check_library_exists(cups ippDeleteAttribute "" CUPS_FOUND)
- 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)
-
-endif (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
--- trunk/KDE/kdelibs/kdeprint/CMakeLists.txt #609454:609455
@@ -12,6 +12,9 @@
# you can find macro_optional_find_package() in \
kdelibs/cmake/modules/OptionalFindPackage.cmake # it is the same as \
FIND_PACKAGE(<name>) but additionally creates an OPTION(WITH_<name>) # so the \
checking for the software can be disabled via ccmake or -DWITH_<name>=OFF +
+# we need a version of cups which has ippDeleteAttribute(), so we have to tell the \
FindCups module so, Alex +set(CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE TRUE)
macro_optional_find_package(Cups)
macro_log_feature(CUPS_FOUND "CUPS" "The CUPS (Common UNIX Printing System)" \
"http://www.cups.org" FALSE "" "Provide CUPS support in kdeprint.")
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic