Skip to content

Commit

Permalink
Add oniguruma package (ruslo#1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaachier authored and ruslo committed Mar 28, 2018
1 parent 1b255c4 commit 56ceeb0
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ hunter_config(odb-mysql VERSION 2.4.0)
hunter_config(odb-pgsql VERSION 2.4.0)
hunter_config(odb-sqlite VERSION 2.4.0)
hunter_config(ogles_gpgpu VERSION 0.2.9)
hunter_config(oniguruma VERSION 6.8.1-p0)
hunter_config(onmt VERSION 0.4.1-p2)
hunter_config(openddlparser VERSION 0.1.0-p2)
hunter_config(opentracing-cpp VERSION 1.3.0)
Expand Down
17 changes: 17 additions & 0 deletions cmake/projects/oniguruma/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
PACKAGE_NAME oniguruma
VERSION "6.8.1-p0"
URL "https://github.com/hunter-packages/oniguruma/archive/v6.8.1-p0.tar.gz"
SHA1 "6d82ba6bf7a7313b64ba9772622eeeb964e951fb")

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(oniguruma)
hunter_download(PACKAGE_NAME oniguruma)
1 change: 1 addition & 0 deletions docs/packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ List of packages and usage instructions for each package.
/packages/media
/packages/networking
/packages/random
/packages/regex
/packages/scripting
/packages/serialize
/packages/os
Expand Down
2 changes: 1 addition & 1 deletion docs/packages/pkg/libpcre.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

libpcre

.. index:: development ; libpcre
.. index:: regex ; libpcre

.. _pkg.libpcre:

Expand Down
20 changes: 20 additions & 0 deletions docs/packages/pkg/oniguruma.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spelling::

oniguruma

.. index:: regex ; oniguruma

.. _pkg.oniguruma:

oniguruma
=========

- `Official <https://github.com/kkos/oniguruma>`__
- `Hunterized <https://github.com/hunter-packages/oniguruma>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/oniguruma/CMakeLists.txt>`__
- Added by `Isaac Hier <https://github.com/isaachier>`__ (`pr-1391 <https://github.com/ruslo/hunter/pull/1391>`__)

.. literalinclude:: /../examples/oniguruma/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
10 changes: 10 additions & 0 deletions docs/packages/regex.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. spelling::

libpcre
oniguruma

Regex
-----

- :ref:`pkg.libpcre` - Perl-compatible regular expression library
- :ref:`pkg.oniguruma` - modern and flexible regular expression library
12 changes: 12 additions & 0 deletions examples/oniguruma/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.1)

include("../common.cmake")

project(download-oniguruma)

# DOCUMENTATION_START {
hunter_add_package(oniguruma)
find_package(oniguruma CONFIG REQUIRED)
add_executable(main main.c)
target_link_libraries(main oniguruma::onig)
# DOCUMENTATION_END }
9 changes: 9 additions & 0 deletions examples/oniguruma/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <oniguruma.h>

int main()
{
const char* version;
version = onig_version();
(void) version;
return 0;
}

0 comments on commit 56ceeb0

Please sign in to comment.