author | koda |
Sat, 26 Sep 2009 20:54:13 +0000 | |
changeset 2395 | d01d3bf3e1de |
parent 2336 | 66c751f7a28e |
child 2399 | ddde0ac1472b |
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) |
2012 | 9 |
# set(QT_USE_QTOPENGL TRUE) |
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) |
|
2395 | 20 |
find_package(Sparkle) |
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}) |
1159 | 24 |
if(UNIX) |
25 |
include_directories("/usr/local/include") # HACK: in freebsd cannot find iconv.h included via SDL.h |
|
26 |
endif(UNIX) |
|
555 | 27 |
|
1904 | 28 |
|
184 | 29 |
if(WIN32 AND NOT UNIX) |
30 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 31 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 32 |
else(WIN32 AND NOT UNIX) |
33 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 34 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 35 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 36 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 37 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 38 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 39 |
endif(WIN32 AND NOT UNIX) |
40 |
||
2239
d7b5c65f7544
move C and C++ optimization flags in the main CMakeLists.txt
koda
parents:
2230
diff
changeset
|
41 |
|
2219
07f5345ecae7
additional variable (BUNDLE) to make a standalone Mac application
koda
parents:
2218
diff
changeset
|
42 |
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 43 |
|
781 | 44 |
set(hwfr_src |
184 | 45 |
game.cpp |
46 |
main.cpp |
|
781 | 47 |
hwform.cpp |
184 | 48 |
team.cpp |
1907 | 49 |
namegen.cpp |
184 | 50 |
teamselect.cpp |
51 |
teamselhelper.cpp |
|
52 |
frameTeam.cpp |
|
53 |
vertScrollArea.cpp |
|
54 |
gameuiconfig.cpp |
|
55 |
ui_hwform.cpp |
|
56 |
gamecfgwidget.cpp |
|
57 |
pages.cpp |
|
58 |
SquareLabel.cpp |
|
1236 | 59 |
hats.cpp |
184 | 60 |
hedgehogerWidget.cpp |
61 |
hwmap.cpp |
|
62 |
mapContainer.cpp |
|
187 | 63 |
tcpBase.cpp |
239 | 64 |
about.cpp |
297 | 65 |
proto.cpp |
314 | 66 |
fpsedit.cpp |
67 |
netserver.cpp |
|
412 | 68 |
newnetclient.cpp |
69 |
netudpserver.cpp |
|
461 | 70 |
netudpwidget.cpp |
633 | 71 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
72 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
73 |
chatwidget.cpp |
555 | 74 |
binds.cpp |
579 | 75 |
SDLs.cpp |
76 |
playrecordpage.cpp |
|
781 | 77 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
78 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
79 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
80 |
input_ip.cpp |
1192 | 81 |
igbox.cpp |
1621 | 82 |
weaponItem.cpp |
83 |
statsPage.cpp |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
84 |
misc.cpp |
1881 | 85 |
ammoSchemeModel.cpp |
1932 | 86 |
togglebutton.cpp |
2012 | 87 |
bgwidget.cpp |
1621 | 88 |
) |
184 | 89 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
90 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
91 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
92 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 93 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 94 |
-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
|
95 |
-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
|
96 |
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
|
97 |
else(MINGW) |
1042 | 98 |
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
|
99 |
endif(MINGW) |
184 | 100 |
|
101 |
set(hwfr_moc_hdrs |
|
102 |
game.h |
|
1236 | 103 |
hats.h |
184 | 104 |
hwform.h |
105 |
teamselect.h |
|
106 |
teamselhelper.h |
|
107 |
frameTeam.h |
|
108 |
vertScrollArea.h |
|
109 |
gameuiconfig.h |
|
110 |
gamecfgwidget.h |
|
111 |
pages.h |
|
112 |
SquareLabel.h |
|
113 |
hedgehogerWidget.h |
|
114 |
hwmap.h |
|
115 |
mapContainer.h |
|
187 | 116 |
tcpBase.h |
208 | 117 |
about.h |
297 | 118 |
proto.h |
314 | 119 |
fpsedit.h |
120 |
netserver.h |
|
412 | 121 |
newnetclient.h |
122 |
netudpserver.h |
|
461 | 123 |
netudpwidget.h |
633 | 124 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
125 |
netserverslist.h |
555 | 126 |
chatwidget.h |
579 | 127 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
128 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
129 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
130 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
131 |
input_ip.h |
1192 | 132 |
igbox.h |
1621 | 133 |
weaponItem.h |
134 |
statsPage.h |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
135 |
misc.h |
1881 | 136 |
ammoSchemeModel.h |
1932 | 137 |
togglebutton.h |
2012 | 138 |
bgwidget.h |
1621 | 139 |
) |
184 | 140 |
|
2395 | 141 |
if(APPLE AND SPARKLE_FOUND) |
2261 | 142 |
set(hwfr_src ${hwfr_src} AutoUpdater.cpp CocoaInitializer.mm SparkleAutoUpdater.mm) |
143 |
#set(hwfr_moc_hdrs ${hwfr_moc_hdrs} AutoUpdater.h CocoaInitializer.h SparkleAutoUpdater.h) |
|
2395 | 144 |
endif() |
2261 | 145 |
|
477 | 146 |
set(hwfr_hdrs |
147 |
binds.h |
|
148 |
ui_hwform.h |
|
149 |
predefteams.h |
|
150 |
KB.h |
|
579 | 151 |
hwconsts.h |
477 | 152 |
) |
184 | 153 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
154 |
set(hwfr_rez hedgewars.qrc) |
184 | 155 |
|
156 |
qt4_add_resources(hwfr_rez_src |
|
157 |
${hwfr_rez}) |
|
158 |
||
159 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
160 |
${hwfr_moc_hdrs}) |
|
161 |
||
162 |
add_executable(hedgewars WIN32 |
|
163 |
${hwfr_src} |
|
164 |
${hwfr_moc_srcs} |
|
477 | 165 |
${hwfr_hdrs} |
184 | 166 |
${hwfr_rez_src}) |
2191 | 167 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
168 |
|
555 | 169 |
set(HW_LINK_LIBS |
170 |
${QT_LIBRARIES} |
|
171 |
${SDL_LIBRARY} |
|
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
172 |
openalbridge |
2191 | 173 |
) |
184 | 174 |
|
2336
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
175 |
#remember that in windows library order counts |
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
176 |
if(NOT APPLE) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
177 |
set(HW_LINK_LIBS |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
178 |
${HW_LINK_LIBS} |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
179 |
${OPENAL_LIBRARY} |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
180 |
${OGG_LIBRARY} |
2229
081081a61a16
patch for loading sprites on two columns (helps embedded and lowpower machines). must deal with amGirder.png
koda
parents:
2219
diff
changeset
|
181 |
${VORBIS_LIBRARY} |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
182 |
${VORBISFILE_LIBRARY} |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
183 |
) |
2336
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
184 |
else() |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
185 |
#no vorbisfile required for MacOS X |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
186 |
set(HW_LINK_LIBS |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
187 |
${OPENAL_LIBRARY} |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
188 |
${OGG_LIBRARY} |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
189 |
${VORBIS_LIBRARY} |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
190 |
${HW_LINK_LIBS} |
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
191 |
) |
2395 | 192 |
if (SPARKLE_FOUND) |
193 |
set(HW_LINK_LIBS ${HW_LINK_LIBS} ${SPARKLE_LIBRARY}) |
|
194 |
set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS} "-DSPARKLE_ENABLED") |
|
195 |
endif() |
|
2336
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
196 |
endif() |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
197 |
|
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
198 |
|
184 | 199 |
if(WIN32 AND NOT UNIX) |
555 | 200 |
if(NOT SDL_LIBRARY) |
201 |
set(HW_LINK_LIBS |
|
202 |
${HW_LINK_LIBS} |
|
203 |
SDL |
|
204 |
) |
|
205 |
endif(NOT SDL_LIBRARY) |
|
206 |
||
495 | 207 |
set(HW_LINK_LIBS |
208 |
${HW_LINK_LIBS} |
|
209 |
ole32 |
|
1043 | 210 |
oleaut32 |
495 | 211 |
winspool |
555 | 212 |
uuid |
213 |
) |
|
495 | 214 |
endif(WIN32 AND NOT UNIX) |
184 | 215 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
216 |
|
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
217 |
target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
218 |
|
495 | 219 |
|
2015 | 220 |
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
|
221 |