我需要从相同的代码编译三个包,但是cmake中的include(同名xyz.h)应该从每个包的不同位置选取。由于我是c++和柯南的新手,请指点。
发布于 2020-08-20 04:48:04
您应该在package()方法中实现您想要的逻辑:
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")
...这假设您在构建包时在布局中具有不同的win和nix folders。
然后,您可以根据需要多次执行conan create:
$ 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在最终的include文件夹中,每个包都将以不同的标题结束
https://stackoverflow.com/questions/63449046
复制相似问题