Browse Source

CMake: Use boost_{zlib,bzip2} when statically linking Boost

The official Windows binaries for Boost come with these renamed versions
of the zlib and bzip2 libraries.
pull/86/head
Daniel Scharrer 8 years ago
parent
commit
516a1563cb
  1. 30
      CMakeLists.txt

30
CMakeLists.txt

@ -149,19 +149,23 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIR})
has_static_libs(Boost Boost_LIBRARIES)
if(Boost_HAS_STATIC_LIBS)
use_static_libs(ZLIB)
find_package(ZLIB REQUIRED)
use_static_libs_restore()
check_link_library(ZLIB ZLIB_LIBRARIES)
list(APPEND LIBRARIES ${ZLIB_LIBRARIES})
use_static_libs(BZip2)
find_package(BZip2 REQUIRED)
use_static_libs_restore()
check_link_library(BZip2 BZIP2_LIBRARIES)
list(APPEND LIBRARIES ${BZIP2_LIBRARIES})
foreach(Lib IN ITEMS ZLIB BZip2)
string(TOUPPER ${Lib} LIB)
string(TOLOWER ${Lib} lib)
use_static_libs(${Lib})
if(WIN32)
find_package(Boost COMPONENTS ${lib} QUIET)
endif()
if(Boost_${LIB}_FOUND)
message (STATUS "Found boost_${lib}")
set(${LIB}_LIBRARIES ${Boost_${LIB}_LIBRARY})
else()
find_package(${Lib} REQUIRED)
endif()
use_static_libs_restore()
check_link_library(${Lib} ${LIB}_LIBRARIES)
list(APPEND LIBRARIES ${${LIB}_LIBRARIES})
endforeach()
endif()
set(INNOEXTRACT_HAVE_ICONV 0)

Loading…
Cancel
Save