convert HAVE_NETSERVER to check for file existance, so that it's easier to provide missing servers
--- a/CMakeLists.txt Mon Mar 04 10:08:38 2013 +0100
+++ b/CMakeLists.txt Mon Mar 04 10:30:56 2013 +0100
@@ -261,7 +261,6 @@
endif()
if(ghc_executable)
- set(HAVE_NETSERVER true)
add_subdirectory(gameServer)
message(STATUS "Found GHC: ${ghc_executable}")
else()
--- a/QTfrontend/hwconsts.cpp.in Mon Mar 04 10:08:38 2013 +0100
+++ b/QTfrontend/hwconsts.cpp.in Mon Mar 04 10:30:56 2013 +0100
@@ -73,7 +73,5 @@
QString * netHost = new QString();
quint16 netPort = NETGAME_DEFAULT_PORT;
-bool haveServer = ${HAVE_NETSERVER};
-
int season = SEASON_NONE;
int years_since_foundation = 0;
--- a/QTfrontend/hwconsts.h Mon Mar 04 10:08:38 2013 +0100
+++ b/QTfrontend/hwconsts.h Mon Mar 04 10:30:56 2013 +0100
@@ -50,7 +50,6 @@
extern QString * netHost;
extern quint16 netPort;
-extern bool haveServer;
//Current season, SEASON_NONE by default
extern int season;
--- a/QTfrontend/ui/page/pagenet.cpp Mon Mar 04 10:08:38 2013 +0100
+++ b/QTfrontend/ui/page/pagenet.cpp Mon Mar 04 10:30:56 2013 +0100
@@ -72,7 +72,12 @@
BtnNetSvrStart = formattedButton(QPushButton::tr("Start server"));
BtnNetSvrStart->setMinimumWidth(180);
- BtnNetSvrStart->setVisible(haveServer);
+ QString serverPath = bindir->absolutePath() + "/hedgewars-server";
+#ifdef Q_WS_WIN
+ serverPath += + ".exe";
+#endif
+ QFile server(serverPath);
+ BtnNetSvrStart->setVisible(server.exists());
footerLayout->addStretch();
footerLayout->addWidget(BtnNetSvrStart);