author | unc0rr |
Fri, 12 Sep 2008 18:00:49 +0000 | |
changeset 1256 | 2754a6a8c8f1 |
parent 1236 | f9110fd03754 |
child 1310 | 4616e15d566f |
permissions | -rw-r--r-- |
555 | 1 |
# Configure for Qt4 |
1196 | 2 |
set(QT_MIN_VERSION "4.3.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 |
|
420
6cdfc07dceed
netserver and netonnectedclient splited to different files
displacer
parents:
412
diff
changeset
|
65 |
netconnectedclient.cpp |
412 | 66 |
newnetclient.cpp |
67 |
netudpserver.cpp |
|
461 | 68 |
netudpwidget.cpp |
633 | 69 |
netwwwserver.cpp |
625 | 70 |
netwwwwidget.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 |
624 | 82 |
weaponItem.cpp) |
184 | 83 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
84 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
85 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
86 |
add_custom_command(OUTPUT ${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
|
87 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 88 |
-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
|
89 |
-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
|
90 |
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
|
91 |
else(MINGW) |
1042 | 92 |
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
|
93 |
endif(MINGW) |
184 | 94 |
|
95 |
set(hwfr_moc_hdrs |
|
96 |
game.h |
|
1236 | 97 |
hats.h |
184 | 98 |
hwform.h |
99 |
teamselect.h |
|
100 |
teamselhelper.h |
|
101 |
frameTeam.h |
|
102 |
vertScrollArea.h |
|
103 |
gameuiconfig.h |
|
104 |
gamecfgwidget.h |
|
105 |
pages.h |
|
106 |
SquareLabel.h |
|
107 |
hedgehogerWidget.h |
|
108 |
hwmap.h |
|
109 |
mapContainer.h |
|
187 | 110 |
tcpBase.h |
208 | 111 |
about.h |
297 | 112 |
proto.h |
314 | 113 |
fpsedit.h |
114 |
netserver.h |
|
420
6cdfc07dceed
netserver and netonnectedclient splited to different files
displacer
parents:
412
diff
changeset
|
115 |
netconnectedclient.h |
412 | 116 |
newnetclient.h |
117 |
netudpserver.h |
|
461 | 118 |
netudpwidget.h |
633 | 119 |
netwwwserver.h |
625 | 120 |
netwwwwidget.h |
633 | 121 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
122 |
netserverslist.h |
555 | 123 |
chatwidget.h |
579 | 124 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
125 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
126 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
127 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
128 |
input_ip.h |
1192 | 129 |
igbox.h |
624 | 130 |
weaponItem.h) |
184 | 131 |
|
477 | 132 |
set(hwfr_hdrs |
133 |
binds.h |
|
134 |
ui_hwform.h |
|
135 |
predefteams.h |
|
136 |
KB.h |
|
579 | 137 |
hwconsts.h |
477 | 138 |
) |
184 | 139 |
|
140 |
set(hwfr_rez |
|
141 |
hedgewars.qrc) |
|
142 |
||
143 |
qt4_add_resources(hwfr_rez_src |
|
144 |
${hwfr_rez}) |
|
145 |
||
146 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
147 |
${hwfr_moc_hdrs}) |
|
148 |
||
149 |
add_executable(hedgewars WIN32 |
|
150 |
${hwfr_src} |
|
151 |
${hwfr_moc_srcs} |
|
477 | 152 |
${hwfr_hdrs} |
184 | 153 |
${hwfr_rez_src}) |
495 | 154 |
|
555 | 155 |
set(HW_LINK_LIBS |
156 |
${QT_LIBRARIES} |
|
157 |
${SDL_LIBRARY} |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
158 |
${SDLMIXER_LIBRARY} |
555 | 159 |
) |
184 | 160 |
|
161 |
if(WIN32 AND NOT UNIX) |
|
555 | 162 |
if(NOT SDL_LIBRARY) |
163 |
set(HW_LINK_LIBS |
|
164 |
${HW_LINK_LIBS} |
|
165 |
SDL |
|
166 |
) |
|
167 |
endif(NOT SDL_LIBRARY) |
|
168 |
||
495 | 169 |
set(HW_LINK_LIBS |
170 |
${HW_LINK_LIBS} |
|
171 |
ole32 |
|
1043 | 172 |
oleaut32 |
495 | 173 |
winspool |
555 | 174 |
uuid |
175 |
) |
|
495 | 176 |
endif(WIN32 AND NOT UNIX) |
184 | 177 |
|
781 | 178 |
target_link_libraries(hedgewars |
495 | 179 |
${HW_LINK_LIBS}) |
180 |
||
181 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |