author | unc0rr |
Mon, 13 Apr 2009 13:03:57 +0000 | |
changeset 1991 | 24b5a3368ab6 |
parent 1932 | f586d75c8b6a |
child 2012 | 76fff564246b |
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 |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
14 |
#find_package(QCA2 REQUIRED) |
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
15 |
#include_directories(${QCA2_INCLUDE_DIR}) |
1843 | 16 |
|
555 | 17 |
# Configure for SDL |
18 |
find_package(SDL REQUIRED) |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
19 |
find_package(SDL_mixer REQUIRED) |
555 | 20 |
|
707 | 21 |
include_directories(${SDL_INCLUDE_DIR}) |
1226 | 22 |
include_directories(${SDLMIXER_INCLUDE_DIR}) |
1159 | 23 |
if(UNIX) |
24 |
include_directories("/usr/local/include") # HACK: in freebsd cannot find iconv.h included via SDL.h |
|
25 |
endif(UNIX) |
|
555 | 26 |
|
27 |
# Done |
|
494 | 28 |
include_directories(.) |
184 | 29 |
|
1904 | 30 |
set(CMAKE_CXX_FLAGS "-Wall") |
31 |
||
184 | 32 |
if(WIN32 AND NOT UNIX) |
33 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 34 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 35 |
else(WIN32 AND NOT UNIX) |
36 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 37 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 38 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 39 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 40 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 41 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 42 |
endif(WIN32 AND NOT UNIX) |
43 |
||
579 | 44 |
configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in |
781 | 45 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 46 |
|
781 | 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 |
1621 | 90 |
) |
184 | 91 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
92 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
93 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
94 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 95 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 96 |
-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
|
97 |
-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
|
98 |
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
|
99 |
else(MINGW) |
1042 | 100 |
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
|
101 |
endif(MINGW) |
184 | 102 |
|
103 |
set(hwfr_moc_hdrs |
|
104 |
game.h |
|
1236 | 105 |
hats.h |
184 | 106 |
hwform.h |
107 |
teamselect.h |
|
108 |
teamselhelper.h |
|
109 |
frameTeam.h |
|
110 |
vertScrollArea.h |
|
111 |
gameuiconfig.h |
|
112 |
gamecfgwidget.h |
|
113 |
pages.h |
|
114 |
SquareLabel.h |
|
115 |
hedgehogerWidget.h |
|
116 |
hwmap.h |
|
117 |
mapContainer.h |
|
187 | 118 |
tcpBase.h |
208 | 119 |
about.h |
297 | 120 |
proto.h |
314 | 121 |
fpsedit.h |
122 |
netserver.h |
|
412 | 123 |
newnetclient.h |
124 |
netudpserver.h |
|
461 | 125 |
netudpwidget.h |
633 | 126 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
127 |
netserverslist.h |
555 | 128 |
chatwidget.h |
579 | 129 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
130 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
131 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
132 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
133 |
input_ip.h |
1192 | 134 |
igbox.h |
1621 | 135 |
weaponItem.h |
136 |
statsPage.h |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
137 |
misc.h |
1881 | 138 |
ammoSchemeModel.h |
1932 | 139 |
togglebutton.h |
1621 | 140 |
) |
184 | 141 |
|
477 | 142 |
set(hwfr_hdrs |
143 |
binds.h |
|
144 |
ui_hwform.h |
|
145 |
predefteams.h |
|
146 |
KB.h |
|
579 | 147 |
hwconsts.h |
477 | 148 |
) |
184 | 149 |
|
150 |
set(hwfr_rez |
|
151 |
hedgewars.qrc) |
|
152 |
||
153 |
qt4_add_resources(hwfr_rez_src |
|
154 |
${hwfr_rez}) |
|
155 |
||
156 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
157 |
${hwfr_moc_hdrs}) |
|
158 |
||
159 |
add_executable(hedgewars WIN32 |
|
160 |
${hwfr_src} |
|
161 |
${hwfr_moc_srcs} |
|
477 | 162 |
${hwfr_hdrs} |
184 | 163 |
${hwfr_rez_src}) |
495 | 164 |
|
555 | 165 |
set(HW_LINK_LIBS |
166 |
${QT_LIBRARIES} |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
167 |
# ${QCA2_LIBRARIES} |
555 | 168 |
${SDL_LIBRARY} |
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
169 |
${SDLMIXER_LIBRARY} |
555 | 170 |
) |
184 | 171 |
|
172 |
if(WIN32 AND NOT UNIX) |
|
555 | 173 |
if(NOT SDL_LIBRARY) |
174 |
set(HW_LINK_LIBS |
|
175 |
${HW_LINK_LIBS} |
|
176 |
SDL |
|
177 |
) |
|
178 |
endif(NOT SDL_LIBRARY) |
|
179 |
||
495 | 180 |
set(HW_LINK_LIBS |
181 |
${HW_LINK_LIBS} |
|
182 |
ole32 |
|
1043 | 183 |
oleaut32 |
495 | 184 |
winspool |
555 | 185 |
uuid |
186 |
) |
|
495 | 187 |
endif(WIN32 AND NOT UNIX) |
184 | 188 |
|
781 | 189 |
target_link_libraries(hedgewars |
495 | 190 |
${HW_LINK_LIBS}) |
191 |
||
192 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |