From d852a34ef70723f314c32dd7554967a175db75ba Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 1 Jan 2025 13:00:46 +0100 Subject: [PATCH] CMake: use the system bzip2 if it exists It's found on macOS and sometimes Linux. --- libmatroska2/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libmatroska2/CMakeLists.txt b/libmatroska2/CMakeLists.txt index 68747ab8..4eb705cc 100644 --- a/libmatroska2/CMakeLists.txt +++ b/libmatroska2/CMakeLists.txt @@ -58,14 +58,23 @@ if (CONFIG_ZLIB) target_link_libraries("matroska2" PRIVATE $) endif() endif(CONFIG_ZLIB) + if (CONFIG_LZO1X) add_subdirectory("minilzo") target_link_libraries("matroska2" PRIVATE $) endif(CONFIG_LZO1X) + if (CONFIG_BZLIB) - add_subdirectory("bzip2") - target_link_libraries("matroska2" PRIVATE $) + find_package (BZip2) + if(BZIP2_FOUND) + target_include_directories("matroska2" PRIVATE ${BZIP2_INCLUDE_DIRS}) + target_link_libraries("matroska2" PRIVATE ${BZIP2_LIBRARIES}) + else() + add_subdirectory("bzip2") + target_link_libraries("matroska2" PRIVATE $) + endif() endif(CONFIG_BZLIB) + if (NOT CONFIG_NOCODEC_HELPER) add_subdirectory("tremor") target_link_libraries("matroska2" PRIVATE $)