--- a/gameServer/CMakeLists.txt Tue Nov 10 18:16:35 2015 +0100
+++ b/gameServer/CMakeLists.txt Tue Nov 10 20:43:13 2015 +0100
@@ -3,6 +3,30 @@
find_package_or_disable(GHC NOSERVER)
+include(${CMAKE_MODULE_PATH}/CheckHaskellModuleExists.cmake)
+
+check_haskell_module_exists("Control.Exception" mask 1 base)
+check_haskell_module_exists("Data.Map" size 1 containers)
+check_haskell_module_exists("Data.Vector" length 1 vector)
+check_haskell_module_exists("Data.ByteString" pack 1 bytestring)
+check_haskell_module_exists("Text.Show.ByteString" putDigit 1 bytestring-show)
+check_haskell_module_exists("Network.BSD" getHostName 0 network)
+check_haskell_module_exists("Data.Time" getCurrentTime 0 time)
+check_haskell_module_exists("Control.Monad.State" fix 1 mtl)
+check_haskell_module_exists("Codec.Binary.Base64" encode 1 dataenc)
+check_haskell_module_exists("System.Log.Logger" warningM 1 hslogger)
+check_haskell_module_exists("System.Process" createProcess 3 process)
+check_haskell_module_exists("Data.ByteString.Lazy.UTF8" decode 1 utf8-string)
+check_haskell_module_exists("Data.Digest.Pure.SHA" sha1 1 SHA)
+check_haskell_module_exists("System.Entropy" openHandle 0 entropy)
+check_haskell_module_exists("Codec.Compression.Zlib" decompress 1 zlib)
+check_haskell_module_exists("System.Random" getStdGen 0 random)
+
+# this one needs type signatures to work
+# check_haskell_module_exists("Control.DeepSeq" deepseq 2 deepseq)
+
+
+
set(hwserver_sources
OfficialServer/DBInteraction.hs
Actions.hs
@@ -11,11 +35,13 @@
Consts.hs
CoreTypes.hs
EngineInteraction.hs
+ FloodDetection.hs
HWProtoCore.hs
HWProtoInRoomState.hs
HWProtoLobbyState.hs
HWProtoNEState.hs
HandlerUtils.hs
+ JoinsMonitor.hs
NetRoutines.hs
Opts.hs
RoomsAndClients.hs
@@ -23,14 +49,15 @@
ServerState.hs
Store.hs
Utils.hs
+ Votes.hs
hedgewars-server.hs
)
-set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs)
+set(hwserv_main ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars-server.hs)
set(ghc_flags
--make ${hwserv_main}
- -i${hedgewars_SOURCE_DIR}/gameServer
+ -i${CMAKE_CURRENT_SOURCE_DIR}
-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
-odir ${CMAKE_CURRENT_BINARY_DIR}
-hidir ${CMAKE_CURRENT_BINARY_DIR}