Commit 516b4bde authored by Jonathan Dowland's avatar Jonathan Dowland

New upstream version 5.2+dfsg1

parent 4e19dd19
......@@ -31,8 +31,11 @@ Please try to give as much information as possible:
you're using.
* Please say which game you're playing (Doom 1, Doom 2, Heretic,
Hexen, Strife, etc.) and list any add-on WADs you're using. Please
mention if you have any special configuration you think may be
Hexen, Strife, etc.) and if you're using any fan-made WADs or mods,
please say which mods (and where they can be downloaded!). It helps
to give the full command line you're using to start the game.
* Please mention if you have any special configuration you think may be
relevant, too.
### Feature requests
......
<!--
Thank you for reporting a bug in Chocolate Doom. Please complete
the following template so that we can better diagnose the source
of your problem.
To save yourself some time, you may want to check the FAQ and the
NOT-BUGS list for solutions to some common problems:
https://www.chocolate-doom.org/wiki/index.php/FAQ
https://www.chocolate-doom.org/not-bugs
-->
### Background
Version of Chocolate Doom:
Operating System and version:
Game: (Doom/Heretic/Hexen/Strife/other)
Any loaded WADs and mods (please include full command line):
### Bug description
Observed behavior:
Expected behavior:
......@@ -28,6 +28,7 @@ DOOM*.pcx
HTIC*.pcx
HEXEN*.pcx
STRIFE*.pcx
/build*
# These are the default patterns globally ignored by Subversion:
*.o
......
......@@ -3,7 +3,7 @@ set -e
if [ "$ANALYZE" = "true" ] ; then
cppcheck --error-exitcode=1 -j2 -UTESTING -Iopl -Isrc -Isrc/setup opl pcsound src textscreen > /dev/null
else
./autogen.sh
./autogen.sh --enable-werror
make
make install DESTDIR=/tmp/whatever
make dist
......
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
cmake_minimum_required(VERSION 3.7.2)
project("Chocolate Doom" VERSION 3.0.0 LANGUAGES C)
# Autotools variables
set(top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
set(top_builddir ${CMAKE_CURRENT_BINARY_DIR})
# AC_INIT variables
set(PACKAGE_NAME "${PROJECT_NAME}")
set(PACKAGE_TARNAME "chocolate-doom")
set(PACKAGE_VERSION "${PROJECT_VERSION}")
set(PACKAGE_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
set(PACKAGE_BUGREPORT "chocolate-doom-dev-list@chocolate-doom.org")
string(REGEX REPLACE " Doom$" "" PACKAGE_SHORTNAME "${PACKAGE_NAME}")
set(PACKAGE_COPYRIGHT "Copyright (C) 1993-2017")
set(PACKAGE_LICENSE "GNU General Public License, version 2")
# Any settings that should apply to all targets in this directory and all
# subdirectories should go here. Use judiciously.
if(MSVC)
add_definitions("/D_CRT_SECURE_NO_WARNINGS" "/D_CRT_SECURE_NO_DEPRECATE"
"/D_CRT_NONSTDC_NO_DEPRECATE")
else()
add_compile_options("-Wall" "-Wdeclaration-after-statement"
"-Wredundant-decls")
endif()
find_package(SDL2 2.0.1)
find_package(SDL2_mixer 2.0.0)
find_package(SDL2_net 2.0.0)
# Check for libsamplerate.
find_package(samplerate)
if(SAMPLERATE_FOUND)
set(HAVE_LIBSAMPLERATE TRUE)
endif()
# Check for libpng.
find_package(PNG)
if(PNG_FOUND)
set(HAVE_LIBPNG TRUE)
endif()
find_package(m)
include(CheckSymbolExists)
check_symbol_exists(strcasecmp "strings.h" HAVE_DECL_STRCASECMP)
check_symbol_exists(strncasecmp "strings.h" HAVE_DECL_STRNCASECMP)
string(CONCAT WINDOWS_RC_VERSION "${PROJECT_VERSION_MAJOR}, "
"${PROJECT_VERSION_MINOR}, ${PROJECT_VERSION_PATCH}, 0")
# Without a hyphen. This is used for the bash-completion scripts.
string(TOLOWER "${PACKAGE_SHORTNAME}" PROGRAM_SPREFIX)
# With a hyphen, used almost everywhere else.
set(PROGRAM_PREFIX "${PROGRAM_SPREFIX}-")
configure_file(cmake/config.h.cin config.h)
configure_file(src/resource.rc.in src/resource.rc)
configure_file(src/setup-res.rc.in src/setup-res.rc)
configure_file(src/setup/setup-manifest.xml.in src/setup/setup-manifest.xml)
foreach(SUBDIR textscreen midiproc opl pcsound src)
add_subdirectory("${SUBDIR}")
endforeach()
This diff is collapsed.
......@@ -38,6 +38,9 @@ Variables should be named like this: `my_variable_name`, not like this:
`MyVariableName`. In pointer variable declarations, place the `*` next
to the variable name, not the type.
When casting variables from one type to another, put a space after the
last closing brace.
When using an if, do, while, or for statement, always use the { } braces
even when they are not necessary. For example, do this:
......
......@@ -2,42 +2,17 @@ AUX_DIST_GEN = \
$(ac_aux_dir)/install-sh \
$(ac_aux_dir)/missing
MSVC_FILES= \
msvc/chocolate.sln \
msvc/config.h \
msvc/doom.vcproj \
msvc/heretic.vcproj \
msvc/hexen.vcproj \
msvc/strife.vcproj \
msvc/inttypes.h \
msvc/libopl.vcproj \
msvc/libpcsound.vcproj \
msvc/libtextscreen.vcproj \
msvc/README \
msvc/server.vcproj \
msvc/setup.vcproj \
msvc/stdint.h \
msvc/win_opendir.c \
msvc/win_opendir.h \
msvc/win32.rc
CODEBLOCKS_FILES= \
codeblocks/chocolate.workspace \
codeblocks/config.h \
codeblocks/doom.cbp \
codeblocks/game-res.rc \
codeblocks/heretic.cbp \
codeblocks/hexen.cbp \
codeblocks/strife.cbp \
codeblocks/libopl.cbp \
codeblocks/libpcsound.cbp \
codeblocks/libtextscreen.cbp \
codeblocks/README \
codeblocks/server.cbp \
codeblocks/setup.cbp \
codeblocks/setup-res.rc
CMAKE_FILES= \
CMakeLists.txt \
cmake/FindSDL2.cmake \
cmake/FindSDL2_mixer.cmake \
cmake/FindSDL2_net.cmake \
cmake/Findm.cmake \
cmake/Findsamplerate.cmake \
cmake/config.h.cin
DOC_FILES= \
COPYING.md \
README.md \
README.Music.md \
NEWS.md \
......@@ -46,15 +21,16 @@ DOC_FILES= \
EXTRA_DIST= \
$(AUX_DIST_GEN) \
$(MSVC_FILES) \
$(CODEBLOCKS_FILES) \
$(CMAKE_FILES) \
$(DOC_FILES) \
NOT-BUGS.md \
README.Strife.md \
.lvimrc \
HACKING.md \
TODO.md \
rpm.spec
rpm.spec \
win32/win_opendir.c \
win32/win_opendir.h
doomdocsdir = ${docdir}/../${PROGRAM_PREFIX}doom
doomdocs_DATA = $(DOC_FILES) NOT-BUGS.md
......@@ -78,7 +54,8 @@ if HAVE_PYTHON
INSTALL : man/INSTALL.template man/simplecpp
./man/simplecpp -DDOOM -DHERETIC -DHEXEN -DSTRIFE \
-DLONG_GAME_NAME="@PACKAGE_SHORTNAME@ Doom" \
-DLONG_EXE_NAME="@PROGRAM_PREFIX@doom" \
< man/INSTALL.template > $@
endif
## 3.0.0 (????-??-??)
## HEAD
### General
* The 0 and 5 keys on the number pad can now be bound independently
of any other keyboard key. (thanks BlooD2ool)
* Man page generation has been reworked to use autoconf macro
substitution, making it eaiser for downstream forks to change the
project name. (thanks Jon)
* Several functions have been hardened against incomplete reads and
error conditions, and made safer. (thanks turol)
* We now print a meaningful error message when a savegame cannot be
loaded. (thanks Zodomaniac, chungy)
* Fixed an exception thrown by the Windows kernel when debugging with
GDB. (thanks AXDOOMER)
* With aspect ratio correction disabled, the game can scale to any
arbitrary size and remove all black borders in full screen mode.
(thanks chungy)
### Build systems
* CMake has been added along with the deprecation of Microsoft
Visual Studio and Code::Blocks files. CMake maintains support for
multiple IDEs and versions thereof, and reduces developer overhead
when updating Chocolate Doom. (thanks AlexMax)
### Doom
* Map33 intermission screen and map33-map35 automap names are
emulated. (thanks CapnClever)
### Hexen
* ACS code has been hardened against potential security
vulnerabilities.
## 3.0.0 (2017-12-30)
Chocolate Doom 3.0 is a new major revision. The main change is that
the codebase has been ported to SDL 2.0. This brings a number of
......@@ -32,6 +64,9 @@
* Keyboard input is improved and uses the new SDL input API; on
systems with on-screen keyboards, this should activate the on-screen
keyboard when it is appropriate.
* Menu navigation with the joystick is now much more practical, and
it’s possible to bind a joystick axis to look up/down in games which
support it (thanks Jon, Wintermute0110).
* Several command line options were removed that were judged to be
useless: `-grabmouse`, `-novert` and `-nonovert`. The mouse grabbing
and novert settings can still be configured in the setup tool.
......@@ -43,14 +78,28 @@
* There is no longer a soft dependency on Zenity on Unix systems; the
SDL API is now used to display error dialogs.
* Joysticks are identified more precisely using GUID now.
* A new parameter -savedir allows users to specify a directory from
* A new parameter, `-savedir` allows users to specify a directory from
which to load and save games. (thanks CapnClever)
* The midiproc code from Eternity Engine has been imported, improving
native MIDI playback on Windows and fixing a long-standing bug with
music volume adjustment (thanks AlexMax, Quasar).
* VGA “porch” emulation was added (thanks Jon).
* The codebase now compiles with OpenWatcom (thanks Stephen Finniss).
### Doom
* The GOG install of Doom 3: BFG Edition is now detected (thanks chungy)
* A `-shorttics` command line parameter was added that simulates
recording a vanilla demo without actually recording a demo.
### Hexen
* The CD audio option for music playback has been removed; the CD
playback API has been removed from SDL 2.0. However, it is possible
to use digital music packs as an alternative.
### Strife
* `voices.wad` is now correctly loaded before PWADs (thanks
@Catoptromancy)
### libtextscreen
* On OS X on machines with retina displays, text screens are rendered
using a high detail font.
......@@ -61,6 +110,8 @@
* Handling of code pages was cleaned up, so it is easier to change the
code to work with a different code page now.
* Lots of the UI code was changed to use UTF-8 strings.
* File extensions when using the Zenity file selector are now case
insensitive (thanks Jon).
## 2.3.0 (2016-12-29)
......@@ -91,7 +142,7 @@
### Build systems
* There is better compatibility with BSD Make (thanks R.Rebello)
* “./configure --with-PACKAGE” checks were repaired to behave
* `./configure --with-PACKAGE` checks were repaired to behave
logically, rather than disabling the feature (thanks R.Rebello)
* Games are now installed to ${bindir} by default, eg.
/usr/local/bin, rather than /usr/local/games (thanks chungy)
......@@ -104,7 +155,7 @@
### Doom
* Chex Quest’s level warp cheat (LEESNYDER##) now behaves more like
like the original EXE (thanks Nuke.YKT)
* It's now possible to start multiplayer Chex Quest games.
* Its now possible to start multiplayer Chex Quest games.
* Freedoom: Phase 1 <= 0.10.1 can now be loaded with mods, with
-gameversion older than ultimate (thanks Fabian, chungy)
* The IWAD order preference for GOG.com installs matches vanilla
......@@ -120,9 +171,9 @@
* Map names were added for Episode 6, fixing a crash after completing
a level in this episode (thanks J.Benaim)
* Support for unlimited demo/savegames was added (thanks CapnClever)
* Demo support is expanded: "-demoextend" allows demos to last longer
than a single level; "-shortticfix" adjusts low-resolution turning
to match Doom's handling, and there is now "-maxdemo" and "-longtics"
* Demo support is expanded: `-demoextend` allows demos to last longer
than a single level; `-shortticfix` adjusts low-resolution turning
to match Doom’s handling, and there is now `-maxdemo` and `-longtics`
support (thanks CapnClever)
### Hexen
......@@ -132,11 +183,11 @@
Wraithverge in 64-bit builds (thanks J.Benaim)
* Support for unlimited demo/savegames was added (thanks CapnClever)
* Mouse buttons for strafe left/right and move backward were added,
as well as a "Double click acts as use" mouse option (thanks
as well as a “Double click acts as use” mouse option (thanks
CapnClever)
* Demo support is expanded: "-demoextend" allows demos to last longer
than a single level; "-shortticfix" adjusts low-resolution turning
to match Doom's handling, and there is now "-maxdemo" and "-longtics"
* Demo support is expanded: `-demoextend` allows demos to last longer
than a single level; `-shortticfix` adjusts low-resolution turning
to match Doom’s handling, and there is now `-maxdemo` and `-longtics`
support (thanks CapnClever)
### Strife
......@@ -151,7 +202,7 @@
### libtextscreen
* The API for creating and managing tables and columns was simplified.
* It's now possible to cycle through tables with the tab key.
* Its now possible to cycle through tables with the tab key.
* Windows can now have multiple columns.
## 2.2.1 (2015-09-10)
......
This diff is collapsed.
......@@ -44,6 +44,13 @@ Having downloaded the patches, select “GUS (emulated)” in the sound
configuration dialog in the setup tool, and use the “GUS patch path”
widget to enter the path to the directory containing the patch files.
For the music not to sound weird, you will almost certainly want to
load gusgonna.wad (sounds/gusgonna.zip in the idgames archive) when
you run the game, to work around a bug in vanilla Doom's instrument
mappings parser:
https://www.doomworld.com/idgames/sounds/gusgonna
By default a GUS card with 1024KB is simulated; to simulate a 256KB,
512KB or 768KB card instead, change the gus_ram_kb option in
chocolate-doom.cfg.
......@@ -109,7 +116,8 @@ systems unless you are running as the superuser (root/Administrator).
On modern Windows systems it is not possible to directly access the
OPL chip, even when running as Administrator. Fortunately, it is
possible to use the “ioperm.sys” driver developed for Cygwin:
possible to use the “ioperm.sys” driver developed for Cygwin (look for
iopermsys-0.2.1.tar.bz2):
http://openwince.sourceforge.net/ioperm/
......
# FindSDL2.cmake
#
# Copyright (c) 2018, Alex Mayfield <alexmax2742@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the <organization> nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Currently works with the following generators:
# - Unix Makefiles (Linux, MSYS2)
# - Ninja (Linux, MSYS2)
# - Visual Studio
# Cache variable that allows you to point CMake at a directory containing
# an extracted development library.
set(SDL2_DIR "${SDL2_DIR}" CACHE PATH "Location of SDL2 library directory")
# Use pkg-config to find library locations in *NIX environments.
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_search_module(PC_SDL2 QUIET sdl2)
endif()
# Find the include directory.
find_path(SDL2_INCLUDE_DIR "SDL_version.h"
HINTS "${SDL2_DIR}/include" ${PC_SDL2_INCLUDE_DIRS})
# Find the version. Taken and modified from CMake's FindSDL.cmake.
if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL_version.h" SDL2_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR "${SDL2_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR "${SDL2_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH "${SDL2_VERSION_PATCH_LINE}")
set(SDL2_VERSION "${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH}")
unset(SDL2_VERSION_MAJOR_LINE)
unset(SDL2_VERSION_MINOR_LINE)
unset(SDL2_VERSION_PATCH_LINE)
unset(SDL2_VERSION_MAJOR)
unset(SDL2_VERSION_MINOR)
unset(SDL2_VERSION_PATCH)
endif()
# Find the SDL2 and SDL2main libraries
if(CMAKE_SIZEOF_VOID_P STREQUAL 8)
find_library(SDL2_LIBRARY "SDL2"
HINTS "${SDL2_DIR}/lib/x64" ${PC_SDL2_LIBRARY_DIRS})
find_library(SDL2_MAIN_LIBRARY "SDL2main"
HINTS "${SDL2_DIR}/lib/x64" ${PC_SDL2_LIBRARY_DIRS})
else()
find_library(SDL2_LIBRARY "SDL2"
HINTS "${SDL2_DIR}/lib/x86" ${PC_SDL2_LIBRARY_DIRS})
find_library(SDL2_MAIN_LIBRARY "SDL2main"
HINTS "${SDL2_DIR}/lib/x86" ${PC_SDL2_LIBRARY_DIRS})
endif()
set(SDL2_LIBRARIES "${SDL2_MAIN_LIBRARY}" "${SDL2_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDL2
FOUND_VAR SDL2_FOUND
REQUIRED_VARS SDL2_INCLUDE_DIR SDL2_LIBRARIES
VERSION_VAR SDL2_VERSION
)
if(SDL2_FOUND)
# SDL2 imported target.
add_library(SDL2::SDL2 UNKNOWN IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
INTERFACE_COMPILE_OPTIONS "${PC_SDL2_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
IMPORTED_LOCATION "${SDL2_LIBRARY}")
# SDL2main imported target.
if(MINGW)
# Gross hack to get mingw32 first in the linker order.
add_library(SDL2::_SDL2main_detail UNKNOWN IMPORTED)
set_target_properties(SDL2::_SDL2main_detail PROPERTIES
IMPORTED_LOCATION "${SDL2_MAIN_LIBRARY}")
# Ensure that SDL2main comes before SDL2 in the linker order. CMake
# isn't smart enough to keep proper ordering for indirect dependencies
# so we have to spell it out here.
target_link_libraries(SDL2::_SDL2main_detail INTERFACE SDL2::SDL2)
add_library(SDL2::SDL2main INTERFACE IMPORTED)
set_target_properties(SDL2::SDL2main PROPERTIES
IMPORTED_LIBNAME mingw32)
target_link_libraries(SDL2::SDL2main INTERFACE SDL2::_SDL2main_detail)
else()
add_library(SDL2::SDL2main UNKNOWN IMPORTED)
set_target_properties(SDL2::SDL2main PROPERTIES
IMPORTED_LOCATION "${SDL2_MAIN_LIBRARY}")
endif()
endif()
# FindSDL2_mixer.cmake
#
# Copyright (c) 2018, Alex Mayfield <alexmax2742@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the <organization> nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Currently works with the following generators:
# - Unix Makefiles (Linux, MSYS2)
# - Ninja (Linux, MSYS2)
# - Visual Studio
# Cache variable that allows you to point CMake at a directory containing
# an extracted development library.
set(SDL2_MIXER_DIR "${SDL2_MIXER_DIR}" CACHE PATH "Location of SDL2_mixer library directory")
# Use pkg-config to find library locations in *NIX environments.
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_search_module(PC_SDL2_MIXER QUIET SDL2_mixer)
endif()
# Find the include directory.
find_path(SDL2_MIXER_INCLUDE_DIR "SDL_mixer.h"
HINTS "${SDL2_MIXER_DIR}/include" ${PC_SDL2_MIXER_INCLUDE_DIRS})
# Find the version. Taken and modified from CMake's FindSDL.cmake.
if(SDL2_MIXER_INCLUDE_DIR AND EXISTS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h")
file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL2_MIXER_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_MAJOR "${SDL2_MIXER_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_MINOR "${SDL2_MIXER_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_MIXER_VERSION_PATCH "${SDL2_MIXER_VERSION_PATCH_LINE}")
set(SDL2_MIXER_VERSION "${SDL2_MIXER_VERSION_MAJOR}.${SDL2_MIXER_VERSION_MINOR}.${SDL2_MIXER_VERSION_PATCH}")
unset(SDL2_MIXER_VERSION_MAJOR_LINE)
unset(SDL2_MIXER_VERSION_MINOR_LINE)
unset(SDL2_MIXER_VERSION_PATCH_LINE)
unset(SDL2_MIXER_VERSION_MAJOR)
unset(SDL2_MIXER_VERSION_MINOR)
unset(SDL2_MIXER_VERSION_PATCH)
endif()
# Find the library.
if(CMAKE_SIZEOF_VOID_P STREQUAL 8)
find_library(SDL2_MIXER_LIBRARY "SDL2_mixer"
HINTS "${SDL2_MIXER_DIR}/lib/x64" ${PC_SDL2_MIXER_LIBRARY_DIRS})
else()
find_library(SDL2_MIXER_LIBRARY "SDL2_mixer"
HINTS "${SDL2_MIXER_DIR}/lib/x86" ${PC_SDL2_MIXER_LIBRARY_DIRS})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDL2_mixer
FOUND_VAR SDL2_MIXER_FOUND
REQUIRED_VARS SDL2_MIXER_INCLUDE_DIR SDL2_MIXER_LIBRARY
VERSION_VAR SDL2_MIXER_VERSION
)
if(SDL2_MIXER_FOUND)
# Imported target.
add_library(SDL2::mixer UNKNOWN IMPORTED)
set_target_properties(SDL2::mixer PROPERTIES
INTERFACE_COMPILE_OPTIONS "${PC_SDL2_MIXER_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_MIXER_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES SDL2::SDL2
IMPORTED_LOCATION "${SDL2_MIXER_LIBRARY}")
endif()
# FindSDL2_net.cmake
#
# Copyright (c) 2018, Alex Mayfield <alexmax2742@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the <organization> nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Currently works with the following generators:
# - Unix Makefiles (Linux, MSYS2)
# - Ninja (Linux, MSYS2)
# - Visual Studio
# Cache variable that allows you to point CMake at a directory containing
# an extracted development library.
set(SDL2_NET_DIR "${SDL2_NET_DIR}" CACHE PATH "Location of SDL2_net library directory")