netserver/CMakeLists.txt
author unc0rr
Sat, 18 Oct 2008 11:57:46 +0000
changeset 1370 ff8863ebde17
child 1371 e206cdb009a7
permissions -rw-r--r--
Add hedgewars server to build process
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1370
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     1
find_program(ghc_executable ghc)
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     2
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     3
if (NOT ghc_executable)
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     4
	message("Cannot find GHC" FATAL)
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     5
endif(NOT ghc_executable)
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     6
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     7
set(hwserver_sources
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     8
	HWProto.hs
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
     9
	Miscutils.hs
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    10
	Opts.hs
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    11
	hedgewars-server.hs
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    12
	)
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    13
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    14
set(ghc_flags "--make" "hedgewars-server.hs")
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    15
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    16
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    17
		COMMAND "${ghc_executable}"
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    18
		ARGS ${ghc_flags}
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    19
		MAIN_DEPENDENCY "hedgewars-server.hs"
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    20
		DEPENDS ${hwserver_sources}
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    21
		)
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    22
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    23
add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    24
ff8863ebde17 Add hedgewars server to build process
unc0rr
parents:
diff changeset
    25
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)