author | unc0rr |
Fri, 30 Jan 2009 19:26:32 +0000 | |
changeset 1780 | 9b26e9f6ee96 |
parent 1621 | d1ded2532d3f |
child 1843 | 16cdd1745b73 |
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 |
|
555 | 14 |
# Configure for SDL |
15 |
find_package(SDL REQUIRED) |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
16 |
find_package(SDL_mixer REQUIRED) |
555 | 17 |
|
707 | 18 |
include_directories(${SDL_INCLUDE_DIR}) |
1226 | 19 |
include_directories(${SDLMIXER_INCLUDE_DIR}) |
1159 | 20 |
if(UNIX) |
21 |
include_directories("/usr/local/include") # HACK: in freebsd cannot find iconv.h included via SDL.h |
|
22 |
endif(UNIX) |
|
555 | 23 |
|
24 |
# Done |
|
494 | 25 |
include_directories(.) |
184 | 26 |
|
27 |
if(WIN32 AND NOT UNIX) |
|
28 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 29 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 30 |
else(WIN32 AND NOT UNIX) |
31 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 32 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 33 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 34 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 35 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 36 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 37 |
endif(WIN32 AND NOT UNIX) |
38 |
||
579 | 39 |
configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in |
781 | 40 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 41 |
|
781 | 42 |
set(hwfr_src |
184 | 43 |
game.cpp |
44 |
main.cpp |
|
781 | 45 |
hwform.cpp |
184 | 46 |
team.cpp |
47 |
teamselect.cpp |
|
48 |
teamselhelper.cpp |
|
49 |
frameTeam.cpp |
|
50 |
vertScrollArea.cpp |
|
51 |
gameuiconfig.cpp |
|
52 |
ui_hwform.cpp |
|
53 |
gamecfgwidget.cpp |
|
54 |
pages.cpp |
|
55 |
SquareLabel.cpp |
|
1236 | 56 |
hats.cpp |
184 | 57 |
hedgehogerWidget.cpp |
58 |
hwmap.cpp |
|
59 |
mapContainer.cpp |
|
187 | 60 |
tcpBase.cpp |
239 | 61 |
about.cpp |
297 | 62 |
proto.cpp |
314 | 63 |
fpsedit.cpp |
64 |
netserver.cpp |
|
412 | 65 |
newnetclient.cpp |
66 |
netudpserver.cpp |
|
461 | 67 |
netudpwidget.cpp |
633 | 68 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
69 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
70 |
chatwidget.cpp |
555 | 71 |
binds.cpp |
579 | 72 |
SDLs.cpp |
73 |
playrecordpage.cpp |
|
781 | 74 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
75 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
76 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
77 |
input_ip.cpp |
1192 | 78 |
igbox.cpp |
1621 | 79 |
weaponItem.cpp |
80 |
statsPage.cpp |
|
81 |
) |
|
184 | 82 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
83 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
84 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
85 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 86 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 87 |
-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
|
88 |
-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
|
89 |
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
|
90 |
else(MINGW) |
1042 | 91 |
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
|
92 |
endif(MINGW) |
184 | 93 |
|
94 |
set(hwfr_moc_hdrs |
|
95 |
game.h |
|
1236 | 96 |
hats.h |
184 | 97 |
hwform.h |
98 |
teamselect.h |
|
99 |
teamselhelper.h |
|
100 |
frameTeam.h |
|
101 |
vertScrollArea.h |
|
102 |
gameuiconfig.h |
|
103 |
gamecfgwidget.h |
|
104 |
pages.h |
|
105 |
SquareLabel.h |
|
106 |
hedgehogerWidget.h |
|
107 |
hwmap.h |
|
108 |
mapContainer.h |
|
187 | 109 |
tcpBase.h |
208 | 110 |
about.h |
297 | 111 |
proto.h |
314 | 112 |
fpsedit.h |
113 |
netserver.h |
|
412 | 114 |
newnetclient.h |
115 |
netudpserver.h |
|
461 | 116 |
netudpwidget.h |
633 | 117 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
118 |
netserverslist.h |
555 | 119 |
chatwidget.h |
579 | 120 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
121 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
122 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
123 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
124 |
input_ip.h |
1192 | 125 |
igbox.h |
1621 | 126 |
weaponItem.h |
127 |
statsPage.h |
|
128 |
) |
|
184 | 129 |
|
477 | 130 |
set(hwfr_hdrs |
131 |
binds.h |
|
132 |
ui_hwform.h |
|
133 |
predefteams.h |
|
134 |
KB.h |
|
579 | 135 |
hwconsts.h |
477 | 136 |
) |
184 | 137 |
|
138 |
set(hwfr_rez |
|
139 |
hedgewars.qrc) |
|
140 |
||
141 |
qt4_add_resources(hwfr_rez_src |
|
142 |
${hwfr_rez}) |
|
143 |
||
144 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
145 |
${hwfr_moc_hdrs}) |
|
146 |
||
147 |
add_executable(hedgewars WIN32 |
|
148 |
${hwfr_src} |
|
149 |
${hwfr_moc_srcs} |
|
477 | 150 |
${hwfr_hdrs} |
184 | 151 |
${hwfr_rez_src}) |
495 | 152 |
|
555 | 153 |
set(HW_LINK_LIBS |
154 |
${QT_LIBRARIES} |
|
155 |
${SDL_LIBRARY} |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
156 |
${SDLMIXER_LIBRARY} |
555 | 157 |
) |
184 | 158 |
|
159 |
if(WIN32 AND NOT UNIX) |
|
555 | 160 |
if(NOT SDL_LIBRARY) |
161 |
set(HW_LINK_LIBS |
|
162 |
${HW_LINK_LIBS} |
|
163 |
SDL |
|
164 |
) |
|
165 |
endif(NOT SDL_LIBRARY) |
|
166 |
||
495 | 167 |
set(HW_LINK_LIBS |
168 |
${HW_LINK_LIBS} |
|
169 |
ole32 |
|
1043 | 170 |
oleaut32 |
495 | 171 |
winspool |
555 | 172 |
uuid |
173 |
) |
|
495 | 174 |
endif(WIN32 AND NOT UNIX) |
184 | 175 |
|
781 | 176 |
target_link_libraries(hedgewars |
495 | 177 |
${HW_LINK_LIBS}) |
178 |
||
179 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |