Skip to content

Commit

Permalink
Add 'Alut' package
Browse files Browse the repository at this point in the history
  • Loading branch information
drodin committed Apr 24, 2024
1 parent 89ab45f commit 33fbaac
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include(hunter_user_error)

hunter_default_version(ARM_NEON_2_x86_SSE VERSION 1.0.0-p0)
hunter_default_version(AllTheFlopsThreads VERSION 0.1-p0)
hunter_default_version(Alut VERSION 1.1.0-469287b-p0)
hunter_default_version(Android-Apk VERSION 1.1.14)
hunter_default_version(Android-Build-Tools VERSION 27.0.3)
hunter_default_version(Android-Google-Repository VERSION 58)
Expand Down
27 changes: 27 additions & 0 deletions cmake/projects/Alut/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME
Alut
VERSION
1.1.0-469287b-p0
URL
"https://github.com/drodin/freealut/archive/hunter-1.1.0-469287b.tar.gz"
SHA1
4ec4904ecd46c70e4b46a821a6c782928d01916c
)

hunter_cmake_args(
Alut
CMAKE_ARGS
BUILD_EXAMPLES=OFF
BUILD_TESTS=OFF
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(Alut)
hunter_download(PACKAGE_NAME Alut)
21 changes: 21 additions & 0 deletions docs/packages/pkg/Alut.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling::

Alut

.. index::
single: media ; Alut

.. _pkg.Alut:

Alut
====

- `Official <https://github.com/vancegroup/freealut>`__
- `Hunterized <https://github.com/cpp-pm/freealut>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/Alut/CMakeLists.txt>`__
- Added by `drodin <https://github.com/drodin>`__ (`pr-N <https://github.com/cpp-pm/hunter/pull/N>`__)

.. literalinclude:: /../examples/Alut/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
15 changes: 15 additions & 0 deletions examples/Alut/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.5)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-Alut)

# DOCUMENTATION_START {
hunter_add_package(Alut)
find_package(Alut CONFIG REQUIRED)

add_executable(main main.cpp)
target_link_libraries(main PUBLIC Alut::alut)
# DOCUMENTATION_END }
16 changes: 16 additions & 0 deletions examples/Alut/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <stdlib.h>
#include <AL/alut.h>

int
main (int argc, char **argv)
{
ALuint helloBuffer, helloSource;
alutInit (&argc, argv);
helloBuffer = alutCreateBufferHelloWorld ();
alGenSources (1, &helloSource);
alSourcei (helloSource, AL_BUFFER, helloBuffer);
alSourcePlay (helloSource);
alutSleep (1);
alutExit ();
return EXIT_SUCCESS;
}

0 comments on commit 33fbaac

Please sign in to comment.