Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ scripts/soloud_codegen.py
glue/rpgmaker_soloud.rb
*.lastcodeanalysissucceeded
*.bak
CMakeLists.txt.user
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ Danny Angelo Carminati Grein https://github.com/fungos
Igor Ivanov https://github.com/laptabrok
Matthew O'Connell https://github.com/matthew-oconnell
Boris Carvajal https://github.com/BorisCarvajal
Bradley Clemetson https://github.com/bradc6
76 changes: 56 additions & 20 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,68 @@
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.0)
project(SoLoud)

project (SoLoud)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
#INCLUDE (StandartIncludes)
include(OptionDependentOnPackage)
include(PrintOptionStatus)

include_directories (../include)
option(SOLOUD_DYNAMIC "Set to ON to build dynamic SoLoud" OFF)
print_option_status (SOLOUD_DYNAMIC "Build dynamic library")

include (Configure.cmake)
#INCLUDE (InstallIncludes.cmake)
#INCLUDE (InstallStaticData.cmake)
option(SOLOUD_STATIC "Set to ON to build static SoLoud" ON)
print_option_status (SOLOUD_STATIC "Build static library")

if (UNIX AND NOT WIN32 AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
set (LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
mark_as_advanced (LIB_POSTFIX)
endif ()
endif ()
if (NOT DEFINED LIB_POSTFIX)
set (LIB_POSTFIX "")
endif ()
option(SOLOUD_BUILD_DEMOS "Set to ON for building demos" OFF)
option(SOLOUD_ENABLE_BACKEND_NULL "Set to ON for building NULL backend" ON)
option(SOLOUD_ENABLE_BACKEND_SDL2 "Set to ON for building SDL2 backend" OFF)
option(SOLOUD_ENABLE_BACKEND_ALSA "Set to ON for building the ALSA backend" OFF)
option(SOLOUD_ENABLE_BACKEND_PIPEWIRE "Set to ON for building PIPEWIRE backend" OFF)
option(SOLOUD_ENABLE_BACKEND_COREAUDIO "Set to ON for building CoreAudio backend" OFF)
option(SOLOUD_ENABLE_BACKEND_OPENSLES "Set to ON for building OpenSLES backend" OFF)
option(SOLOUD_ENABLE_BACKEND_XAUDIO2 "Set to ON for building XAudio2 backend" OFF)
option(SOLOUD_ENABLE_BACKEND_WINMM "Set to ON for building WINMM backend" OFF)
option(SOLOUD_ENABLE_BACKEND_WASAPI "Set to ON for building WASAPI backend" OFF)
option(SOLOUD_AUTO_DETECT_BACKENDS "Attempt to enable backends based on what is available" ON)

if(SOLOUD_AUTO_DETECT_BACKENDS)
find_package(SDL2)
set(SOLOUD_ENABLE_BACKEND_SDL2 ${SDL2_FOUND})
find_package(ALSA)
set(SOLOUD_ENABLE_BACKEND_ALSA ${ALSA_FOUND})
find_package(PipeWire)
set(SOLOUD_ENABLE_BACKEND_PIPEWIRE ${PipeWire_FOUND})

if(APPLE)
set(SOLOUD_BACKEND_COREAUDIO ON)
endif()

find_package(OpenSLES)
set(SOLOUD_ENABLE_BACKEND_OPENSLES ${OPENSLES_FOUND})
endif()

if(SOLOUD_BUILD_DEMOS)
set(SOLOUD_STATIC ON)
endif()

print_option_status (SOLOUD_BUILD_DEMOS "Build demos")
print_option_status (SOLOUD_AUTO_DETECT_BACKENDS "Auto Detect Backends")
print_option_status (SOLOUD_ENABLE_BACKEND_NULL "NULL backend")
print_option_status (SOLOUD_BACKEND_SDL2 "SDL2 backend")
print_option_status (SOLOUD_ENABLE_BACKEND_ALSA "ALSA backend")
print_option_status (SOLOUD_ENABLE_BACKEND_PIPEWIRE "PipeWire backend")
print_option_status (SOLOUD_BACKEND_COREAUDIO "CoreAudio backend")
print_option_status (SOLOUD_BACKEND_OPENSLES "OpenSLES backend")
print_option_status (SOLOUD_BACKEND_XAUDIO2 "XAudio2 backend")
print_option_status (SOLOUD_BACKEND_WINMM "WINMM backend")
print_option_status (SOLOUD_BACKEND_WASAPI "WASAPI backend")

#Establish some basic mappings to filesystem directories
get_filename_component(SOLOUD_ROOT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)

include (src.cmake)

# Demos
IF (SOLOUD_BUILD_DEMOS)
if(SOLOUD_BUILD_DEMOS)
include (demos.cmake)
endif ()

include (InstallExport)
33 changes: 0 additions & 33 deletions contrib/Configure.cmake

This file was deleted.

28 changes: 28 additions & 0 deletions contrib/cmake/FindOpenSLES.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# - Find OpenSLES
# Find the OpenSLES includes and libraries
#
# OPENSLES_INCLUDE_DIR - where to find dsound.h
# OPENSLES_LIBRARIES - List of libraries when using dsound.
# OPENSLES_FOUND - True if dsound found.

get_property(_FIND_LIBRARY_USE_LIB64_PATHS GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS 1)

find_path(OpenSLES_INCLUDE_DIR SLES/OpenSLES.h)
find_library(OpenSLES_LIBRARY NAMES OpenSLES)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenSLES DEFAULT_MSG OpenSLES_INCLUDE_DIR OpenSLES_LIBRARY)

if(OpenSLES_FOUND)
set(OpenSLES_INCLUDE_DIRS ${OPENSLES_INCLUDE_DIR})
set(OpenSLES_LIBRARIES ${OPENSLES_LIBRARY})
else(OpenSLES_FOUND)
if (OpenSLES_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find OPENSLES")
endif()
endif(OpenSLES_FOUND)

mark_as_advanced(OpenSLES_INCLUDE_DIR OpenSLES_LIBRARY)

set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ${_FIND_LIBRARY_USE_LIB64_PATHS})
122 changes: 122 additions & 0 deletions contrib/cmake/FindPipeWire.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#.rst:
# FindPipeWire
# -------
#
# Try to find PipeWire on a Unix system.
#
# This will define the following variables:
#
# ``PipeWire_FOUND``
# True if (the requested version of) PipeWire is available
# ``PipeWire_VERSION``
# The version of PipeWire
# ``PipeWire_LIBRARIES``
# This can be passed to target_link_libraries() instead of the ``PipeWire::PipeWire``
# target
# ``PipeWire_INCLUDE_DIRS``
# This should be passed to target_include_directories() if the target is not
# used for linking
# ``PipeWire_DEFINITIONS``
# This should be passed to target_compile_options() if the target is not
# used for linking
#
# If ``PipeWire_FOUND`` is TRUE, it will also define the following imported target:
#
# ``PipeWire::PipeWire``
# The PipeWire library
#
# In general we recommend using the imported target, as it is easier to use.
# Bear in mind, however, that if the target is in the link interface of an
# exported library, it must be made available by the package config file.

#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
# Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
#=============================================================================

# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)

pkg_search_module(PKG_PipeWire QUIET libpipewire-0.3 libpipewire-0.2)
pkg_search_module(PKG_Spa QUIET libspa-0.2 libspa-0.1)

set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS}" "${PKG_Spa_CFLAGS}")
set(PipeWire_VERSION "${PKG_PipeWire_VERSION}")

find_path(PipeWire_INCLUDE_DIRS
NAMES
pipewire/pipewire.h
HINTS
${PKG_PipeWire_INCLUDE_DIRS}
${PKG_PipeWire_INCLUDE_DIRS}/pipewire-0.3
)

find_path(Spa_INCLUDE_DIRS
NAMES
spa/param/props.h
HINTS
${PKG_Spa_INCLUDE_DIRS}
${PKG_Spa_INCLUDE_DIRS}/spa-0.2
)

find_library(PipeWire_LIBRARIES
NAMES
pipewire-0.3
pipewire-0.2
HINTS
${PKG_PipeWire_LIBRARY_DIRS}
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PipeWire
FOUND_VAR
PipeWire_FOUND
REQUIRED_VARS
PipeWire_LIBRARIES
PipeWire_INCLUDE_DIRS
Spa_INCLUDE_DIRS
VERSION_VAR
PipeWire_VERSION
)

if(PipeWire_FOUND AND NOT TARGET PipeWire::PipeWire)
add_library(PipeWire::PipeWire UNKNOWN IMPORTED)
set_target_properties(PipeWire::PipeWire PROPERTIES
IMPORTED_LOCATION "${PipeWire_LIBRARIES}"
INTERFACE_COMPILE_OPTIONS "${PipeWire_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS};${Spa_INCLUDE_DIRS}"
)
endif()

mark_as_advanced(PipeWire_LIBRARIES PipeWire_INCLUDE_DIRS)

include(FeatureSummary)
set_package_properties(PipeWire PROPERTIES
URL "https://www.pipewire.org"
DESCRIPTION "PipeWire - multimedia processing"
)
22 changes: 0 additions & 22 deletions contrib/cmake/Install.cmake

This file was deleted.

38 changes: 0 additions & 38 deletions contrib/cmake/InstallExport.cmake

This file was deleted.

Loading