diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-24 19:19:12 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-25 03:10:04 +0000 |
commit | 5ae6a9bea6ba943e6c674799a7b906b3dffed157 (patch) | |
tree | fef4b31f355e52fae8757d7e2e6e741556022c31 /cmake/modules/FindZLIB.cmake | |
parent | c66994215b4f0344d7ec6f9340ed79e647053018 (diff) |
Do FIND_PACKAGE_HANDLE_STANDARD_ARGS() before checking ZLIB_FOUND.
It's what sets {package}_FOUND.
Combine two "do this if zlib was found" blocks.
Change-Id: I55062a11c7ae7e6f32886615a0201df55f700d1e
Reviewed-on: https://code.wireshark.org/review/32974
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'cmake/modules/FindZLIB.cmake')
-rw-r--r-- | cmake/modules/FindZLIB.cmake | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake index 28b4b4bbe9..d0bfb1a455 100644 --- a/cmake/modules/FindZLIB.cmake +++ b/cmake/modules/FindZLIB.cmake @@ -68,6 +68,12 @@ if (NOT ZLIB_INCLUDE_DIR OR NOT ZLIB_LIBRARY) endif() MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) +# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR + VERSION_VAR ZLIB_VERSION_STRING) + if(ZLIB_FOUND) IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") FILE(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") @@ -121,15 +127,7 @@ if(ZLIB_FOUND) # reset CMAKE_POP_CHECK_STATE() ENDIF() -ENDIF() - -# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR - VERSION_VAR ZLIB_VERSION_STRING) -IF(ZLIB_FOUND) AddWSWinDLL(ZLIB ZLIB_HINTS "zlib*") SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) |