Skip to content

Commit

Permalink
fix version definition
Browse files Browse the repository at this point in the history
Signed-off-by: Stavros Avramidis <[email protected]>
  • Loading branch information
purpl3F0x committed Apr 19, 2023
1 parent bc093ff commit eaae346
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ add_executable(tidal-rpc main.cc resource.rc ${QRCS})
target_include_directories(tidal-rpc PRIVATE discord-game-sdk/c)
target_include_directories(tidal-rpc PRIVATE discord-game-sdk/cpp)
target_link_libraries(tidal-rpc Qt6::Widgets Qt6::Core Qt6::Network)
if (VERSION)
target_compile_definitions(tidal-rpc PUBLIC VERSION= "v.${VERSION}")
endif (VERSION)

if (DEFINED ENV{APPVEYOR_BUILD_VERSION})
target_compile_definitions(tidal-rpc PUBLIC VERSION="v.$ENV{APPVEYOR_BUILD_VERSION}")
endif ()


# generate proper GUI program on specified platform if on release
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ for:
build_script:
- mkdir .\build
- cd .\build
- cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DVERSION=%APPVEYOR_BUILD_VERSION% ../
- cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../
- cmake --build .
- call %QTDIR%\bin\windeployqt --release tidal-rpc.exe

Expand Down Expand Up @@ -90,7 +90,7 @@ for:
build_script:
- mkdir build
- cd build
- cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DVERSION=$APPVEYOR_BUILD_VERSION ../ -DQt6_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6 -DQt6CoreTools_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6CoreTools -DQt6GuiTools_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6GuiTools -DQt6WidgetsTools_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6WidgetsTools ..
- cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../ -DQt6_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6 -DQt6CoreTools_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6CoreTools -DQt6GuiTools_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6GuiTools -DQt6WidgetsTools_DIR=$HOME/Qt/6.4.0/macos/lib/cmake/Qt6WidgetsTools ..
- cmake --build .
- $HOME/Qt/6.4.0/macos/bin/macdeployqt tidal-rpc.app -dmg

Expand Down
4 changes: 3 additions & 1 deletion main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#define VERSION "v.1.3.0"
#endif

#pragma message("Building version:" VERSION)

/* C++ libs */
#include <atomic>
#include <algorithm>
Expand Down Expand Up @@ -395,7 +397,7 @@ int main(int argc, char **argv) {
nlohmann::json j;
j = nlohmann::json::parse(reply->readAll().toStdString());

if (j["tag_name"].get<std::string>() > VERSION) {
if (j["tag_name"].get<std::string>() > (VERSION)) {
tray.showMessage("Tidal Discord RPC", "New Version Available!\nClick to download");
QObject::connect(&tray, &QSystemTrayIcon::messageClicked, &app, []() {
QDesktopServices::openUrl(QUrl("https://github.com/purpl3F0x/TIDAL-Discord-Rich-Presence-UNOFFICIAL/releases/latest",
Expand Down

0 comments on commit eaae346

Please sign in to comment.