summaryrefslogtreecommitdiff
path: root/indra/cmake/ZLIBNG.cmake
blob: 60164116dd9aceab7f4d00a0a283f52d15a89360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- cmake -*-

include(Prebuilt)

include_guard()
add_library( ll::zlib-ng INTERFACE IMPORTED )

if(USE_CONAN )
  target_link_libraries( ll::zlib-ng INTERFACE CONAN_PKG::zlib )
  return()
elseif(NOT USE_AUTOBUILD_3P)
  pkg_check_modules(Zlib REQUIRED zlib)
  target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${Zlib_INCLUDE_DIRS})
  target_link_directories( ll::zlib-ng INTERFACE ${Zlib_LIBRARY_DIRS} )
  target_link_libraries( ll::zlib-ng INTERFACE ${Zlib_LIBRARIES})
  return()
endif()

use_prebuilt_binary(zlib-ng)
if (WINDOWS)
  target_link_libraries( ll::zlib-ng INTERFACE zlib )
else()
  target_link_libraries( ll::zlib-ng INTERFACE z )
endif (WINDOWS)

if( NOT LINUX )
  target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/zlib-ng)
endif()