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