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