@@ -171,20 +171,6 @@ endif ()
171
171
172
172
set (SOURCE_DIR "${PROJECT_SOURCE_DIR} /" )
173
173
174
- if (ENABLE_MONGOC STREQUAL ON )
175
- add_subdirectory (src/libmongoc )
176
- endif ()
177
-
178
- set (CPACK_RESOURCE_FILE_LICENSE "${SOURCE_DIR} /COPYING" )
179
-
180
- include (CPack )
181
-
182
- if (NOT ENABLE_ZLIB MATCHES "SYSTEM|AUTO|BUNDLED|OFF" )
183
- message (FATAL_ERROR
184
- "ENABLE_ZLIB option must be SYSTEM, BUNDLED, AUTO, or OFF"
185
- )
186
- endif ()
187
-
188
174
set (ZLIB_SOURCES
189
175
${SOURCE_DIR} /src/zlib-1.2.11/adler32.c
190
176
${SOURCE_DIR} /src/zlib-1.2.11/crc32.c
@@ -203,59 +189,13 @@ set (ZLIB_SOURCES
203
189
${SOURCE_DIR} /src/zlib-1.2.11/gzwrite.c
204
190
)
205
191
206
- # Disable warnings on bundled zlib source files.
207
- set_source_files_properties (${ZLIB_SOURCES} PROPERTIES COMPILE_FLAGS -w )
208
-
209
- # Copy zconf.h.in to zconf.h; even when using system zlib, the 'dist' target
210
- # will look for zconf.h in that location.
211
- configure_file (
212
- "${SOURCE_DIR} /src/zlib-1.2.11/zconf.h.in"
213
- "${PROJECT_BINARY_DIR} /src/zlib-1.2.11/zconf.h"
214
- COPYONLY
215
- )
216
- if (ENABLE_ZLIB MATCHES "SYSTEM|AUTO" )
217
- message (STATUS "Searching for zlib CMake packages" )
218
- include (FindZLIB )
219
- if (ZLIB_FOUND )
220
- message ("-- zlib found version \" ${ZLIB_VERSION_STRING} \" " )
221
- message ("-- zlib include path \" ${ZLIB_INCLUDE_DIRS} \" " )
222
- message ("-- zlib libraries \" ${ZLIB_LIBRARIES} \" " )
223
- include_directories ("${ZLIB_INCLUDE_DIRS} " )
224
- else ()
225
- if (ENABLE_ZLIB STREQUAL "SYSTEM" )
226
- message (FATAL_ERROR
227
- "Unable to find system zlib package. Either specify the zlib \
228
- location by setting ZLIB_ROOT, or else set ENABLE_ZLIB=BUNDLED or \
229
- set ENABLE_ZLIB=OFF."
230
- )
231
- endif ()
232
- set (ZLIB_LIBRARIES "" )
233
- endif ()
192
+ if (ENABLE_MONGOC STREQUAL ON )
193
+ add_subdirectory (src/libmongoc )
234
194
endif ()
235
195
236
- if ( (ENABLE_ZLIB STREQUAL "BUNDLED" )
237
- OR (ENABLE_ZLIB STREQUAL "AUTO" AND NOT ZLIB_FOUND ) )
238
- message (STATUS "Enabling zlib compression (bundled)" )
239
- set (SOURCES ${SOURCES} ${ZLIB_SOURCES} )
240
-
241
- list (
242
- APPEND
243
- MONGOC_INTERNAL_INCLUDE_DIRS
244
- "${SOURCE_DIR} /src/zlib-1.2.11"
245
- "${PROJECT_BINARY_DIR} /src/zlib-1.2.11"
246
- )
247
- endif ()
196
+ set (CPACK_RESOURCE_FILE_LICENSE "${SOURCE_DIR} /COPYING" )
248
197
249
- if (NOT ENABLE_ZLIB STREQUAL "OFF" )
250
- # At this point the system zlib was found, or the bundled library was used
251
- include (CheckIncludeFiles )
252
- check_include_files ("unistd.h" HAVE_UNISTD_H )
253
- check_include_files ("stdarg.h" HAVE_STDARG_H )
254
- set (MONGOC_ENABLE_COMPRESSION 1 )
255
- set (MONGOC_ENABLE_COMPRESSION_ZLIB 1 )
256
- else ()
257
- message (STATUS "Disabling zlib compression" )
258
- endif ()
198
+ include (CPack )
259
199
260
200
# Ensure the default behavior: don't ignore RPATH settings.
261
201
set (CMAKE_SKIP_BUILD_RPATH OFF )
0 commit comments