equal
deleted
inserted
replaced
|
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}) |
1 |
22 |
2 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
23 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
3 |
24 |
4 add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c" |
25 add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c" |
5 COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}" |
26 COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}" |
9 |
30 |
10 add_custom_target(engine_c ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c") |
31 add_custom_target(engine_c ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c") |
11 |
32 |
12 add_subdirectory(rtl) |
33 add_subdirectory(rtl) |
13 |
34 |
14 find_package(GLEW REQUIRED) |
35 include_directories("${GLEW_INCLUDE_PATH}") |
15 message("${GLEW_INCLUDE_PATH}") |
36 include_directories(rtl) |
16 |
37 |
17 include_directories(rtl) |
|
18 file(GLOB engine_src *.c) |
38 file(GLOB engine_src *.c) |
19 add_executable(hwengine WIN32 ${engine_src}) |
39 add_executable(hwengine WIN32 ${engine_src}) |
20 add_dependencies(hwengine engine_c fpcrtl) |
40 add_dependencies(hwengine engine_c fpcrtl) |