Allow build without net game server: introduce -DWITH_SERVER configuration parameter
authorunc0rr
Sun, 26 Oct 2008 13:00:35 +0000
changeset 1415 6fbfee0e113a
parent 1414 971136fa0a80
child 1416 60b86d6fe9ae
Allow build without net game server: introduce -DWITH_SERVER configuration parameter
CMakeLists.txt
INSTALL
QTfrontend/CMakeLists.txt
QTfrontend/hwconsts.cpp.in
QTfrontend/hwconsts.h
QTfrontend/main.cpp
QTfrontend/newnetclient.cpp
QTfrontend/pages.cpp
hedgewars/CMakeLists.txt
--- a/CMakeLists.txt	Sat Oct 25 09:55:58 2008 +0000
+++ b/CMakeLists.txt	Sun Oct 26 13:00:35 2008 +0000
@@ -21,8 +21,14 @@
 set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 set(HEDGEWARS_PROTO_VER 17)
 
+if(WITH_SERVER)
+	set(HAVE_NETSERVER true)
+	add_subdirectory(netserver)
+else(WITH_SERVER)
+	set(HAVE_NETSERVER false)
+endif(WITH_SERVER)
+
 add_subdirectory(bin)
-add_subdirectory(netserver)
 add_subdirectory(QTfrontend)
 add_subdirectory(hedgewars)
 add_subdirectory(share)
--- a/INSTALL	Sat Oct 25 09:55:58 2008 +0000
+++ b/INSTALL	Sun Oct 26 13:00:35 2008 +0000
@@ -1,6 +1,6 @@
 To compile and install you need:
- - Qt >= 4.2
- - FreePascal >= 1.9.4
+ - Qt >= 4.4
+ - FreePascal >= 2.2.0
  - SDL >= 1.2.5
  - SDL_net >= 1.2.5
  - SDL_mixer >= 1.2
@@ -13,6 +13,8 @@
 or
 $ cmake -DCMAKE_CXX_FLAGS="flags" -DCMAKE_INSTALL_PREFIX="install prefix" -DDATA_INSTALL_DIR="data dir" .
 
+add -DWITH_SERVER=1 to compile net server (requires Glasgow Haskell Compiler)
+
 2. Compile:
 $ make
 
--- a/QTfrontend/CMakeLists.txt	Sat Oct 25 09:55:58 2008 +0000
+++ b/QTfrontend/CMakeLists.txt	Sun Oct 26 13:00:35 2008 +0000
@@ -1,5 +1,5 @@
 # Configure for Qt4
-set(QT_MIN_VERSION "4.3.0")
+set(QT_MIN_VERSION "4.4.0")
 
 set(QT_USE_QTCORE TRUE)
 set(QT_USE_QTGUI TRUE)
--- a/QTfrontend/hwconsts.cpp.in	Sat Oct 25 09:55:58 2008 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Sun Oct 26 13:00:35 2008 +0000
@@ -40,3 +40,5 @@
 
 QString * netHost = new QString();
 quint16 netPort = 46631;
+
+bool haveServer = ${HAVE_NETSERVER};
--- a/QTfrontend/hwconsts.h	Sat Oct 25 09:55:58 2008 +0000
+++ b/QTfrontend/hwconsts.h	Sun Oct 26 13:00:35 2008 +0000
@@ -43,3 +43,5 @@
 
 extern QString * netHost;
 extern quint16 netPort;
+
+extern bool haveServer;
--- a/QTfrontend/main.cpp	Sat Oct 25 09:55:58 2008 +0000
+++ b/QTfrontend/main.cpp	Sun Oct 26 13:00:35 2008 +0000
@@ -283,6 +283,26 @@
 			"QMenu::indicator:non-exclusive:unchecked{"
 				"image: url(\":/res/unchecked.png\");"
 				"}"
+
+			"QScrollBar:vertical{"
+				"background-color: #000000;"
+				"border: 2px #ffcc00;"
+				"width: 16px;"
+				"margin: 22px 0 22px 0;"
+				"}"
+			"QScrollBar::handle:vertical{"
+				"border: 1px #ffcc00;"
+				"background-color: #0d0544;"
+				"min-height: 16px;"
+				"}"
+			"QScrollBar::up-arrow:vertical{"
+				"image: url(\":/res/spin_up.png\");"
+				"width: 16px;"
+				"height: 16px;"
+				"}"
+			"QScrollBar::down-arrow:vertical{"
+				"image: url(\":/res/spin_down.png\");"
+				"}"
 			)
 		);
 
--- a/QTfrontend/newnetclient.cpp	Sat Oct 25 09:55:58 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Sun Oct 26 13:00:35 2008 +0000
@@ -69,7 +69,6 @@
 	
 	RawSendNet(QString("CREATE%1%2").arg(delimeter).arg(room));
 	m_pGameCFGWidget->setEnabled(true);
-	//m_pTeamSelWidget->setNonInteractive();
 	isChief = true;
 }
 
--- a/QTfrontend/pages.cpp	Sat Oct 25 09:55:58 2008 +0000
+++ b/QTfrontend/pages.cpp	Sun Oct 26 13:00:35 2008 +0000
@@ -386,6 +386,7 @@
 	BtnNetSvrStart = new QPushButton(this);
 	BtnNetSvrStart->setFont(*font14);
 	BtnNetSvrStart->setText(QPushButton::tr("Start server"));
+	BtnNetSvrStart->setVisible(haveServer);
 	pageLayout->addWidget(BtnNetSvrStart, 4, 2);
 
 	BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true);
--- a/hedgewars/CMakeLists.txt	Sat Oct 25 09:55:58 2008 +0000
+++ b/hedgewars/CMakeLists.txt	Sun Oct 26 13:00:35 2008 +0000
@@ -69,12 +69,12 @@
 	string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
 	string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
 	math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
-	if (fpc_ver LESS "010904")
-		message("Minimum required version of FreePascal is 1.9.4")
-	else (fpc_ver LESS "010904")
+	if (fpc_ver LESS "020200")
+		message("Minimum required version of FreePascal is 2.2.0")
+	else (fpc_ver LESS "020200")
 		set(pascal_compiler ${fpc_executable})
 		set(pascal_compiler_flags ${noexecstack_flags} "-B" "-FE../bin" "-Cs2000000" "-vwi" "-O2" ${hwengine_project})
-	endif (fpc_ver LESS "010904")
+	endif (fpc_ver LESS "020200")
 endif (fpc_version)
 
 if (NOT pascal_compiler)