diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2018-11-23 20:39:47 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2018-11-30 10:52:58 +0000 |
commit | dd457b08783e89e36e6e9e886438b7d7602c66fb (patch) | |
tree | fc3129d32116dd149aa582a2b3d5f9bdfc57afb7 /CMakeLists.txt | |
parent | 2bcc8dbf267bb33aae5c62d93653b0e1d3105a1b (diff) |
CMake: Generate cmake target exports on Windows
CMake requires zlib to be added to the exports via epan and wiretap
targets.
Ping-Bug: 15301
Change-Id: I5cfe746e67c195eb83b1d159a2cc2a645c8c47ea
Reviewed-on: https://code.wireshark.org/review/30793
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f7b5cddea7..de8d8019c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -996,10 +996,15 @@ endif() if(ENABLE_ZLIB) if (WIN32) # On Windows we build our own version of zlib, so add the paths - set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.11-ws") - set(SKIP_INSTALL_ALL True) # We copy the DLL ourselves. + set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.11-1-ws") + set(SKIP_INSTALL_STATIC True) + set(SKIP_INSTALL_HEADERS True) + set(SKIP_INSTALL_FILES True) + set(ZLIB_EXPORTS "WiresharkTargets") add_subdirectory("${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib") - unset(SKIP_INSTALL_ALL) + unset(SKIP_INSTALL_STATIC) + unset(SKIP_INSTALL_HEADERS) + unset(SKIP_INSTALL_FILES) set(ZLIB_INCLUDE_DIR "${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib") set(ZLIB_LIBRARY zlib) set(ZLIB_DLL "zlib1.dll") @@ -2968,21 +2973,17 @@ write_basic_package_version_file( COMPATIBILITY AnyNewerVersion ) -# XXX On Windows wsutil depends on a CMake zlib target for which there are no -# exports. -if(NOT WIN32) - install( - FILES - ${CMAKE_BINARY_DIR}/WiresharkConfig.cmake - ${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake - DESTINATION - ${WIRESHARK_INSTALL_CMAKEDIR} - ) +install( + FILES + ${CMAKE_BINARY_DIR}/WiresharkConfig.cmake + ${CMAKE_BINARY_DIR}/WiresharkConfigVersion.cmake + DESTINATION + ${WIRESHARK_INSTALL_CMAKEDIR} +) - install(EXPORT WiresharkTargets - DESTINATION ${WIRESHARK_INSTALL_CMAKEDIR} - ) -endif() +install(EXPORT WiresharkTargets + DESTINATION ${WIRESHARK_INSTALL_CMAKEDIR} +) if (DOXYGEN_EXECUTABLE) # API reference |