abelayer / AbZip

Qt based Zip/Unzip Archive classes
GNU General Public License v2.0
2 stars 0 forks source link

Works in Ubuntu with Qt5 but I have to manually hack in CMake #1

Open artemis-beta opened 2 years ago

artemis-beta commented 2 years ago

The macro:

#if QT_VERSION >= 0x050000
#include <QtZlib/zlib.h>
#else
#include <zlib.h>
#endif

fails for me. After some online searching it looks like this header was a private one no longer present in Qt. In order to get this to work I have to manually copy zlib.h to a location as QtZlib/zlib.h to mock the behaviour. I have added AbZip as a git submodule to my project:

# AbZip assumes QtZlib/zlib.h exists when it does not so have to dummy it
add_custom_target( MOCK_QTLZIB 
    COMMAND ${CMAKE_COMMAND} -E copy ${ZLIB_INCLUDE_DIRS}/zlib.h ${CMAKE_BINARY_DIR}/QtZlib/zlib.h
)
target_include_directories( ${ABZIP} PUBLIC ${CMAKE_BINARY_DIR}/zlib )
add_dependencies( ${ABZIP} MOCK_QTLZIB )

I recommend removing this and adding the requirement for zlib.h or finding another way of doing this.

But I can confirm this works! Also does exactly what I have been wanting to do so thank you :slightly_smiling_face:

artemis-beta commented 2 years ago

Repository of project: https://github.com/Railway-Op-Sim/ROSPkgManager