gameServer/CMakeLists.txt
author nemo
Sun, 03 May 2009 17:35:10 +0000
changeset 2023 41d3afaa20c7
parent 2015 d2848d723690
child 2203 6bd39d75e0dd
permissions -rw-r--r--
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
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
2015
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    41
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    42
if(APPLE)
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    43
	set (target_dir ".")
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    44
else(APPLE)
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    45
	set (target_dir "bin")
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    46
endif(APPLE)
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    47
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    48
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})