Open aarangop opened 2 years ago
Hi @aarangop
Some initial quick feedback while checking the issue:
self.copy("*")
, but just in case, be aware that it is packaging all the temporary build files. It is also packaging both the Debug and Release flavors of the lib, irrespective of the Conan build_type
setting, which seems problematic.conan export-pkg
flow? For precompiled binaries, it is simpler and faster.--build=missing
in conan install .. --build=missing
the consumer. That would mean that the first creation didn't work correctly if you really need it (or get a binary missing error). Seem the shared=True
could be related, if that is the case, you want to create the package with conan create . --pkgname:shared=True
in the first place.CMakeDeps
is the new one, which will completely replace cmake_find_package_xxx
ones in 2.0.I will investigate a bit further your code and try to reproduce. Thanks very much for your elaborated description and putting together a repo with the code!
I have done a review to your repo in https://github.com/aarangop/simconnect_packaging_working_example/pull/1
Hi, thanks for the feedback! I will slim down the recipes with my actual code. I'll give it a try with CMakeDeps, which I saw is part of what you reviewed in the repo. As I mentioned, I can get things to work, I just can't link to the simconnect_package library, if there are any news on that front I'll be interested to know about them, I'll see if I can keep an eye open.
...And thanks for the work with Conan! I've found it really useful and I can see you make a great effort to listen to the users and to keep developing it.
As I mentioned, I can get things to work, I just can't link to the simconnect_package library, if there are any news on that front I'll be interested to know about them, I'll see if I can keep an eye open.
Sure, but please note there is a difference in getting something that works, and following some good practices that will really help you scale faster and more easily, with less work. In your repo there were some things that aren't best practices, and that can easily come back to you to bite you later in ways you don't expect. If you want to know more about those, feel free to respond to my PR to your repo, and we can talk there.
Let us know how it goes with the CMakeDeps generator.
And thanks for the work with Conan! I've found it really useful and I can see you make a great effort to listen to the users and to keep developing it.
Thanks for your kind words! Happy to know that it is being useful :)
Hello, I have been trying with success to package some precompiled libraries. However, there is a behavior I don't understand. Maybe someone can shed some light on this.
I wanted to package some precompiled libraries (SimConnect), so that they can be consumed by other packages. I have created two packages, one which links to the precompiled libraries and the other one which consumes the first one:
This seems to work well, however, if simconnect_package provides some functionality, for instance, if I wanted to make a wrapper for the SimConnect libraries, the simconnect_package library itself is not found when building simconnect_package_consumer. So, from simconnect_package_consumer I have access to the precompiled libraries (thanks to simconnect_package) but I have no access to simconnect_package functionality itself.
I am using the cmake_find_package_multi generator. After a few hours of trying to make things work, I found out that while the precompiled libraries are found by find_package(simconnect_package) in the simconnect_package_consumer's CMakeLists file, the simconnect_package libraries itself are not found. Hence, they aren't linked and so, any functions referenced in the consumer package result in unresolved external symbols.
I have made a working sample here:
The precompiled simconnect libraries are found within the repo. These are freely available through the Prepar3D SDK.
This are my settings (default profile):
And this is the list of commands that I've used (after cloning repo and cd'ing to it):
The exe should run, but you should get a message reporting failure to open connection, since I assume you don't have Prepar3D v5 on your machine.
The simconnect_package package is successfully exported, simconnect_package_consumer is successfully built and I can run the compiled simconnect_consumer.exe, which uses the precompiled libraries.
So, maybe someone can explain this behavior? Why are the simconnect_package libraries not found by find_package() but the precompiled libraries are?