author | koda |
Tue, 06 Oct 2009 16:30:08 +0000 | |
changeset 2406 | 2e757b32991e |
parent 2401 | 2a694ea2a437 |
child 2421 | a4b039ee2eb0 |
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 |
|
2400
2422ea85d100
added a utility that warns the user to install hedgewars when it's run from the diskimage
koda
parents:
2399
diff
changeset
|
141 |
if(APPLE) |
2422ea85d100
added a utility that warns the user to install hedgewars when it's run from the diskimage
koda
parents:
2399
diff
changeset
|
142 |
set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m) |
2422ea85d100
added a utility that warns the user to install hedgewars when it's run from the diskimage
koda
parents:
2399
diff
changeset
|
143 |
if(SPARKLE_FOUND) |
2422ea85d100
added a utility that warns the user to install hedgewars when it's run from the diskimage
koda
parents:
2399
diff
changeset
|
144 |
set(hwfr_src ${hwfr_src} AutoUpdater.cpp SparkleAutoUpdater.mm) |
2422ea85d100
added a utility that warns the user to install hedgewars when it's run from the diskimage
koda
parents:
2399
diff
changeset
|
145 |
endif() |
2395 | 146 |
endif() |
2261 | 147 |
|
477 | 148 |
set(hwfr_hdrs |
149 |
binds.h |
|
150 |
ui_hwform.h |
|
151 |
predefteams.h |
|
152 |
KB.h |
|
579 | 153 |
hwconsts.h |
477 | 154 |
) |
184 | 155 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
156 |
set(hwfr_rez hedgewars.qrc) |
184 | 157 |
|
158 |
qt4_add_resources(hwfr_rez_src |
|
159 |
${hwfr_rez}) |
|
160 |
||
161 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
162 |
${hwfr_moc_hdrs}) |
|
163 |
||
164 |
add_executable(hedgewars WIN32 |
|
165 |
${hwfr_src} |
|
166 |
${hwfr_moc_srcs} |
|
477 | 167 |
${hwfr_hdrs} |
184 | 168 |
${hwfr_rez_src}) |
2191 | 169 |
|
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
170 |
|
555 | 171 |
set(HW_LINK_LIBS |
172 |
${QT_LIBRARIES} |
|
173 |
${SDL_LIBRARY} |
|
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
174 |
openalbridge |
2191 | 175 |
) |
184 | 176 |
|
2336
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
177 |
#remember that in windows library order counts |
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
178 |
if(NOT APPLE) |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
179 |
set(HW_LINK_LIBS |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
180 |
${HW_LINK_LIBS} |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
181 |
${OPENAL_LIBRARY} |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
182 |
${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
|
183 |
${VORBIS_LIBRARY} |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
184 |
${VORBISFILE_LIBRARY} |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
185 |
) |
2336
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
186 |
else() |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
187 |
#no vorbisfile required for MacOS X |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
188 |
set(HW_LINK_LIBS |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
189 |
${OPENAL_LIBRARY} |
2230
d6963f72d21a
once again, trying to restore windows compatibility from nemo's experiments
koda
parents:
2229
diff
changeset
|
190 |
${OGG_LIBRARY} |
2218
59a9bebc4988
-Smaxx' solution for compiling frontend with static libs in windows
koda
parents:
2212
diff
changeset
|
191 |
${VORBIS_LIBRARY} |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
192 |
${HW_LINK_LIBS} |
2400
2422ea85d100
added a utility that warns the user to install hedgewars when it's run from the diskimage
koda
parents:
2399
diff
changeset
|
193 |
IOKit |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
194 |
) |
2395 | 195 |
if (SPARKLE_FOUND) |
196 |
set(HW_LINK_LIBS ${HW_LINK_LIBS} ${SPARKLE_LIBRARY}) |
|
2401 | 197 |
add_definitions(-DSPARKLE_ENABLED) |
2395 | 198 |
endif() |
2336
66c751f7a28e
fix windows compilation with dll (frontend and engine)
koda
parents:
2261
diff
changeset
|
199 |
endif() |
2200
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
200 |
|
8192be6e3aef
koda/Smaxx changes to openal for crossplatform building
nemo
parents:
2191
diff
changeset
|
201 |
|
184 | 202 |
if(WIN32 AND NOT UNIX) |
555 | 203 |
if(NOT SDL_LIBRARY) |
2401 | 204 |
set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL) |
555 | 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 |