From 39b48f2357b0b783815be88031b738376fa228e0 Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Thu, 19 Feb 2015 02:51:00 +1100 Subject: Upgrade Heimdall Frontend to Qt5 and build with cmake --- heimdall-frontend/CMakeLists.txt | 48 +++++++++++++++++++++++++++++++++ heimdall-frontend/Source/aboutform.cpp | 2 ++ heimdall-frontend/Source/aboutform.h | 6 +++++ heimdall-frontend/Source/main.cpp | 7 +++-- heimdall-frontend/Source/mainwindow.cpp | 2 +- heimdall-frontend/mainwindow.ui | 11 -------- 6 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 heimdall-frontend/CMakeLists.txt (limited to 'heimdall-frontend') diff --git a/heimdall-frontend/CMakeLists.txt b/heimdall-frontend/CMakeLists.txt new file mode 100644 index 0000000..a21db5a --- /dev/null +++ b/heimdall-frontend/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 2.8.4) + +project(heimdall-frontend) + +set(LIBPIT_INCLUDE_DIRS + ../libpit/Source) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) # moc files are generated in build (current) directory + +find_package(Qt5Widgets REQUIRED) +find_package(ZLIB REQUIRED) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static") + +include_directories(${LIBPIT_INCLUDE_DIRS}) + +set(HEIMDALL_FRONTEND_SOURCE_FILES + Source/aboutform.cpp + Source/Alerts.cpp + Source/FirmwareInfo.cpp + Source/main.cpp + Source/mainwindow.cpp + Source/PackageData.cpp + Source/Packaging.cpp) + +qt5_wrap_ui(HEIMDALL_FRONTEND_FORMS + mainwindow.ui + aboutform.ui) + +qt5_add_resources(HEIMDALL_FRONTEND_RESOURCES + mainwindow.qrc) + +add_executable(heimdall-frontend WIN32 + ${HEIMDALL_FRONTEND_SOURCE_FILES} + ${HEIMDALL_FRONTEND_FORMS} + ${HEIMDALL_FRONTEND_RESOURCES}) + +include(LargeFiles) +use_large_files(heimdall-frontend YES) + +set_property(TARGET heimdall-frontend + APPEND PROPERTY COMPILE_DEFINITIONS "QT_LARGEFILE_SUPPORT") + +target_link_libraries(heimdall-frontend pit) +target_link_libraries(heimdall-frontend Qt5::Widgets) +target_link_libraries(heimdall-frontend z) diff --git a/heimdall-frontend/Source/aboutform.cpp b/heimdall-frontend/Source/aboutform.cpp index 9f04c6b..fbb3fb1 100644 --- a/heimdall-frontend/Source/aboutform.cpp +++ b/heimdall-frontend/Source/aboutform.cpp @@ -25,6 +25,8 @@ // Heimdall Frontend #include "aboutform.h" +#include + #define UNUSED(x) (void)(x) using namespace HeimdallFrontend; diff --git a/heimdall-frontend/Source/aboutform.h b/heimdall-frontend/Source/aboutform.h index 0c02f08..4b6a8e3 100644 --- a/heimdall-frontend/Source/aboutform.h +++ b/heimdall-frontend/Source/aboutform.h @@ -18,6 +18,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ +#ifndef ABOUTFORM_H +#define ABOUTFORM_H + // Qt #include #include @@ -50,3 +53,6 @@ namespace HeimdallFrontend void HandleHeimdallError(QProcess::ProcessError error); }; } + +#endif + diff --git a/heimdall-frontend/Source/main.cpp b/heimdall-frontend/Source/main.cpp index 41e018d..c327b63 100644 --- a/heimdall-frontend/Source/main.cpp +++ b/heimdall-frontend/Source/main.cpp @@ -19,17 +19,20 @@ THE SOFTWARE.*/ // Qt -#include +#include +#include // Heimdall Frontend #include "mainwindow.h" +Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin); + using namespace HeimdallFrontend; int main(int argc, char *argv[]) { QApplication application(argc, argv); - + MainWindow window; window.show(); diff --git a/heimdall-frontend/Source/mainwindow.cpp b/heimdall-frontend/Source/mainwindow.cpp index f122034..74d9500 100644 --- a/heimdall-frontend/Source/mainwindow.cpp +++ b/heimdall-frontend/Source/mainwindow.cpp @@ -836,7 +836,7 @@ void MainWindow::SelectPit(void) for (int i = 0; i < partitionNamesCount; i++) { - const PitEntry *pitEntry = currentPitData.FindEntry(partitionNames[i].toAscii().constData()); + const PitEntry *pitEntry = currentPitData.FindEntry(partitionNames[i].toLatin1().constData()); if (pitEntry) { diff --git a/heimdall-frontend/mainwindow.ui b/heimdall-frontend/mainwindow.ui index ce42a89..f3113f2 100644 --- a/heimdall-frontend/mainwindow.ui +++ b/heimdall-frontend/mainwindow.ui @@ -53,17 +53,6 @@ QTabWidget::Rounded - - - 0 - 0 - - - - - MS Shell Dlg 2 - - true -- cgit v1.1