author | unc0rr |
Sun, 22 Mar 2009 14:35:45 +0000 | |
changeset 1907 | a104432e8301 |
parent 1904 | 20348675b015 |
child 1932 | f586d75c8b6a |
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 |
1621 | 89 |
) |
184 | 90 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
91 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
92 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
93 |
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
1574 | 94 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 95 |
-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
|
96 |
-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
|
97 |
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
|
98 |
else(MINGW) |
1042 | 99 |
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
|
100 |
endif(MINGW) |
184 | 101 |
|
102 |
set(hwfr_moc_hdrs |
|
103 |
game.h |
|
1236 | 104 |
hats.h |
184 | 105 |
hwform.h |
106 |
teamselect.h |
|
107 |
teamselhelper.h |
|
108 |
frameTeam.h |
|
109 |
vertScrollArea.h |
|
110 |
gameuiconfig.h |
|
111 |
gamecfgwidget.h |
|
112 |
pages.h |
|
113 |
SquareLabel.h |
|
114 |
hedgehogerWidget.h |
|
115 |
hwmap.h |
|
116 |
mapContainer.h |
|
187 | 117 |
tcpBase.h |
208 | 118 |
about.h |
297 | 119 |
proto.h |
314 | 120 |
fpsedit.h |
121 |
netserver.h |
|
412 | 122 |
newnetclient.h |
123 |
netudpserver.h |
|
461 | 124 |
netudpwidget.h |
633 | 125 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
126 |
netserverslist.h |
555 | 127 |
chatwidget.h |
579 | 128 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
129 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
130 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
131 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
132 |
input_ip.h |
1192 | 133 |
igbox.h |
1621 | 134 |
weaponItem.h |
135 |
statsPage.h |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
136 |
misc.h |
1881 | 137 |
ammoSchemeModel.h |
1621 | 138 |
) |
184 | 139 |
|
477 | 140 |
set(hwfr_hdrs |
141 |
binds.h |
|
142 |
ui_hwform.h |
|
143 |
predefteams.h |
|
144 |
KB.h |
|
579 | 145 |
hwconsts.h |
477 | 146 |
) |
184 | 147 |
|
148 |
set(hwfr_rez |
|
149 |
hedgewars.qrc) |
|
150 |
||
151 |
qt4_add_resources(hwfr_rez_src |
|
152 |
${hwfr_rez}) |
|
153 |
||
154 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
155 |
${hwfr_moc_hdrs}) |
|
156 |
||
157 |
add_executable(hedgewars WIN32 |
|
158 |
${hwfr_src} |
|
159 |
${hwfr_moc_srcs} |
|
477 | 160 |
${hwfr_hdrs} |
184 | 161 |
${hwfr_rez_src}) |
495 | 162 |
|
555 | 163 |
set(HW_LINK_LIBS |
164 |
${QT_LIBRARIES} |
|
1878
b3b277d2b891
own md5 function, no qca2 dependancy (patch by nemo with Qt adaptation by me)
unc0rr
parents:
1843
diff
changeset
|
165 |
# ${QCA2_LIBRARIES} |
555 | 166 |
${SDL_LIBRARY} |
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
167 |
${SDLMIXER_LIBRARY} |
555 | 168 |
) |
184 | 169 |
|
170 |
if(WIN32 AND NOT UNIX) |
|
555 | 171 |
if(NOT SDL_LIBRARY) |
172 |
set(HW_LINK_LIBS |
|
173 |
${HW_LINK_LIBS} |
|
174 |
SDL |
|
175 |
) |
|
176 |
endif(NOT SDL_LIBRARY) |
|
177 |
||
495 | 178 |
set(HW_LINK_LIBS |
179 |
${HW_LINK_LIBS} |
|
180 |
ole32 |
|
1043 | 181 |
oleaut32 |
495 | 182 |
winspool |
555 | 183 |
uuid |
184 |
) |
|
495 | 185 |
endif(WIN32 AND NOT UNIX) |
184 | 186 |
|
781 | 187 |
target_link_libraries(hedgewars |
495 | 188 |
${HW_LINK_LIBS}) |
189 |
||
190 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |