21 |
21 |
22 include_directories(.) |
22 include_directories(.) |
23 include_directories(${SDL_INCLUDE_DIR}) |
23 include_directories(${SDL_INCLUDE_DIR}) |
24 include_directories(${SDLMIXER_INCLUDE_DIR}) |
24 include_directories(${SDLMIXER_INCLUDE_DIR}) |
25 if(UNIX) |
25 if(UNIX) |
26 # HACK: in freebsd cannot find iconv.h included via SDL.h |
26 # HACK: in freebsd cannot find iconv.h included via SDL.h |
27 include_directories("/usr/local/include") |
27 include_directories("/usr/local/include") |
28 endif(UNIX) |
28 endif(UNIX) |
29 |
29 |
30 |
30 |
31 if(WIN32 AND NOT UNIX) |
31 if(WIN32 AND NOT UNIX) |
32 set(HEDGEWARS_BINDIR ".") |
32 set(HEDGEWARS_BINDIR ".") |
33 set(HEDGEWARS_DATADIR "../share/") |
33 set(HEDGEWARS_DATADIR "../share/") |
34 add_definitions(-DUSE_XFIRE) |
34 add_definitions(-DUSE_XFIRE) |
35 else() |
35 else() |
36 set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
36 set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}) |
37 if(DEFINED DATA_INSTALL_DIR) |
37 if(DEFINED DATA_INSTALL_DIR) |
38 set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
38 set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}) |
39 else() |
39 else() |
40 set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
40 set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/) |
41 endif() |
41 endif() |
42 endif() |
42 endif() |
43 |
43 |
44 |
44 |
45 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
45 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp) |
46 |
46 |
47 set( hwfr_src |
47 set(hwfr_src |
48 game.cpp |
48 game.cpp |
49 main.cpp |
49 main.cpp |
50 hwform.cpp |
50 hwform.cpp |
51 team.cpp |
51 team.cpp |
52 namegen.cpp |
52 namegen.cpp |
53 teamselect.cpp |
53 teamselect.cpp |
54 teamselhelper.cpp |
54 teamselhelper.cpp |
55 frameTeam.cpp |
55 frameTeam.cpp |
56 vertScrollArea.cpp |
56 vertScrollArea.cpp |
57 gameuiconfig.cpp |
57 gameuiconfig.cpp |
58 ui_hwform.cpp |
58 ui_hwform.cpp |
59 gamecfgwidget.cpp |
59 gamecfgwidget.cpp |
60 pages.cpp |
60 pages.cpp |
61 SquareLabel.cpp |
61 SquareLabel.cpp |
62 hats.cpp |
62 hats.cpp |
63 hedgehogerWidget.cpp |
63 hedgehogerWidget.cpp |
64 hwmap.cpp |
64 hwmap.cpp |
65 mapContainer.cpp |
65 mapContainer.cpp |
66 tcpBase.cpp |
66 tcpBase.cpp |
67 about.cpp |
67 about.cpp |
68 proto.cpp |
68 proto.cpp |
69 fpsedit.cpp |
69 fpsedit.cpp |
70 netserver.cpp |
70 netserver.cpp |
71 newnetclient.cpp |
71 newnetclient.cpp |
72 netudpserver.cpp |
72 netudpserver.cpp |
73 netudpwidget.cpp |
73 netudpwidget.cpp |
74 netregister.cpp |
74 netregister.cpp |
75 netserverslist.cpp |
75 netserverslist.cpp |
76 chatwidget.cpp |
76 chatwidget.cpp |
77 binds.cpp |
77 binds.cpp |
78 SDLs.cpp |
78 SDLs.cpp |
79 playrecordpage.cpp |
79 playrecordpage.cpp |
80 ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
80 ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
81 selectWeapon.cpp |
81 selectWeapon.cpp |
82 itemNum.cpp |
82 itemNum.cpp |
83 input_ip.cpp |
83 input_ip.cpp |
84 igbox.cpp |
84 igbox.cpp |
85 weaponItem.cpp |
85 weaponItem.cpp |
86 statsPage.cpp |
86 statsPage.cpp |
87 misc.cpp |
87 misc.cpp |
88 ammoSchemeModel.cpp |
88 ammoSchemeModel.cpp |
89 togglebutton.cpp |
89 togglebutton.cpp |
90 bgwidget.cpp |
90 bgwidget.cpp |
91 achievements.cpp |
91 achievements.cpp |
92 ) |
92 qaspectratiolayout.cpp |
|
93 drawmapwidget.cpp |
|
94 drawmapscene.cpp |
|
95 ) |
93 |
96 |
94 #xfire integration |
97 #xfire integration |
95 if(WIN32) |
98 if(WIN32) |
96 set(hwfr_src ${hwfr_src} xfire.cpp ../misc/xfire/xfiregameclient.cpp) |
99 set(hwfr_src ${hwfr_src} xfire.cpp ../misc/xfire/xfiregameclient.cpp) |
97 endif(WIN32) |
100 endif(WIN32) |
98 |
101 |
99 if(MINGW) |
102 if(MINGW) |
100 # resource compilation for mingw |
103 # resource compilation for mingw |
101 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
104 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
102 COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
105 COMMAND windres -I ${CMAKE_CURRENT_SOURCE_DIR} |
103 -i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc |
106 -i ${CMAKE_CURRENT_SOURCE_DIR}/hedgewars.rc |
104 -o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
107 -o ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
105 set(hwfr_src ${hwfr_src} ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
108 set(hwfr_src ${hwfr_src} ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o) |
106 else(MINGW) |
109 else(MINGW) |
107 set(hwfr_src ${hwfr_src} hedgewars.rc) |
110 set(hwfr_src ${hwfr_src} hedgewars.rc) |
108 endif(MINGW) |
111 endif(MINGW) |
109 |
112 |
110 set( hwfr_moc_hdrs |
113 set(hwfr_moc_hdrs |
111 game.h |
114 game.h |
112 hats.h |
115 hats.h |
113 hwform.h |
116 hwform.h |
114 teamselect.h |
117 teamselect.h |
115 teamselhelper.h |
118 teamselhelper.h |
116 frameTeam.h |
119 frameTeam.h |
117 vertScrollArea.h |
120 vertScrollArea.h |
118 gameuiconfig.h |
121 gameuiconfig.h |
119 gamecfgwidget.h |
122 gamecfgwidget.h |
120 pages.h |
123 pages.h |
121 SquareLabel.h |
124 SquareLabel.h |
122 hedgehogerWidget.h |
125 hedgehogerWidget.h |
123 hwmap.h |
126 hwmap.h |
124 mapContainer.h |
127 mapContainer.h |
125 tcpBase.h |
128 tcpBase.h |
126 about.h |
129 about.h |
127 proto.h |
130 proto.h |
128 fpsedit.h |
131 fpsedit.h |
129 netserver.h |
132 netserver.h |
130 newnetclient.h |
133 newnetclient.h |
131 netudpserver.h |
134 netudpserver.h |
132 netudpwidget.h |
135 netudpwidget.h |
133 netregister.h |
136 netregister.h |
134 netserverslist.h |
137 netserverslist.h |
135 chatwidget.h |
138 chatwidget.h |
136 SDLs.h |
139 SDLs.h |
137 playrecordpage.h |
140 playrecordpage.h |
138 selectWeapon.h |
141 selectWeapon.h |
139 itemNum.h |
142 itemNum.h |
140 input_ip.h |
143 input_ip.h |
141 igbox.h |
144 igbox.h |
142 weaponItem.h |
145 weaponItem.h |
143 statsPage.h |
146 statsPage.h |
144 misc.h |
147 misc.h |
145 ammoSchemeModel.h |
148 ammoSchemeModel.h |
146 togglebutton.h |
149 togglebutton.h |
147 bgwidget.h |
150 bgwidget.h |
148 ) |
151 qaspectratiolayout.h |
149 |
152 drawmapwidget.h |
150 set( hwfr_hdrs |
153 drawmapscene.h |
151 binds.h |
154 ) |
152 ui_hwform.h |
155 |
153 predefteams.h |
156 set(hwfr_hdrs |
154 KB.h |
157 binds.h |
155 hwconsts.h |
158 ui_hwform.h |
156 ) |
159 KB.h |
|
160 hwconsts.h |
|
161 ) |
157 |
162 |
158 set(hwfr_rez hedgewars.qrc) |
163 set(hwfr_rez hedgewars.qrc) |
159 |
164 |
160 qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
165 qt4_add_resources(hwfr_rez_src ${hwfr_rez}) |
161 |
166 |
162 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
167 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs}) |
163 |
168 |
164 |
169 |
165 if(APPLE) |
170 if(APPLE) |
166 set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m) |
171 set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m) |
167 set(HW_LINK_LIBS IOKit) |
172 set(HW_LINK_LIBS IOKit) |
168 |
173 |
169 find_package(Sparkle) |
174 find_package(Sparkle) |
170 if(SPARKLE_FOUND) |
175 if(SPARKLE_FOUND) |
171 add_definitions(-DSPARKLE_ENABLED) |
176 add_definitions(-DSPARKLE_ENABLED) |
172 set(hwfr_src ${hwfr_src} AutoUpdater.cpp SparkleAutoUpdater.mm) |
177 set(hwfr_src ${hwfr_src} AutoUpdater.cpp SparkleAutoUpdater.mm) |
173 set(HW_LINK_LIBS ${SPARKLE_LIBRARY} ${HW_LINK_LIBS}) |
178 set(HW_LINK_LIBS ${SPARKLE_LIBRARY} ${HW_LINK_LIBS}) |
174 endif() |
179 endif() |
175 endif() |
180 endif() |
176 |
181 |
177 |
182 |
178 add_executable(hedgewars WIN32 |
183 add_executable(hedgewars WIN32 |
179 ${hwfr_src} |
184 ${hwfr_src} |
180 ${hwfr_moc_srcs} |
185 ${hwfr_moc_srcs} |
181 ${hwfr_hdrs} |
186 ${hwfr_hdrs} |
182 ${hwfr_rez_src} |
187 ${hwfr_rez_src} |
183 ) |
188 ) |
184 |
189 |
185 |
190 |
186 set( HW_LINK_LIBS |
191 set(HW_LINK_LIBS |
187 ${QT_LIBRARIES} |
192 ${QT_LIBRARIES} |
188 ${SDL_LIBRARY} |
193 ${SDL_LIBRARY} |
189 ${SDLMIXER_LIBRARY} |
194 ${SDLMIXER_LIBRARY} |
190 ${HW_LINK_LIBS} |
195 ${HW_LINK_LIBS} |
191 ) |
196 ) |
192 |
197 |
193 if(WIN32 AND NOT UNIX) |
198 if(WIN32 AND NOT UNIX) |
194 if(NOT SDL_LIBRARY) |
199 if(NOT SDL_LIBRARY) |
195 set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL) |
200 set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL) |
196 endif() |
201 endif() |
197 |
202 |
198 set( HW_LINK_LIBS |
203 set( HW_LINK_LIBS |
199 ${HW_LINK_LIBS} |
204 ${HW_LINK_LIBS} |
200 ole32 |
205 ole32 |
201 oleaut32 |
206 oleaut32 |
202 winspool |
207 winspool |
203 uuid |
208 uuid |
204 ) |
209 ) |
205 endif() |
210 endif() |
206 |
211 |
207 |
212 |
208 target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
213 target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
209 |
214 |