From f816f44f4c36feb3da8fe6fa7c9fddf85e8050fd Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 25 Feb 2022 20:48:14 +0100 Subject: [PATCH] Cmake: add SELF_CONTAINED --- CMakeLists.txt | 1 + src/CMakeLists.txt | 4 ++++ src/MainWindow.cpp | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bd8c2b..a5339f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}") option(STATIC "Link libraries statically, requires static Qt") +option(SELF_CONTAINED "Disable when building Feather for packages" OFF) option(LOCALMONERO "Include LocalMonero module" ON) option(XMRIG "Include XMRig module" ON) option(TOR_BIN "Path to Tor binary to embed inside Feather" OFF) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c6461d..d21d2f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -144,6 +144,10 @@ if(WITH_SCANNER) ) endif() +if(SELF_CONTAINED) + target_compile_definitions(feather PRIVATE SELF_CONTAINED=1) +endif() + if(DONATE_BEG) target_compile_definitions(feather PRIVATE DONATE_BEG=1) endif() diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index ce48323..d9c33f4 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -317,6 +317,10 @@ void MainWindow::initMenu() { ui->actionCreateDesktopEntry->setDisabled(true); #endif +#ifndef SELF_CONTAINED + ui->actionCreateDesktopEntry->setVisible(false); +#endif + // [Help] connect(ui->actionAbout, &QAction::triggered, this, &MainWindow::menuAboutClicked); connect(ui->actionOfficialWebsite, &QAction::triggered, [this](){Utils::externalLinkWarning(this, "https://featherwallet.org");});