gameServer/CMakeLists.txt
author smxx
Thu, 04 Feb 2010 14:48:49 +0000
changeset 2745 11fce231f24a
parent 2606 ed687a8d081f
child 3452 8c04583d8e2a
permissions -rw-r--r--
Engine: + Split PlaySound into PlaySound and LoopSound + Added overloaded versions of PlaySound/LoopSound that won't require voicepack parameter + LoopSound now allows multiple copies of the same sound to play looped and returns the channel used for playback (to stop them later) + StopSound now allows either a specific sound (single playback) or channel (single playback as well as looped playback) to be stopped + SoundChannel attribute for Gears to be used when looping sounds

find_program(ghc_executable ghc)

if(NOT ghc_executable)
	message(FATAL_ERROR "Cannot find GHC")
endif(NOT ghc_executable)


set(hwserver_sources
	OfficialServer/DBInteraction.hs
	Actions.hs
	ClientIO.hs
	CoreTypes.hs
	HWProtoCore.hs
	HWProtoInRoomState.hs
	HWProtoLobbyState.hs
	HWProtoNEState.hs
	NetRoutines.hs
	Opts.hs
	ServerCore.hs
	Utils.hs
	hedgewars-server.hs
	)

set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs)

set(ghc_flags
	--make ${hwserv_main}
	-i${hedgewars_SOURCE_DIR}/gameServer
	-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
	-odir ${CMAKE_CURRENT_BINARY_DIR}
	-hidir ${CMAKE_CURRENT_BINARY_DIR})

set(ghc_flags ${haskell_compiler_flags_cmn} ${ghc_flags})

add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
		COMMAND "${ghc_executable}"
		ARGS ${ghc_flags}
		MAIN_DEPENDENCY ${hwserv_main}
		DEPENDS ${hwserver_sources}
		)

add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")

install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})