Conan-center-index: [package] taocpp-pegtl/2.8.3: CMake find_package compatibility

Created on 22 Jun 2020  路  3Comments  路  Source: conan-io/conan-center-index

I think the recipe should contain cpp_info.name = "pegtl" as documented here to allow find_package(pegtl) instead of find_package(taocpp-pegtl). The first variant is what PEGTL docs recommend and it's also used by system package managers like Debian, Homebrew etc.

Example of a package doing this.

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: taocpp-pegtl/2.8.3
  • OS etc.: not relevant

Steps to reproduce (Include if Applicable)

  1. Create conanfile.txt like this one:
[requires]
taocpp-pegtl/2.8.3

[generators]
cmake_find_package_multi
  1. Create CMakeLists.txt:
cmake_minimum_required(VERSION 3.9)
project(TryPegtl CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
find_package(pegtl REQUIRED)
  1. Try to generate build files:
conan install .
cmake .

Logs (Include/Attach if Applicable)

Click to expand log

-- The CXX compiler identification is GNU 10.1.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:4 (find_package):
  By not providing "Findpegtl.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "pegtl", but
  CMake did not find one.

  Could not find a package configuration file provided by "pegtl" with any of
  the following names:

    pegtlConfig.cmake
    pegtl-config.cmake

  Add the installation prefix of "pegtl" to CMAKE_PREFIX_PATH or set
  "pegtl_DIR" to a directory containing one of the above files.  If "pegtl"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!

blocked bug

All 3 comments

It should provide a taocpp::pegtl target.
See https://github.com/taocpp/PEGTL/blob/b46c696ced0f164cde79871d22333612e8e256e1/CMakeLists.txt#L70-L77
Can conan do this? @danimtb

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndreyMlashkin picture AndreyMlashkin  路  3Comments

Croydon picture Croydon  路  3Comments

Horki picture Horki  路  3Comments

mmha picture mmha  路  3Comments

jgsogo picture jgsogo  路  3Comments