author | unc0rr |
Thu, 30 Apr 2009 20:13:44 +0000 | |
changeset 2017 | 7845c77c8d31 |
parent 2015 | d2848d723690 |
child 2191 | 20c62f787a4d |
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) |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
20 |
find_package(SDL_mixer REQUIRED) |
555 | 21 |
|
707 | 22 |
include_directories(${SDL_INCLUDE_DIR}) |
1226 | 23 |
include_directories(${SDLMIXER_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 |
|
28 |
# Done |
|
494 | 29 |
include_directories(.) |
184 | 30 |
|
2015 | 31 |
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}") |
1904 | 32 |
|
184 | 33 |
if(WIN32 AND NOT UNIX) |
34 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 35 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 36 |
else(WIN32 AND NOT UNIX) |
37 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 38 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 39 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 40 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 41 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 42 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 43 |
endif(WIN32 AND NOT UNIX) |
44 |
||
579 | 45 |
configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in |
781 | 46 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 47 |
|
781 | 48 |
set(hwfr_src |
184 | 49 |
game.cpp |
50 |
main.cpp |
|
781 | 51 |
hwform.cpp |
184 | 52 |
team.cpp |
1907 | 53 |
namegen.cpp |
184 | 54 |
teamselect.cpp |
55 |
teamselhelper.cpp |
|
56 |
frameTeam.cpp |
|
57 |
vertScrollArea.cpp |
|
58 |
gameuiconfig.cpp |
|
59 |
ui_hwform.cpp |
|
60 |
gamecfgwidget.cpp |
|
61 |
pages.cpp |
|
62 |
SquareLabel.cpp |
|
1236 | 63 |
hats.cpp |
184 | 64 |
hedgehogerWidget.cpp |
65 |
hwmap.cpp |
|
66 |
mapContainer.cpp |
|
187 | 67 |
tcpBase.cpp |
239 | 68 |
about.cpp |
297 | 69 |
proto.cpp |
314 | 70 |
fpsedit.cpp |
71 |
netserver.cpp |
|
412 | 72 |
newnetclient.cpp |
73 |
netudpserver.cpp |
|
461 | 74 |
netudpwidget.cpp |
633 | 75 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
76 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
77 |
chatwidget.cpp |
555 | 78 |
binds.cpp |
579 | 79 |
SDLs.cpp |
80 |
playrecordpage.cpp |
|
781 | 81 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
82 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
83 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
84 |
input_ip.cpp |
1192 | 85 |
igbox.cpp |
1621 | 86 |
weaponItem.cpp |
87 |
statsPage.cpp |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
88 |
misc.cpp |
1881 | 89 |
ammoSchemeModel.cpp |
1932 | 90 |
togglebutton.cpp |
2012 | 91 |
bgwidget.cpp |
1621 | 92 |
) |
184 | 93 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
94 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
95 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
96 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 97 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 98 |
-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
|
99 |
-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
|
100 |
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
|
101 |
else(MINGW) |
1042 | 102 |
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
|
103 |
endif(MINGW) |
184 | 104 |
|
105 |
set(hwfr_moc_hdrs |
|
106 |
game.h |
|
1236 | 107 |
hats.h |
184 | 108 |
hwform.h |
109 |
teamselect.h |
|
110 |
teamselhelper.h |
|
111 |
frameTeam.h |
|
112 |
vertScrollArea.h |
|
113 |
gameuiconfig.h |
|
114 |
gamecfgwidget.h |
|
115 |
pages.h |
|
116 |
SquareLabel.h |
|
117 |
hedgehogerWidget.h |
|
118 |
hwmap.h |
|
119 |
mapContainer.h |
|
187 | 120 |
tcpBase.h |
208 | 121 |
about.h |
297 | 122 |
proto.h |
314 | 123 |
fpsedit.h |
124 |
netserver.h |
|
412 | 125 |
newnetclient.h |
126 |
netudpserver.h |
|
461 | 127 |
netudpwidget.h |
633 | 128 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
129 |
netserverslist.h |
555 | 130 |
chatwidget.h |
579 | 131 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
132 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
133 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
134 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
135 |
input_ip.h |
1192 | 136 |
igbox.h |
1621 | 137 |
weaponItem.h |
138 |
statsPage.h |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
139 |
misc.h |
1881 | 140 |
ammoSchemeModel.h |
1932 | 141 |
togglebutton.h |
2012 | 142 |
bgwidget.h |
1621 | 143 |
) |
184 | 144 |
|
477 | 145 |
set(hwfr_hdrs |
146 |
binds.h |
|
147 |
ui_hwform.h |
|
148 |
predefteams.h |
|
149 |
KB.h |
|
579 | 150 |
hwconsts.h |
477 | 151 |
) |
184 | 152 |
|
153 |
set(hwfr_rez |
|
154 |
hedgewars.qrc) |
|
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}) |
495 | 167 |
|
555 | 168 |
set(HW_LINK_LIBS |
169 |
${QT_LIBRARIES} |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
170 |
# ${QCA2_LIBRARIES} |
555 | 171 |
${SDL_LIBRARY} |
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
172 |
${SDLMIXER_LIBRARY} |
555 | 173 |
) |
184 | 174 |
|
175 |
if(WIN32 AND NOT UNIX) |
|
555 | 176 |
if(NOT SDL_LIBRARY) |
177 |
set(HW_LINK_LIBS |
|
178 |
${HW_LINK_LIBS} |
|
179 |
SDL |
|
180 |
) |
|
181 |
endif(NOT SDL_LIBRARY) |
|
182 |
||
495 | 183 |
set(HW_LINK_LIBS |
184 |
${HW_LINK_LIBS} |
|
185 |
ole32 |
|
1043 | 186 |
oleaut32 |
495 | 187 |
winspool |
555 | 188 |
uuid |
189 |
) |
|
495 | 190 |
endif(WIN32 AND NOT UNIX) |
184 | 191 |
|
781 | 192 |
target_link_libraries(hedgewars |
495 | 193 |
${HW_LINK_LIBS}) |
194 |
||
2015 | 195 |
|
196 |
if(APPLE) |
|
197 |
set (target_dir ".") |
|
198 |
else(APPLE) |
|
199 |
set (target_dir "bin") |
|
200 |
endif(APPLE) |
|
201 |
||
202 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |