8004
|
1 |
|
|
2 |
if(CLANG)
|
|
3 |
set(clang_executable ${CLANG})
|
|
4 |
else()
|
8023
|
5 |
find_program(clang_executable
|
|
6 |
NAMES clang-mp-3.2 clang-mp-3.1 clang-mp-3.0 clang
|
|
7 |
PATHS /opt/local/bin /usr/local/bin /usr/bin)
|
8004
|
8 |
endif()
|
|
9 |
|
|
10 |
if (clang_executable)
|
|
11 |
exec_program(${clang_executable} ARGS "-v" OUTPUT_VARIABLE clang_version_full)
|
|
12 |
string(REGEX MATCH "[0-9]+\\.[0-9]+" clang_version_long "${clang_version_full}")
|
|
13 |
string(REGEX REPLACE "([0-9]+\\.[0-9]+)" "\\1" clang_version "${clang_version_long}")
|
8008
|
14 |
#TODO: check version >= 3.0
|
8004
|
15 |
message(STATUS "Found CLANG: ${clang_executable} (version ${clang_version})")
|
|
16 |
else()
|
|
17 |
message(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)")
|
|
18 |
endif()
|
|
19 |
|
8006
|
20 |
set(CMAKE_C_COMPILER ${clang_executable})
|
|
21 |
|
8004
|
22 |
|
8029
|
23 |
find_package(OPENGL REQUIRED)
|
8004
|
24 |
find_package(GLEW REQUIRED)
|
8029
|
25 |
find_package(SDL REQUIRED)
|
|
26 |
find_package(SDL_mixer REQUIRED)
|
|
27 |
find_package(SDL_net REQUIRED)
|
|
28 |
find_package(SDL_image REQUIRED)
|
|
29 |
find_package(SDL_ttf REQUIRED)
|
8004
|
30 |
|
8006
|
31 |
configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
|
7999
|
32 |
|
|
33 |
|
|
34 |
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c"
|
|
35 |
COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
|
8006
|
36 |
ARGS -n hwengine
|
|
37 |
-i "${hedgewars_SOURCE_DIR}/hedgewars"
|
8008
|
38 |
#-i "~/xymengxy-webport/hedgewars"
|
8006
|
39 |
-o "${CMAKE_CURRENT_BINARY_DIR}"
|
|
40 |
-a "${CMAKE_CURRENT_BINARY_DIR}"
|
7999
|
41 |
DEPENDS pas2c
|
8006
|
42 |
)
|
7999
|
43 |
|
|
44 |
add_custom_target(engine_c ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c")
|
|
45 |
|
8006
|
46 |
|
7999
|
47 |
add_subdirectory(rtl)
|
|
48 |
|
8004
|
49 |
include_directories("${GLEW_INCLUDE_PATH}")
|
|
50 |
include_directories(rtl)
|
7999
|
51 |
|
8006
|
52 |
set(engine_src uDebug.c uLandTexture.c
|
|
53 |
LuaPas.c uFloat.c uLocale.c
|
|
54 |
SDLh.c uGame.c uMisc.c
|
|
55 |
adler32.c uGears.c uMobile.c
|
|
56 |
hwengine.c uGearsHandlers.c uRandom.c
|
|
57 |
uAI.c uGearsHandlersRope.c uRender.c
|
|
58 |
uAIActions.c uGearsHedgehog.c uRenderUtils.c
|
|
59 |
uAIAmmoTests.c uGearsList.c uScript.c
|
|
60 |
uAILandMarks.c uGearsRender.c uSinTable.c
|
|
61 |
uAIMisc.c uGearsUtils.c uSound.c
|
|
62 |
uAmmos.c uIO.c uStats.c
|
|
63 |
uCaptions.c uInputHandler.c uStore.c
|
|
64 |
uChat.c uLand.c uTeams.c
|
|
65 |
uCollisions.c uLandGenMaze.c uTextures.c
|
|
66 |
uCommandHandlers.c uLandGraphics.c uTypes.c
|
|
67 |
uCommands.c uLandObjects.c uUtils.c
|
|
68 |
uConsole.c uLandOutline.c uVariables.c
|
|
69 |
uConsts.c uLandPainted.c uVisualGears.c
|
|
70 |
uCursor.c uLandTemplates.c uWorld.c
|
|
71 |
)
|
|
72 |
|
|
73 |
set(engine_hdr uGame.h uFloat.h
|
|
74 |
uLocale.h SDLh.h uMisc.h
|
|
75 |
adler32.h uDebug.h uLandTexture.h
|
|
76 |
LuaPas.h uGears.h uMobile.h
|
|
77 |
uAI.h uGearsHandlersRope.h uRender.h
|
|
78 |
uAIActions.h uGearsHedgehog.h uRenderUtils.h
|
|
79 |
uAIAmmoTests.h uGearsList.h uScript.h
|
|
80 |
uGearsHandlers.h uRandom.h
|
|
81 |
uAILandMarks.h uGearsRender.h uSinTable.h
|
|
82 |
uAIMisc.h uGearsUtils.h uSound.h
|
|
83 |
uAmmos.h uIO.h uStats.h
|
|
84 |
uCaptions.h uInputHandler.h uStore.h
|
|
85 |
uChat.h uLand.h uTeams.h
|
|
86 |
uCollisions.h uLandGenMaze.h uTextures.h
|
|
87 |
uCommandHandlers.h uLandGraphics.h uTypes.h
|
|
88 |
uCommands.h uLandObjects.h uUtils.h
|
|
89 |
uConsole.h uLandOutline.h uVariables.h
|
|
90 |
uConsts.h uLandPainted.h uVisualGears.h
|
|
91 |
uCursor.h uLandTemplates.h uWorld.h
|
|
92 |
)
|
|
93 |
|
7999
|
94 |
add_executable(hwengine WIN32 ${engine_src})
|
8029
|
95 |
|
|
96 |
target_link_libraries(hwengine fpcrtl
|
|
97 |
${LUA_LIBRARY}
|
|
98 |
${OPENGL_LIBRARY}
|
|
99 |
${SDL_LIBRARY}
|
|
100 |
${SDLMIXER_LIBRARY}
|
|
101 |
${SDLNET_LIBRARY}
|
|
102 |
${SDLIMAGE_LIBRARY}
|
|
103 |
${SDLTTF_LIBRARY}
|
|
104 |
)
|
|
105 |
|
7999
|
106 |
add_dependencies(hwengine engine_c fpcrtl)
|
8006
|
107 |
|