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.
conanfile.txt like this one:[requires]
taocpp-pegtl/2.8.3
[generators]
cmake_find_package_multi
CMakeLists.txt:cmake_minimum_required(VERSION 3.9)
project(TryPegtl CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
find_package(pegtl REQUIRED)
conan install .
cmake .
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!
It should provide a taocpp::pegtl target.
See https://github.com/taocpp/PEGTL/blob/b46c696ced0f164cde79871d22333612e8e256e1/CMakeLists.txt#L70-L77
Can conan do this? @danimtb
this has been fixed https://github.com/conan-io/conan-center-index/pull/2823