diff options
author | Graham Bloice <graham.bloice@trihedral.com> | 2015-03-30 14:03:22 +0100 |
---|---|---|
committer | Graham Bloice <graham.bloice@trihedral.com> | 2015-04-07 20:51:26 +0000 |
commit | 69a435bb082578eaf191fa1ce27929b869c29788 (patch) | |
tree | f1351d19332d991bfae633a16bcdaf5deb5b69f5 | |
parent | 77f87b7a012daa84056d16010e4d92447fe05651 (diff) |
Add zlib compilation to CMake on Windows
Modify CMake to compile zlib, removing need for an nmake compilation
of zlib before running CMake.
Change-Id: I63cead55b14d6a2e22b1b6a8536eaf9260e21231
Reviewed-on: https://code.wireshark.org/review/7864
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ecd5240012..58ed434a49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -620,6 +620,20 @@ endif() # Zlib compression if(ENABLE_ZLIB) + if (WIN32) + # On Windows we build our own version of zlib, so add the paths + if( DEFINED ENV{WIRESHARK_LIB_DIR} ) + # The buildbots set WIRESHARK_LIB_DIR but not WIRESHARK_BASE_DIR. + file( TO_CMAKE_PATH "$ENV{WIRESHARK_LIB_DIR}" _PROJECT_LIB_DIR ) + else() + file( TO_CMAKE_PATH "$ENV{WIRESHARK_BASE_DIR}" _WS_BASE_DIR ) + set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" ) + endif() + set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.8") + add_subdirectory("${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib") + set(ZLIB_INCLUDE_DIR "${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib") + set(ZLIB_LIBRARY zlib) + endif() set(PACKAGELIST ${PACKAGELIST} ZLIB) endif() @@ -1305,13 +1319,6 @@ if(WIN32) "${_dll_output_dir}" ) endif(WINSPARKLE_FOUND) - if (ZLIB_FOUND) - add_custom_command(TARGET copy_cli_dlls PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${ZLIB_DLL_DIR}/${ZLIB_DLL}" - "${_dll_output_dir}" - ) - endif(ZLIB_FOUND) add_dependencies(epan copy_cli_dlls) |