diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
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() | |||
50 | # | 50 | # |
51 | # Check for unistd.h | 51 | # Check for unistd.h |
52 | # | 52 | # |
53 | check_include_file(unistd.h HAVE_UNISTD_H) | 53 | check_include_file(unistd.h Z_HAVE_UNISTD_H) |
54 | 54 | ||
55 | # | 55 | # |
56 | # Check for errno.h | 56 | # Check for errno.h |
@@ -65,6 +65,21 @@ if(MSVC) | |||
65 | add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) | 65 | add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) |
66 | endif() | 66 | endif() |
67 | 67 | ||
68 | if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) | ||
69 | # If we're doing an out of source build and the user has a zconf.h | ||
70 | # in their source tree... | ||
71 | if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h) | ||
72 | message(FATAL_ERROR "You must remove zconf.h from the source tree. This f | ||
73 | ile is generated by the ./configure script shipped with zlib. CMake generates t | ||
74 | his file for you automatically in the build directory") | ||
75 | endif() | ||
76 | endif() | ||
77 | |||
78 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.in | ||
79 | ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h @ONLY) | ||
80 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) | ||
81 | |||
82 | |||
68 | #============================================================================ | 83 | #============================================================================ |
69 | # zlib | 84 | # zlib |
70 | #============================================================================ | 85 | #============================================================================ |
@@ -90,7 +105,6 @@ set(ZLIB_SRCS | |||
90 | crc32.c | 105 | crc32.c |
91 | deflate.c | 106 | deflate.c |
92 | gzclose.c | 107 | gzclose.c |
93 | gzio.c | ||
94 | gzlib.c | 108 | gzlib.c |
95 | gzread.c | 109 | gzread.c |
96 | gzwrite.c | 110 | gzwrite.c |