gameServer/CMakeLists.txt
author palewolf
Tue, 30 Mar 2010 20:18:54 +0000
changeset 3186 8d3e4e9a5199
parent 2606 ed687a8d081f
child 3452 8c04583d8e2a
permissions -rw-r--r--
Blox theme Sky.png was ¿white?
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)
1979
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
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
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
     9
	OfficialServer/DBInteraction.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    10
	Actions.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    11
	ClientIO.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    12
	CoreTypes.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    13
	HWProtoCore.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    14
	HWProtoInRoomState.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    15
	HWProtoLobbyState.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    16
	HWProtoNEState.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    17
	NetRoutines.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    18
	Opts.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    19
	ServerCore.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    20
	Utils.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    21
	hedgewars-server.hs
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    22
	)
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
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    27
	--make ${hwserv_main}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    28
	-i${hedgewars_SOURCE_DIR}/gameServer
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    29
	-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    30
	-odir ${CMAKE_CURRENT_BINARY_DIR}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    31
	-hidir ${CMAKE_CURRENT_BINARY_DIR})
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}"
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    36
		COMMAND "${ghc_executable}"
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    37
		ARGS ${ghc_flags}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    38
		MAIN_DEPENDENCY ${hwserv_main}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    39
		DEPENDS ${hwserver_sources}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    40
		)
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})