diff --git a/src/ifcviewer/CMakeLists.txt b/src/ifcviewer/CMakeLists.txt index 127cd67cf8..36301d683c 100644 --- a/src/ifcviewer/CMakeLists.txt +++ b/src/ifcviewer/CMakeLists.txt @@ -227,11 +227,8 @@ if(EMSCRIPTEN) target_sources(IfcViewerCore PRIVATE ${ZSTD_DEC_SRC}) target_include_directories(IfcViewerCore PRIVATE ${ZSTD_DEC_DIR}) else() - find_library(ZSTD_LIBRARY NAMES zstd libzstd) - if(NOT ZSTD_LIBRARY) - message(FATAL_ERROR "libzstd not found (needed for .ifcview compression)") - endif() - target_link_libraries(IfcViewerCore PUBLIC ${ZSTD_LIBRARY}) + find_package(zstd CONFIG REQUIRED) + target_link_libraries(IfcViewerCore PUBLIC zstd::libzstd_static) endif() install(TARGETS IfcViewerCore EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})