From 47bb2aa964f79cb2b6e6f277ed13b382390119ea Mon Sep 17 00:00:00 2001 From: DonRumata710 Date: Thu, 19 Jun 2025 00:48:10 +0400 Subject: [PATCH 1/2] #226 provide correct BZip2 information for in-project build --- CMakeLists.txt | 12 ++++++++++++ quazip/QuaZipConfig.cmake.in | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 188e994e..7683a6b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,8 @@ if(QUAZIP_BZIP2) list(APPEND QUAZIP_LBD ${BZIP2_LIBRARY_DIRS}) set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lbzip2") + + set(QUAZIP_BZIP2_BUILD FALSE) elseif(QUAZIP_FETCH_LIBS) clone_repo(bzip2 https://sourceware.org/git/bzip2.git) @@ -193,6 +195,14 @@ if(QUAZIP_BZIP2) add_library(bzip2 STATIC ${BZIP2_SRC} ${BZIP2_HDR}) + set_target_properties(bzip2 PROPERTIES + PUBLIC_HEADER "${BZIP2_SOURCE_DIR}/bzlib.h" + ) + target_include_directories(bzip2 PUBLIC + $ + $ + ) + if(NOT QUAZIP_BZIP2_STDIO) target_compile_definitions(bzip2 PRIVATE -DBZ_NO_STDIO) endif() @@ -200,6 +210,8 @@ if(QUAZIP_BZIP2) list(APPEND QUAZIP_DEP bzip2) list(APPEND QUAZIP_LIB bzip2) list(APPEND QUAZIP_INC ${BZIP2_SOURCE_DIR}) + + set(QUAZIP_BZIP2_BUILD ON) else() message(STATUS "BZip2 library not found") diff --git a/quazip/QuaZipConfig.cmake.in b/quazip/QuaZipConfig.cmake.in index 4179c76a..ff33007c 100644 --- a/quazip/QuaZipConfig.cmake.in +++ b/quazip/QuaZipConfig.cmake.in @@ -14,7 +14,7 @@ else() message(FATAL_ERROR "Qt version QUAZIP_QT_MAJOR_VERSION=@QUAZIP_QT_MAJOR_VERSION@ is unsupported") endif() -if(@QUAZIP_BZIP2@) +if(@QUAZIP_BZIP2@ AND NOT @QUAZIP_BZIP2_BUILD@) find_dependency(BZip2 REQUIRED) endif() From 1a255ead0e21573fcc584cad68bba1a6aca3b004 Mon Sep 17 00:00:00 2001 From: DonRumata710 Date: Sat, 16 Aug 2025 23:56:25 +0400 Subject: [PATCH 2/2] test fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7683a6b3..fc1ed36b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,7 +200,7 @@ if(QUAZIP_BZIP2) ) target_include_directories(bzip2 PUBLIC $ - $ + $ ) if(NOT QUAZIP_BZIP2_STDIO)