author | unc0rr |
Fri, 15 Aug 2008 06:33:50 +0000 | |
changeset 1214 | 090f94cd663e |
parent 1196 | 3b8806ffa1b1 |
child 1223 | 41d7283934c1 |
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) |
|
16 |
||
707 | 17 |
include_directories(${SDL_INCLUDE_DIR}) |
1159 | 18 |
if(UNIX) |
19 |
include_directories("/usr/local/include") # HACK: in freebsd cannot find iconv.h included via SDL.h |
|
20 |
endif(UNIX) |
|
555 | 21 |
|
22 |
# Done |
|
494 | 23 |
include_directories(.) |
184 | 24 |
|
25 |
if(WIN32 AND NOT UNIX) |
|
26 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 27 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 28 |
else(WIN32 AND NOT UNIX) |
29 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 30 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 31 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 32 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 33 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 34 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 35 |
endif(WIN32 AND NOT UNIX) |
36 |
||
579 | 37 |
configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in |
781 | 38 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 39 |
|
781 | 40 |
set(hwfr_src |
184 | 41 |
game.cpp |
42 |
main.cpp |
|
781 | 43 |
hwform.cpp |
184 | 44 |
team.cpp |
45 |
teamselect.cpp |
|
46 |
teamselhelper.cpp |
|
47 |
frameTeam.cpp |
|
48 |
vertScrollArea.cpp |
|
49 |
gameuiconfig.cpp |
|
50 |
ui_hwform.cpp |
|
51 |
gamecfgwidget.cpp |
|
52 |
pages.cpp |
|
53 |
SquareLabel.cpp |
|
54 |
hedgehogerWidget.cpp |
|
55 |
hwmap.cpp |
|
56 |
mapContainer.cpp |
|
187 | 57 |
tcpBase.cpp |
239 | 58 |
about.cpp |
297 | 59 |
proto.cpp |
314 | 60 |
fpsedit.cpp |
61 |
netserver.cpp |
|
420
6cdfc07dceed
netserver and netonnectedclient splited to different files
displacer
parents:
412
diff
changeset
|
62 |
netconnectedclient.cpp |
412 | 63 |
newnetclient.cpp |
64 |
netudpserver.cpp |
|
461 | 65 |
netudpwidget.cpp |
633 | 66 |
netwwwserver.cpp |
625 | 67 |
netwwwwidget.cpp |
633 | 68 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
69 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
70 |
chatwidget.cpp |
555 | 71 |
binds.cpp |
579 | 72 |
SDLs.cpp |
73 |
playrecordpage.cpp |
|
781 | 74 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
75 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
76 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
77 |
input_ip.cpp |
1192 | 78 |
igbox.cpp |
624 | 79 |
weaponItem.cpp) |
184 | 80 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
81 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
82 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
83 |
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
|
84 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
1039 | 85 |
-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
|
86 |
-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
|
87 |
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
|
88 |
else(MINGW) |
1042 | 89 |
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
|
90 |
endif(MINGW) |
184 | 91 |
|
92 |
set(hwfr_moc_hdrs |
|
93 |
game.h |
|
94 |
hwform.h |
|
95 |
teamselect.h |
|
96 |
teamselhelper.h |
|
97 |
frameTeam.h |
|
98 |
vertScrollArea.h |
|
99 |
gameuiconfig.h |
|
100 |
gamecfgwidget.h |
|
101 |
pages.h |
|
102 |
SquareLabel.h |
|
103 |
hedgehogerWidget.h |
|
104 |
hwmap.h |
|
105 |
mapContainer.h |
|
187 | 106 |
tcpBase.h |
208 | 107 |
about.h |
297 | 108 |
proto.h |
314 | 109 |
fpsedit.h |
110 |
netserver.h |
|
420
6cdfc07dceed
netserver and netonnectedclient splited to different files
displacer
parents:
412
diff
changeset
|
111 |
netconnectedclient.h |
412 | 112 |
newnetclient.h |
113 |
netudpserver.h |
|
461 | 114 |
netudpwidget.h |
633 | 115 |
netwwwserver.h |
625 | 116 |
netwwwwidget.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} |
|
154 |
) |
|
184 | 155 |
|
156 |
if(WIN32 AND NOT UNIX) |
|
555 | 157 |
if(NOT SDL_LIBRARY) |
158 |
set(HW_LINK_LIBS |
|
159 |
${HW_LINK_LIBS} |
|
160 |
SDL |
|
161 |
) |
|
162 |
endif(NOT SDL_LIBRARY) |
|
163 |
||
495 | 164 |
set(HW_LINK_LIBS |
165 |
${HW_LINK_LIBS} |
|
166 |
ole32 |
|
1043 | 167 |
oleaut32 |
495 | 168 |
winspool |
555 | 169 |
uuid |
170 |
) |
|
495 | 171 |
endif(WIN32 AND NOT UNIX) |
184 | 172 |
|
781 | 173 |
target_link_libraries(hedgewars |
495 | 174 |
${HW_LINK_LIBS}) |
175 |
||
176 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |