build: rm SERVER_BINARY_NAME define

This commit is contained in:
sithlord48
2024-10-28 21:31:33 -04:00
committed by Nick Bolton
parent 078ec61e9a
commit e52ce58541
11 changed files with 22 additions and 23 deletions

View File

@ -97,7 +97,7 @@ macro(post_config_all)
run_post_build
deskflow
${CLIENT_BINARY_NAME}
${SERVER_BINARY_NAME}
deskflow-server
${DAEMON_BINARY_NAME})
endif()

View File

@ -73,10 +73,6 @@ endmacro()
macro(configure_bin_names)
set(SERVER_BINARY_NAME
"deskflow-server"
CACHE STRING "Filename of the server binary")
set(CLIENT_BINARY_NAME
"deskflow-client"
CACHE STRING "Filename of the client binary")
@ -90,13 +86,11 @@ macro(configure_bin_names)
CACHE STRING "Filename of the daemon binary")
message(VERBOSE "Server binary: ${SERVER_BINARY_NAME}")
message(VERBOSE "Client binary: ${CLIENT_BINARY_NAME}")
message(VERBOSE "Core binary: ${CORE_BINARY_NAME}")
message(VERBOSE "Daemon binary: ${DAEMON_BINARY_NAME}")
add_definitions(-DSERVER_BINARY_NAME="${SERVER_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}")

View File

@ -22,7 +22,7 @@
<?define OpenSslExeDir="@OPENSSL_EXE_DIR@"?>
<?define OpenSslDllDir="@OPENSSL_ROOT_DIR@/bin"?>
<?define GuiBin="deskflow.exe"?>
<?define ServerBin="@SERVER_BINARY_NAME@.exe"?>
<?define ServerBin="deskflow-server.exe"?>
<?define ClientBin="@CLIENT_BINARY_NAME@.exe"?>
<?define CoreBin="@CORE_BINARY_NAME@.exe"?>
<?define DaemonBin="@DAEMON_BINARY_NAME@.exe"?>

View File

@ -29,7 +29,7 @@
void showHelp()
{
std::cout << "Usage: " CORE_BINARY_NAME " <server | client> [...options]" << std::endl;
std::cout << "server - start as a server (" << SERVER_BINARY_NAME << ")" << 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 << "use " CORE_BINARY_NAME " <server|client> --help for more information." << std::endl;
}

View File

@ -15,14 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(server_source_name "deskflows")
set(target ${SERVER_BINARY_NAME})
set(target deskflow-server)
if(WIN32)
set(PLATFORM_SOURCES
${server_source_name}.exe.manifest
${server_source_name}.ico
${server_source_name}.rc
deskflows.exe.manifest
deskflows.ico
deskflows.rc
MSWindowsServerTaskBarReceiver.cpp
MSWindowsServerTaskBarReceiver.h
resource.h
@ -44,7 +43,7 @@ elseif(UNIX)
)
endif()
add_executable(${target} ${PLATFORM_SOURCES} "${server_source_name}.cpp")
add_executable(${target} ${PLATFORM_SOURCES} deskflows.cpp)
target_link_libraries(
${target}

View File

@ -78,7 +78,7 @@ bool isServerCommandLine(const std::vector<String> &cmd)
auto isServer = false;
if (cmd.size() > 1) {
isServer = (cmd[0].find(SERVER_BINARY_NAME) != String::npos) ||
isServer = (cmd[0].find("deskflow-server") != String::npos) ||
(cmd[0].find(CORE_BINARY_NAME) != String::npos && cmd[1] == "server");
}

View File

@ -847,7 +847,7 @@ const char *ServerApp::daemonName() const
#if SYSAPI_WIN32
return "Deskflow Server";
#elif SYSAPI_UNIX
return SERVER_BINARY_NAME;
return "deskflow-server";
#endif
}

View File

@ -35,11 +35,9 @@ const int kWizardVersion = 8;
static const char *const kLogLevelNames[] = {"INFO", "DEBUG", "DEBUG1", "DEBUG2"};
#if defined(Q_OS_WIN)
const char AppConfig::m_CoreServerName[] = SERVER_BINARY_NAME ".exe";
const char AppConfig::m_CoreClientName[] = CLIENT_BINARY_NAME ".exe";
const char AppConfig::m_LogDir[] = "log/";
#else
const char AppConfig::m_CoreServerName[] = SERVER_BINARY_NAME;
const char AppConfig::m_CoreClientName[] = CLIENT_BINARY_NAME;
const char AppConfig::m_LogDir[] = "/var/log/";
#endif
@ -469,7 +467,11 @@ QString AppConfig::lastVersion() const
QString AppConfig::coreServerName() const
{
return m_CoreServerName;
#ifdef Q_OS_WIN
return s_winExeTemplate.arg(s_CoreServerName);
#else
return s_CoreServerName;
#endif
}
QString AppConfig::coreClientName() const

View File

@ -289,7 +289,11 @@ private:
*/
QString defaultTlsCertPath() const;
static const char m_CoreServerName[];
// Used to make the server and client names on windows.
#ifdef Q_OS_WIN
inline static const auto s_winExeTemplate = QStringLiteral("%1.exe");
#endif
inline static const auto s_CoreServerName = QStringLiteral("deskflow-server");
static const char m_CoreClientName[];
static const char m_LogDir[];

View File

@ -571,7 +571,7 @@ void MSWindowsWatchdog::shutdownExistingProcesses()
if (entry.th32ProcessID != 0) {
if (_stricmp(entry.szExeFile, CLIENT_BINARY_NAME ".exe") == 0 ||
_stricmp(entry.szExeFile, SERVER_BINARY_NAME ".exe") == 0 ||
_stricmp(entry.szExeFile, "deskflow-server.exe") == 0 ||
_stricmp(entry.szExeFile, CORE_BINARY_NAME ".exe") == 0) {
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, entry.th32ProcessID);

View File

@ -40,7 +40,7 @@ TEST(ServerAppTests, runInner_will_handle_configuration_lifetime)
EXPECT_FALSE(app.args().m_config);
const char *argv[]{SERVER_BINARY_NAME};
const char *argv[]{"deskflow-server"};
app.runInner(1, const_cast<char **>(argv), nullptr, [](int, char **) { return 0; });
EXPECT_TRUE(app.args().m_config);