Skip to content

Commit

Permalink
Use "ZLIB_LIBRARY" instead of "ZLIB_LIBRARIES" as expected by FindZLIB
Browse files Browse the repository at this point in the history
See #17
  • Loading branch information
jcfr committed Apr 29, 2013
1 parent 87d8601 commit be39470
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions README
Expand Up @@ -111,8 +111,9 @@ CMake options:
USE_SYSTEM_ZLIB=ON|OFF (defaults to ON)
If set to OFF, no attempt to detect ZLIB libraries will be done.
Associated python extensions are: BINASCII, ZLIB
Following CMake variables can manually be set: ZLIB_LIBRARIES, ZLIB_INCLUDE_DIR
If [ZLIB_LIBRARIES, ZLIB_INCLUDE_DIR] are found, extensions [BINASCII] will be built with ZLIB_CRC32
Following CMake variables can manually be set: ZLIB_LIBRARY, ZLIB_INCLUDE_DIR, ZLIB_ROOT
ZLIB_ROOT should be set only if USE_SYSTEM_ZLIB is ON
If [ZLIB_LIBRARY, ZLIB_INCLUDE_DIR] are found, extensions [BINASCII] will be built with ZLIB_CRC32

USE_SYSTEM_DB=ON|OFF (defaults to ON)
If set to OFF, no attempt to detect DB libraries will be done.
Expand Down
6 changes: 3 additions & 3 deletions cmake/ConfigureChecks.cmake
Expand Up @@ -1452,18 +1452,18 @@ endif(HAVE_SIZE_T_FORMAT)

##########################################################

if(ZLIB_LIBRARIES)
if(ZLIB_LIBRARY)
cmake_push_check_state()
set(CFG_HEADERS_SAVE ${CFG_HEADERS})

set(CFG_HEADERS ${CFG_HEADERS} zlib.h)
add_cond(CMAKE_REQUIRED_INCLUDES ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIR})
add_cond(CMAKE_REQUIRED_LIBRARIES ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
add_cond(CMAKE_REQUIRED_LIBRARIES ZLIB_LIBRARY ${ZLIB_LIBRARY})
check_symbol_exists(inflateCopy "${CFG_HEADERS}" HAVE_ZLIB_COPY)

set(CFG_HEADERS ${CFG_HEADERS_SAVE})
cmake_pop_check_state()
endif(ZLIB_LIBRARIES)
endif(ZLIB_LIBRARY)

############################################

Expand Down
8 changes: 4 additions & 4 deletions cmake/extensions/CMakeLists.txt
Expand Up @@ -241,15 +241,15 @@ add_python_extension(_sha512 REQUIRES OPENSSL_NOT_FOUND SOURCES sha512module.c)
# Extensions that depend on other libraries
set(binascii_REQUIRES "")
set(binascii_DEFINITIONS "")
if(ZLIB_LIBRARIES)
if(ZLIB_LIBRARY)
list(APPEND binascii_REQUIRES ZLIB_INCLUDE_DIR)
list(APPEND binascii_DEFINITIONS USE_ZLIB_CRC32)
endif()
add_python_extension(binascii
REQUIRES ${binascii_REQUIRES}
SOURCES binascii.c
DEFINITIONS ${binascii_DEFINITIONS}
LIBRARIES ${ZLIB_LIBRARIES}
LIBRARIES ${ZLIB_LIBRARY}
INCLUDEDIRS ${ZLIB_INCLUDE_DIR}
)
add_python_extension(_bsddb
Expand Down Expand Up @@ -338,9 +338,9 @@ add_python_extension(_tkinter
INCLUDEDIRS ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH}
)
add_python_extension(zlib
REQUIRES ZLIB_LIBRARIES ZLIB_INCLUDE_DIR
REQUIRES ZLIB_LIBRARY ZLIB_INCLUDE_DIR
SOURCES zlibmodule.c
LIBRARIES ${ZLIB_LIBRARIES}
LIBRARIES ${ZLIB_LIBRARY}
INCLUDEDIRS ${ZLIB_INCLUDE_DIR}
)

Expand Down

0 comments on commit be39470

Please sign in to comment.