diff --git a/CMakeLists.txt b/CMakeLists.txt index 5712cf8..88bad96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,7 +389,6 @@ set(KTX_MAIN_SRC external/basisu/transcoder/basisu_transcoder.cpp external/basisu/transcoder/basisu_transcoder.h external/basisu/transcoder/basisu.h - external/basisu/zstd/zstd.c lib/checkheader.c external/dfdutils/createdfd.c external/dfdutils/colourspaces.c @@ -608,12 +607,12 @@ macro(common_libktx_settings target enable_write library_type) ${KTX_BASISU_INCLUDE_DIRS} external - $ - $ $ $ ) + find_package(zstd CONFIG REQUIRED) + target_link_libraries(${target} PRIVATE zstd::libzstd) target_include_directories( ${target} @@ -972,10 +971,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") external/basisu/transcoder/basisu_transcoder.cpp "-Wno-sign-compare;-Wno-unused-function;-Wno-unused-variable" ) - set_source_files_properties( - external/basisu/zstd/zstd.c - PROPERTIES COMPILE_OPTIONS "-Wno-unused-function" - ) endif() else() message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} not yet supported.") diff --git a/cmake/KtxConfig.cmake b/cmake/KtxConfig.cmake index 6386ba2..c932dd4 100644 --- a/cmake/KtxConfig.cmake +++ b/cmake/KtxConfig.cmake @@ -4,4 +4,8 @@ # include(CMakeFindDependencyMacro) # find_dependency() +include(CMakeFindDependencyMacro) +find_dependency(Threads) +find_dependency(zstd CONFIG) + include("${CMAKE_CURRENT_LIST_DIR}/KtxTargets.cmake")