271
+ − 1
configure_file(${hedgewars_SOURCE_DIR}/hedgewars/proto.inc.in
+ − 2
${hedgewars_SOURCE_DIR}/hedgewars/proto.inc)
+ − 3
184
+ − 4
set(fpc_tryexe fpc)
+ − 5
set(hwengine_project "hwengine.dpr")
+ − 6
220
+ − 7
set(engine_sources
+ − 8
${hwengine_project}
+ − 9
SDLh.pas
+ − 10
uAI.pas
+ − 11
uAIActions.pas
+ − 12
uAIAmmoTests.pas
+ − 13
uAIMisc.pas
+ − 14
uAIThinkStack.pas
288
+ − 15
uAmmos.pas
220
+ − 16
uCollisions.pas
+ − 17
uConsole.pas
+ − 18
uConsts.pas
357
+ − 19
uFloat.pas
220
+ − 20
uGame.pas
+ − 21
uGears.pas
+ − 22
uIO.pas
+ − 23
uKeys.pas
+ − 24
uLand.pas
+ − 25
uLandGraphics.pas
+ − 26
uLandObjects.pas
+ − 27
uLandTemplates.pas
+ − 28
uLocale.pas
+ − 29
uMisc.pas
+ − 30
uRandom.pas
368
+ − 31
uSHA.pas
220
+ − 32
uSound.pas
+ − 33
uStore.pas
+ − 34
uTeams.pas
+ − 35
uWorld.pas
+ − 36
CCHandlers.inc
+ − 37
GSHandlers.inc
+ − 38
HHHandlers.inc
357
+ − 39
SinTable.inc
220
+ − 40
options.inc
271
+ − 41
proto.inc
220
+ − 42
tunsetborder.inc
+ − 43
)
+ − 44
184
+ − 45
find_program(fpc_executable ${fpc_tryexe})
+ − 46
+ − 47
if (fpc_executable)
+ − 48
exec_program(${fpc_executable} ARGS "-h" OUTPUT_VARIABLE fpc_output)
+ − 49
endif (fpc_executable)
+ − 50
360
+ − 51
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}")
+ − 52
if (fpc_version)
+ − 53
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
+ − 54
string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
+ − 55
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
+ − 56
math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
+ − 57
if (fpc_ver LESS "010904")
+ − 58
message("Minimum required version of FreePascal is 1.9.4")
+ − 59
else (fpc_ver LESS "010904")
+ − 60
set(pascal_compiler ${fpc_executable})
+ − 61
set(pascal_compiler_flags "-B" "-FE../bin" "-Cs2000000" "-O2" ${hwengine_project})
+ − 62
endif (fpc_ver LESS "010904")
+ − 63
endif (fpc_version)
184
+ − 64
+ − 65
if (NOT pascal_compiler)
+ − 66
message(FATAL_ERROR "No Pascal compiler found!")
+ − 67
endif (NOT pascal_compiler)
+ − 68
220
+ − 69
add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}"
+ − 70
COMMAND "${pascal_compiler}"
+ − 71
ARGS ${pascal_compiler_flags}
+ − 72
MAIN_DEPENDENCY ${hwengine_project}
+ − 73
DEPENDS ${engine_sources}
+ − 74
)
+ − 75
+ − 76
add_custom_target(hwengine ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}")
184
+ − 77
220
+ − 78
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)