12 message(STATUS "Found CLANG: ${clang_executable} (version ${clang_version})") |
12 message(STATUS "Found CLANG: ${clang_executable} (version ${clang_version})") |
13 else() |
13 else() |
14 message(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)") |
14 message(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)") |
15 endif() |
15 endif() |
16 |
16 |
|
17 set(CMAKE_C_COMPILER ${clang_executable}) |
|
18 |
17 |
19 |
18 find_package(GLEW REQUIRED) |
20 find_package(GLEW REQUIRED) |
19 |
21 |
20 |
22 |
21 set(CMAKE_C_COMPILER ${clang_executable}) |
23 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
22 |
24 |
23 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
|
24 |
25 |
25 add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c" |
26 add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c" |
26 COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}" |
27 COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}" |
27 ARGS -n hwengine -i "${hedgewars_SOURCE_DIR}/hedgewars" -o "${CMAKE_CURRENT_BINARY_DIR}" -a ./ |
28 ARGS -n hwengine |
|
29 -i "${hedgewars_SOURCE_DIR}/hedgewars" |
|
30 -o "${CMAKE_CURRENT_BINARY_DIR}" |
|
31 -a "${CMAKE_CURRENT_BINARY_DIR}" |
28 DEPENDS pas2c |
32 DEPENDS pas2c |
29 ) |
33 ) |
30 |
34 |
31 add_custom_target(engine_c ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c") |
35 add_custom_target(engine_c ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c") |
|
36 |
32 |
37 |
33 add_subdirectory(rtl) |
38 add_subdirectory(rtl) |
34 |
39 |
35 include_directories("${GLEW_INCLUDE_PATH}") |
40 include_directories("${GLEW_INCLUDE_PATH}") |
36 include_directories(rtl) |
41 include_directories(rtl) |
37 |
42 |
38 file(GLOB engine_src *.c) |
43 set(engine_src uDebug.c uLandTexture.c |
|
44 LuaPas.c uFloat.c uLocale.c |
|
45 SDLh.c uGame.c uMisc.c |
|
46 adler32.c uGears.c uMobile.c |
|
47 hwengine.c uGearsHandlers.c uRandom.c |
|
48 uAI.c uGearsHandlersRope.c uRender.c |
|
49 uAIActions.c uGearsHedgehog.c uRenderUtils.c |
|
50 uAIAmmoTests.c uGearsList.c uScript.c |
|
51 uAILandMarks.c uGearsRender.c uSinTable.c |
|
52 uAIMisc.c uGearsUtils.c uSound.c |
|
53 uAmmos.c uIO.c uStats.c |
|
54 uCaptions.c uInputHandler.c uStore.c |
|
55 uChat.c uLand.c uTeams.c |
|
56 uCollisions.c uLandGenMaze.c uTextures.c |
|
57 uCommandHandlers.c uLandGraphics.c uTypes.c |
|
58 uCommands.c uLandObjects.c uUtils.c |
|
59 uConsole.c uLandOutline.c uVariables.c |
|
60 uConsts.c uLandPainted.c uVisualGears.c |
|
61 uCursor.c uLandTemplates.c uWorld.c |
|
62 ) |
|
63 |
|
64 set(engine_hdr uGame.h uFloat.h |
|
65 uLocale.h SDLh.h uMisc.h |
|
66 adler32.h uDebug.h uLandTexture.h |
|
67 LuaPas.h uGears.h uMobile.h |
|
68 uAI.h uGearsHandlersRope.h uRender.h |
|
69 uAIActions.h uGearsHedgehog.h uRenderUtils.h |
|
70 uAIAmmoTests.h uGearsList.h uScript.h |
|
71 uGearsHandlers.h uRandom.h |
|
72 uAILandMarks.h uGearsRender.h uSinTable.h |
|
73 uAIMisc.h uGearsUtils.h uSound.h |
|
74 uAmmos.h uIO.h uStats.h |
|
75 uCaptions.h uInputHandler.h uStore.h |
|
76 uChat.h uLand.h uTeams.h |
|
77 uCollisions.h uLandGenMaze.h uTextures.h |
|
78 uCommandHandlers.h uLandGraphics.h uTypes.h |
|
79 uCommands.h uLandObjects.h uUtils.h |
|
80 uConsole.h uLandOutline.h uVariables.h |
|
81 uConsts.h uLandPainted.h uVisualGears.h |
|
82 uCursor.h uLandTemplates.h uWorld.h |
|
83 ) |
|
84 |
39 add_executable(hwengine WIN32 ${engine_src}) |
85 add_executable(hwengine WIN32 ${engine_src}) |
40 add_dependencies(hwengine engine_c fpcrtl) |
86 add_dependencies(hwengine engine_c fpcrtl) |
|
87 |