8004
|
1 |
|
|
2 |
if(CLANG)
|
|
3 |
set(clang_executable ${CLANG})
|
|
4 |
else()
|
|
5 |
find_program(clang_executable clang)
|
|
6 |
endif()
|
|
7 |
|
|
8 |
if (clang_executable)
|
|
9 |
exec_program(${clang_executable} ARGS "-v" OUTPUT_VARIABLE clang_version_full)
|
|
10 |
string(REGEX MATCH "[0-9]+\\.[0-9]+" clang_version_long "${clang_version_full}")
|
|
11 |
string(REGEX REPLACE "([0-9]+\\.[0-9]+)" "\\1" clang_version "${clang_version_long}")
|
|
12 |
message(STATUS "Found CLANG: ${clang_executable} (version ${clang_version})")
|
|
13 |
else()
|
|
14 |
message(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)")
|
|
15 |
endif()
|
|
16 |
|
|
17 |
|
|
18 |
find_package(GLEW REQUIRED)
|
|
19 |
|
|
20 |
|
|
21 |
set(CMAKE_C_COMPILER ${clang_executable})
|
7999
|
22 |
|
|
23 |
configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
|
|
24 |
|
|
25 |
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c"
|
|
26 |
COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
|
|
27 |
ARGS -n hwengine -i "${hedgewars_SOURCE_DIR}/hedgewars" -o "${CMAKE_CURRENT_BINARY_DIR}" -a ./
|
|
28 |
DEPENDS pas2c
|
|
29 |
)
|
|
30 |
|
|
31 |
add_custom_target(engine_c ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c")
|
|
32 |
|
|
33 |
add_subdirectory(rtl)
|
|
34 |
|
8004
|
35 |
include_directories("${GLEW_INCLUDE_PATH}")
|
|
36 |
include_directories(rtl)
|
7999
|
37 |
|
|
38 |
file(GLOB engine_src *.c)
|
|
39 |
add_executable(hwengine WIN32 ${engine_src})
|
|
40 |
add_dependencies(hwengine engine_c fpcrtl)
|