diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-07-18 17:56:45 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-07-18 17:56:45 (GMT) |
commit | b5f656e0de6e39f0fd935203e0ef2b4231af733d (patch) | |
tree | 8b58020cca8fef8af4df6ae631fddf49e3230049 /Modules/FindPNG.cmake | |
parent | e118a62709fdc84e6c5b5b8d0bb055895d206ec9 (diff) | |
download | CMake-b5f656e0de6e39f0fd935203e0ef2b4231af733d.zip CMake-b5f656e0de6e39f0fd935203e0ef2b4231af733d.tar.gz CMake-b5f656e0de6e39f0fd935203e0ef2b4231af733d.tar.bz2 |
ENH: use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules, remove some of the extra search paths which are also searched by
default
Alex
Diffstat (limited to 'Modules/FindPNG.cmake')
-rw-r--r-- | Modules/FindPNG.cmake | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index c082c01..3b776e7 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -11,26 +11,18 @@ # PNG depends on Zlib INCLUDE(FindZLIB) -SET(PNG_FOUND "NO") - IF(ZLIB_FOUND) FIND_PATH(PNG_PNG_INCLUDE_DIR png.h - /usr/local/include - /usr/include /usr/local/include/libpng # OpenBSD ) SET(PNG_NAMES ${PNG_NAMES} png libpng) - FIND_LIBRARY(PNG_LIBRARY - NAMES ${PNG_NAMES} - PATHS /usr/lib /usr/local/lib - ) + FIND_LIBRARY(PNG_LIBRARY NAMES ${PNG_NAMES} ) IF (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR) # png.h includes zlib.h. Sigh. SET(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY}) - SET(PNG_FOUND "YES") IF (CYGWIN) IF(BUILD_SHARED_LIBS) @@ -44,14 +36,9 @@ IF(ZLIB_FOUND) ENDIF(ZLIB_FOUND) -IF (PNG_FOUND) - IF (NOT PNG_FIND_QUIETLY) - MESSAGE(STATUS "Found PNG: ${PNG_LIBRARY}") - ENDIF (NOT PNG_FIND_QUIETLY) -ELSE (PNG_FOUND) - IF (PNG_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find PNG library") - ENDIF (PNG_FIND_REQUIRED) -ENDIF (PNG_FOUND) +# handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PNG PNG_LIBRARY PNG_PNG_INCLUDE_DIR) MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR PNG_LIBRARY ) |