From 4c146d9e0766bf84d21fd08255afafdff233ffd1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 1 May 2013 00:32:17 -0400 Subject: [PATCH] Fix "binascii" configure error happening when no zlib is found This commit will prevent the following error from occurring when configuring using the default option where no zlib is installed on the system: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: ZLIB_INCLUDE_DIR (ADVANCED) used as include directory in directory C:/D/W/CPython-64-VS2010/Continuous/CPython-64-cl-VS2010-Win64/cmake/extensions ZLIB_LIBRARY (ADVANCED) linked by target "extension_binascii" in directory C:/D/W/CPython-64-VS2010/Continuous/CPython-64-cl-VS2010-Win64/cmake/extensions See #15 --- cmake/extensions/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/extensions/CMakeLists.txt b/cmake/extensions/CMakeLists.txt index 6f91dbb27..9b03687bf 100644 --- a/cmake/extensions/CMakeLists.txt +++ b/cmake/extensions/CMakeLists.txt @@ -241,16 +241,20 @@ add_python_extension(_sha512 REQUIRES OPENSSL_NOT_FOUND SOURCES sha512module.c) # Extensions that depend on other libraries set(binascii_REQUIRES "") set(binascii_DEFINITIONS "") +set(binascii_LIBRARIES "") +set(binascii_INCLUDEDIRS "") if(ZLIB_LIBRARY) list(APPEND binascii_REQUIRES ZLIB_INCLUDE_DIR) list(APPEND binascii_DEFINITIONS USE_ZLIB_CRC32) + list(APPEND binascii_LIBRARIES ${ZLIB_LIBRARY}) + list(APPEND binascii_INCLUDEDIRS ${ZLIB_INCLUDE_DIR}) endif() add_python_extension(binascii REQUIRES ${binascii_REQUIRES} SOURCES binascii.c DEFINITIONS ${binascii_DEFINITIONS} - LIBRARIES ${ZLIB_LIBRARY} - INCLUDEDIRS ${ZLIB_INCLUDE_DIR} + LIBRARIES ${binascii_LIBRARIES} + INCLUDEDIRS ${binascii_INCLUDEDIRS} ) add_python_extension(_bsddb REQUIRES DB_INCLUDE_PATH DB_LIBRARIES