Skip to content

Header Only needs cpp_info.includedirs #2287

Open
@Fettpet

Description

@Fettpet

Hello,
I followed the tutorial for a header only conan package. For test purpose, I create an little example and include the header only libary with conan. The example is build with cmake. My lib is included via find_package.

I got stuck because no headers are found. After some investigations I found that inside the FindMyLib.cmake the include directory are empty:
set(MyLib_INCLUDE_DIRS)
To resolve it I need to add cpp_info.includedirs to the package_info in the header only conan package:

    def package_info(self):
        self.cpp_info.libs = ["MyLib"]
        self.cpp_info.includedirs = ['include']

The setting of the includedirs should be part of the tutorial.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions