]> git.jsancho.org Git - lugaru.git/blob - CMakeLists.txt
CI: Drop legacy msvc2005 files, add AppVeyor
[lugaru.git] / CMakeLists.txt
1 project(lugaru)
2
3 cmake_minimum_required(VERSION 3.5)
4
5 set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/Source")
6 set(DEPDIR "${CMAKE_CURRENT_SOURCE_DIR}/Dependencies")
7
8 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --std=c++11")
9 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -pg --std=c++11")
10 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -O2 -std=c++11")
11
12 if(NOT LUGARU_INSTALL_PREFIX)
13   if(WIN32)
14      set(LUGARU_INSTALL_PREFIX "C:/Lugaru" CACHE PATH
15      "LUGARU_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
16       FORCE)
17   else(WIN32)
18      set(LUGARU_INSTALL_PREFIX "/usr/local/lugaru" CACHE PATH
19      "CMAKE_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
20       FORCE)
21   endif(WIN32)
22 endif(NOT LUGARU_INSTALL_PREFIX)
23
24 set(CMAKE_INSTALL_PREFIX "${LUGARU_INSTALL_PREFIX}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
25
26 if(MINGW)
27         set(OPENGL_gl_LIBRARY "-lopengl32" CACHE STRING "OpenGL library for Win32" FORCE)
28         set(OPENGL_glu_LIBRARY "-lglu32" CACHE STRING "GLU library for Win32" FORCE)
29 endif(MINGW)
30
31 if(APPLE)
32         set(CMAKE_OSX_ARCHITECTURES "i386;x86_64;ppc" CACHE STRING "Build architectures for OSX")
33         set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING
34                 "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value")
35         set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk" CACHE PATH
36                 "The product will be built against the headers and libraries located inside the indicated SDK.")
37 endif(APPLE)
38
39 if(APPLE)
40         # Save our sanity; Set all available libraries to internal by default
41         set(LUGARU_FORCE_INTERNAL_SDL True)
42         set(LUGARU_FORCE_INTERNAL_GLU True)
43         set(LUGARU_FORCE_INTERNAL_JPEG True)
44         set(LUGARU_FORCE_INTERNAL_PNG True)
45         set(LUGARU_FORCE_INTERNAL_VORBIS True)
46         set(LUGARU_FORCE_INTERNAL_ZLIB True)
47         set(LUGARU_FORCE_INTERNAL_OPENAL True)
48 endif(APPLE)
49
50 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
51
52 set(LUGARU_SRCS
53         ${SRCDIR}/Frustum.cpp
54         ${SRCDIR}/Account.cpp
55         ${SRCDIR}/Game.cpp
56         ${SRCDIR}/GameDraw.cpp
57         ${SRCDIR}/GameInitDispose.cpp
58         ${SRCDIR}/GameTick.cpp
59         ${SRCDIR}/Globals.cpp
60         ${SRCDIR}/Lights.cpp
61         ${SRCDIR}/Menu.cpp
62         ${SRCDIR}/Models.cpp
63         ${SRCDIR}/Objects.cpp
64         ${SRCDIR}/pack.c
65         ${SRCDIR}/Person.cpp
66         ${SRCDIR}/private.c
67         ${SRCDIR}/Quaternions.cpp
68         ${SRCDIR}/Skeleton.cpp
69         ${SRCDIR}/Skybox.cpp
70         ${SRCDIR}/Sprite.cpp
71         ${SRCDIR}/Terrain.cpp
72         ${SRCDIR}/Texture.cpp
73         ${SRCDIR}/Text.cpp
74         ${SRCDIR}/TGALoader.cpp
75         ${SRCDIR}/unpack.c
76         ${SRCDIR}/Weapons.cpp
77         ${SRCDIR}/OpenGL_Windows.cpp
78         ${SRCDIR}/openal_wrapper.cpp
79         ${SRCDIR}/Input.cpp
80         ${SRCDIR}/Settings.cpp
81         ${SRCDIR}/Stereo.cpp
82         ${SRCDIR}/Animation.cpp
83         ${SRCDIR}/Sounds.cpp
84         ${SRCDIR}/Awards.cpp
85 )
86
87 set(LUGARU_H
88         ${SRCDIR}/Frustum.h
89         ${SRCDIR}/Account.h
90         ${SRCDIR}/Game.h
91         ${SRCDIR}/Lights.h
92         ${SRCDIR}/Menu.h
93         ${SRCDIR}/Models.h
94         ${SRCDIR}/Objects.h
95         ${SRCDIR}/Person.h
96         ${SRCDIR}/PhysicsMath.h
97         ${SRCDIR}/Quaternions.h
98         ${SRCDIR}/Random.h
99         ${SRCDIR}/Skeleton.h
100         ${SRCDIR}/Skybox.h
101         ${SRCDIR}/Sprite.h
102         ${SRCDIR}/TGALoader.h
103         ${SRCDIR}/Terrain.h
104         ${SRCDIR}/Texture.h
105         ${SRCDIR}/Text.h
106         ${SRCDIR}/Weapons.h
107         ${SRCDIR}/Input.h
108         ${SRCDIR}/alstubs.h
109         ${SRCDIR}/binio.h
110         ${SRCDIR}/openal_wrapper.h
111         ${SRCDIR}/gamegl.h
112         ${SRCDIR}/glstubs.h
113         ${SRCDIR}/private.h
114         ${SRCDIR}/Settings.h
115         ${SRCDIR}/Stereo.h
116         ${SRCDIR}/Animation.h
117         ${SRCDIR}/Sounds.h
118 )
119
120 if(UNIX)
121         set(LUGARU_SRCS
122                 ${LUGARU_SRCS}
123                 ${SRCDIR}/MacCompatibility.cpp
124         )
125         set(LUGARU_H
126                 ${LUGARU_H}
127                 ${SRCDIR}/MacCompatibility.h
128         )
129 endif(UNIX)
130
131 if(MSVC) # MSVC non-C99 support biting us hard
132         set(LUGARU_H
133                 ${LUGARU_H}
134                 ${DEPDIR}/msinttypes/stdint.h
135                 ${DEPDIR}/msinttypes/inttypes.h
136         )
137 endif(MSVC)
138
139 if(WIN32)
140   ENABLE_LANGUAGE(RC)
141
142   # !!! FIXME: get rid of WinDefs.{cpp,h}
143   set(LUGARU_SRCS
144         ${LUGARU_SRCS}
145         ${SRCDIR}/WinDefs.cpp
146         ${SRCDIR}/win-res/Lugaru.rc)
147
148   set(LUGARU_H
149         ${LUGARU_H}
150         ${SRCDIR}/WinDefs.h
151         ${SRCDIR}/win-res/resource.h)
152 endif(WIN32)
153
154 if (APPLE)
155     set(PLATFORM_LIBS "-framework Carbon -framework Cocoa -framework OpenGL -framework OpenAL")
156 endif (APPLE)
157
158 # Deal with dependencies...
159 find_package(OpenGL REQUIRED)
160 # force this include dir no matter what on Windows, so we get sane headers.
161 if(NOT WIN32)
162         option (LUGARU_FORCE_INTERNAL_OPENGL "Force internal OpenGL headers, even if there's a system version" True)
163         if (LUGARU_FORCE_INTERNAL_OPENGL)
164                 include_directories("${DEPDIR}/OpenGL")
165         endif (LUGARU_FORCE_INTERNAL_OPENGL)
166 endif(NOT WIN32)
167
168 if(WIN32)
169         include_directories("${DEPDIR}/OpenGL")
170 endif(WIN32)
171
172 if(MSVC) # More Visual Studio annoyances
173         include_directories("${DEPDIR}/msinttypes")
174 endif(MSVC)
175
176 option (LUGARU_FORCE_INTERNAL_OPENAL "Force internal libOpenAL, even if there's a system version" False)
177 if (NOT LUGARU_FORCE_INTERNAL_OPENAL)
178         find_package(OpenAL REQUIRED)
179 else(NOT LUGARU_FORCE_INTERNAL_OPENAL)
180         set(OPENAL_FOUND False)
181 endif (NOT LUGARU_FORCE_INTERNAL_OPENAL)
182
183 if (NOT OPENAL_FOUND OR LUGARU_FORCE_INTERNAL_OPENAL)
184     message(STATUS "Using internal copy of OpenAL")
185     set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OpenAL")
186     set(OPENALDIR "${DEPDIR}/OpenAL")
187     set(OPENAL_INCLUDE_DIR "${OPENALDIR}/include/AL")
188     set(OPENAL_LIBRARY "")
189
190     if (WIN32)
191         set(LUGARU_HAS_INTERNAL_OPENAL True)
192         if (MSVC)
193             set(OPENAL_LIBRARY
194                 ${OPENALDIR}/lib/win32/msvc2008/OpenAL32.lib
195             )
196         endif (MSVC)
197         if (MINGW)
198             set(OPENAL_LIBRARY
199                 ${OPENALDIR}/lib/win32/mingw/libOpenAL32.dll.a
200             )
201         endif (MINGW)
202      endif(WIN32)
203
204     if (NOT LUGARU_HAS_INTERNAL_OPENAL)
205         message(ERROR "We don't have a prebuilt OpenAL for this platform.")
206     endif (NOT LUGARU_HAS_INTERNAL_OPENAL)
207 endif (NOT OPENAL_FOUND OR LUGARU_FORCE_INTERNAL_OPENAL)
208
209 option (LUGARU_FORCE_INTERNAL_SDL "Force internal libSDL, even if there's a system version" False)
210 if (NOT LUGARU_FORCE_INTERNAL_SDL)
211     find_package(SDL)
212 else(NOT LUGARU_FORCE_INTERNAL_SDL)
213         set(SDL_FOUND False)
214 endif (NOT LUGARU_FORCE_INTERNAL_SDL)
215
216 if (NOT SDL_FOUND)
217     message(STATUS "Using internal copy of SDL")
218     set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} SDL")
219     set(SDLDIR "${DEPDIR}/SDL12")
220     set(SDL_INCLUDE_DIR "${SDLDIR}/include")
221     set(SDL_LIBRARY "")
222     if (APPLE)
223         set(LUGARU_HAS_INTERNAL_SDL True)
224         set(SDL_LIBRARY
225             ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib
226             ${SDLDIR}/lib/macosx/libSDLmain-osx.a
227         )
228     endif (APPLE)
229
230     if (WIN32)
231         set(LUGARU_HAS_INTERNAL_SDL True)
232         if (MSVC)
233           set(SDL_LIBRARY
234               ${SDLDIR}/lib/win32/msvc2008/SDLmain.lib
235               ${SDLDIR}/lib/win32/msvc2008/SDL.lib
236           )
237         endif (MSVC)
238         if (MINGW)
239           set(SDL_LIBRARY
240               "mingw32"
241               ${SDLDIR}/lib/win32/mingw/libSDLmain.a
242               ${SDLDIR}/lib/win32/mingw/libSDL.dll.a
243               "-mwindows"
244           )
245         endif (MINGW)
246     endif (WIN32)
247
248     if (NOT LUGARU_HAS_INTERNAL_SDL)
249         message(ERROR "We don't have a prebuilt SDL for this platform.")
250     endif (NOT LUGARU_HAS_INTERNAL_SDL)
251 endif (NOT SDL_FOUND)
252
253 option (LUGARU_FORCE_INTERNAL_PNG "Force internal libPNG, even if there's a system version" False)
254 if (NOT LUGARU_FORCE_INTERNAL_PNG)
255     find_package(PNG)
256 else(NOT LUGARU_FORCE_INTERNAL_PNG)
257         set(PNG_FOUND False)
258 endif (NOT LUGARU_FORCE_INTERNAL_PNG)
259
260 if (NOT PNG_FOUND)
261     message(STATUS "Using internal copy of libpng")
262     set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} PNG")
263     set(PNGDIR "${DEPDIR}/libpng")
264     set(PNG_INCLUDE_DIR "${PNGDIR}")
265     set(PNG_LIBRARY "")
266     set(LUGARU_SRCS
267         ${LUGARU_SRCS}
268         ${PNGDIR}/png.c
269         ${PNGDIR}/pngerror.c
270         ${PNGDIR}/pngget.c
271         ${PNGDIR}/pngmem.c
272         ${PNGDIR}/pngpread.c
273         ${PNGDIR}/pngread.c
274         ${PNGDIR}/pngrio.c
275         ${PNGDIR}/pngrtran.c
276         ${PNGDIR}/pngrutil.c
277         ${PNGDIR}/pngset.c
278         ${PNGDIR}/pngtrans.c
279         ${PNGDIR}/pngwio.c
280         ${PNGDIR}/pngwrite.c
281         ${PNGDIR}/pngwtran.c
282         ${PNGDIR}/pngwutil.c
283     )
284 endif (NOT PNG_FOUND)
285
286 option (LUGARU_FORCE_INTERNAL_JPEG "Force internal libJPEG, even if there's a system version" False)
287 if (NOT LUGARU_FORCE_INTERNAL_JPEG)
288     find_package(JPEG)
289 else(NOT LUGARU_FORCE_INTERNAL_JPEG)
290         set(JPEG_FOUND False)
291 endif (NOT LUGARU_FORCE_INTERNAL_JPEG)
292
293 if (NOT JPEG_FOUND)
294     message(STATUS "Using internal copy of libjpeg")
295     set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} JPEG")
296     set(JPEGDIR "${DEPDIR}/libjpeg")
297     set(JPEG_INCLUDE_DIR "${JPEGDIR}")
298     set(JPEG_LIBRARY "")
299     set(LUGARU_SRCS
300         ${LUGARU_SRCS}
301         ${JPEGDIR}/jdapistd.c
302         ${JPEGDIR}/jdmaster.c
303         ${JPEGDIR}/jdapimin.c
304         ${JPEGDIR}/jcapimin.c
305         ${JPEGDIR}/jdmerge.c
306         ${JPEGDIR}/jdatasrc.c
307         ${JPEGDIR}/jdatadst.c
308         ${JPEGDIR}/jdcoefct.c
309         ${JPEGDIR}/jdcolor.c
310         ${JPEGDIR}/jddctmgr.c
311         ${JPEGDIR}/jdhuff.c
312         ${JPEGDIR}/jdinput.c
313         ${JPEGDIR}/jdmainct.c
314         ${JPEGDIR}/jdmarker.c
315         ${JPEGDIR}/jdpostct.c
316         ${JPEGDIR}/jdsample.c
317         ${JPEGDIR}/jdtrans.c
318         ${JPEGDIR}/jerror.c
319         ${JPEGDIR}/jidctflt.c
320         ${JPEGDIR}/jidctfst.c
321         ${JPEGDIR}/jidctint.c
322         ${JPEGDIR}/jmemmgr.c
323         ${JPEGDIR}/jutils.c
324         ${JPEGDIR}/jmemnobs.c
325         ${JPEGDIR}/jquant1.c
326         ${JPEGDIR}/jquant2.c
327         ${JPEGDIR}/jcomapi.c
328         ${JPEGDIR}/jcmarker.c
329         ${JPEGDIR}/jcapistd.c
330         ${JPEGDIR}/jcparam.c
331         ${JPEGDIR}/jcinit.c
332         ${JPEGDIR}/jcdctmgr.c
333         ${JPEGDIR}/jccoefct.c
334         ${JPEGDIR}/jcmainct.c
335         ${JPEGDIR}/jfdctflt.c
336         ${JPEGDIR}/jfdctint.c
337         ${JPEGDIR}/jfdctfst.c
338         ${JPEGDIR}/jchuff.c
339         ${JPEGDIR}/jcsample.c
340         ${JPEGDIR}/jcmaster.c
341         ${JPEGDIR}/jccolor.c
342         ${JPEGDIR}/jcprepct.c
343         ${JPEGDIR}/jcarith.c
344         ${JPEGDIR}/jdarith.c
345         ${JPEGDIR}/jaricom.c
346     )
347 endif (NOT JPEG_FOUND)
348
349 option (LUGARU_FORCE_INTERNAL_ZLIB "Force internal zlib, even if there's a system version" False)
350 if (NOT LUGARU_FORCE_INTERNAL_ZLIB)
351     find_package(ZLIB)
352 else(NOT LUGARU_FORCE_INTERNAL_ZLIB)
353         set(ZLIB_FOUND False)
354 endif (NOT LUGARU_FORCE_INTERNAL_ZLIB)
355
356 if (NOT ZLIB_FOUND)
357     message(STATUS "Using internal copy of zlib")
358     set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} ZLIB")
359     set(ZLIBDIR "${DEPDIR}/zlib")
360     set(ZLIB_INCLUDE_DIR "${ZLIBDIR}")
361     set(ZLIB_LIBRARIES "")
362     set(LUGARU_SRCS
363         ${LUGARU_SRCS}
364         ${ZLIBDIR}/adler32.c
365         ${ZLIBDIR}/compress.c
366         ${ZLIBDIR}/crc32.c
367         ${ZLIBDIR}/deflate.c
368         ${ZLIBDIR}/infback.c
369         ${ZLIBDIR}/inffast.c
370         ${ZLIBDIR}/inflate.c
371         ${ZLIBDIR}/inftrees.c
372         ${ZLIBDIR}/trees.c
373         ${ZLIBDIR}/uncompr.c
374         ${ZLIBDIR}/zutil.c
375     )
376 endif (NOT ZLIB_FOUND)
377
378 option (LUGARU_FORCE_INTERNAL_GLU "Force internal libGLU, even if there's a system version" False)
379 if (LUGARU_FORCE_INTERNAL_GLU)
380         set(OPENGL_GLU_FOUND False)
381 endif (LUGARU_FORCE_INTERNAL_GLU)
382
383 if (NOT OPENGL_GLU_FOUND)
384     message(STATUS "Using internal copy of libGLU")
385     set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} GLU")
386     set(GLUDIR "${DEPDIR}/GLU")
387     set(GLU_INCLUDE_DIR "${GLUDIR}")
388     set(GLU_LIBRARY "")
389     set(LUGARU_SRCS
390         ${LUGARU_SRCS}
391         ${GLUDIR}/dict.c
392         ${GLUDIR}/geom.c
393         ${GLUDIR}/memalloc.c
394         ${GLUDIR}/mesh.c
395         ${GLUDIR}/mipmap.c
396         ${GLUDIR}/normal.c
397         ${GLUDIR}/priorityq.c
398         ${GLUDIR}/render.c
399         ${GLUDIR}/sweep.c
400         ${GLUDIR}/tess.c
401         ${GLUDIR}/tessmono.c
402         ${GLUDIR}/util.c
403     )
404 endif (NOT OPENGL_GLU_FOUND)
405
406 option (LUGARU_FORCE_INTERNAL_VORBIS "Force internal Vorbis, even if there's a system version" False)
407 if (NOT LUGARU_FORCE_INTERNAL_VORBIS)
408     find_package(OggVorbis)
409 else(NOT LUGARU_FORCE_INTERNAL_VORBIS)
410         set(OGGVORBIS_FOUND False)
411 endif (NOT LUGARU_FORCE_INTERNAL_VORBIS)
412
413 if (NOT OGGVORBIS_FOUND)
414     message(STATUS "Using internal copy of Ogg Vorbis")
415     set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OggVorbis")
416     set(OGGDIR "${DEPDIR}/libogg")
417     set(OGG_INCLUDE_DIR "${OGGDIR}/include")
418     set(OGG_LIBRARY "")
419     set(VORBISDIR "${DEPDIR}/libvorbis")
420     set(VORBISFILE_INCLUDE_DIR "${VORBISDIR}/include")
421     set(VORBISFILE_LIBRARY "")
422     set(LUGARU_SRCS
423         ${LUGARU_SRCS}
424         ${OGGDIR}/src/bitwise.c
425         ${OGGDIR}/src/framing.c
426         ${VORBISDIR}/lib/analysis.c
427         ${VORBISDIR}/lib/bitrate.c
428         ${VORBISDIR}/lib/block.c
429         ${VORBISDIR}/lib/codebook.c
430         ${VORBISDIR}/lib/envelope.c
431         ${VORBISDIR}/lib/floor0.c
432         ${VORBISDIR}/lib/floor1.c
433         ${VORBISDIR}/lib/info.c
434         ${VORBISDIR}/lib/lpc.c
435         ${VORBISDIR}/lib/lsp.c
436         ${VORBISDIR}/lib/mapping0.c
437         ${VORBISDIR}/lib/mdct.c
438         ${VORBISDIR}/lib/psy.c
439         ${VORBISDIR}/lib/registry.c
440         ${VORBISDIR}/lib/res0.c
441         ${VORBISDIR}/lib/sharedbook.c
442         ${VORBISDIR}/lib/smallft.c
443         ${VORBISDIR}/lib/synthesis.c
444         ${VORBISDIR}/lib/vorbisfile.c
445         ${VORBISDIR}/lib/window.c
446     )
447 endif (NOT OGGVORBIS_FOUND)
448
449 include_directories(
450     ${OPENAL_INCLUDE_DIR}
451     ${JPEG_INCLUDE_DIR}
452     ${PNG_INCLUDE_DIR}
453     ${ZLIB_INCLUDE_DIR}
454     ${OPENGL_INCLUDE_DIR}
455     ${GLU_INCLUDE_DIR}
456     ${SDL_INCLUDE_DIR}
457     ${VORBISFILE_INCLUDE_DIR}
458     ${OGG_INCLUDE_DIR}
459     ${CMAKE_SOURCE_DIR}/Source
460 )
461
462 set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${OPENGL_glu_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY} ${PLATFORM_LIBS})
463
464
465 add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H})
466
467 target_link_libraries(lugaru ${LUGARU_LIBS})
468
469 if(WIN32)
470         add_definitions(-DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=<stdint.h>)
471         if(MINGW)
472                 add_definitions(-DWIN32)
473         endif(MINGW)
474 else(WIN32)
475         add_definitions(-DPLATFORM_LINUX=1 -DPLATFORM_UNIX=1 -DUSE_OPENAL=1 -DUSE_SDL=1 -DBinIO_STDINT_HEADER=<stdint.h>)
476 endif(WIN32)
477
478 # Install target
479 if(APPLE)
480         set(APPS_ROOT "${CMAKE_INSTALL_PREFIX}/Lugaru.app")
481         set(APPS_BIN "${APPS_ROOT}/Contents/MacOS")
482         set(APPS_DATA "${APPS_ROOT}/Contents/Resources")
483 endif(APPLE)
484
485 if(WIN32)
486         install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX})
487         if(MSVC)
488                 install(FILES ${SDLDIR}/lib/win32/msvc2008/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
489                 install(FILES ${OPENALDIR}/lib/win32/msvc2008/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
490         endif(MSVC)
491         if(MINGW)
492                 install(FILES ${SDLDIR}/lib/win32/mingw/SDL.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
493                 install(FILES ${OPENALDIR}/lib/win32/mingw/OpenAL32.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
494         endif(MINGW)
495 else(WIN32)
496         if(APPLE)
497                 set(CMAKE_INSTALL_PREFIX "${APPS_BIN}")
498                 install(FILES ${SRCDIR}/mac-res/lugaru.icns DESTINATION ${APPS_DATA})
499                 install(FILES ${SRCDIR}/mac-res/Info.plist DESTINATION ${APPS_ROOT}/Contents)
500         endif(APPLE)
501         install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX})
502         if(APPLE AND LUGARU_HAS_INTERNAL_SDL)
503                 install(FILES ${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib DESTINATION ${CMAKE_INSTALL_PREFIX})
504         endif(APPLE AND LUGARU_HAS_INTERNAL_SDL)
505 endif(WIN32)
506
507 if(NOT APPLE)
508 install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX})
509 endif(NOT APPLE)
510
511 if(APPLE)
512 install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${APPS_ROOT})
513 endif(APPLE)
514
515 if (LUGARU_MISSING_DEPS)
516     message(STATUS "Using our copy of these libs: ${LUGARU_MISSING_DEPS}")
517 endif (LUGARU_MISSING_DEPS)
518