author | unc0rr |
Wed, 08 Oct 2008 15:55:23 +0000 | |
changeset 1319 | fedaae857a50 |
parent 1310 | 4616e15d566f |
child 1374 | f33fa81e583d |
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 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
70 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
71 |
chatwidget.cpp |
555 | 72 |
binds.cpp |
579 | 73 |
SDLs.cpp |
74 |
playrecordpage.cpp |
|
781 | 75 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
76 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
77 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
78 |
input_ip.cpp |
1192 | 79 |
igbox.cpp |
624 | 80 |
weaponItem.cpp) |
184 | 81 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
82 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
83 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
84 |
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
|
85 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 86 |
-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
|
87 |
-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
|
88 |
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
|
89 |
else(MINGW) |
1042 | 90 |
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
|
91 |
endif(MINGW) |
184 | 92 |
|
93 |
set(hwfr_moc_hdrs |
|
94 |
game.h |
|
1236 | 95 |
hats.h |
184 | 96 |
hwform.h |
97 |
teamselect.h |
|
98 |
teamselhelper.h |
|
99 |
frameTeam.h |
|
100 |
vertScrollArea.h |
|
101 |
gameuiconfig.h |
|
102 |
gamecfgwidget.h |
|
103 |
pages.h |
|
104 |
SquareLabel.h |
|
105 |
hedgehogerWidget.h |
|
106 |
hwmap.h |
|
107 |
mapContainer.h |
|
187 | 108 |
tcpBase.h |
208 | 109 |
about.h |
297 | 110 |
proto.h |
314 | 111 |
fpsedit.h |
112 |
netserver.h |
|
420
6cdfc07dceed
netserver and netonnectedclient splited to different files
displacer
parents:
412
diff
changeset
|
113 |
netconnectedclient.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 |
624 | 126 |
weaponItem.h) |
184 | 127 |
|
477 | 128 |
set(hwfr_hdrs |
129 |
binds.h |
|
130 |
ui_hwform.h |
|
131 |
predefteams.h |
|
132 |
KB.h |
|
579 | 133 |
hwconsts.h |
477 | 134 |
) |
184 | 135 |
|
136 |
set(hwfr_rez |
|
137 |
hedgewars.qrc) |
|
138 |
||
139 |
qt4_add_resources(hwfr_rez_src |
|
140 |
${hwfr_rez}) |
|
141 |
||
142 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
143 |
${hwfr_moc_hdrs}) |
|
144 |
||
145 |
add_executable(hedgewars WIN32 |
|
146 |
${hwfr_src} |
|
147 |
${hwfr_moc_srcs} |
|
477 | 148 |
${hwfr_hdrs} |
184 | 149 |
${hwfr_rez_src}) |
495 | 150 |
|
555 | 151 |
set(HW_LINK_LIBS |
152 |
${QT_LIBRARIES} |
|
153 |
${SDL_LIBRARY} |
|
1223
41d7283934c1
Hackish way to play music in frontend... to be fixed
unc0rr
parents:
1196
diff
changeset
|
154 |
${SDLMIXER_LIBRARY} |
555 | 155 |
) |
184 | 156 |
|
157 |
if(WIN32 AND NOT UNIX) |
|
555 | 158 |
if(NOT SDL_LIBRARY) |
159 |
set(HW_LINK_LIBS |
|
160 |
${HW_LINK_LIBS} |
|
161 |
SDL |
|
162 |
) |
|
163 |
endif(NOT SDL_LIBRARY) |
|
164 |
||
495 | 165 |
set(HW_LINK_LIBS |
166 |
${HW_LINK_LIBS} |
|
167 |
ole32 |
|
1043 | 168 |
oleaut32 |
495 | 169 |
winspool |
555 | 170 |
uuid |
171 |
) |
|
495 | 172 |
endif(WIN32 AND NOT UNIX) |
184 | 173 |
|
781 | 174 |
target_link_libraries(hedgewars |
495 | 175 |
${HW_LINK_LIBS}) |
176 |
||
177 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |