Skip to content

Create package & push to registry a C++ library I made w/ Conan + CMake (Conan 1) #3246

Open
@jreich218

Description

@jreich218

Hi,

I have to use Conan 1 right now because we have to store our remote registries in GitLab which only has Conan 1 support for the time being.

I'm having some doubt around how to transition...

From:

  • Wrapping up a library I created w/ CMake and Conan (I used conanfile.py for the 3rd party dependencies my library depends on).

To:

  • Creating a Conan package holding said library that I can push to a remote registry and share with the team (this implies I need know enough about building packages to be able to confidently tell the team what to write in CMake's "find_package" and "target_link_libraries", along with what to have them type in C++ "#include ..." statements when using my library).

Here are my questions:

  1. Is it normal/encouraged to use the same conanfile.py for both tasks (i.e. the same conanfile.py for both for gathering third party dependencies during development and for creating the final package after development is finished)?
  2. Regarding creating the package after development is finished: Is there a place in the documentation that focuses on how I can know what users should write in CMake's "find_package" and "target_link_libraries", along with what to type in C++ "#include ..." statements when using my libarary/Conan package? I know that, in general, doing an install with CMake can be tricky; is the expectation that package creators master CMake install ideas first and then "just know" how to wire everything up when making a Conan package? (I know that's a strange question... I'm just trying to get some intuition on expectations and resources).

Thanks...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions