Andrew E
Andrew E

Reputation: 8337

How do I publish a Conan package locally?

I'm new to Conan but experienced with cmake/make/studio etc.

I'm trying to build a simple program that uses a library (uWebSockets) that uses another library (uSockets) that uses another library (libuv). The libraries aren't important to the question, it's just that there's a chain of dependencies.

I found libuv in conan central and all ok.

The uSockets lib is makefile only but I added cmake and I think added Conan support. A sample compiles and runs, so I'll take that as ok.

But... How can I use my fresh uSockets lib locally?

I don't want to publish it anywhere, just use it in the build of uWebSockets, and then use that build for my executable.

I'm looking for something like "Conan publish local" I think.

Any help would be appreciated!

Upvotes: 11

Views: 9860

Answers (1)

drodri
drodri

Reputation: 6007

The package creation process from sources is local. When you execute a conan create, it takes the recipe and sources from your local folder, put them in the Conan cache, builds the package as requested (every conan create will build a different configuration, you can use input settings -s compiler.version=xxx or use a full profile-recommended, to specify configurations).

When packages are in the local cache, they can be reused from any other project. Doing conan install will first look in the Conan cache, and only if the package is not found there, will try to look in configured remotes. If everything is found locally, it might not need internet connection at all.

Also, depends on what is your concern, you don't need to publish your packages to a public server, like ConanCenter. You can use Artifactory CE (free) to put your packages there, you could run it in your LAN, without external internet connection, and you could still reuse your binaries from there, without needing to rebuild from sources.

Upvotes: 12

Related Questions