Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
251 commits
Select commit Hold shift + click to select a range
404e3c3
adding sdl1_wrapper.h
nsklaus Jul 9, 2019
433f8e6
update sdl1_wrapper.h
nsklaus Jul 9, 2019
61045f7
more functions declaration to the wrapper
nsklaus Jul 9, 2019
b5b9529
more readability
nsklaus Jul 9, 2019
4aed3e6
building up 84% so far
nsklaus Jul 9, 2019
e56cace
more protoss
nsklaus Jul 9, 2019
1eb9ad7
compile 100% linker fails
nsklaus Jul 9, 2019
e204d78
Update sdl1_wrapper.h
nonarkitten Jul 9, 2019
957712f
Merge pull request #1 from nonarkitten/patch-2
nsklaus Jul 9, 2019
c2e435b
Update sdl1_wrapper.h
nonarkitten Jul 9, 2019
8810169
Update sdl1_wrapper.cpp
nonarkitten Jul 9, 2019
2d16b88
Merge pull request #2 from nonarkitten/patch-3
nsklaus Jul 9, 2019
0161e55
Update sdl1_wrapper.h
nonarkitten Jul 9, 2019
ae1e4ae
gaaAaah
nsklaus Jul 9, 2019
d97012e
marlon's fight, round 1
nsklaus Jul 10, 2019
1c7efcf
Include sdl1_wrapper.cpp
arczi84 Jul 11, 2019
099c053
implement basic sdl2 funcs
arczi84 Jul 11, 2019
a72066e
Merge pull request #1 from nsklaus/master
MBeijer Jul 11, 2019
92e2128
typo
arczi84 Jul 11, 2019
ee03d89
remove duplicate
arczi84 Jul 11, 2019
0fcf6cf
test
nsklaus Jul 11, 2019
3b0c81a
remove test
nsklaus Jul 11, 2019
20e9bfb
Merge branch 'master' of github.com:nsklaus/devilutionX
arczi84 Jul 11, 2019
f607efa
Some fixes for 68k-amiga
MBeijer Jul 11, 2019
4b56228
merge
MBeijer Jul 11, 2019
cb2269f
Merge branch 'nsklaus-master'
MBeijer Jul 11, 2019
609bca9
Remove ssh keys!
MBeijer Jul 11, 2019
77f7ec8
remove
arczi84 Jul 11, 2019
d72677e
Merge pull request #4 from AmigaPorts/master
nsklaus Jul 11, 2019
4fe4ad1
Merge pull request #3 from nonarkitten/patch-4
nsklaus Jul 11, 2019
490091d
Merge pull request #3 from diasurgical/master
MBeijer Jul 11, 2019
d57e88d
Some 68k fixes
MBeijer Jul 11, 2019
f685c45
Merge branch 'master' of github.com:nsklaus/devilutionX
arczi84 Jul 11, 2019
8712aef
Merge pull request #4 from nsklaus/master
MBeijer Jul 11, 2019
09bde54
Remove some exception handling when compiling for Amiga
MBeijer Jul 11, 2019
a61ffff
Fixing some redeclarations and uncommented code
MBeijer Jul 11, 2019
59cb0c7
Merge pull request #5 from AmigaPorts/master
MBeijer Jul 11, 2019
2559e5b
Merge branch 'master' of github.com:nsklaus/devilutionX
arczi84 Jul 11, 2019
c2e9cd6
push test
arczi84 Jul 11, 2019
94e3d2b
push test
arczi84 Jul 11, 2019
9eeaca6
Merge pull request #5 from nsklaus/master
MBeijer Jul 11, 2019
cd7e562
fix double declaration
arczi84 Jul 11, 2019
39f91d3
fix double declaration
arczi84 Jul 11, 2019
c239499
Ignore CLion CMake folders
MBeijer Jul 11, 2019
2ecc282
Fixes so it compiles on MacOS with CLIon
MBeijer Jul 11, 2019
542f561
Ignore CMakeFiles directory
MBeijer Jul 11, 2019
a149808
Merge pull request #6 from nsklaus/master
MBeijer Jul 11, 2019
a128810
Ignore CMakeCache
MBeijer Jul 11, 2019
1b6a930
Merge branch 'master' of github.com:AmigaPorts/devilutionX
MBeijer Jul 11, 2019
075d1af
remove junk
MBeijer Jul 11, 2019
385af60
Remove more junk
MBeijer Jul 11, 2019
af003bd
Merge pull request #6 from AmigaPorts/master
MBeijer Jul 11, 2019
aba6aca
Further fixes for 68k
MBeijer Jul 11, 2019
218a12d
Fix CMakeLists.txt so it adds needed libraries to build for m68k-amigaos
MBeijer Jul 11, 2019
2b14e18
Add FindLibMad.cmake to make SDL_mixer work
MBeijer Jul 11, 2019
a34a77a
Only link Amiga specific stuff if compiling for amiga
MBeijer Jul 11, 2019
8d1fe53
Some SDL fixes
MBeijer Jul 11, 2019
0a59a0e
Fix line endings
MBeijer Jul 11, 2019
8b9c732
Disable net code and add a bunch of SDL2 -> SDL1.2 functions
MBeijer Jul 11, 2019
22f00d7
Merge pull request #7 from AmigaPorts/master
MBeijer Jul 11, 2019
86f3971
Some testing
MBeijer Jul 11, 2019
e547e34
Initialize the SDL_Window struct and apply some Amiga specific stuff
MBeijer Jul 11, 2019
f6e9534
Some further tests
MBeijer Jul 11, 2019
231c6eb
Merge pull request #7 from diasurgical/master
MBeijer Jul 12, 2019
348362f
Fix the creation of the surface
MBeijer Jul 12, 2019
ec63e15
Clean up
MBeijer Jul 12, 2019
4a46492
Merge pull request #8 from AmigaPorts/master
MBeijer Jul 12, 2019
cc02a8f
uncomment SDL_Log
arczi84 Jul 14, 2019
2f7e864
fix include
arczi84 Jul 14, 2019
3e10a5d
print more error info
arczi84 Jul 14, 2019
e3a9574
improve SDL_UpdateWindowSurface
arczi84 Jul 14, 2019
462db32
fix warnings
arczi84 Jul 14, 2019
57669cb
disable upscale
arczi84 Jul 14, 2019
0da8ce9
disable sdl_log back
arczi84 Jul 14, 2019
d6d4ceb
disable sdl_log back
arczi84 Jul 14, 2019
5db051f
roll back
arczi84 Jul 14, 2019
f45ae40
Revert "roll back"
nsklaus Jul 14, 2019
b7b204f
Revert "disable sdl_log back"
nsklaus Jul 14, 2019
a0196ee
Revert "disable sdl_log back"
nsklaus Jul 14, 2019
4a5d89c
Revert "disable upscale"
nsklaus Jul 14, 2019
7555c81
Revert "fix warnings"
nsklaus Jul 14, 2019
973efef
Revert "improve SDL_UpdateWindowSurface"
nsklaus Jul 14, 2019
5054e27
Revert "print more error info"
nsklaus Jul 14, 2019
d3e9dae
Revert "fix include"
nsklaus Jul 14, 2019
7f3a10f
Revert "uncomment SDL_Log"
nsklaus Jul 14, 2019
a1067b1
Revert "roll back"
nsklaus Jul 14, 2019
75919b4
Revert "disable sdl_log back"
nsklaus Jul 14, 2019
37c3c97
Revert "disable sdl_log back"
nsklaus Jul 14, 2019
58c6ad2
reverting to last marlon commit
nsklaus Jul 14, 2019
0d804e5
enabling back a few sdl_log() that were previously commented out
Jul 14, 2019
244c512
implemented structs SDL_DisplayMode and SDL_WindowUserData
Jul 14, 2019
047a7e4
Better SDL_GetPrefPath
arczi84 Jul 14, 2019
198e22c
add build files
arczi84 Jul 14, 2019
cd680ed
Add missing return
arczi84 Jul 14, 2019
c5e3afa
SDL_VideoDisplay and SDL_DisplayOrientation
nsklaus Jul 14, 2019
0386732
Merge branch 'master' of https://github.com/nsklaus/devilutionX
nsklaus Jul 14, 2019
73306d4
revert sdl_free() and SDL_GetPrefPath()
nsklaus Jul 14, 2019
daf46a9
Enable translate_sdl_key
arczi84 Jul 14, 2019
99801e6
Merge pull request #8 from diasurgical/master
MBeijer Jul 14, 2019
dcd7369
Merge pull request #9 from nsklaus/master
MBeijer Jul 14, 2019
38633e5
Implement SDL_GetKeyboardState
arczi84 Jul 14, 2019
4c38d50
Disable upscale and replace badly implemented SDL_ConvertSurfaceFormat
arczi84 Jul 14, 2019
1f5b4fb
Merge pull request #10 from nsklaus/master
MBeijer Jul 14, 2019
997420f
Some minor changes to get it to compile with Bebbo's toolchain
MBeijer Jul 14, 2019
dec0201
Merge pull request #9 from AmigaPorts/master
MBeijer Jul 14, 2019
7a9ad6c
Some tests trying to get it running on Amiga
MBeijer Jul 14, 2019
1f564e6
display SDL_ShowSimpleMessageBox() messages
nsklaus Jul 14, 2019
644a64d
Minor tweaks
MBeijer Jul 14, 2019
b35005e
display SDL_ShowSimpleMessageBox() messages with \n this time
nsklaus Jul 14, 2019
3035a3a
merge
MBeijer Jul 14, 2019
be33bcd
Merge pull request #11 from nsklaus/master
MBeijer Jul 14, 2019
aa662da
Fix dumb mistake
MBeijer Jul 14, 2019
aec59d3
Quick fix / proof of concept: SDL2 -> SDL1.2 palette functions are br…
MBeijer Jul 15, 2019
f6120bc
Some comments so we know what we need to look at
MBeijer Jul 15, 2019
19bd3e6
Merge pull request #12 from diasurgical/master
MBeijer Jul 15, 2019
6b46804
Possible endian fix for Amiga+ some cleanyp
MBeijer Jul 15, 2019
d6dab48
Trying to get sound working
MBeijer Jul 15, 2019
c029940
Some clean up work
MBeijer Jul 15, 2019
b9d376f
Some more cleanup
MBeijer Jul 15, 2019
d02b873
Fix SDL_Mixer, fix palette for video playback
MBeijer Jul 15, 2019
095c4ad
Add Amiga icon info-file
MBeijer Jul 15, 2019
4beb7f4
Merge branch 'master' of github.com:AmigaPorts/devilutionX
MBeijer Jul 15, 2019
598f99f
Merge branch 'master' of github.com:AmigaPorts/devilutionX
MBeijer Jul 15, 2019
595b665
StormLib:
MBeijer Jul 15, 2019
f2d05b1
Prettify the code
MBeijer Jul 15, 2019
15205d8
Add endian switch for Linux as well
MBeijer Jul 15, 2019
5792003
Enable text input
arczi84 Jul 16, 2019
0b86c04
Enable text input
arczi84 Jul 16, 2019
ccb3c58
Run DevilutionX in 8bit mode on amiga and set the colors appropriately
MBeijer Jul 16, 2019
9afad9e
Re-enable all SDL_log
MBeijer Jul 16, 2019
29a0d50
Fix typo
MBeijer Jul 16, 2019
bb47e3e
Fix another typo
MBeijer Jul 16, 2019
ebf44a4
Go in-game !
arczi84 Jul 17, 2019
1afd400
Merge branch 'master' of https://github.com/AmigaPorts/devilutionX
arczi84 Jul 17, 2019
989fb4f
Make SDL modes more maintainable
MBeijer Jul 17, 2019
78344f1
Enable network to fix player movement. Needs libsodium.
arczi84 Jul 18, 2019
2803cd6
Add Jenkins build
MBeijer Jul 18, 2019
3a8c449
Make sure to use the toolchain files when building in Jenkins
MBeijer Jul 18, 2019
b3af596
Use the proper toolchain names
MBeijer Jul 18, 2019
650dc87
Ignore debug files
arczi84 Jul 19, 2019
cc9e525
Enable network to fix player movement.
arczi84 Jul 19, 2019
861243f
Fix mistake
MBeijer Jul 21, 2019
d931d7a
Merge
MBeijer Jul 21, 2019
f3551ec
git push origin masterMerge branch 'StormLib-Amiga'
MBeijer Jul 21, 2019
a493721
Some LE->BE fixes
MBeijer Jul 21, 2019
b71224e
Merge pull request #14 from diasurgical/master
MBeijer Jul 21, 2019
9c442e8
Add dummy SDL_RaiseWindow in sdl1_wrapper
MBeijer Jul 21, 2019
7235031
Merge pull request #15 from diasurgical/master
MBeijer Jul 21, 2019
ec8606c
Swap the endianness with sound files
MBeijer Jul 21, 2019
62e8c2e
Go back to how it was
MBeijer Jul 21, 2019
8d0c7c6
Fix Findsodium.cmake so it works for Amiga as well
MBeijer Jul 21, 2019
6f0092b
merge
MBeijer Jul 21, 2019
b88898f
Merge branch 'diasurgical-master'
MBeijer Jul 21, 2019
ef65ae1
Merge pull request #16 from diasurgical/master
MBeijer Jul 21, 2019
d8376d0
Merge pull request #18 from diasurgical/master
MBeijer Jul 22, 2019
cd115fe
Merge pull request #19 from diasurgical/master
MBeijer Jul 24, 2019
87037f0
Update Jenkins build
Jul 25, 2019
183cbfa
Build dependencies
Jul 25, 2019
52181f3
Fix downloading of dependencies
Jul 25, 2019
f10f0a7
Fix define issues
Jul 25, 2019
33965d0
Fix unpacking of dependency
Jul 25, 2019
f42b5c9
Fix building of SDL_mixer
Jul 25, 2019
085d680
Forgot to add ./configure to dependency builds
Jul 25, 2019
ce25d09
Try to fix ./configure
Jul 25, 2019
bb6a569
Install the libraries built with CMake
Jul 25, 2019
4a164a4
Build zlib as well
Jul 25, 2019
d558894
Use configure to build zlib
Jul 25, 2019
645ddcc
Go back to CMake for zlib and set proper install prefix
Jul 25, 2019
72cabaf
Only define target once
Jul 25, 2019
9cd6d2a
Install freetype to prefix
Jul 25, 2019
10861f2
Fix install-path for all dependencies compiled with CMake
Jul 25, 2019
5e99378
Attempt to fix building of SDL_ttf and SDL_mixer
Jul 25, 2019
322f66a
More fixes
Jul 25, 2019
1b4e59a
Fix dumb mistakes
Jul 25, 2019
829221b
Make sure the configure script use the proper prefix
Jul 25, 2019
fcfbb8f
Lets try this again
Jul 25, 2019
d3206d3
More fixes
Jul 25, 2019
806b569
Go back to using CMake for freetype
Jul 25, 2019
f335993
Use freetype version 2.10.1 instead
Jul 25, 2019
6abe1a8
Set FT2_CONFIG environment variable
Jul 25, 2019
64c6245
Actually point the FT2_CONFIG environment variable to ftconfig.h file
Jul 25, 2019
054738e
...
Jul 25, 2019
6407080
Try CMake for SDL2_ttf
Jul 25, 2019
6bddd6d
Some fixes for Big Endian systems
MBeijer Jul 25, 2019
760a933
Fix SDL2_ttf
MBeijer Jul 26, 2019
8c2669a
Don't use relative path's for CMAKE_MODULE_PATH
MBeijer Jul 26, 2019
8db3c21
SDL2_ttf has a broken CMakeFile, ignore the error
MBeijer Jul 26, 2019
b8c5d71
Grab latest SDL2_ttf source
MBeijer Jul 26, 2019
6100452
Revert change and add potential fix
MBeijer Jul 26, 2019
6b8f232
Add more PKG_CONFIG_PATH's + Add proper FindFreetype.cmake
MBeijer Jul 26, 2019
cc91ce5
.
MBeijer Jul 26, 2019
dc1cf09
.
MBeijer Jul 26, 2019
c1395cc
.
MBeijer Jul 26, 2019
5782462
.
MBeijer Jul 26, 2019
4a43981
Append cmake module path, don't replace
MBeijer Jul 26, 2019
f5e40a0
.
MBeijer Jul 26, 2019
09bcbc2
.
MBeijer Jul 26, 2019
83d1a11
.
MBeijer Jul 26, 2019
30c83a5
.
MBeijer Jul 26, 2019
795e93d
.
MBeijer Jul 26, 2019
df8b2c8
.
MBeijer Jul 26, 2019
9d09a5c
.
MBeijer Jul 26, 2019
4e34bf4
.
MBeijer Jul 26, 2019
a03d63e
.
MBeijer Jul 26, 2019
3ded0f1
.
MBeijer Jul 26, 2019
a76a05e
.
MBeijer Jul 26, 2019
155402b
.
MBeijer Jul 26, 2019
1625264
.
MBeijer Jul 26, 2019
8027f50
.
MBeijer Jul 26, 2019
d0e8451
.
MBeijer Jul 26, 2019
9a27eae
Make both SDL1.2 and SDL2 work
MBeijer Jul 26, 2019
8e505c1
Checking for wrong variable in SYSROOT
MBeijer Jul 26, 2019
4e4169f
Fix some things that got broken when making SDL2 -> SDL1.2 wrapper
MBeijer Jul 26, 2019
e1a9d82
Get SDL2 working again
MBeijer Jul 27, 2019
3f5e709
Fix SDL2
MBeijer Jul 27, 2019
8a5bc84
More fixes
MBeijer Jul 27, 2019
ea2ff8e
More SDL1.2->SDL2 fixes
MBeijer Jul 27, 2019
5e2f0b1
Clean up
MBeijer Jul 27, 2019
478d63e
More fixes
MBeijer Jul 27, 2019
decc7f2
Fix minor mistake in Jenkinsfile
MBeijer Jul 27, 2019
4935572
Hope this fix the building
MBeijer Jul 27, 2019
bda2456
Some clean up and some verbose logging for building
MBeijer Jul 27, 2019
ec5acf6
Oops
MBeijer Jul 27, 2019
b70ac0b
please work!
MBeijer Jul 27, 2019
6144045
More clean up and build fixes
MBeijer Jul 27, 2019
e5a1520
Jenkins bug
MBeijer Jul 27, 2019
5986fdf
Fix SDL2 linking
MBeijer Jul 27, 2019
5a8e1a9
Should now link properly
MBeijer Jul 27, 2019
77b047c
.
MBeijer Jul 27, 2019
5d12666
Try fixing finding zlib for mingw targets + fix archiving of artifacts
MBeijer Jul 27, 2019
44e2109
Fix typo
MBeijer Jul 27, 2019
3607f3f
Disable webasm for now + fix linking of freetype
MBeijer Jul 27, 2019
c3f6849
.
MBeijer Jul 27, 2019
869449a
Try to get WebAsm running
MBeijer Jul 27, 2019
5d08d65
try pointing to the static libz.a
MBeijer Jul 27, 2019
1c0b389
Try disabling shared
MBeijer Jul 27, 2019
f824ddf
Fix building of libpng
MBeijer Jul 27, 2019
6df6445
.
MBeijer Jul 27, 2019
29cb48d
.
MBeijer Jul 27, 2019
65e180f
Oopsie
MBeijer Jul 27, 2019
fd93a2a
Set prefix path
MBeijer Jul 27, 2019
44f263c
Emscripten fixes
MBeijer Jul 27, 2019
e649744
Emscripten fixes
MBeijer Jul 27, 2019
9eeccbb
More emscripten fixes
MBeijer Jul 27, 2019
836fcbf
Hopefully the last fix for Emscripten
MBeijer Jul 27, 2019
8abcbb0
Possibly last fixes
MBeijer Jul 27, 2019
7a00038
Revert...
MBeijer Jul 27, 2019
edc2bd3
Test
MBeijer Jul 28, 2019
8ed1810
Lets try a different approach
MBeijer Jul 28, 2019
d35b871
Another test
MBeijer Jul 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
# macOS
.DS_Store

# qt-creator
devilutionx.config
devilutionx.creator
devilutionx.files
devilutionx.includes
.cproject
.settings/


# CodeLite
.CodeLite
*.project
Expand Down Expand Up @@ -422,3 +431,20 @@ DerivedData/
/libs

# End of https://www.gitignore.io/api/xcode
cmake-*
CMakeFiles/*
CMakeCache.txt


##mine

*.mpq
*.a
*.cmake
Makefile
devilutionx
.gitignore
Source/diablo.cpp.debug
Source/interfac.cpp.debug
SourceX/DiabloUI/credits.cpp.debug
SourceX/storm/storm_net.cpp.debug
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ void handler_tracking::reactor_operation(
void handler_tracking::write_line(const char* format, ...)
{
using namespace std; // For sprintf (or equivalent).

va_list args;

va_start(args, format);

char line[256] = "";
Expand Down
45 changes: 45 additions & 0 deletions CMake/FindLibMad.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#-------------------------------------------------------------------------------
#
# Copyright 2013-2018 BBC Research and Development
#
# This file is part of Audio Waveform Image Generator.
#
# Author: Chris Needham
#
# Audio Waveform Image Generator is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Audio Waveform Image Generator is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Audio Waveform Image Generator. If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------------------------------------
#
# Finds libmad include file and library. This module sets the following
# variables:
#
# LIBMAD_FOUND - Flag if libmad was found
# LIBMAD_INCLUDE_DIRS - libmad include directories
# LIBMAD_LIBRARIES - libmad library paths
#
#-------------------------------------------------------------------------------

include(FindPackageHandleStandardArgs)

find_path(LIBMAD_INCLUDE_DIRS mad.h)
find_library(LIBMAD_LIBRARIES mad)

find_package_handle_standard_args(
LibMad
DEFAULT_MSG
LIBMAD_LIBRARIES
LIBMAD_INCLUDE_DIRS
)

#-------------------------------------------------------------------------------
180 changes: 180 additions & 0 deletions CMake/FindSDL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Locate SDL library
# This module defines
# SDL_LIBRARY, the name of the library to link against
# SDL_FOUND, if false, do not try to link to SDL
# SDL_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL_BUILDING_LIBRARY
# If this is defined, then no SDL_main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL_LIBRARY_TEMP in your configuration
# and no SDL_LIBRARY, it means CMake did not find your SDL library
# (SDL.dll, libsdl.so, SDL.framework, etc).
# Set SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
# Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL_LIBRARY
# variable, but when these values are unset, SDL_LIBRARY does not get created.
#
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL/ (see FreeBSD).

#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)

FIND_PATH(SDL_INCLUDE_DIR SDL.h
HINTS
$ENV{SDLDIR}
PATH_SUFFIXES include/SDL include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
${Package_search_hints}
)
#MESSAGE("SDL_INCLUDE_DIR is ${SDL_INCLUDE_DIR}")

# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
FIND_LIBRARY(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
HINTS
$ENV{SDLDIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw
/opt/local
/opt/csw
/opt
${Package_search_hints}
)

#MESSAGE("SDL_LIBRARY_TEMP is ${SDL_LIBRARY_TEMP}")

IF(NOT SDL_BUILDING_LIBRARY)
IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
HINTS
$ENV{SDLDIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw
/opt/local
/opt/csw
/opt
${Package_search_hints}
)
ENDIF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL_BUILDING_LIBRARY)

# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)

# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)

SET(SDL_FOUND "NO")
IF(SDL_LIBRARY_TEMP)
# For SDLmain
IF(NOT SDL_BUILDING_LIBRARY)
IF(SDLMAIN_LIBRARY)
SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
ENDIF(SDLMAIN_LIBRARY)
ENDIF(NOT SDL_BUILDING_LIBRARY)

# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)

# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)

# For MinGW library
IF(MINGW)
SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP})
ENDIF(MINGW)

# Set the final string here so the GUI reflects the final state.
SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")

SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP)

#MESSAGE("SDL_LIBRARY is ${SDL_LIBRARY}")

Loading