File: zlib.cmake

package info (click to toggle)
opentelemetry-cpp 1.23.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,372 kB
  • sloc: cpp: 96,239; sh: 1,766; makefile: 36; python: 31
file content (20 lines) | stat: -rw-r--r-- 760 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

# ZLIB must be found as an installed package for now.
# Fetching ZLIB and building in-tree is not supported.
# Protobuf, gRPC, prometheus-cpp, civetweb, CURL, and other dependencies require ZLIB and import its target.
# When ZLIB::ZLIB is an alias of the shared library then inconsistent linking may occur.

find_package(ZLIB REQUIRED)
set(ZLIB_PROVIDER "find_package")

# Set the ZLIB_VERSION from the legacy ZLIB_VERSION_STRING Required for CMake
# versions below 3.26
if(NOT ZLIB_VERSION AND ZLIB_VERSION_STRING)
  set(ZLIB_VERSION ${ZLIB_VERSION_STRING})
endif()

if(NOT TARGET ZLIB::ZLIB)
  message(FATAL_ERROR "The required zlib target (ZLIB::ZLIB) was not imported.")
endif()