gameServer/CMakeLists.txt
author unc0rr
Mon, 13 Apr 2009 13:03:57 +0000
changeset 1991 24b5a3368ab6
parent 1979 912e450d4db2
child 2015 d2848d723690
permissions -rw-r--r--
Update release doc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     1
find_program(ghc_executable ghc)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     2
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     3
if (NOT ghc_executable)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     4
	message(FATAL_ERROR "Cannot find GHC")
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     5
endif(NOT ghc_executable)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     6
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     7
set(hwserver_sources
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     8
	OfficialServer/DBInteraction.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     9
	Actions.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    10
	ClientIO.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    11
	CoreTypes.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    12
	HWProtoCore.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    13
	HWProtoInRoomState.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    14
	HWProtoLobbyState.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    15
	HWProtoNEState.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    16
	NetRoutines.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    17
	Opts.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    18
	ServerCore.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    19
	Utils.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    20
	hedgewars-server.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    21
	)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    22
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    23
set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    24
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    25
set(ghc_flags
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    26
	--make ${hwserv_main}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    27
	-i${hedgewars_SOURCE_DIR}/gameServer
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    28
	-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    29
	-odir ${CMAKE_CURRENT_BINARY_DIR}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    30
	-hidir ${CMAKE_CURRENT_BINARY_DIR})
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    31
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    32
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    33
		COMMAND "${ghc_executable}"
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    34
		ARGS ${ghc_flags}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    35
		MAIN_DEPENDENCY ${hwserv_main}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    36
		DEPENDS ${hwserver_sources}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    37
		)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    38
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    39
add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    40
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    41
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)