From 2213f3f7468abfbe3b12450e0e29a237063f2570 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Mon, 28 Oct 2024 21:53:38 -0400 Subject: [PATCH] build:rm CLIENT_BINARY_NAME define --- cmake/Build.cmake | 2 +- cmake/Definitions.cmake | 6 ------ deploy/dist/wix/Include.wxi.in | 2 +- src/cmd/deskflow-core/deskflow-core.cpp | 2 +- src/cmd/deskflowc/CMakeLists.txt | 11 +++++------ src/lib/deskflow/ClientApp.cpp | 2 +- src/lib/gui/config/AppConfig.cpp | 8 +++++--- src/lib/gui/config/AppConfig.h | 2 +- src/lib/platform/MSWindowsWatchdog.cpp | 2 +- 9 files changed, 16 insertions(+), 21 deletions(-) diff --git a/cmake/Build.cmake b/cmake/Build.cmake index e7d2958c4..e063a5a05 100644 --- a/cmake/Build.cmake +++ b/cmake/Build.cmake @@ -96,7 +96,7 @@ macro(post_config_all) add_dependencies( run_post_build deskflow - ${CLIENT_BINARY_NAME} + deskflow-client deskflow-server ${DAEMON_BINARY_NAME}) endif() diff --git a/cmake/Definitions.cmake b/cmake/Definitions.cmake index 4c7ac0c23..0aa828780 100644 --- a/cmake/Definitions.cmake +++ b/cmake/Definitions.cmake @@ -73,10 +73,6 @@ endmacro() macro(configure_bin_names) - set(CLIENT_BINARY_NAME - "deskflow-client" - CACHE STRING "Filename of the client binary") - set(CORE_BINARY_NAME "deskflow-core" CACHE STRING "Filename of the core binary") @@ -86,12 +82,10 @@ macro(configure_bin_names) CACHE STRING "Filename of the daemon binary") - message(VERBOSE "Client binary: ${CLIENT_BINARY_NAME}") message(VERBOSE "Core binary: ${CORE_BINARY_NAME}") message(VERBOSE "Daemon binary: ${DAEMON_BINARY_NAME}") - add_definitions(-DCLIENT_BINARY_NAME="${CLIENT_BINARY_NAME}") add_definitions(-DCORE_BINARY_NAME="${CORE_BINARY_NAME}") add_definitions(-DDAEMON_BINARY_NAME="${DAEMON_BINARY_NAME}") diff --git a/deploy/dist/wix/Include.wxi.in b/deploy/dist/wix/Include.wxi.in index 45cfd91ba..7f990fe17 100644 --- a/deploy/dist/wix/Include.wxi.in +++ b/deploy/dist/wix/Include.wxi.in @@ -23,7 +23,7 @@ - + diff --git a/src/cmd/deskflow-core/deskflow-core.cpp b/src/cmd/deskflow-core/deskflow-core.cpp index 246a2920b..59f4a9046 100644 --- a/src/cmd/deskflow-core/deskflow-core.cpp +++ b/src/cmd/deskflow-core/deskflow-core.cpp @@ -30,7 +30,7 @@ void showHelp() { std::cout << "Usage: " CORE_BINARY_NAME " [...options]" << std::endl; std::cout << "server - start as a server ( deskflow-server)" << std::endl; - std::cout << "client - start as a client (" << CLIENT_BINARY_NAME << ")" << std::endl; + std::cout << "client - start as a client ( deslflow-client)" << std::endl; std::cout << "use " CORE_BINARY_NAME " --help for more information." << std::endl; } diff --git a/src/cmd/deskflowc/CMakeLists.txt b/src/cmd/deskflowc/CMakeLists.txt index 8f0e9fb80..13873f3bd 100644 --- a/src/cmd/deskflowc/CMakeLists.txt +++ b/src/cmd/deskflowc/CMakeLists.txt @@ -15,14 +15,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(client_source_name "deskflowc") -set(target ${CLIENT_BINARY_NAME}) +set(target deskflow-client) if(WIN32) set(PLATFORM_SOURCES - ${client_source_name}.exe.manifest - ${client_source_name}.ico - ${client_source_name}.rc + deskflowc.exe.manifest + deskflowc.ico + deskflowc.rc MSWindowsClientTaskBarReceiver.cpp MSWindowsClientTaskBarReceiver.h resource.h @@ -44,7 +43,7 @@ elseif(UNIX) ) endif() -add_executable(${target} ${PLATFORM_SOURCES} "${client_source_name}.cpp") +add_executable(${target} ${PLATFORM_SOURCES} deskflowc.cpp) target_link_libraries( ${target} diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index 93f518450..87f15b9d1 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -168,7 +168,7 @@ const char *ClientApp::daemonName() const #if SYSAPI_WIN32 return "Deskflow Client"; #elif SYSAPI_UNIX - return CLIENT_BINARY_NAME; + return "deskflow-client"; #endif } diff --git a/src/lib/gui/config/AppConfig.cpp b/src/lib/gui/config/AppConfig.cpp index 8ea7b87fc..a7534ae23 100644 --- a/src/lib/gui/config/AppConfig.cpp +++ b/src/lib/gui/config/AppConfig.cpp @@ -35,10 +35,8 @@ const int kWizardVersion = 8; static const char *const kLogLevelNames[] = {"INFO", "DEBUG", "DEBUG1", "DEBUG2"}; #if defined(Q_OS_WIN) -const char AppConfig::m_CoreClientName[] = CLIENT_BINARY_NAME ".exe"; const char AppConfig::m_LogDir[] = "log/"; #else -const char AppConfig::m_CoreClientName[] = CLIENT_BINARY_NAME; const char AppConfig::m_LogDir[] = "/var/log/"; #endif @@ -476,7 +474,11 @@ QString AppConfig::coreServerName() const QString AppConfig::coreClientName() const { - return m_CoreClientName; +#ifdef Q_OS_WIN + return s_winExeTemplate.arg(s_CoreClientName); +#else + return s_CoreClientName; +#endif } ElevateMode AppConfig::elevateMode() const diff --git a/src/lib/gui/config/AppConfig.h b/src/lib/gui/config/AppConfig.h index 9473f7f48..936809225 100644 --- a/src/lib/gui/config/AppConfig.h +++ b/src/lib/gui/config/AppConfig.h @@ -294,7 +294,7 @@ private: inline static const auto s_winExeTemplate = QStringLiteral("%1.exe"); #endif inline static const auto s_CoreServerName = QStringLiteral("deskflow-server"); - static const char m_CoreClientName[]; + inline static const auto s_CoreClientName = QStringLiteral("deskflow-client"); static const char m_LogDir[]; /// @brief Contains the string values of the settings names that will be saved diff --git a/src/lib/platform/MSWindowsWatchdog.cpp b/src/lib/platform/MSWindowsWatchdog.cpp index 1dcbffd3e..4101492f9 100644 --- a/src/lib/platform/MSWindowsWatchdog.cpp +++ b/src/lib/platform/MSWindowsWatchdog.cpp @@ -570,7 +570,7 @@ void MSWindowsWatchdog::shutdownExistingProcesses() // make sure we're not checking the system process if (entry.th32ProcessID != 0) { - if (_stricmp(entry.szExeFile, CLIENT_BINARY_NAME ".exe") == 0 || + if (_stricmp(entry.szExeFile, "deskflow-client.exe") == 0 || _stricmp(entry.szExeFile, "deskflow-server.exe") == 0 || _stricmp(entry.szExeFile, CORE_BINARY_NAME ".exe") == 0) {