whiteoutlib 0.1.6

Read and write Blizzard game assets from Rust: models (MDX, M2, M3), textures (BLP, DDS, PNG, JPEG, BMP, TGA, TIFF, GIF) and archives (CASC, MPQ).
Documentation
@PACKAGE_INIT@

# Transitive dependencies: when the installed library was built with
# libcurl support, CURL::libcurl appears in whiteout_lib's INTERFACE
# link libraries — re-discover it on the consumer side so the import
# resolves cleanly.
include(CMakeFindDependencyMacro)

# zlib-ng is an OPTIONAL DEFLATE backend. When WhiteoutLib was built with
# WHITEOUT_USE_ZLIBNG=ON it is a PUBLIC link dependency of whiteout_lib, so the
# imported target is rediscovered here (bundled-and-installed or system/vcpkg
# alike). When built with the in-house codec there is no such dependency.
if(@WHITEOUT_USE_ZLIBNG@)
    find_dependency(zlib-ng CONFIG)
endif()

if(@CURL_FOUND@)
    find_dependency(CURL)
endif()

include("${CMAKE_CURRENT_LIST_DIR}/WhiteoutLibTargets.cmake")

# Convenience: re-export the cores under their bare names so users can
# write `target_link_libraries(app PRIVATE WhiteoutLib::whiteout_lib)`
# regardless of whether CASC / MPQ are part of this install.
set(WhiteoutLib_AVAILABLE_COMPONENTS lib)
if(TARGET WhiteoutLib::whiteout_casc)
    list(APPEND WhiteoutLib_AVAILABLE_COMPONENTS casc)
endif()
if(TARGET WhiteoutLib::whiteout_mpq)
    list(APPEND WhiteoutLib_AVAILABLE_COMPONENTS mpq)
endif()

# Honour `find_package(WhiteoutLib REQUIRED COMPONENTS casc mpq)`:
# if the user explicitly asked for casc/mpq but this install was built
# without them, fail loudly instead of silently providing only the core.
foreach(_comp ${WhiteoutLib_FIND_COMPONENTS})
    if(NOT _comp IN_LIST WhiteoutLib_AVAILABLE_COMPONENTS)
        set(WhiteoutLib_${_comp}_FOUND FALSE)
        if(WhiteoutLib_FIND_REQUIRED_${_comp})
            set(WhiteoutLib_FOUND FALSE)
            set(WhiteoutLib_NOT_FOUND_MESSAGE
                "WhiteoutLib was installed without the '${_comp}' component. "
                "Available: ${WhiteoutLib_AVAILABLE_COMPONENTS}.")
            return()
        endif()
    else()
        set(WhiteoutLib_${_comp}_FOUND TRUE)
    endif()
endforeach()

check_required_components(WhiteoutLib)