Skip to content

Commit

Permalink
Add proper version+hash appending in about dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
SeongGino committed Dec 6, 2024
1 parent 39cca97 commit e012fe4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ if(NOT NERO_QT_VERSIONS)
set(NERO_QT_VERSIONS Qt6)
endif()

option(NERO_VERSION "Sets Nero version number" OFF)
option(NERO_GITHASH "Sets Nero git hash" OFF)

if(NERO_VERSION)
add_compile_definitions(NERO_VERSION="${NERO_VERSION}")
endif()

if(NERO_GITHASH)
add_compile_definitions(NERO_GITHASH="${NERO_GITHASH}")
endif()

find_package(QT NAMES ${NERO_QT_VERSIONS} COMPONENTS Widgets LinguistTools REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools REQUIRED)

Expand Down
6 changes: 3 additions & 3 deletions src/neromanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,12 @@ void NeroManagerWindow::on_actionAbout_Nero_triggered()
// TODO: better about screen pls
QString vInfo;
#ifdef NERO_VERSION
vInfo.append(QString("v%1").arg(NERO_VERSION));
vInfo.append(" v" + QString(NERO_VERSION));
#endif // NERO_VERSION
#ifdef NERO_GITHASH
vInfo.append(QString("-%1").arg(NERO_GITHASH));
vInfo.append("-" + QString(NERO_GITHASH));
#endif // NERO_GITHASH
vInfo.append("\nRunning on Qt" +
vInfo.append("\nRunning on Qt " +
QString::number(QT_VERSION_MAJOR) + '.' +
QString::number(QT_VERSION_MINOR) + '.' +
QString::number(QT_VERSION_PATCH));
Expand Down

0 comments on commit e012fe4

Please sign in to comment.