author | nemo |
Mon, 22 Aug 2011 15:35:37 -0400 | |
changeset 5654 | 1cb68f420aa6 |
parent 4568 | f85243bf890e |
child 6536 | 8a096836321c |
permissions | -rw-r--r-- |
1979 | 1 |
find_program(ghc_executable ghc) |
2 |
||
2401 | 3 |
if(NOT ghc_executable) |
4568 | 4 |
message(FATAL_ERROR "Cannot find GHC") |
1979 | 5 |
endif(NOT ghc_executable) |
6 |
||
2401 | 7 |
|
1979 | 8 |
set(hwserver_sources |
4568 | 9 |
OfficialServer/DBInteraction.hs |
10 |
Actions.hs |
|
11 |
ClientIO.hs |
|
12 |
CoreTypes.hs |
|
13 |
HWProtoCore.hs |
|
14 |
HWProtoInRoomState.hs |
|
15 |
HWProtoLobbyState.hs |
|
16 |
HWProtoNEState.hs |
|
17 |
NetRoutines.hs |
|
18 |
Opts.hs |
|
19 |
ServerCore.hs |
|
20 |
Utils.hs |
|
21 |
hedgewars-server.hs |
|
22 |
) |
|
1979 | 23 |
|
24 |
set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs) |
|
25 |
||
26 |
set(ghc_flags |
|
4568 | 27 |
--make ${hwserv_main} |
28 |
-i${hedgewars_SOURCE_DIR}/gameServer |
|
29 |
-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX} |
|
30 |
-odir ${CMAKE_CURRENT_BINARY_DIR} |
|
31 |
-hidir ${CMAKE_CURRENT_BINARY_DIR}) |
|
1979 | 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 | 35 |
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" |
4568 | 36 |
COMMAND "${ghc_executable}" |
37 |
ARGS ${ghc_flags} |
|
38 |
MAIN_DEPENDENCY ${hwserv_main} |
|
39 |
DEPENDS ${hwserver_sources} |
|
40 |
) |
|
1979 | 41 |
|
42 |
add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}") |
|
43 |
||
2015 | 44 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |