libarchive: Cleanup after ZLIB_WINAPI check

Clear CMAKE_REQUIRED_(INCLUDES|LIBRARIES) so that the rest of the checks
after this one do not try to link zlib.
This commit is contained in:
Brad King 2012-01-03 18:32:35 -05:00
parent f15d75760f
commit 6781a09940
1 changed files with 2 additions and 0 deletions

View File

@ -174,6 +174,8 @@ IF(ZLIB_FOUND)
CHECK_C_SOURCE_Runs( CHECK_C_SOURCE_Runs(
"#ifndef ZLIB_WINAPI\n#define ZLIB_WINAPI\n#endif\n#include <zlib.h>\nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" "#ifndef ZLIB_WINAPI\n#define ZLIB_WINAPI\n#endif\n#include <zlib.h>\nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }"
ZLIB_WINAPI) ZLIB_WINAPI)
SET(CMAKE_REQUIRED_INCLUDES)
SET(CMAKE_REQUIRED_LIBRARIES)
ENDIF(WIN32 AND NOT CYGWIN) ENDIF(WIN32 AND NOT CYGWIN)
ELSE(ZLIB_FOUND) ELSE(ZLIB_FOUND)
MESSAGE(FATAL_ERROR "CMake requires zlib to be available to libarchive") MESSAGE(FATAL_ERROR "CMake requires zlib to be available to libarchive")