gameServer/CMakeLists.txt
author koda
Mon, 02 Aug 2010 00:55:24 +0200
changeset 3703 12d17c6e8855
parent 3555 4c5ca656d1bb
child 4242 5e3c5fe2cb14
permissions -rw-r--r--
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
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)
3452
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
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
3452
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
     9
    OfficialServer/DBInteraction.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    10
    Actions.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    11
    ClientIO.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    12
    CoreTypes.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    13
    HWProtoCore.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    14
    HWProtoInRoomState.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    15
    HWProtoLobbyState.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    16
    HWProtoNEState.hs
3542
f216b24aeb7f - Fix a function
unc0rr
parents: 3458
diff changeset
    17
    HandlerUtils.hs
3452
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    18
    NetRoutines.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    19
    Opts.hs
3542
f216b24aeb7f - Fix a function
unc0rr
parents: 3458
diff changeset
    20
    RoomsAndClients.hs
3452
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    21
    ServerCore.hs
3458
11cd56019f00 Make some more protocol commands work
unc0rr
parents: 3452
diff changeset
    22
    ServerState.hs
11cd56019f00 Make some more protocol commands work
unc0rr
parents: 3452
diff changeset
    23
    Store.hs
3542
f216b24aeb7f - Fix a function
unc0rr
parents: 3458
diff changeset
    24
    Utils.hs
3452
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    25
    hedgewars-server.hs
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    26
    )
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    27
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    28
set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs)
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    29
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    30
set(ghc_flags
3555
4c5ca656d1bb Reimplement ADD_TEAM
unc0rr
parents: 3542
diff changeset
    31
    -Wall
3452
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    32
    --make ${hwserv_main}
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    33
    -i${hedgewars_SOURCE_DIR}/gameServer
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    34
    -o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    35
    -odir ${CMAKE_CURRENT_BINARY_DIR}
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    36
    -hidir ${CMAKE_CURRENT_BINARY_DIR})
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    37
2606
ed687a8d081f updated build files for macosx and optimization system
koda
parents: 2409
diff changeset
    38
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
    39
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    40
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
3452
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    41
        COMMAND "${ghc_executable}"
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    42
        ARGS ${ghc_flags}
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    43
        MAIN_DEPENDENCY ${hwserv_main}
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    44
        DEPENDS ${hwserver_sources}
8c04583d8e2a - Enable -O2 optimization for server
unc0rr
parents: 2606
diff changeset
    45
        )
1979
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    46
912e450d4db2 - Add gameServer to build system
unc0rr
parents:
diff changeset
    47
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
    48
2015
d2848d723690 koda's patch
unc0rr
parents: 1979
diff changeset
    49
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})