summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:27:26 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:27:26 -0700
commit7751bd4c715ea8478113e34b49b5a794a4642e8e (patch)
tree537ba82b3780f933c2f17028febd6fe3a2332190 /CMakeLists.txt
parente0ff940e1adb68d3575705ebf1546d9f07ad3b4a (diff)
downloadzlib-7751bd4c715ea8478113e34b49b5a794a4642e8e.tar.gz
zlib 1.2.3.9v1.2.3.9
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea0fa99..b129ef2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,7 +50,7 @@ endif()
#
# Check for unistd.h
#
-check_include_file(unistd.h HAVE_UNISTD_H)
+check_include_file(unistd.h Z_HAVE_UNISTD_H)
#
# Check for errno.h
@@ -65,6 +65,21 @@ if(MSVC)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()
+if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
+ # If we're doing an out of source build and the user has a zconf.h
+ # in their source tree...
+ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
+ message(FATAL_ERROR "You must remove zconf.h from the source tree. This f
+ile is generated by the ./configure script shipped with zlib. CMake generates t
+his file for you automatically in the build directory")
+ endif()
+endif()
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h @ONLY)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+
#============================================================================
# zlib
#============================================================================
@@ -90,7 +105,6 @@ set(ZLIB_SRCS
crc32.c
deflate.c
gzclose.c
- gzio.c
gzlib.c
gzread.c
gzwrite.c