Description: Use the CMake package and target names the system lz4/zstd export The WITH_SYSTEM_DEFLATE branch looks for a CMake package called "libzstd" and links against the bare targets "lz4_shared" and "libzstd_shared". Those names only exist in the else() branch, where the vendored ext/lz4 and ext/zstd subprojects are pulled in with add_subdirectory(). . The installed lz4 and zstd both export a config package and namespaced imported targets instead: . lz4Config.cmake -> LZ4::lz4_shared, LZ4::lz4_static, LZ4::lz4 zstdConfig.cmake -> zstd::libzstd_shared, zstd::libzstd_static, zstd::libzstd . Use those, matching the libdeflate::libdeflate_shared already on the same line. This is not Debian-specific: the names come from lz4's and zstd's own upstream CMake install rules, so the fix should apply anywhere the system libraries are used, and is worth forwarding upstream. . Based on a patch by Stuart Prescott, extended to link the namespaced imported targets rather than fall back to bare -llz4 / -lzstd. Author: Stuart Prescott Forwarded: https://github.com/danielhrisca/asammdf/pull/1314 Last-Update: 2026-09-10 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,8 @@ python_add_library(cutils MODULE WITH_SO if (WITH_SYSTEM_DEFLATE) find_package(libdeflate REQUIRED) find_package(lz4 REQUIRED) - find_package(libzstd REQUIRED) - target_link_libraries(cutils PRIVATE Python::NumPy libdeflate::libdeflate_shared lz4_shared libzstd_shared) + find_package(zstd REQUIRED) + target_link_libraries(cutils PRIVATE Python::NumPy libdeflate::libdeflate_shared LZ4::lz4_shared zstd::libzstd_shared) else() # Add submodule libdeflate set(CMAKE_POSITION_INDEPENDENT_CODE ON)