File: zlib.cmake

package info (click to toggle)
audacity 3.7.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 125,252 kB
  • sloc: cpp: 358,238; ansic: 75,458; lisp: 7,761; sh: 3,410; python: 1,503; xml: 1,385; perl: 854; makefile: 122
file content (39 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download | duplicates (4)
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
29
30
31
32
33
34
35
36
37
38
39
# ZLib is a very popular library to use.
# Some of the dependencies do not check for the system libraries,
# which can be problematic.
# We need to call find_package once again.
if (${_OPT}use_zlib STREQUAL "system")
    message(STATUS "Fixing up ZLib mess...")
    
    find_package(ZLIB REQUIRED)

    set_target_properties(ZLIB::ZLIB PROPERTIES
        INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")

    if(ZLIB_LIBRARY_RELEASE)
        set_property(TARGET ZLIB::ZLIB APPEND PROPERTY
            IMPORTED_CONFIGURATIONS RELEASE)
        
        set_property(TARGET ZLIB::ZLIB
            PROPERTY INTERFACE_LINK_LIBRARIES 
            "${ZLIB_LIBRARY_RELEASE}"
        )
    endif()

    if(ZLIB_LIBRARY_DEBUG)
        set_property(TARGET ZLIB::ZLIB APPEND PROPERTY
            IMPORTED_CONFIGURATIONS DEBUG)

        set_property(TARGET ZLIB::ZLIB
            PROPERTY INTERFACE_LINK_LIBRARIES 
            "${ZLIB_LIBRARY_DEBUG}"
        )
    endif()

    if(NOT ZLIB_LIBRARY_RELEASE AND NOT ZLIB_LIBRARY_DEBUG)
        set_property(TARGET ZLIB::ZLIB
            PROPERTY INTERFACE_LINK_LIBRARIES 
            "${ZLIB_LIBRARY}"
        )
    endif()
endif()