aboutsummaryrefslogtreecommitdiff
path: root/modules/FindGIF.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2006-04-20 12:25:46 +0000
committerDavid Faure <faure@kde.org>2006-04-20 12:25:46 +0000
commit9a75f145de53a04eca02dd5da5c2ab092f67d2f0 (patch)
tree246e6e63b638374354d3496365be8b0064397a11 /modules/FindGIF.cmake
parent672022196187fa0d0b412c01f70de04b3827bbaf (diff)
downloadextra-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/FindGIF.cmake')
-rw-r--r--modules/FindGIF.cmake66
1 files changed, 28 insertions, 38 deletions
diff --git a/modules/FindGIF.cmake b/modules/FindGIF.cmake
index c809b243..8ea3043a 100644
--- a/modules/FindGIF.cmake
+++ b/modules/FindGIF.cmake
@@ -7,44 +7,34 @@
# GIF_DEFINITIONS - Compiler switches required for using GIF
#
-IF (DEFINED CACHED_GIF)
+if (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
+ # Already in cache, be silent
+ set(GIF_FIND_QUIETLY TRUE)
+endif (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
- # in cache already
- IF ("${CACHED_GIF}" STREQUAL "YES")
- SET(GIF_FOUND TRUE)
- ENDIF ("${CACHED_GIF}" STREQUAL "YES")
+FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
+ /usr/include
+ /usr/local/include
+)
-ELSE (DEFINED CACHED_GIF)
+FIND_LIBRARY(GIF_LIBRARIES NAMES gif libgif ungif libungif giflib
+ PATHS
+ /usr/lib
+ /usr/local/lib
+)
- FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
- /usr/include
- /usr/local/include
- )
-
- FIND_LIBRARY(GIF_LIBRARIES NAMES gif libgif ungif libungif giflib
- PATHS
- /usr/lib
- /usr/local/lib
- )
-
- if (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
- set(GIF_FOUND TRUE)
- set(CACHED_GIF "YES")
- else (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
- set(CACHED_GIF "NO")
- endif (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
-
- if (GIF_FOUND)
- if (NOT GIF_FIND_QUIETLY)
- message(STATUS "Found GIF: ${GIF_LIBRARIES}")
- endif (NOT GIF_FIND_QUIETLY)
- else (GIF_FOUND)
- if (GIF_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find GIF")
- endif (GIF_FIND_REQUIRED)
- endif (GIF_FOUND)
-
- set(CACHED_GIF ${CACHED_GIF} CACHE INTERNAL "If gif was checked")
- MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARIES)
-
-ENDIF (DEFINED CACHED_GIF)
+if (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
+ set(GIF_FOUND TRUE)
+endif (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
+
+if (GIF_FOUND)
+ if (NOT GIF_FIND_QUIETLY)
+ message(STATUS "Found GIF: ${GIF_LIBRARIES}")
+ endif (NOT GIF_FIND_QUIETLY)
+else (GIF_FOUND)
+ if (GIF_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find GIF")
+ endif (GIF_FIND_REQUIRED)
+endif (GIF_FOUND)
+
+MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARIES)