在C++中设置Conan的最佳方法
情况
- 单个C ++回购包含20个项目
- 在Windows中构建的MSV中构建,使用CMake进行Linux。相同的代码库为两个平台构建。
- 有一个MSVS解决方案文件,将存储库中的所有项目连接在一起
- 试图找到最佳工具和工作流程
我到目前为止为
- MSV安装的Windows安装的conan扩展程序所
- 拥有的,我对几个项目(并非所有项目都需要它们)和它们位于每个项目的根文件夹中(不是回购的根文件夹)。
- 有一个“解决方案中的所有项目的柯南安装”按钮,但这一无所有。
- Question1 :有人可以更轻松地安装Conan Dep,而无需右键单击每个项目并选择“为此项目的Conan安装”?
- Conan Extension的默认安装位置是
$(outputdir)\。conan
。因此,当我通过工具“柯南”项目“安装”一个项目时,有重要的conan*.props
该项目将导入。这些props
现在在输出文件夹中(例如x64/debug
),该文件被Git忽略了。如果我在此状态下推了回购,那么下一个克隆的人将无法打开解决方案,因为项目现在引用props
,但它们不存在。- 问题2 我已经将安装位置更改为
$(solutionDir)\。conan
。这是这样做的常见方法吗? - 问题3 是否有一种方法可以默认Conan MSVS扩展名(也许是通过设置文件),因此新机器不会返回安装到
$(outputddir)\。 /code>并拧紧回购?
- 问题2 我已经将安装位置更改为
我可能会做错任何事情,因此任何最佳实践技巧都将不胜感激。
Situation
- single C++ repo containing 20 projects
- Builds in MSVS for windows, uses cmake for Linux. Same code base builds for both platforms.
- There's an msvs solution file connecting all projects in the repo together
- Trying to find best tools and workflow
What I have so far for Windows
- installed conan extension for msvs
- I have a conanfile.txt for a couple of projects (not all projects need them) and they're located in the root folder of each project (not the root folder of the repo).
- There's a "conan install for all projects in solution" button but that does nothing somehow.
- Question1: Is there an easier way for someone to install conan deps without having to right click on each project and select "Conan install for this project"?
- Conan extension's default install location is
$(OutputDir)\.conan
. So when I "conan install" a project through the tool, there are importantconan*.props
that the project would import. Theseprops
are now in the output folder (e.g.x64/Debug
) that's ignored by git. If I pushed the repo in this state, the next guy who clones it won't be able to open the solution because the projects now reference theprops
but they're not present.- Question2 I've changed the install location to
$(SolutionDir)\.conan
. Is this the common way to do it? - Question3 Is there a way to default the conan msvs extension (maybe through settings files) so a new machine wouldn't go back to installing to
$(OutputDir)\.conan
and screwing up the repo?
- Question2 I've changed the install location to
I could be doing this all wrong so any best practices tips will be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论