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