aboutsummaryrefslogtreecommitdiff
path: root/modules/FindCups.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2006-04-18 11:22:38 +0000
committerDavid Faure <faure@kde.org>2006-04-18 11:22:38 +0000
commit2b43aad081d13bdeb2ed8a65f65fbecfb470da0d (patch)
tree405e268ae2040a0266b2921ea2fa3ce8ffaded57 /modules/FindCups.cmake
parentf0436915e149f27532c6aece815e3169794dc72b (diff)
downloadextra-cmake-modules-2b43aad081d13bdeb2ed8a65f65fbecfb470da0d.tar.gz
extra-cmake-modules-2b43aad081d13bdeb2ed8a65f65fbecfb470da0d.tar.bz2
More use of the cache; fixing previous commit to not recheck everytime when something isn't available (e.g. agg for me).
svn path=/trunk/KDE/kdelibs/; revision=531000
Diffstat (limited to 'modules/FindCups.cmake')
-rw-r--r--modules/FindCups.cmake63
1 files changed, 38 insertions, 25 deletions
diff --git a/modules/FindCups.cmake b/modules/FindCups.cmake
index 0be87208..387d82d9 100644
--- a/modules/FindCups.cmake
+++ b/modules/FindCups.cmake
@@ -7,31 +7,44 @@
# CUPS_DEFINITIONS - Compiler switches required for using Cups
#
+IF (DEFINED CACHED_CUPS)
-FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h
- /usr/include
- /usr/local/include
-)
+ # in cache already
+ IF ("${CACHED_CUPS}" STREQUAL "YES")
+ SET(CUPS_FOUND TRUE)
+ ENDIF ("${CACHED_CUPS}" STREQUAL "YES")
-FIND_LIBRARY(CUPS_LIBRARIES NAMES cups
- PATHS
- /usr/lib
- /usr/local/lib
-)
+ELSE (DEFINED CACHED_CUPS)
-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)
- 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)
+ FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h
+ /usr/include
+ /usr/local/include
+ )
+
+ FIND_LIBRARY(CUPS_LIBRARIES NAMES cups
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ )
+
+ 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)
+ set (CACHED_CUPS "YES")
+ if (NOT Cups_FIND_QUIETLY)
+ message(STATUS "Found Cups: ${CUPS_LIBRARIES}")
+ endif (NOT Cups_FIND_QUIETLY)
+ else (CUPS_FOUND)
+ set (CACHED_CUPS "NO")
+ if (Cups_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find Cups")
+ endif (Cups_FIND_REQUIRED)
+ endif (CUPS_FOUND)
+
+ set(CACHED_CUPS ${CACHED_CUPS} CACHE INTERNAL "If cups was checked")
+ MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
+
+ENDIF (DEFINED CACHED_CUPS)