1370
|
1 |
find_program(ghc_executable ghc)
|
|
2 |
|
|
3 |
if (NOT ghc_executable)
|
|
4 |
message("Cannot find GHC" FATAL)
|
|
5 |
endif(NOT ghc_executable)
|
|
6 |
|
|
7 |
set(hwserver_sources
|
|
8 |
HWProto.hs
|
|
9 |
Miscutils.hs
|
|
10 |
Opts.hs
|
|
11 |
hedgewars-server.hs
|
|
12 |
)
|
|
13 |
|
|
14 |
set(ghc_flags "--make" "hedgewars-server.hs")
|
|
15 |
|
|
16 |
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
|
|
17 |
COMMAND "${ghc_executable}"
|
|
18 |
ARGS ${ghc_flags}
|
|
19 |
MAIN_DEPENDENCY "hedgewars-server.hs"
|
|
20 |
DEPENDS ${hwserver_sources}
|
|
21 |
)
|
|
22 |
|
|
23 |
add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")
|
|
24 |
|
|
25 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
|