include(FetchContent)

if(NOT DEFINED KTX_REPO)
    set(KTX_REPO https://github.com/KhronosGroup/KTX-Software.git)
endif ()

FetchContent_Declare(
    ktx
    EXCLUDE_FROM_ALL
    GIT_REPOSITORY ${KTX_REPO}
    GIT_TAG v4.3.2
    GIT_SHALLOW TRUE
)

set(LIB_TYPE_DEFAULT OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(BASISU_SUPPORT_SSE OFF CACHE BOOL "" FORCE)
set(KTX_FEATURE_STATIC_LIBRARY ON CACHE BOOL "" FORCE)

FetchContent_MakeAvailable(ktx)