From 49f4d3ad6a2c046033910f44c9d2817066838148 Mon Sep 17 00:00:00 2001 From: Alexander Yee Date: Sun, 24 Nov 2024 02:59:16 -0800 Subject: [PATCH] Fix debug build. Add version info. --- SerialPrograms/CMakeLists.txt | 2 +- .../Source/CommonFramework/Globals.cpp | 17 +++++++++- .../Source/CommonFramework/Globals.h | 2 ++ .../CommonFramework/Windows/MainWindow.cpp | 34 +++++++++++-------- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index e99ece0f0..d92f3c330 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -2086,7 +2086,7 @@ endif() #extract opencv_world460d.dll from archive on Windows Debug builds if (MSVC) if (CMAKE_BUILD_TYPE MATCHES "Debug") - file(ARCHIVE_EXTRACT INPUT ../3rdPartyBinaries/opencv_world460d.zip DESTINATION ../3rdPartyBinaries/) + file(ARCHIVE_EXTRACT INPUT ../../../3rdPartyBinaries/opencv_world460d.zip DESTINATION ../../../3rdPartyBinaries/) endif() endif() diff --git a/SerialPrograms/Source/CommonFramework/Globals.cpp b/SerialPrograms/Source/CommonFramework/Globals.cpp index 1762a2a5a..1a18607d3 100644 --- a/SerialPrograms/Source/CommonFramework/Globals.cpp +++ b/SerialPrograms/Source/CommonFramework/Globals.cpp @@ -25,7 +25,7 @@ namespace PokemonAutomation{ const bool IS_BETA_VERSION = true; const int PROGRAM_VERSION_MAJOR = 0; const int PROGRAM_VERSION_MINOR = 50; -const int PROGRAM_VERSION_PATCH = 3; +const int PROGRAM_VERSION_PATCH = 4; const std::string PROGRAM_VERSION_BASE = "v" + std::to_string(PROGRAM_VERSION_MAJOR) + @@ -52,6 +52,21 @@ const std::string PROJECT_GITHUB = "github.com/PokemonAutomation"; const std::string PROJECT_GITHUB_URL = "https://github.com/PokemonAutomation/"; const std::string PROJECT_SOURCE_URL = "https://github.com/PokemonAutomation/Arduino-Source/"; +#if 0 +#elif __INTEL_LLVM_COMPILER +const std::string COMPILER_VERSION = "ICX " + std::to_string(__VERSION__); +#elif __INTEL_COMPILER +const std::string COMPILER_VERSION = "ICC " + std::to_string(__INTEL_COMPILER) + "." + std::to_string(__INTEL_COMPILER_UPDATE); +#elif _MSC_VER +const std::string COMPILER_VERSION = "MSVC " + std::to_string(_MSC_FULL_VER); +#elif __clang__ +const std::string COMPILER_VERSION = "Clang " + std::string(__clang_version__); +#elif __GNUC__ +const std::string COMPILER_VERSION = "GCC " + std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__); +#else +const std::string COMPILER_VERSION = "Unknown Compiler"; +#endif + namespace{ diff --git a/SerialPrograms/Source/CommonFramework/Globals.h b/SerialPrograms/Source/CommonFramework/Globals.h index d4e6a428f..1b190b097 100644 --- a/SerialPrograms/Source/CommonFramework/Globals.h +++ b/SerialPrograms/Source/CommonFramework/Globals.h @@ -28,6 +28,8 @@ extern const std::string PROJECT_GITHUB; extern const std::string PROJECT_GITHUB_URL; extern const std::string PROJECT_SOURCE_URL; +extern const std::string COMPILER_VERSION; + const auto SERIAL_REFRESH_RATE = std::chrono::milliseconds(1000); // Folder path (end with "/") to hold program setting files. diff --git a/SerialPrograms/Source/CommonFramework/Windows/MainWindow.cpp b/SerialPrograms/Source/CommonFramework/Windows/MainWindow.cpp index e269b5625..05cb1f0e7 100644 --- a/SerialPrograms/Source/CommonFramework/Windows/MainWindow.cpp +++ b/SerialPrograms/Source/CommonFramework/Windows/MainWindow.cpp @@ -22,9 +22,9 @@ #include "MainWindow.h" -#include -using std::cout; -using std::endl; +//#include +//using std::cout; +//using std::endl; namespace PokemonAutomation{ @@ -119,19 +119,23 @@ MainWindow::MainWindow(QWidget* parent) connect( about, &QLabel::linkActivated, this, [](const QString&){ + std::string str; + str += PROGRAM_NAME + " Computer-Control Programs
"; + str += "Copyright: 2020 - 2025
"; + str += "Version: " + PROGRAM_VERSION + "
"; + str += "
"; + str += "Framwork: Qt " + std::to_string(QT_VERSION_MAJOR); + str += "." + std::to_string(QT_VERSION_MINOR); + str += "." + std::to_string(QT_VERSION_PATCH); + str += "
"; + str += "Compiler: " + COMPILER_VERSION; + str += "

"; + str += "Made by the " + PROGRAM_NAME + " Discord Server.
"; + str += "
"; + str += "This program uses Qt and dynamically links to unmodified Qt libraries under LGPL.
"; + QMessageBox box; - box.information( - nullptr, - "About", - QString::fromStdString( - PROGRAM_NAME + " Computer-Control Programs (" + PROGRAM_VERSION + ")
" + - "Copyright: 2020 - 2022
" + - "
" - "Made by the " + PROGRAM_NAME + " Discord Server.
" - "
" - "This program uses Qt and dynamically links to unmodified Qt libraries under LGPL.
" - ) - ); + box.information(nullptr, "About", QString::fromStdString(str)); } ); }