Commit 32623cf6 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Fix linking to debug build of zlib on Windows.

Enabled NEW CMake policy 0022 to avoid warning.
parent 2a989b33
Pipeline #433 failed with stage
in 0 seconds
......@@ -5,6 +5,7 @@ RelWithDebInfo MinSizeRel.")
PROJECT(Nektar++ C CXX)
CMAKE_POLICY(SET CMP0022 NEW)
# Nektar++ requires C++11. Try to infer this for older CMake versions (less than
# 3.1.0)
IF ("${CMAKE_VERSION}" VERSION_LESS "3.1")
......
......@@ -53,16 +53,24 @@ IF (THIRDPARTY_BUILD_ZLIB)
IF (WIN32)
THIRDPARTY_LIBRARY(ZLIB_LIBRARIES STATIC zlib DESCRIPTION "Zlib library")
THIRDPARTY_LIBRARY(ZLIB_LIBRARIES_DEBUG STATIC zlibd DESCRIPTION "Zlib library")
ELSE ()
THIRDPARTY_LIBRARY(ZLIB_LIBRARIES SHARED z DESCRIPTION "Zlib library")
THIRDPARTY_LIBRARY(ZLIB_LIBRARIES_DEBUG SHARED z DESCRIPTION "Zlib library")
ENDIF ()
MESSAGE(STATUS "Build Zlib: ${ZLIB_LIBRARIES}")
MESSAGE(STATUS "Build Zlib: ")
MESSAGE(STATUS " -- Optimized: ${ZLIB_LIBRARIES}")
MESSAGE(STATUS " -- Debug: ${ZLIB_LIBRARIES_DEBUG}")
SET(ZLIB_INCLUDE_DIR ${TPDIST}/include CACHE PATH "Zlib include" FORCE)
SET(ZLIB_CONFIG_INCLUDE_DIR ${TPINC})
ELSE (THIRDPARTY_BUILD_ZLIB)
ADD_CUSTOM_TARGET(zlib-1.2.7 ALL)
MESSAGE(STATUS "Found Zlib: ${ZLIB_LIBRARIES} (version ${ZLIB_VERSION_STRING})")
# We use the found library also for debug builds.
SET(ZLIB_LIBRARIES_DEBUG ${ZLIB_LIBRARIES})
SET(ZLIB_CONFIG_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS})
ENDIF (THIRDPARTY_BUILD_ZLIB)
......
......@@ -378,7 +378,7 @@ TARGET_LINK_LIBRARIES(LibUtilities LINK_PUBLIC
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${ZLIB_LIBRARIES}
optimized ${ZLIB_LIBRARIES} debug ${ZLIB_LIBRARIES_DEBUG}
)
# TinyXML
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment