Skip to content

Commit

Permalink
Add 'FLAC' package (#116)
Browse files Browse the repository at this point in the history
* Add 'FLAC' package

* change package source to cpp-pm

* build libs only
  • Loading branch information
drodin authored and rbsheth committed Jan 9, 2020
1 parent adf8011 commit d8dba30
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 @@ -59,6 +59,7 @@ hunter_default_version(CsvParserCPlusPlus VERSION 1.0.1)
hunter_default_version(Eigen VERSION 3.3.7)
hunter_default_version(EnumGroup VERSION 0.0.1)
hunter_default_version(Expat VERSION 2.1.1)
hunter_default_version(FLAC VERSION 1.3.3-p0)
hunter_default_version(FP16 VERSION 0.0.0-febbb1c-p0)
hunter_default_version(FakeIt VERSION 2.0.3)
hunter_default_version(Fruit VERSION 3.1.1-p0)
Expand Down
39 changes: 39 additions & 0 deletions cmake/projects/FLAC/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME
FLAC
VERSION
1.3.3-p0
URL
"https://github.com/cpp-pm/flac/archive/1.3.3-p0.tar.gz"
SHA1
712ff57b046ed00ebc2898989290c148cfda5c36
)

set(_hunter_flac_cmake_args)
if(ANDROID OR IOS)
set(
_hunter_flac_cmake_args
WITH_ASM=OFF
)
endif()

hunter_cmake_args(
FLAC
CMAKE_ARGS
WITH_OGG=OFF
BUILD_EXECUTABLES=OFF
BUILD_EXAMPLES=OFF
BUILD_TESTING=OFF
BUILD_DOXYGEN=OFF
${_hunter_flac_cmake_args}
)

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

FLAC

.. index::
single: media ; FLAC

.. _pkg.FLAC:

FLAC
====

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

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

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

project(download-FLAC)

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

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

int main() {
}

0 comments on commit d8dba30

Please sign in to comment.