Skip to content
Tcl Source Code Artifact [25c3c6e088]
Login

Artifact [25c3c6e088]

Artifact 25c3c6e088e7c532c9119bf2b8deedcb546a94a991343da498a86da2165de686:


set(_MINIZIP_supported_components "shared" "static")
include(CMakeFindDependencyMacro)

set(minizip_HAS_BZIP2
    "@MINIZIP_ENABLE_BZIP2@"
    CACHE
    BOOL
    "Indicates if minizip was compiled with bzip2 support")

if(minizip_HAS_BZIP2)
    find_dependency(BZip2)
endif(minizip_HAS_BZIP2)

if(minizip_FIND_COMPONENTS)
    find_dependency(ZLIB CONFIG COMPONENTS ${minizip_FIND_COMPONENTS})

    foreach(_comp ${minizip_FIND_COMPONENTS})
        if(NOT _comp IN_LIST _MINIZIP_supported_components)
            set(minizip_FOUND False)
            set(minizip_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
        endif(NOT _comp IN_LIST _MINIZIP_supported_components)

        include("${CMAKE_CURRENT_LIST_DIR}/minizip-${_comp}.cmake"
            OPTIONAL
            RESULT_VARIABLE _comp_loaded)

        if(NOT _comp_loaded)
            set(minizip_FOUND False)
            set(minizip_NOT_FOUND_MESSAGE "Component ${_comp} not found.")
        else(NOT _comp_loaded)
            set(minizip_${_comp}_FOUND TRUE)
        endif(NOT _comp_loaded)
    endforeach(_comp ${minizip_FIND_COMPONENTS})
else(minizip_FIND_COMPONENTS)
    find_dependency(ZLIB CONFIG)

    foreach(_component_config IN LISTS _MINIZIP_supported_components)
        include("${CMAKE_CURRENT_LIST_DIR}/minizip-${_component_config}.cmake"
                OPTIONAL)
    endforeach(_component_config IN LISTS _MINIZIP_supported_components)

    if(NOT TARGET MINIZIP::minizip)
        set(minizip_FOUND False)
        set(minizip_NOT_FOUND_MESSAGE "Target ZLIB::ZLIB not created\n")
        string(APPEND minizip_NOT_FOUND_MESSAGE "build minizip with support for shared libs or\n")
        string(APPEND minizip_NOT_FOUND_MESSAGE "specify COMPONENTS static in your find_package call")
    endif(NOT TARGET MINIZIP::minizip)

    if(NOT TARGET MINIZIP::minizipstatic)
        set(minizip_FOUND False)
        set(minizip_NOT_FOUND_MESSAGE "Target ZLIB::ZLIBSTATIC not created\n")
        string(APPEND minizip_NOT_FOUND_MESSAGE "build minizip with support for static libs or\n")
        string(APPEND minizip_NOT_FOUND_MESSAGE "specify COMPONENTS shared in your find_package call")
    endif(NOT TARGET MINIZIP::minizipstatic)
endif(minizip_FIND_COMPONENTS)