Reputation: 35
I need to compile three packages from the same code, but the includes(same name xyz.h) in the cmake should get picked from different location for each of the package. As I am new to c++ and conan, please give pointers.
Upvotes: 0
Views: 40
Reputation: 5962
You should be implementing the logic you want in your package()
method:
def package(self):
# for example, headers are different based on OS
if self.settings.os == "Windows":
self.copy("*.h", src="win", dst="include")
elif self.settings.os == "Linux":
self.copy("*.h, src="nix", dst="include")
...
This assumes you have different win
and nix
folders in your layout when you build the package.
Then you do the conan create
as many times as necessary:
$ conan create . user/channel -s os=Windows # default if you are in a Win machine
# or
$ conan create . user/channel -s os=Linux # default if you are in a Linux machin
Every package will end with different headers in the final include folder
Upvotes: 1