File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,8 @@ if(QUAZIP_BZIP2)
176176 list (APPEND QUAZIP_LBD ${BZIP2_LIBRARY_DIRS} )
177177
178178 set (PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lbzip2" )
179+
180+ set (QUAZIP_BZIP2_BUILD FALSE )
179181 elseif (QUAZIP_FETCH_LIBS)
180182 clone_repo(bzip2 https://sourceware.org/git/bzip2.git)
181183
@@ -196,13 +198,23 @@ if(QUAZIP_BZIP2)
196198
197199 add_library (bzip2 STATIC ${BZIP2_SRC} ${BZIP2_HDR} )
198200
201+ set_target_properties (bzip2 PROPERTIES
202+ PUBLIC_HEADER "${BZIP2_SOURCE_DIR} /bzlib.h"
203+ )
204+ target_include_directories (bzip2 PUBLIC
205+ $<BUILD_INTERFACE:${BZIP2_SOURCE_DIR} >
206+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >
207+ )
208+
199209 if (NOT QUAZIP_BZIP2_STDIO)
200210 target_compile_definitions (bzip2 PRIVATE -DBZ_NO_STDIO)
201211 endif ()
202212
203213 list (APPEND QUAZIP_DEP bzip2)
204214 list (APPEND QUAZIP_LIB bzip2)
205215 list (APPEND QUAZIP_INC ${BZIP2_SOURCE_DIR} )
216+
217+ set (QUAZIP_BZIP2_BUILD ON )
206218 else ()
207219 message (STATUS "BZip2 library not found" )
208220
Original file line number Diff line number Diff line change 1414 message (FATAL_ERROR "Qt version QUAZIP_QT_MAJOR_VERSION=@QUAZIP_QT_MAJOR_VERSION@ is unsupported" )
1515endif ()
1616
17- if (@QUAZIP_BZIP2@)
17+ if (@QUAZIP_BZIP2@ AND NOT @QUAZIP_BZIP2_BUILD@ )
1818 find_dependency(BZip2 REQUIRED)
1919endif ()
2020
You can’t perform that action at this time.
0 commit comments