Commit ac30a73d authored by Leander Schulten's avatar Leander Schulten
Browse files

Use kubazip instead of quazip

parent d80c7e59
Pipeline #444134 passed with stage
in 9 minutes and 4 seconds
......@@ -155,8 +155,6 @@ RUN make qtquickcontrols2
RUN make qtserialport
RUN make qttools
RUN make qtwebsockets
RUN make zlib
RUN make quazip
#set path to mxe compiler
RUN export PATH=/usr/src/mxe/usr/bin:$PATH
......@@ -175,6 +175,10 @@ target_compile_definitions(lichtsteuerung PRIVATE USE_SPAN_LITE)
# SingleApplication
# target_link_libraries(${PROJECT_NAME} SingleApplication::SingleApplication)
# kubazip
find_package(kubazip REQUIRED)
target_link_libraries(lichtsteuerung kubazip::kubazip)
# Qt MQTT
target_include_directories(lichtsteuerung PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/qtmqtt/include)
if(APPLE)
......@@ -189,21 +193,3 @@ endif()
target_include_directories(lichtsteuerung PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/segvcatch/include)
target_link_directories(lichtsteuerung PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/segvcatch/lib)
target_link_libraries(lichtsteuerung segvcatch)
# Quazip
target_include_directories(lichtsteuerung PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/dist/include)
#target_link_directories(lichtsteuerung PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/dist/lib)
if(DEFINED ENV{GITLAB_CI})
# in the gitlab CI quazip and zlib is build by mxe
target_link_directories(lichtsteuerung PRIVATE /usr/src/mxe/usr/x86_64-w64-mingw32.shared.posix/bin)
target_link_libraries(lichtsteuerung quazip zlib1)
elseif(UNIX)
target_link_libraries(lichtsteuerung "-L${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/dist/lib -lQt5Quazip")
target_link_libraries(lichtsteuerung "-lz")
elseif(WIN32)
target_link_directories(lichtsteuerung PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/dist/bin)
target_link_libraries(lichtsteuerung Qt5Quazip1)
target_link_directories(lichtsteuerung PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/quazip/zlib_windows/bin)
target_link_libraries(lichtsteuerung zlib1)
endif()
......@@ -15,10 +15,5 @@ cd qtmqtt
./getAndUpdate.sh
cd ..
echo $'\n\nUpdate quazip'
cd quazip
./update_and_build.sh
cd ..
echo "Lib installation complete"
......@@ -9,7 +9,7 @@
#include <QProcess>
#include <QTemporaryFile>
#include <QtConcurrent/QtConcurrentRun>
#include <quazip/JlCompress.h>
#include <zip/zip.h>
QByteArray getFileContent(const QString & filename){
QFile file(filename);
......@@ -27,6 +27,11 @@ Updater::Updater(){
}
}
QFuture<bool> extractZip(const QFile &file) {
return QtConcurrent::run(
[path = QFileInfo(file).absoluteFilePath().toStdString(), dest = QFileInfo(file).absolutePath().toStdString()] { return zip_extract(path.c_str(), dest.c_str(), nullptr, nullptr) == 0; });
}
void Updater::checkForUpdate(){
if(state == UpdaterState::IDE_ENV){
return;
......@@ -80,7 +85,7 @@ void Updater::checkForUpdate(){
});
// Start the computation.
QFuture<bool> future = QtConcurrent::run([path = QFileInfo(version).absoluteFilePath(), dest = QFileInfo(version).absolutePath()] { return !JlCompress::extractDir(path, dest).empty(); });
QFuture<bool> future = extractZip(version);
watcher->setFuture(future);
});
}
......@@ -165,7 +170,7 @@ void Updater::update(){
});
// Start the computation.
QFuture<bool> future = QtConcurrent::run([path = QFileInfo(*deploy).absoluteFilePath(), dest = QFileInfo(*deploy).absolutePath()] { return !JlCompress::extractDir(path, dest).empty(); });
QFuture<bool> future = extractZip(*deploy);
watcher->setFuture(future);
});
}
......
......@@ -8,9 +8,10 @@
"libbacktrace",
"span-lite",
"rtaudio",
"kubazip",
{
"name": "aubio",
"default-features": false
}
]
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment