~ubuntu-branches/ubuntu/lucid/fceux/lucid

« back to all changes in this revision

Viewing changes to fceu/cmake/fceux.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-12-14 08:05:17 UTC
  • Revision ID: james.westby@ubuntu.com-20091214080517-abi5tj8avthfan7c
Tags: upstream-2.1.2+repack
ImportĀ upstreamĀ versionĀ 2.1.2+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#TODO: install generated exe's, appropriately named, in bin/
 
2
include(CheckFunctionExists)
 
3
include(TestBigEndian)
 
4
 
 
5
option(FCEUX_FORCE_LE   "Build for a little-endian target" OFF)
 
6
option(FCEUX_FORCE_BE   "Build for a big-endian target" OFF)
 
7
option(FCEUX_FRAMESKIP  "Build legacy frameskip code" OFF)
 
8
 
 
9
if(NOT WIN32)
 
10
  option(FCEUX_SDL_OPENGL "Build with OpenGL support" ON)
 
11
  find_package(SDL REQUIRED)
 
12
  find_package(ZLIB REQUIRED)
 
13
  if(FCEUX_SDL_OPENGL)
 
14
    find_package(OpenGL REQUIRED)
 
15
  endif(FCEUX_SDL_OPENGL)
 
16
endif(NOT WIN32)
 
17
 
 
18
set(SRC_CORE
 
19
  ${CMAKE_SOURCE_DIR}/src/asm.cpp
 
20
  ${CMAKE_SOURCE_DIR}/src/cart.cpp
 
21
  ${CMAKE_SOURCE_DIR}/src/cheat.cpp
 
22
  ${CMAKE_SOURCE_DIR}/src/conddebug.cpp
 
23
  ${CMAKE_SOURCE_DIR}/src/config.cpp
 
24
  ${CMAKE_SOURCE_DIR}/src/debug.cpp
 
25
  ${CMAKE_SOURCE_DIR}/src/drawing.cpp
 
26
  ${CMAKE_SOURCE_DIR}/src/fceu.cpp
 
27
  ${CMAKE_SOURCE_DIR}/src/fds.cpp
 
28
  ${CMAKE_SOURCE_DIR}/src/file.cpp
 
29
  ${CMAKE_SOURCE_DIR}/src/filter.cpp
 
30
  ${CMAKE_SOURCE_DIR}/src/ines.cpp
 
31
  ${CMAKE_SOURCE_DIR}/src/input.cpp
 
32
  ${CMAKE_SOURCE_DIR}/src/movie.cpp
 
33
  ${CMAKE_SOURCE_DIR}/src/netplay.cpp
 
34
  ${CMAKE_SOURCE_DIR}/src/nsf.cpp
 
35
  ${CMAKE_SOURCE_DIR}/src/palette.cpp
 
36
  ${CMAKE_SOURCE_DIR}/src/ppu.cpp
 
37
  ${CMAKE_SOURCE_DIR}/src/sound.cpp
 
38
  ${CMAKE_SOURCE_DIR}/src/state.cpp
 
39
  ${CMAKE_SOURCE_DIR}/src/unif.cpp
 
40
  ${CMAKE_SOURCE_DIR}/src/video.cpp
 
41
  ${CMAKE_SOURCE_DIR}/src/vsuni.cpp
 
42
  ${CMAKE_SOURCE_DIR}/src/wave.cpp
 
43
  ${CMAKE_SOURCE_DIR}/src/x6502.cpp
 
44
  ${CMAKE_SOURCE_DIR}/src/boards/01-222.cpp
 
45
  ${CMAKE_SOURCE_DIR}/src/boards/112.cpp
 
46
  ${CMAKE_SOURCE_DIR}/src/boards/117.cpp
 
47
  ${CMAKE_SOURCE_DIR}/src/boards/164.cpp
 
48
  ${CMAKE_SOURCE_DIR}/src/boards/183.cpp
 
49
  ${CMAKE_SOURCE_DIR}/src/boards/185.cpp
 
50
  ${CMAKE_SOURCE_DIR}/src/boards/186.cpp
 
51
  ${CMAKE_SOURCE_DIR}/src/boards/187.cpp
 
52
  ${CMAKE_SOURCE_DIR}/src/boards/189.cpp
 
53
  ${CMAKE_SOURCE_DIR}/src/boards/199.cpp
 
54
  ${CMAKE_SOURCE_DIR}/src/boards/208.cpp
 
55
  ${CMAKE_SOURCE_DIR}/src/boards/222.cpp
 
56
  ${CMAKE_SOURCE_DIR}/src/boards/235.cpp
 
57
  ${CMAKE_SOURCE_DIR}/src/boards/43.cpp
 
58
  ${CMAKE_SOURCE_DIR}/src/boards/57.cpp
 
59
  ${CMAKE_SOURCE_DIR}/src/boards/603-5052.cpp
 
60
  ${CMAKE_SOURCE_DIR}/src/boards/8157.cpp
 
61
  ${CMAKE_SOURCE_DIR}/src/boards/8237.cpp
 
62
  ${CMAKE_SOURCE_DIR}/src/boards/88.cpp
 
63
  ${CMAKE_SOURCE_DIR}/src/boards/90.cpp
 
64
  ${CMAKE_SOURCE_DIR}/src/boards/95.cpp
 
65
  ${CMAKE_SOURCE_DIR}/src/boards/__dummy_mapper.cpp
 
66
  ${CMAKE_SOURCE_DIR}/src/boards/a9711.cpp
 
67
  ${CMAKE_SOURCE_DIR}/src/boards/addrlatch.cpp
 
68
  ${CMAKE_SOURCE_DIR}/src/boards/bmc13in1jy110.cpp
 
69
  ${CMAKE_SOURCE_DIR}/src/boards/bmc42in1r.cpp
 
70
  ${CMAKE_SOURCE_DIR}/src/boards/bmc64in1nr.cpp
 
71
  ${CMAKE_SOURCE_DIR}/src/boards/bmc70in1.cpp
 
72
  ${CMAKE_SOURCE_DIR}/src/boards/bonza.cpp
 
73
  ${CMAKE_SOURCE_DIR}/src/boards/datalatch.cpp
 
74
  ${CMAKE_SOURCE_DIR}/src/boards/deirom.cpp
 
75
  ${CMAKE_SOURCE_DIR}/src/boards/dream.cpp
 
76
  ${CMAKE_SOURCE_DIR}/src/boards/edu2000.cpp
 
77
  ${CMAKE_SOURCE_DIR}/src/boards/fk23c.cpp
 
78
  ${CMAKE_SOURCE_DIR}/src/boards/h2288.cpp
 
79
  ${CMAKE_SOURCE_DIR}/src/boards/karaoke.cpp
 
80
  ${CMAKE_SOURCE_DIR}/src/boards/kof97.cpp
 
81
  ${CMAKE_SOURCE_DIR}/src/boards/konami-qtai.cpp
 
82
  ${CMAKE_SOURCE_DIR}/src/boards/malee.cpp
 
83
  ${CMAKE_SOURCE_DIR}/src/boards/mmc1.cpp
 
84
  ${CMAKE_SOURCE_DIR}/src/boards/mmc3.cpp
 
85
  ${CMAKE_SOURCE_DIR}/src/boards/mmc5.cpp
 
86
  ${CMAKE_SOURCE_DIR}/src/boards/n-c22m.cpp
 
87
  ${CMAKE_SOURCE_DIR}/src/boards/n106.cpp
 
88
  ${CMAKE_SOURCE_DIR}/src/boards/novel.cpp
 
89
  ${CMAKE_SOURCE_DIR}/src/boards/sachen.cpp
 
90
  ${CMAKE_SOURCE_DIR}/src/boards/sheroes.cpp
 
91
  ${CMAKE_SOURCE_DIR}/src/boards/sl1632.cpp
 
92
  ${CMAKE_SOURCE_DIR}/src/boards/subor.cpp
 
93
  ${CMAKE_SOURCE_DIR}/src/boards/super24.cpp
 
94
  ${CMAKE_SOURCE_DIR}/src/boards/supervision.cpp
 
95
  ${CMAKE_SOURCE_DIR}/src/boards/t-262.cpp
 
96
  ${CMAKE_SOURCE_DIR}/src/boards/tengen.cpp
 
97
  ${CMAKE_SOURCE_DIR}/src/input/arkanoid.cpp
 
98
  ${CMAKE_SOURCE_DIR}/src/input/bworld.cpp
 
99
  ${CMAKE_SOURCE_DIR}/src/input/cursor.cpp
 
100
  ${CMAKE_SOURCE_DIR}/src/input/fkb.cpp
 
101
  ${CMAKE_SOURCE_DIR}/src/input/ftrainer.cpp
 
102
  ${CMAKE_SOURCE_DIR}/src/input/hypershot.cpp
 
103
  ${CMAKE_SOURCE_DIR}/src/input/mahjong.cpp
 
104
  ${CMAKE_SOURCE_DIR}/src/input/mouse.cpp
 
105
  ${CMAKE_SOURCE_DIR}/src/input/oekakids.cpp
 
106
  ${CMAKE_SOURCE_DIR}/src/input/powerpad.cpp
 
107
  ${CMAKE_SOURCE_DIR}/src/input/quiz.cpp
 
108
  ${CMAKE_SOURCE_DIR}/src/input/shadow.cpp
 
109
  ${CMAKE_SOURCE_DIR}/src/input/suborkb.cpp
 
110
  ${CMAKE_SOURCE_DIR}/src/input/toprider.cpp
 
111
  ${CMAKE_SOURCE_DIR}/src/input/zapper.cpp
 
112
  ${CMAKE_SOURCE_DIR}/src/mappers/15.cpp
 
113
  ${CMAKE_SOURCE_DIR}/src/mappers/151.cpp
 
114
  ${CMAKE_SOURCE_DIR}/src/mappers/16.cpp
 
115
  ${CMAKE_SOURCE_DIR}/src/mappers/17.cpp
 
116
  ${CMAKE_SOURCE_DIR}/src/mappers/18.cpp
 
117
  ${CMAKE_SOURCE_DIR}/src/mappers/193.cpp
 
118
  ${CMAKE_SOURCE_DIR}/src/mappers/200.cpp
 
119
  ${CMAKE_SOURCE_DIR}/src/mappers/201.cpp
 
120
  ${CMAKE_SOURCE_DIR}/src/mappers/202.cpp
 
121
  ${CMAKE_SOURCE_DIR}/src/mappers/203.cpp
 
122
  ${CMAKE_SOURCE_DIR}/src/mappers/204.cpp
 
123
  ${CMAKE_SOURCE_DIR}/src/mappers/21.cpp
 
124
  ${CMAKE_SOURCE_DIR}/src/mappers/212.cpp
 
125
  ${CMAKE_SOURCE_DIR}/src/mappers/213.cpp
 
126
  ${CMAKE_SOURCE_DIR}/src/mappers/214.cpp
 
127
  ${CMAKE_SOURCE_DIR}/src/mappers/215.cpp
 
128
  ${CMAKE_SOURCE_DIR}/src/mappers/217.cpp
 
129
  ${CMAKE_SOURCE_DIR}/src/mappers/22.cpp
 
130
  ${CMAKE_SOURCE_DIR}/src/mappers/225.cpp
 
131
  ${CMAKE_SOURCE_DIR}/src/mappers/227.cpp
 
132
  ${CMAKE_SOURCE_DIR}/src/mappers/228.cpp
 
133
  ${CMAKE_SOURCE_DIR}/src/mappers/229.cpp
 
134
  ${CMAKE_SOURCE_DIR}/src/mappers/23.cpp
 
135
  ${CMAKE_SOURCE_DIR}/src/mappers/230.cpp
 
136
  ${CMAKE_SOURCE_DIR}/src/mappers/231.cpp
 
137
  ${CMAKE_SOURCE_DIR}/src/mappers/232.cpp
 
138
  ${CMAKE_SOURCE_DIR}/src/mappers/234.cpp
 
139
  ${CMAKE_SOURCE_DIR}/src/mappers/240.cpp
 
140
  ${CMAKE_SOURCE_DIR}/src/mappers/241.cpp
 
141
  ${CMAKE_SOURCE_DIR}/src/mappers/242.cpp
 
142
  ${CMAKE_SOURCE_DIR}/src/mappers/244.cpp
 
143
  ${CMAKE_SOURCE_DIR}/src/mappers/246.cpp
 
144
  ${CMAKE_SOURCE_DIR}/src/mappers/24and26.cpp
 
145
  ${CMAKE_SOURCE_DIR}/src/mappers/25.cpp
 
146
  ${CMAKE_SOURCE_DIR}/src/mappers/255.cpp
 
147
  ${CMAKE_SOURCE_DIR}/src/mappers/27.cpp
 
148
  ${CMAKE_SOURCE_DIR}/src/mappers/32.cpp
 
149
  ${CMAKE_SOURCE_DIR}/src/mappers/33.cpp
 
150
  ${CMAKE_SOURCE_DIR}/src/mappers/40.cpp
 
151
  ${CMAKE_SOURCE_DIR}/src/mappers/41.cpp
 
152
  ${CMAKE_SOURCE_DIR}/src/mappers/42.cpp
 
153
  ${CMAKE_SOURCE_DIR}/src/mappers/43.cpp
 
154
  ${CMAKE_SOURCE_DIR}/src/mappers/46.cpp
 
155
  ${CMAKE_SOURCE_DIR}/src/mappers/50.cpp
 
156
  ${CMAKE_SOURCE_DIR}/src/mappers/51.cpp
 
157
  ${CMAKE_SOURCE_DIR}/src/mappers/59.cpp
 
158
  ${CMAKE_SOURCE_DIR}/src/mappers/6.cpp
 
159
  ${CMAKE_SOURCE_DIR}/src/mappers/60.cpp
 
160
  ${CMAKE_SOURCE_DIR}/src/mappers/61.cpp
 
161
  ${CMAKE_SOURCE_DIR}/src/mappers/62.cpp
 
162
  ${CMAKE_SOURCE_DIR}/src/mappers/65.cpp
 
163
  ${CMAKE_SOURCE_DIR}/src/mappers/67.cpp
 
164
  ${CMAKE_SOURCE_DIR}/src/mappers/68.cpp
 
165
  ${CMAKE_SOURCE_DIR}/src/mappers/69.cpp
 
166
  ${CMAKE_SOURCE_DIR}/src/mappers/71.cpp
 
167
  ${CMAKE_SOURCE_DIR}/src/mappers/72.cpp
 
168
  ${CMAKE_SOURCE_DIR}/src/mappers/73.cpp
 
169
  ${CMAKE_SOURCE_DIR}/src/mappers/75.cpp
 
170
  ${CMAKE_SOURCE_DIR}/src/mappers/76.cpp
 
171
  ${CMAKE_SOURCE_DIR}/src/mappers/77.cpp
 
172
  ${CMAKE_SOURCE_DIR}/src/mappers/79.cpp
 
173
  ${CMAKE_SOURCE_DIR}/src/mappers/8.cpp
 
174
  ${CMAKE_SOURCE_DIR}/src/mappers/80.cpp
 
175
  ${CMAKE_SOURCE_DIR}/src/mappers/82.cpp
 
176
  ${CMAKE_SOURCE_DIR}/src/mappers/83.cpp
 
177
  ${CMAKE_SOURCE_DIR}/src/mappers/85.cpp
 
178
  ${CMAKE_SOURCE_DIR}/src/mappers/86.cpp
 
179
  ${CMAKE_SOURCE_DIR}/src/mappers/89.cpp
 
180
  ${CMAKE_SOURCE_DIR}/src/mappers/91.cpp
 
181
  ${CMAKE_SOURCE_DIR}/src/mappers/92.cpp
 
182
  ${CMAKE_SOURCE_DIR}/src/mappers/97.cpp
 
183
  ${CMAKE_SOURCE_DIR}/src/mappers/99.cpp
 
184
  ${CMAKE_SOURCE_DIR}/src/mappers/__226.cpp
 
185
  ${CMAKE_SOURCE_DIR}/src/mappers/emu2413.c
 
186
  ${CMAKE_SOURCE_DIR}/src/mappers/mmc2and4.cpp
 
187
  ${CMAKE_SOURCE_DIR}/src/mappers/simple.cpp
 
188
  ${CMAKE_SOURCE_DIR}/src/utils/crc32.cpp
 
189
  ${CMAKE_SOURCE_DIR}/src/utils/endian.cpp
 
190
  ${CMAKE_SOURCE_DIR}/src/utils/general.cpp
 
191
  ${CMAKE_SOURCE_DIR}/src/utils/guid.cpp
 
192
  ${CMAKE_SOURCE_DIR}/src/utils/md5.cpp
 
193
  ${CMAKE_SOURCE_DIR}/src/utils/memory.cpp
 
194
  ${CMAKE_SOURCE_DIR}/src/utils/unzip.cpp
 
195
  ${CMAKE_SOURCE_DIR}/src/utils/xstring.cpp
 
196
)
 
197
 
 
198
set(SRC_DRIVERS_COMMON
 
199
  ${CMAKE_SOURCE_DIR}/src/drivers/common/args.cpp
 
200
  ${CMAKE_SOURCE_DIR}/src/drivers/common/cheat.cpp
 
201
  ${CMAKE_SOURCE_DIR}/src/drivers/common/config.cpp
 
202
  ${CMAKE_SOURCE_DIR}/src/drivers/common/configSys.cpp
 
203
  ${CMAKE_SOURCE_DIR}/src/drivers/common/hq2x.cpp
 
204
  ${CMAKE_SOURCE_DIR}/src/drivers/common/hq3x.cpp
 
205
  ${CMAKE_SOURCE_DIR}/src/drivers/common/scale2x.cpp
 
206
  ${CMAKE_SOURCE_DIR}/src/drivers/common/scale3x.cpp
 
207
  ${CMAKE_SOURCE_DIR}/src/drivers/common/scalebit.cpp
 
208
  ${CMAKE_SOURCE_DIR}/src/drivers/common/vidblit.cpp
 
209
)
 
210
 
 
211
set(SRC_DRIVERS_SDL
 
212
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/config.cpp
 
213
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/input.cpp
 
214
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl.cpp
 
215
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-joystick.cpp
 
216
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-sound.cpp
 
217
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-throttle.cpp
 
218
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-video.cpp
 
219
  ${CMAKE_SOURCE_DIR}/src/drivers/sdl/unix-netplay.cpp
 
220
)
 
221
 
 
222
if(FCEUX_SDL_OPENGL)
 
223
  set(SRC_DRIVERS_SDL ${SRC_DRIVERS_SDL} ${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-opengl.cpp)
 
224
endif(FCEUX_SDL_OPENGL)
 
225
 
 
226
set(SRC_DRIVERS_WIN
 
227
  ${CMAKE_SOURCE_DIR}/src/drivers/win/args.cpp
 
228
  ${CMAKE_SOURCE_DIR}/src/drivers/win/aviout.cpp
 
229
  ${CMAKE_SOURCE_DIR}/src/drivers/win/basicbot.cpp
 
230
  ${CMAKE_SOURCE_DIR}/src/drivers/win/cdlogger.cpp
 
231
  ${CMAKE_SOURCE_DIR}/src/drivers/win/cheat.cpp
 
232
  ${CMAKE_SOURCE_DIR}/src/drivers/win/common.cpp
 
233
  ${CMAKE_SOURCE_DIR}/src/drivers/win/config.cpp
 
234
  ${CMAKE_SOURCE_DIR}/src/drivers/win/debugger.cpp
 
235
  ${CMAKE_SOURCE_DIR}/src/drivers/win/debuggersp.cpp
 
236
  ${CMAKE_SOURCE_DIR}/src/drivers/win/directories.cpp
 
237
  ${CMAKE_SOURCE_DIR}/src/drivers/win/gui.cpp
 
238
  ${CMAKE_SOURCE_DIR}/src/drivers/win/guiconfig.cpp
 
239
  ${CMAKE_SOURCE_DIR}/src/drivers/win/help.cpp
 
240
  ${CMAKE_SOURCE_DIR}/src/drivers/win/input.cpp
 
241
  ${CMAKE_SOURCE_DIR}/src/drivers/win/joystick.cpp
 
242
  ${CMAKE_SOURCE_DIR}/src/drivers/win/keyboard.cpp
 
243
  ${CMAKE_SOURCE_DIR}/src/drivers/win/log.cpp
 
244
  ${CMAKE_SOURCE_DIR}/src/drivers/win/main.cpp
 
245
  ${CMAKE_SOURCE_DIR}/src/drivers/win/mapinput.cpp
 
246
  ${CMAKE_SOURCE_DIR}/src/drivers/win/memview.cpp
 
247
  ${CMAKE_SOURCE_DIR}/src/drivers/win/memviewsp.cpp
 
248
  ${CMAKE_SOURCE_DIR}/src/drivers/win/memwatch.cpp
 
249
  ${CMAKE_SOURCE_DIR}/src/drivers/win/monitor.cpp
 
250
  ${CMAKE_SOURCE_DIR}/src/drivers/win/netplay.cpp
 
251
  ${CMAKE_SOURCE_DIR}/src/drivers/win/ntview.cpp
 
252
  ${CMAKE_SOURCE_DIR}/src/drivers/win/OutputDS.cpp
 
253
  ${CMAKE_SOURCE_DIR}/src/drivers/win/palette.cpp
 
254
  ${CMAKE_SOURCE_DIR}/src/drivers/win/ppuview.cpp
 
255
  ${CMAKE_SOURCE_DIR}/src/drivers/win/pref.cpp
 
256
  ${CMAKE_SOURCE_DIR}/src/drivers/win/replay.cpp
 
257
  ${CMAKE_SOURCE_DIR}/src/drivers/win/res.rc
 
258
  ${CMAKE_SOURCE_DIR}/src/drivers/win/sound.cpp
 
259
  ${CMAKE_SOURCE_DIR}/src/drivers/win/state.cpp
 
260
  ${CMAKE_SOURCE_DIR}/src/drivers/win/tasedit.cpp
 
261
  ${CMAKE_SOURCE_DIR}/src/drivers/win/throttle.cpp
 
262
  ${CMAKE_SOURCE_DIR}/src/drivers/win/timing.cpp
 
263
  ${CMAKE_SOURCE_DIR}/src/drivers/win/tracer.cpp
 
264
  ${CMAKE_SOURCE_DIR}/src/drivers/win/video.cpp
 
265
  ${CMAKE_SOURCE_DIR}/src/drivers/win/wave.cpp
 
266
  ${CMAKE_SOURCE_DIR}/src/drivers/win/window.cpp
 
267
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/adler32.c
 
268
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/compress.c
 
269
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/crc32.c
 
270
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/deflate.c
 
271
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/gzio.c
 
272
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/infblock.c
 
273
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/infcodes.c
 
274
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/inffast.c
 
275
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/inflate.c
 
276
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/inftrees.c
 
277
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/infutil.c
 
278
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/trees.c
 
279
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/uncompr.c
 
280
  ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/zutil.c
 
281
)
 
282
 
 
283
set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
284
include_directories( ${CMAKE_SOURCE_DIR}/src )
 
285
add_definitions( -DNETWORK )
 
286
 
 
287
if(WIN32)
 
288
  set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_WIN})
 
289
  include_directories( ${CMAKE_SOURCE_DIR}/src/drivers/win/directx ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib )
 
290
  add_definitions( 
 
291
    -DWIN32
 
292
    -DFCEUDEF_DEBUGGER
 
293
    -D_USE_SHARED_MEMORY_
 
294
    -DPSS_STYLE=2
 
295
    -DNOMINMAX
 
296
  )
 
297
  link_directories( ${CMAKE_SOURCE_DIR}/src/drivers/win/directx )
 
298
else(WIN32)
 
299
  set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_SDL})
 
300
  include_directories( ${SDL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
 
301
  add_definitions( ${SDL_DEFINITIONS} ${ZLIB_DEFINITIONS} )
 
302
  if(FCEUX_SDL_OPENGL)
 
303
    add_definitions( -DOPENGL )
 
304
    include_directories( ${OPENGL_INCLUDE_DIR} )
 
305
  endif(FCEUX_SDL_OPENGL)
 
306
endif(WIN32)
 
307
 
 
308
if(APPLE)
 
309
  add_definitions( -DPSS_STYLE=4 )
 
310
else(APPLE)
 
311
  if(UNIX)
 
312
    add_definitions( -DPSS_STYLE=1 )
 
313
  endif(UNIX)
 
314
endif(APPLE)
 
315
 
 
316
if(MINGW)
 
317
  add_definitions( -DNEED_MINGW_HACKS -D_WIN32_IE=0x0600 )
 
318
endif(MINGW)
 
319
if(CMAKE_BUILD_TYPE STREQUAL "debug")
 
320
  add_definitions( -D_DEBUG )
 
321
endif(CMAKE_BUILD_TYPE STREQUAL "debug")
 
322
if(CMAKE_COMPILER_IS_GNUCXX)
 
323
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-write-strings -Wno-sign-compare")
 
324
endif(CMAKE_COMPILER_IS_GNUCXX)
 
325
 
 
326
if(FCEUX_FRAMESKIP)
 
327
  add_definitions( -DFRAMESKIP )
 
328
endif(FCEUX_FRAMESKIP)
 
329
 
 
330
if(NOT FCEUX_FORCE_BE)
 
331
  if(FCEUX_FORCE_LE)
 
332
    add_definitions( -DLSB_FIRST )
 
333
  else(FCEUX_FORCE_LE)
 
334
    test_big_endian(SYS_IS_BE)
 
335
    if(NOT SYS_IS_BE)
 
336
      add_definitions( -DLSB_FIRST )
 
337
    endif(NOT SYS_IS_BE)
 
338
  endif(FCEUX_FORCE_LE)
 
339
endif(NOT FCEUX_FORCE_BE)
 
340
 
 
341
check_function_exists(asprintf HAVE_ASPRINTF)
 
342
# HACK: cmake seems to cache HAVE_ASPRINTF and I don't know how to ask it
 
343
# to forget--even if your compiler changes. So tell it mingw=>no.
 
344
if(HAVE_ASPRINTF AND NOT MINGW)
 
345
  add_definitions( -DHAVE_ASPRINTF )
 
346
endif(HAVE_ASPRINTF AND NOT MINGW)
 
347
 
 
348
add_executable( ${FCEUX_EXE_NAME} ${SOURCES} )
 
349
 
 
350
if(WIN32)
 
351
  add_dependencies( ${FCEUX_EXE_NAME} InstallHelpFile )
 
352
 
 
353
  target_link_libraries( ${FCEUX_EXE_NAME} rpcrt4 comctl32 vfw32 winmm ws2_32 htmlhelp
 
354
    comdlg32 ole32 gdi32
 
355
    dsound dxguid ddraw dinput
 
356
  )
 
357
else(WIN32)
 
358
  target_link_libraries( ${FCEUX_EXE_NAME} ${SDL_LIBRARY} ${ZLIB_LIBRARIES} )
 
359
  if(FCEUX_SDL_OPENGL)
 
360
    target_link_libraries( ${FCEUX_EXE_NAME} ${OPENGL_gl_LIBRARY} )
 
361
  endif(FCEUX_SDL_OPENGL)
 
362
endif(WIN32)