Skip to content

Commit

Permalink
Add 'libpcre' package
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed Sep 21, 2017
1 parent dc81c03 commit ec768af
Show file tree
Hide file tree
Showing 5 changed files with 84 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 @@ -218,6 +218,7 @@ hunter_config(ogles_gpgpu VERSION 0.2.4)
hunter_config(onmt VERSION 0.4.1-p2)
hunter_config(openddlparser VERSION 0.1.0-p2)
hunter_config(pciaccess VERSION 0.13.4)
hunter_config(libpcre VERSION 8.41)
hunter_config(poly2tri VERSION 1.0.0)
hunter_config(polyclipping VERSION 4.8.8-p0) # for Assimp
hunter_config(presentproto VERSION 1.0)
Expand Down
44 changes: 44 additions & 0 deletions cmake/projects/libpcre/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (c) 2016 Ruslan Baratov
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

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

hunter_add_version(
PACKAGE_NAME
libpcre
VERSION
"8.41"
URL
"https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.bz2"
SHA1
7d1f4aae4191512744a718cc2b81bcf995ec1437
)

hunter_configuration_types(libpcre CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autotools)

hunter_cmake_args(
libpcre
CMAKE_ARGS
PKGCONFIG_EXPORT_TARGETS=libpcre;libpcrecpp;libpcreposix
)

hunter_cacheable(libpcre)
hunter_download(
PACKAGE_NAME libpcre
PACKAGE_INTERNAL_DEPS_ID "1"
PACKAGE_UNRELOCATABLE_TEXT_FILES
"lib/libpcre.la"
"lib/libpcrecpp.la"
"lib/libpcreposix.la"
"lib/pkgconfig/libpcre.pc"
"lib/pkgconfig/libpcrecpp.pc"
"lib/pkgconfig/libpcreposix.pc"
)
19 changes: 19 additions & 0 deletions docs/packages/pkg/libpcre.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. spelling::

libpcre

.. index:: development ; libpcre

.. _pkg.libpcre:

libpcre
===

- `Official <http://www.pcre.org>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/libpcre/CMakeLists.txt>`__

.. code-block:: cmake
hunter_add_package(libpcre)
find_package(libpcre CONFIG REQUIRED)
target_link_libraries(... PkgConfig::libpcre)
16 changes: 16 additions & 0 deletions examples/libpcre/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2016, Ruslan Baratov
# All rights reserved.

cmake_minimum_required(VERSION 3.0)

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

project(download-pcre)

hunter_add_package(libpcre)
find_package(libpcre CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo PUBLIC PkgConfig::libpcre)
4 changes: 4 additions & 0 deletions examples/libpcre/foo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <pcre.h>

int main() {
}

0 comments on commit ec768af

Please sign in to comment.