author | unc0rr |
Thu, 05 Mar 2009 14:54:02 +0000 | |
changeset 1861 | 98de5dc5fda7 |
parent 1843 | 16cdd1745b73 |
child 1878 | b3b277d2b891 |
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 |
|
1843 | 14 |
find_package(QCA2 REQUIRED) |
15 |
include_directories(${QCA2_INCLUDE_DIR}) |
|
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 |
|
30 |
if(WIN32 AND NOT UNIX) |
|
31 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 32 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 33 |
else(WIN32 AND NOT UNIX) |
34 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 35 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 36 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 37 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 38 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 39 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 40 |
endif(WIN32 AND NOT UNIX) |
41 |
||
579 | 42 |
configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in |
781 | 43 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 44 |
|
781 | 45 |
set(hwfr_src |
184 | 46 |
game.cpp |
47 |
main.cpp |
|
781 | 48 |
hwform.cpp |
184 | 49 |
team.cpp |
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 |
|
84 |
) |
|
184 | 85 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
86 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
87 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
88 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 89 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 90 |
-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
|
91 |
-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
|
92 |
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
|
93 |
else(MINGW) |
1042 | 94 |
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
|
95 |
endif(MINGW) |
184 | 96 |
|
97 |
set(hwfr_moc_hdrs |
|
98 |
game.h |
|
1236 | 99 |
hats.h |
184 | 100 |
hwform.h |
101 |
teamselect.h |
|
102 |
teamselhelper.h |
|
103 |
frameTeam.h |
|
104 |
vertScrollArea.h |
|
105 |
gameuiconfig.h |
|
106 |
gamecfgwidget.h |
|
107 |
pages.h |
|
108 |
SquareLabel.h |
|
109 |
hedgehogerWidget.h |
|
110 |
hwmap.h |
|
111 |
mapContainer.h |
|
187 | 112 |
tcpBase.h |
208 | 113 |
about.h |
297 | 114 |
proto.h |
314 | 115 |
fpsedit.h |
116 |
netserver.h |
|
412 | 117 |
newnetclient.h |
118 |
netudpserver.h |
|
461 | 119 |
netudpwidget.h |
633 | 120 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
121 |
netserverslist.h |
555 | 122 |
chatwidget.h |
579 | 123 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
124 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
125 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
126 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
127 |
input_ip.h |
1192 | 128 |
igbox.h |
1621 | 129 |
weaponItem.h |
130 |
statsPage.h |
|
131 |
) |
|
184 | 132 |
|
477 | 133 |
set(hwfr_hdrs |
134 |
binds.h |
|
135 |
ui_hwform.h |
|
136 |
predefteams.h |
|
137 |
KB.h |
|
579 | 138 |
hwconsts.h |
477 | 139 |
) |
184 | 140 |
|
141 |
set(hwfr_rez |
|
142 |
hedgewars.qrc) |
|
143 |
||
144 |
qt4_add_resources(hwfr_rez_src |
|
145 |
${hwfr_rez}) |
|
146 |
||
147 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
148 |
${hwfr_moc_hdrs}) |
|
149 |
||
150 |
add_executable(hedgewars WIN32 |
|
151 |
${hwfr_src} |
|
152 |
${hwfr_moc_srcs} |
|
477 | 153 |
${hwfr_hdrs} |
184 | 154 |
${hwfr_rez_src}) |
495 | 155 |
|
555 | 156 |
set(HW_LINK_LIBS |
157 |
${QT_LIBRARIES} |
|
1843 | 158 |
${QCA2_LIBRARIES} |
555 | 159 |
${SDL_LIBRARY} |
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
160 |
${SDLMIXER_LIBRARY} |
555 | 161 |
) |
184 | 162 |
|
163 |
if(WIN32 AND NOT UNIX) |
|
555 | 164 |
if(NOT SDL_LIBRARY) |
165 |
set(HW_LINK_LIBS |
|
166 |
${HW_LINK_LIBS} |
|
167 |
SDL |
|
168 |
) |
|
169 |
endif(NOT SDL_LIBRARY) |
|
170 |
||
495 | 171 |
set(HW_LINK_LIBS |
172 |
${HW_LINK_LIBS} |
|
173 |
ole32 |
|
1043 | 174 |
oleaut32 |
495 | 175 |
winspool |
555 | 176 |
uuid |
177 |
) |
|
495 | 178 |
endif(WIN32 AND NOT UNIX) |
184 | 179 |
|
781 | 180 |
target_link_libraries(hedgewars |
495 | 181 |
${HW_LINK_LIBS}) |
182 |
||
183 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |