author | unc0rr |
Wed, 18 Jun 2008 22:12:58 +0000 | |
changeset 1018 | 7db4bb7ef074 |
parent 880 | f9efe907828f |
child 1039 | 27187008b12f |
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) |
494 | 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}) |
555 | 18 |
|
19 |
# Done |
|
494 | 20 |
include_directories(.) |
184 | 21 |
|
22 |
if(WIN32 AND NOT UNIX) |
|
23 |
set(HEDGEWARS_BINDIR ".") |
|
267 | 24 |
set(HEDGEWARS_DATADIR "../share/") |
184 | 25 |
else(WIN32 AND NOT UNIX) |
26 |
set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
|
266 | 27 |
if(DEFINED DATA_INSTALL_DIR) |
265 | 28 |
set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
266 | 29 |
else(DEFINED DATA_INSTALL_DIR) |
265 | 30 |
set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
266 | 31 |
endif(DEFINED DATA_INSTALL_DIR) |
184 | 32 |
endif(WIN32 AND NOT UNIX) |
33 |
||
579 | 34 |
configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/hwconsts.cpp.in |
781 | 35 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
184 | 36 |
|
781 | 37 |
set(hwfr_src |
184 | 38 |
game.cpp |
39 |
main.cpp |
|
781 | 40 |
hwform.cpp |
184 | 41 |
team.cpp |
42 |
teamselect.cpp |
|
43 |
teamselhelper.cpp |
|
44 |
frameTeam.cpp |
|
45 |
vertScrollArea.cpp |
|
46 |
gameuiconfig.cpp |
|
47 |
ui_hwform.cpp |
|
48 |
gamecfgwidget.cpp |
|
49 |
pages.cpp |
|
50 |
SquareLabel.cpp |
|
51 |
hedgehogerWidget.cpp |
|
52 |
hwmap.cpp |
|
53 |
mapContainer.cpp |
|
187 | 54 |
tcpBase.cpp |
239 | 55 |
about.cpp |
297 | 56 |
proto.cpp |
314 | 57 |
fpsedit.cpp |
58 |
netserver.cpp |
|
420
6cdfc07dceed
netserver and netonnectedclient splited to different files
displacer
parents:
412
diff
changeset
|
59 |
netconnectedclient.cpp |
412 | 60 |
newnetclient.cpp |
61 |
netudpserver.cpp |
|
461 | 62 |
netudpwidget.cpp |
633 | 63 |
netwwwserver.cpp |
625 | 64 |
netwwwwidget.cpp |
633 | 65 |
netregister.cpp |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
66 |
netserverslist.cpp |
539
6a9bf1852bbc
Ability to choose which info is shown above hedgehogs
unc0rr
parents:
502
diff
changeset
|
67 |
chatwidget.cpp |
555 | 68 |
binds.cpp |
579 | 69 |
SDLs.cpp |
70 |
playrecordpage.cpp |
|
781 | 71 |
${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
72 |
selectWeapon.cpp |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
73 |
itemNum.cpp |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
74 |
input_ip.cpp |
624 | 75 |
weaponItem.cpp) |
184 | 76 |
|
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
77 |
if(MINGW) |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
78 |
# resource compilation for mingw |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
79 |
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
|
80 |
COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
81 |
-i ${CMAKE_CURRENT_SOURCE_DIR}/res/hedgewars.rc |
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
82 |
-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
|
83 |
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
|
84 |
else(MINGW) |
184 | 85 |
set(hwfr_src ${hwfr_src} res/hedgewars.rc) |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
86 |
endif(MINGW) |
184 | 87 |
|
88 |
set(hwfr_moc_hdrs |
|
89 |
game.h |
|
90 |
hwform.h |
|
91 |
teamselect.h |
|
92 |
teamselhelper.h |
|
93 |
frameTeam.h |
|
94 |
vertScrollArea.h |
|
95 |
gameuiconfig.h |
|
96 |
gamecfgwidget.h |
|
97 |
pages.h |
|
98 |
SquareLabel.h |
|
99 |
hedgehogerWidget.h |
|
100 |
hwmap.h |
|
101 |
mapContainer.h |
|
187 | 102 |
tcpBase.h |
208 | 103 |
about.h |
297 | 104 |
proto.h |
314 | 105 |
fpsedit.h |
106 |
netserver.h |
|
420
6cdfc07dceed
netserver and netonnectedclient splited to different files
displacer
parents:
412
diff
changeset
|
107 |
netconnectedclient.h |
412 | 108 |
newnetclient.h |
109 |
netudpserver.h |
|
461 | 110 |
netudpwidget.h |
633 | 111 |
netwwwserver.h |
625 | 112 |
netwwwwidget.h |
633 | 113 |
netregister.h |
632
5e09ae25729f
Half implement possibility for different backends of servers list
unc0rr
parents:
625
diff
changeset
|
114 |
netserverslist.h |
555 | 115 |
chatwidget.h |
579 | 116 |
SDLs.h |
597
ec5f057ab268
kdevelop project add, initial weapons scheme button
displacer
parents:
592
diff
changeset
|
117 |
playrecordpage.h |
612
333d095319de
abstract class for items container (hedgehogs num, bullets, etc.)
displacer
parents:
597
diff
changeset
|
118 |
selectWeapon.h |
880
f9efe907828f
Add win32 resource compilation under mingw (used sim-im srcs as example)
unc0rr
parents:
781
diff
changeset
|
119 |
itemNum.h |
653
4f44fc06ca45
Class to ask host/port to connect to ('Specify' button on PageNet)
unc0rr
parents:
633
diff
changeset
|
120 |
input_ip.h |
624 | 121 |
weaponItem.h) |
184 | 122 |
|
477 | 123 |
set(hwfr_hdrs |
124 |
binds.h |
|
125 |
ui_hwform.h |
|
126 |
predefteams.h |
|
127 |
KB.h |
|
579 | 128 |
hwconsts.h |
477 | 129 |
) |
184 | 130 |
|
131 |
set(hwfr_rez |
|
132 |
hedgewars.qrc) |
|
133 |
||
134 |
qt4_add_resources(hwfr_rez_src |
|
135 |
${hwfr_rez}) |
|
136 |
||
137 |
qt4_wrap_cpp(hwfr_moc_srcs |
|
138 |
${hwfr_moc_hdrs}) |
|
139 |
||
140 |
add_executable(hedgewars WIN32 |
|
141 |
${hwfr_src} |
|
142 |
${hwfr_moc_srcs} |
|
477 | 143 |
${hwfr_hdrs} |
184 | 144 |
${hwfr_rez_src}) |
495 | 145 |
|
555 | 146 |
set(HW_LINK_LIBS |
147 |
${QT_LIBRARIES} |
|
148 |
${SDL_LIBRARY} |
|
149 |
) |
|
184 | 150 |
|
151 |
if(WIN32 AND NOT UNIX) |
|
555 | 152 |
if(NOT SDL_LIBRARY) |
153 |
set(HW_LINK_LIBS |
|
154 |
${HW_LINK_LIBS} |
|
155 |
SDL |
|
156 |
) |
|
157 |
endif(NOT SDL_LIBRARY) |
|
158 |
||
495 | 159 |
set(HW_LINK_LIBS |
160 |
${HW_LINK_LIBS} |
|
161 |
ole32 |
|
162 |
winspool |
|
555 | 163 |
uuid |
164 |
) |
|
495 | 165 |
endif(WIN32 AND NOT UNIX) |
184 | 166 |
|
781 | 167 |
target_link_libraries(hedgewars |
495 | 168 |
${HW_LINK_LIBS}) |
169 |
||
170 |
install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION bin) |