gameServer/CMakeLists.txt
author unc0rr
Thu, 11 Nov 2010 22:17:54 +0300
branch0.9.14
changeset 4242 5e3c5fe2cb14
parent 3555 4c5ca656d1bb
child 4295 1f5604cd99be
permissions -rw-r--r--
Revert to old server in branch 0.9.14
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
2401
2a694ea2a437 fixes & co.
koda
parents: 2203
diff changeset
     3
if(NOT ghc_executable)
4242
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
     4
	message(FATAL_ERROR "Cannot find GHC")
1979
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
2401
2a694ea2a437 fixes & co.
koda
parents: 2203
diff changeset
     7
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     8
set(hwserver_sources
4242
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
     9
	OfficialServer/DBInteraction.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    10
	Actions.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    11
	ClientIO.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    12
	CoreTypes.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    13
	HWProtoCore.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    14
	HWProtoInRoomState.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    15
	HWProtoLobbyState.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    16
	HWProtoNEState.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    17
	NetRoutines.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    18
	Opts.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    19
	ServerCore.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    20
	Utils.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    21
	hedgewars-server.hs
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    22
	)
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    23
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    24
set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    25
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    26
set(ghc_flags
4242
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    27
	--make ${hwserv_main}
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    28
	-i${hedgewars_SOURCE_DIR}/gameServer
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    29
	-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    30
	-odir ${CMAKE_CURRENT_BINARY_DIR}
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    31
	-hidir ${CMAKE_CURRENT_BINARY_DIR})
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    32
2606
ed687a8d081f updated build files for macosx and optimization system
koda
parents: 2409
diff changeset
    33
set(ghc_flags ${haskell_compiler_flags_cmn} ${ghc_flags})
2203
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    34
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    35
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
4242
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    36
		COMMAND "${ghc_executable}"
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    37
		ARGS ${ghc_flags}
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    38
		MAIN_DEPENDENCY ${hwserv_main}
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    39
		DEPENDS ${hwserver_sources}
5e3c5fe2cb14 Revert to old server in branch 0.9.14
unc0rr
parents: 3555
diff changeset
    40
		)
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    41
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    42
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
    43
2015
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    44
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})