Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information about components to markdown generator #7677

merged 2 commits into from Sep 10, 2020


Copy link

@jgsogo jgsogo commented Sep 8, 2020

Changelog: Feature: Add information about components to markdown generator.
Docs: omit

closes #7667

In this PR I'm also dividing the template we were using for the markdown generator into chunks, each one of them containing one meaningful piece of information (one generator, some macros to print cpp_info information,...) to show how jinja2 can be powerful by composition and defining functions: more than a template plus substitution.

The next comment is an example of the output from the command

conan install pcre/8.44@ -g markdown

Copy link
Contributor Author

jgsogo commented Sep 8, 2020


Note.- If this package belongs to ConanCenter, you can find more information here.

Graph of dependencies:

Information published by pcre to consumers:

  • Headers (see below)

  • Component pcre::libpcre:

    • Requires: bzip2::bzip2, zlib::zlib
    • Libraries: pcre
    • Preprocessor definitions: PCRE_STATIC=1
  • Component pcre::libpcreposix:

    • Requires: libpcre
    • Libraries: pcreposix
  • Component pcre::libpcre16:

    • Libraries: pcre16
    • Preprocessor definitions: PCRE_STATIC=1
  • Component pcre::libpcre32:

    • Libraries: pcre32
    • Preprocessor definitions: PCRE_STATIC=1


Read below how to use this package using different
generators. In order to use
these generators they have to be listed in the file or using the command
line argument --generator/-g in the conan install command.

Generator cmake

Add these lines to your CMakeLists.txt:


target_link_libraries(<library_name> CONAN_PKG::pcre)

Generator cmake_find_package

Add these lines to your CMakeLists.txt:


# Use the global target
target_link_libraries(<library_name> PCRE::PCRE)

# Or link just one of its components
target_link_libraries(<library_name> PCRE::libpcre)
target_link_libraries(<library_name> PCRE::libpcreposix)
target_link_libraries(<library_name> PCRE::libpcre16)
target_link_libraries(<library_name> PCRE::libpcre32)

Remember to adjust your build system settings to match the binaries you are linking with. You can
use the CMake build helper and
the cmake generator from a or the new toolchain paradigm.

Generator pkg_config

This package provides one pkg-config file pcre.pc with
all the information from the library
and another file for each of its components:libpcre.pc,libpcreposix.pc,libpcre16.pc,libpcre32.pc.
Use your pkg-config tool as usual to consume the information provided by the Conan package.

Header files

List of header files exposed by this package. Use them in your #include directives:


Conan 1.30.0-dev. JFrog LTD. Autogenerated 2020-09-08 17:49:03.

@jgsogo jgsogo added this to the 1.30 milestone Sep 8, 2020
@jgsogo jgsogo marked this pull request as ready for review Sep 8, 2020
@jgsogo jgsogo requested a review from czoido Sep 8, 2020
Copy link

czoido commented Sep 8, 2020

Looks great!

czoido approved these changes Sep 8, 2020
@danimtb danimtb merged commit 007aae9 into conan-io:develop Sep 10, 2020
2 of 3 checks passed
@jgsogo jgsogo deleted the feat/generator-markdown branch Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

[feature] Add more information to 'markdown' generator: components
4 participants