75
|
1 |
add_subdirectory(Data)
|
|
2 |
|
73
|
3 |
set(dcc32_tryexe dcc32.exe)
|
|
4 |
set(ppc386_tryexe ppc386)
|
|
5 |
set(hwengine_project "hwengine.dpr")
|
|
6 |
|
|
7 |
find_program(dcc32_executable ${dcc32_tryexe})
|
|
8 |
find_program(ppc386_executable ${ppc386_tryexe})
|
|
9 |
|
|
10 |
if (dcc32_executable)
|
|
11 |
exec_program(${dcc32_executable} ARGS "--version" OUTPUT_VARIABLE dcc32_output)
|
|
12 |
endif (dcc32_executable)
|
|
13 |
|
|
14 |
if (ppc386_executable)
|
|
15 |
exec_program(${ppc386_executable} ARGS "-v" OUTPUT_VARIABLE ppc386_output)
|
|
16 |
endif (ppc386_executable)
|
|
17 |
|
|
18 |
string(REGEX MATCH "[0-9]+\\.[0-9]+" dcc32version "${dcc32_output}")
|
|
19 |
if (dcc32version)
|
|
20 |
set(pascal_compiler ${dcc32_executable})
|
|
21 |
set(pascal_compiler_flags "-B -W"${hwengine_project})
|
|
22 |
else (dcc32version)
|
|
23 |
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" ppc386_version "${ppc386_output}")
|
|
24 |
if (ppc386_version)
|
|
25 |
string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" ppc386_vers_major "${ppc386_version}")
|
|
26 |
string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" ppc386_vers_minor "${ppc386_version}")
|
|
27 |
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" ppc386_vers_patch "${ppc386_version}")
|
|
28 |
math(EXPR ppc386_ver "${ppc386_vers_major}*10000 + ${ppc386_vers_minor}*100 + ${ppc386_vers_patch}")
|
|
29 |
if (ppc386_ver LESS "010902")
|
|
30 |
message("Minimum required version of FreePascal is 1.9.2")
|
|
31 |
else (ppc386_ver LESS "010902")
|
|
32 |
set(pascal_compiler ${ppc386_executable})
|
75
|
33 |
set(pascal_compiler_flags "-B -Sd -Xs -OG -O3 -Cs2000000"${hwengine_project})
|
73
|
34 |
endif (ppc386_ver LESS "010902")
|
|
35 |
endif (ppc386_version)
|
|
36 |
endif (dcc32version)
|
|
37 |
|
|
38 |
if (NOT pascal_compiler)
|
|
39 |
message(FATAL_ERROR "No Pascal compiler found!")
|
|
40 |
endif (NOT pascal_compiler)
|
|
41 |
|
89
|
42 |
add_custom_command(COMMAND ${pascal_compiler} TARGET hwengine OUTPUTS hwengine ARGS ${pascal_compiler_flags})
|
73
|
43 |
|
89
|
44 |
install(PROGRAMS "hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin)
|