author | unc0rr |
Thu, 08 Jan 2009 15:52:02 +0000 | |
changeset 1605 | bc0bbc71e5ff |
parent 1574 | 2ff75b2abff0 |
child 1621 | d1ded2532d3f |
permissions | -rw-r--r-- |
555 | 1 |
# Configure for Qt4 |
1415
6fbfee0e113a
Allow build without net game server: introduce -DWITH_SERVER configuration parameter
unc0rr
parents:
1374
diff
changeset
|
2 |
set(QT_MIN_VERSION "4.4.0") |
260 | 3 |
|
502
bc178daca088
Fix build with CMake & gcc 4.1.2 on my system (treating #include <QtGui> as including directory)
unc0rr
parents:
495
diff
changeset
|
4 |
set(QT_USE_QTCORE TRUE) |
bc178daca088
Fix build with CMake & gcc 4.1.2 on my system (treating #include <QtGui> as including directory)
unc0rr
parents:
495
diff
changeset
|
5 |
set(QT_USE_QTGUI TRUE) |
494 | 6 |
set(QT_USE_QTNETWORK TRUE) |
7 |
set(QT_USE_QTSVG TRUE) |
|
495 | 8 |
set(QT_USE_QTXML TRUE) |
494 | 9 |
set(QT_USE_QTMAIN TRUE) |
10 |
||
184 | 11 |
find_package(Qt4 REQUIRED) |
1159 | 12 |
include(${QT_USE_FILE}) |
184 | 13 |
|
555 | 14 |
# Configure for SDL |
15 |
find_package(SDL REQUIRED) |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
16 |
find_package(SDL_mixer REQUIRED) |
555 | 17 |
|
707 | 18 |
include_directories(${SDL_INCLUDE_DIR}) |
1226 | 19 |
include_directories(${SDLMIXER_INCLUDE_DIR}) |
1159 | 20 |
if(UNIX) |
21 |
include_directories("/usr/local/include") # HACK: in freebsd cannot find iconv.h included via SDL.h |
|
22 |
endif(UNIX) |
|
555 | 23 |
|
24 |
# Done |
|
494 | 25 |
include_directories(.) |
184 | 26 |
|
27 |
if(WIN32 AND NOT UNIX) |
|
28 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 29 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 30 |
else(WIN32 AND NOT UNIX) |
31 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 32 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 33 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 34 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 35 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 36 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 37 |
endif(WIN32 AND NOT UNIX) |
38 |
||
579 | 39 |
configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in |
781 | 40 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 41 |
|
781 | 42 |
set(hwfr_src |
184 | 43 |
game.cpp |
44 |
main.cpp |
|
781 | 45 |
hwform.cpp |
184 | 46 |
team.cpp |
47 |
teamselect.cpp |
|
48 |
teamselhelper.cpp |
|
49 |
frameTeam.cpp |
|
50 |
vertScrollArea.cpp |
|
51 |
gameuiconfig.cpp |
|
52 |
ui_hwform.cpp |
|
53 |
gamecfgwidget.cpp |
|
54 |
pages.cpp |
|
55 |
SquareLabel.cpp |
|
1236 | 56 |
hats.cpp |
184 | 57 |
hedgehogerWidget.cpp |
58 |
hwmap.cpp |
|
59 |
mapContainer.cpp |
|
187 | 60 |
tcpBase.cpp |
239 | 61 |
about.cpp |
297 | 62 |
proto.cpp |
314 | 63 |
fpsedit.cpp |
64 |
netserver.cpp |
|
412 | 65 |
newnetclient.cpp |
66 |
netudpserver.cpp |
|
461 | 67 |
netudpwidget.cpp |
633 | 68 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
69 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
70 |
chatwidget.cpp |
555 | 71 |
binds.cpp |
579 | 72 |
SDLs.cpp |
73 |
playrecordpage.cpp |
|
781 | 74 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
75 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
76 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
77 |
input_ip.cpp |
1192 | 78 |
igbox.cpp |
624 | 79 |
weaponItem.cpp) |
184 | 80 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
81 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
82 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
83 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 84 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 85 |
-i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
86 |
-o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
87 |
set(hwfr_src ${hwfr_src} ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
88 |
else(MINGW) |
1042 | 89 |
set(hwfr_src ${hwfr_src} hedgewars.rc) |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
90 |
endif(MINGW) |
184 | 91 |
|
92 |
set(hwfr_moc_hdrs |
|
93 |
game.h |
|
1236 | 94 |
hats.h |
184 | 95 |
hwform.h |
96 |
teamselect.h |
|
97 |
teamselhelper.h |
|
98 |
frameTeam.h |
|
99 |
vertScrollArea.h |
|
100 |
gameuiconfig.h |
|
101 |
gamecfgwidget.h |
|
102 |
pages.h |
|
103 |
SquareLabel.h |
|
104 |
hedgehogerWidget.h |
|
105 |
hwmap.h |
|
106 |
mapContainer.h |
|
187 | 107 |
tcpBase.h |
208 | 108 |
about.h |
297 | 109 |
proto.h |
314 | 110 |
fpsedit.h |
111 |
netserver.h |
|
412 | 112 |
newnetclient.h |
113 |
netudpserver.h |
|
461 | 114 |
netudpwidget.h |
633 | 115 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
116 |
netserverslist.h |
555 | 117 |
chatwidget.h |
579 | 118 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
119 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
120 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
121 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
122 |
input_ip.h |
1192 | 123 |
igbox.h |
624 | 124 |
weaponItem.h) |
184 | 125 |
|
477 | 126 |
set(hwfr_hdrs |
127 |
binds.h |
|
128 |
ui_hwform.h |
|
129 |
predefteams.h |
|
130 |
KB.h |
|
579 | 131 |
hwconsts.h |
477 | 132 |
) |
184 | 133 |
|
134 |
set(hwfr_rez |
|
135 |
hedgewars.qrc) |
|
136 |
||
137 |
qt4_add_resources(hwfr_rez_src |
|
138 |
${hwfr_rez}) |
|
139 |
||
140 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
141 |
${hwfr_moc_hdrs}) |
|
142 |
||
143 |
add_executable(hedgewars WIN32 |
|
144 |
${hwfr_src} |
|
145 |
${hwfr_moc_srcs} |
|
477 | 146 |
${hwfr_hdrs} |
184 | 147 |
${hwfr_rez_src}) |
495 | 148 |
|
555 | 149 |
set(HW_LINK_LIBS |
150 |
${QT_LIBRARIES} |
|
151 |
${SDL_LIBRARY} |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
152 |
${SDLMIXER_LIBRARY} |
555 | 153 |
) |
184 | 154 |
|
155 |
if(WIN32 AND NOT UNIX) |
|
555 | 156 |
if(NOT SDL_LIBRARY) |
157 |
set(HW_LINK_LIBS |
|
158 |
${HW_LINK_LIBS} |
|
159 |
SDL |
|
160 |
) |
|
161 |
endif(NOT SDL_LIBRARY) |
|
162 |
||
495 | 163 |
set(HW_LINK_LIBS |
164 |
${HW_LINK_LIBS} |
|
165 |
ole32 |
|
1043 | 166 |
oleaut32 |
495 | 167 |
winspool |
555 | 168 |
uuid |
169 |
) |
|
495 | 170 |
endif(WIN32 AND NOT UNIX) |
184 | 171 |
|
781 | 172 |
target_link_libraries(hedgewars |
495 | 173 |
${HW_LINK_LIBS}) |
174 |
||
175 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |