gameServer/CMakeLists.txt
author unc0rr
Fri, 12 Nov 2010 19:40:35 +0300
branch0.9.12
changeset 2559 711db3cb2aed
parent 2409 dbf195c3e09c
child 2606 ed687a8d081f
permissions -rw-r--r--
Close 0.9.12 branch
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
2406
2e757b32991e cmake optimizations and simplification
koda
parents: 2401
diff changeset
    33
if(OPTIMIZATIONS)
2203
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    34
set(ghc_flags
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    35
	-w
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    36
	-O2
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    37
	${ghc_flags}
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    38
)
2406
2e757b32991e cmake optimizations and simplification
koda
parents: 2401
diff changeset
    39
else(OPTIMIZATIONS)
2203
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    40
set(ghc_flags
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    41
	-Wall
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    42
	-debug
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    43
	-dcore-lint
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    44
	${ghc_flags}
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    45
)
2406
2e757b32991e cmake optimizations and simplification
koda
parents: 2401
diff changeset
    46
endif(OPTIMIZATIONS)
2203
6bd39d75e0dd -Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents: 2015
diff changeset
    47
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    48
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    49
		COMMAND "${ghc_executable}"
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    50
		ARGS ${ghc_flags}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    51
		MAIN_DEPENDENCY ${hwserv_main}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    52
		DEPENDS ${hwserver_sources}
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    53
		)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    54
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    55
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
    56
2015
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    57
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})