author | unc0rr |
Wed, 14 Oct 2009 16:30:41 +0000 | |
changeset 2442 | 228757f6c54d |
parent 2409 | dbf195c3e09c |
child 2606 | ed687a8d081f |
permissions | -rw-r--r-- |
1979 | 1 |
find_program(ghc_executable ghc) |
2 |
||
2401 | 3 |
if(NOT ghc_executable) |
1979 | 4 |
message(FATAL_ERROR "Cannot find GHC") |
5 |
endif(NOT ghc_executable) |
|
6 |
||
2401 | 7 |
|
1979 | 8 |
set(hwserver_sources |
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 |
) |
|
23 |
||
24 |
set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs) |
|
25 |
||
26 |
set(ghc_flags |
|
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}) |
|
32 |
||
2406 | 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 | 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 | 46 |
endif(OPTIMIZATIONS) |
2203
6bd39d75e0dd
-Added support for Release and Debug for CMAKE_BUILD_TYPE
koda
parents:
2015
diff
changeset
|
47 |
|
1979 | 48 |
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" |
49 |
COMMAND "${ghc_executable}" |
|
50 |
ARGS ${ghc_flags} |
|
51 |
MAIN_DEPENDENCY ${hwserv_main} |
|
52 |
DEPENDS ${hwserver_sources} |
|
53 |
) |
|
54 |
||
55 |
add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}") |
|
56 |
||
2015 | 57 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |