diff options
author | David Faure <faure@kde.org> | 2006-04-20 12:25:46 +0000 |
---|---|---|
committer | David Faure <faure@kde.org> | 2006-04-20 12:25:46 +0000 |
commit | 9a75f145de53a04eca02dd5da5c2ab092f67d2f0 (patch) | |
tree | 246e6e63b638374354d3496365be8b0064397a11 /modules/FindBZip2.cmake | |
parent | 672022196187fa0d0b412c01f70de04b3827bbaf (diff) | |
download | extra-cmake-modules-9a75f145de53a04eca02dd5da5c2ab092f67d2f0.tar.gz extra-cmake-modules-9a75f145de53a04eca02dd5da5c2ab092f67d2f0.tar.bz2 |
OK so FIND_PATH and FIND_LIBRARIES use the cache already, so no need for the CACHED_FOO fast-path
when the check only uses those. Instead I used this, to avoid "Found libfoo" in the output when in
fact we didn't just look for it, we had it in the cache.
+if (TIFF_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(TIFF_FIND_QUIETLY TRUE)
+endif (TIFF_INCLUDE_DIR)
CACHED_FOO remains for the cases where there is more logic to the configure check, like
PKGCONFIG, foo-config, or CHECK_LIBRARY_EXISTS (e.g. bzip2)
CCMAIL: kde-buildsystem@kde.org
svn path=/trunk/KDE/kdelibs/; revision=531839
Diffstat (limited to 'modules/FindBZip2.cmake')
-rw-r--r-- | modules/FindBZip2.cmake | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/modules/FindBZip2.cmake b/modules/FindBZip2.cmake index 0f05e0bf..9976c282 100644 --- a/modules/FindBZip2.cmake +++ b/modules/FindBZip2.cmake @@ -8,14 +8,12 @@ # BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_ -IF (DEFINED CACHED_BZIP2) +if (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES) - # in cache already - IF ("${CACHED_BZIP2}" STREQUAL "YES") - SET(BZIP2_FOUND TRUE) - ENDIF ("${CACHED_BZIP2}" STREQUAL "YES") + # in cache already, avoid doing the CHECK_LIBRARY_EXISTS again. + SET(BZIP2_FOUND TRUE) -ELSE (DEFINED CACHED_BZIP2) +else (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES) FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h /usr/include @@ -32,9 +30,6 @@ ELSE (DEFINED CACHED_BZIP2) set(BZIP2_FOUND TRUE) INCLUDE(CheckLibraryExists) CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARIES} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX) - set(CACHED_BZIP2 "YES") - else (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES) - set(CACHED_BZIP2 "NO") endif (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES) if (BZIP2_FOUND) @@ -47,7 +42,6 @@ ELSE (DEFINED CACHED_BZIP2) endif (BZip2_FIND_REQUIRED) endif (BZIP2_FOUND) - set(CACHED_BZIP2 ${CACHED_BZIP2} CACHE INTERNAL "If bzip2 was checked") MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES) -ENDIF(DEFINED CACHED_BZIP2) +endif (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES) |