author | koda |
Sun, 31 Oct 2010 18:28:12 +0100 | |
changeset 4049 | fe799b5d601b |
parent 3708 | 64e059b6f9c5 |
child 4004 | b1c2c2f6fc5e |
child 4320 | 8af00b86a38c |
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) |
2525 | 7 |
set(QT_USE_QTSVG FALSE) |
2428 | 8 |
set(QT_USE_QTXML FALSE) |
9 |
set(QT_USE_QTOPENGL FALSE) |
|
494 | 10 |
set(QT_USE_QTMAIN TRUE) |
11 |
||
184 | 12 |
find_package(Qt4 REQUIRED) |
1159 | 13 |
include(${QT_USE_FILE}) |
184 | 14 |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
15 |
#find_package(QCA2 REQUIRED) |
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
16 |
#include_directories(${QCA2_INCLUDE_DIR}) |
1843 | 17 |
|
555 | 18 |
# Configure for SDL |
19 |
find_package(SDL REQUIRED) |
|
2515
51d3f4b6293a
revert audio to use SDL_mixer -- also frontend uses it, so it needs sdlmixer sources
koda
parents:
2443
diff
changeset
|
20 |
find_package(SDL_mixer REQUIRED) |
555 | 21 |
|
2239
d7b5c65f7544
move C and C++ optimization flags in the main CMakeLists.txt
koda
parents:
2230
diff
changeset
|
22 |
include_directories(.) |
707 | 23 |
include_directories(${SDL_INCLUDE_DIR}) |
2515
51d3f4b6293a
revert audio to use SDL_mixer -- also frontend uses it, so it needs sdlmixer sources
koda
parents:
2443
diff
changeset
|
24 |
include_directories(${SDLMIXER_INCLUDE_DIR}) |
1159 | 25 |
if(UNIX) |
2443
fececcbc2189
Smaxx patch for fixing all sound related issues on any system
koda
parents:
2428
diff
changeset
|
26 |
# HACK: in freebsd cannot find iconv.h included via SDL.h |
fececcbc2189
Smaxx patch for fixing all sound related issues on any system
koda
parents:
2428
diff
changeset
|
27 |
include_directories("/usr/local/include") |
1159 | 28 |
endif(UNIX) |
555 | 29 |
|
1904 | 30 |
|
184 | 31 |
if(WIN32 AND NOT UNIX) |
32 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 33 |
set(HEDGEWARS_DATADIR "../share/") |
3708
64e059b6f9c5
applied from experimental3D, use a slider to set up quality
koda
parents:
3697
diff
changeset
|
34 |
add_definitions(-DUSE_XFIRE) |
2652 | 35 |
else() |
184 | 36 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
266 | 37 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 38 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
2652 | 39 |
else() |
265 | 40 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
2652 | 41 |
endif() |
2663 | 42 |
endif() |
184 | 43 |
|
2239
d7b5c65f7544
move C and C++ optimization flags in the main CMakeLists.txt
koda
parents:
2230
diff
changeset
|
44 |
|
2219
07f5345ecae7
additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
2218
diff
changeset
|
45 |
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 46 |
|
2641 | 47 |
set( hwfr_src |
184 | 48 |
game.cpp |
49 |
main.cpp |
|
781 | 50 |
hwform.cpp |
184 | 51 |
team.cpp |
1907 | 52 |
namegen.cpp |
184 | 53 |
teamselect.cpp |
54 |
teamselhelper.cpp |
|
55 |
frameTeam.cpp |
|
56 |
vertScrollArea.cpp |
|
57 |
gameuiconfig.cpp |
|
58 |
ui_hwform.cpp |
|
59 |
gamecfgwidget.cpp |
|
60 |
pages.cpp |
|
61 |
SquareLabel.cpp |
|
1236 | 62 |
hats.cpp |
184 | 63 |
hedgehogerWidget.cpp |
64 |
hwmap.cpp |
|
65 |
mapContainer.cpp |
|
187 | 66 |
tcpBase.cpp |
239 | 67 |
about.cpp |
297 | 68 |
proto.cpp |
314 | 69 |
fpsedit.cpp |
70 |
netserver.cpp |
|
412 | 71 |
newnetclient.cpp |
72 |
netudpserver.cpp |
|
461 | 73 |
netudpwidget.cpp |
633 | 74 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
75 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
76 |
chatwidget.cpp |
555 | 77 |
binds.cpp |
579 | 78 |
SDLs.cpp |
79 |
playrecordpage.cpp |
|
781 | 80 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
81 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
82 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
83 |
input_ip.cpp |
1192 | 84 |
igbox.cpp |
1621 | 85 |
weaponItem.cpp |
86 |
statsPage.cpp |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
87 |
misc.cpp |
1881 | 88 |
ammoSchemeModel.cpp |
1932 | 89 |
togglebutton.cpp |
2012 | 90 |
bgwidget.cpp |
3344 | 91 |
achievements.cpp |
1621 | 92 |
) |
184 | 93 |
|
2821 | 94 |
#xfire integration |
95 |
if(WIN32) |
|
2830 | 96 |
set(hwfr_src ${hwfr_src} xfire.cpp ../misc/xfire/xfiregameclient.cpp) |
2821 | 97 |
endif(WIN32) |
98 |
||
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
99 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
100 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
101 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 102 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 103 |
-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
|
104 |
-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
|
105 |
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
|
106 |
else(MINGW) |
1042 | 107 |
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
|
108 |
endif(MINGW) |
184 | 109 |
|
2641 | 110 |
set( hwfr_moc_hdrs |
184 | 111 |
game.h |
1236 | 112 |
hats.h |
184 | 113 |
hwform.h |
114 |
teamselect.h |
|
115 |
teamselhelper.h |
|
116 |
frameTeam.h |
|
117 |
vertScrollArea.h |
|
118 |
gameuiconfig.h |
|
119 |
gamecfgwidget.h |
|
120 |
pages.h |
|
121 |
SquareLabel.h |
|
122 |
hedgehogerWidget.h |
|
123 |
hwmap.h |
|
124 |
mapContainer.h |
|
187 | 125 |
tcpBase.h |
208 | 126 |
about.h |
297 | 127 |
proto.h |
314 | 128 |
fpsedit.h |
129 |
netserver.h |
|
412 | 130 |
newnetclient.h |
131 |
netudpserver.h |
|
461 | 132 |
netudpwidget.h |
633 | 133 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
134 |
netserverslist.h |
555 | 135 |
chatwidget.h |
579 | 136 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
137 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
138 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
139 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
140 |
input_ip.h |
1192 | 141 |
igbox.h |
1621 | 142 |
weaponItem.h |
143 |
statsPage.h |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
144 |
misc.h |
1881 | 145 |
ammoSchemeModel.h |
1932 | 146 |
togglebutton.h |
2012 | 147 |
bgwidget.h |
1621 | 148 |
) |
184 | 149 |
|
2641 | 150 |
set( hwfr_hdrs |
477 | 151 |
binds.h |
152 |
ui_hwform.h |
|
153 |
predefteams.h |
|
154 |
KB.h |
|
579 | 155 |
hwconsts.h |
2652 | 156 |
) |
184 | 157 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
158 |
set(hwfr_rez hedgewars.qrc) |
184 | 159 |
|
2641 | 160 |
qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
184 | 161 |
|
2641 | 162 |
qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
184 | 163 |
|
2652 | 164 |
|
165 |
if(APPLE) |
|
166 |
set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m) |
|
167 |
set(HW_LINK_LIBS IOKit) |
|
168 |
||
169 |
find_package(Sparkle) |
|
170 |
if(SPARKLE_FOUND) |
|
171 |
add_definitions(-DSPARKLE_ENABLED) |
|
172 |
set(hwfr_src ${hwfr_src} AutoUpdater.cpp SparkleAutoUpdater.mm) |
|
173 |
set(HW_LINK_LIBS ${SPARKLE_LIBRARY} ${HW_LINK_LIBS}) |
|
174 |
endif() |
|
175 |
endif() |
|
176 |
||
177 |
||
184 | 178 |
add_executable(hedgewars WIN32 |
179 |
${hwfr_src} |
|
180 |
${hwfr_moc_srcs} |
|
477 | 181 |
${hwfr_hdrs} |
2641 | 182 |
${hwfr_rez_src} |
183 |
) |
|
2191 | 184 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
185 |
|
3697 | 186 |
set( HW_LINK_LIBS |
555 | 187 |
${QT_LIBRARIES} |
188 |
${SDL_LIBRARY} |
|
2515
51d3f4b6293a
revert audio to use SDL_mixer -- also frontend uses it, so it needs sdlmixer sources
koda
parents:
2443
diff
changeset
|
189 |
${SDLMIXER_LIBRARY} |
2652 | 190 |
${HW_LINK_LIBS} |
2641 | 191 |
) |
184 | 192 |
|
193 |
if(WIN32 AND NOT UNIX) |
|
555 | 194 |
if(NOT SDL_LIBRARY) |
2401 | 195 |
set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL) |
2663 | 196 |
endif() |
555 | 197 |
|
3697 | 198 |
set( HW_LINK_LIBS |
495 | 199 |
${HW_LINK_LIBS} |
200 |
ole32 |
|
1043 | 201 |
oleaut32 |
495 | 202 |
winspool |
555 | 203 |
uuid |
204 |
) |
|
2663 | 205 |
endif() |
184 | 206 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
207 |
|
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
208 |
target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
209 |
|
495 | 210 |
|
2015 | 211 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
212 |