且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 CMake 生成 Visual Studio C++ 项目文件

更新时间:2023-02-12 15:27:59

CMake 实际上非常适合这个.关键是 Windows 端的每个人都必须记住在加载解决方案之前运行 CMake,而我们 Mac 端的每个人都必须记住在 make 之前运行它.

CMake is actually pretty good for this. The key part was everyone on the Windows side has to remember to run CMake before loading in the solution, and everyone on our Mac side would have to remember to run it before make.

最难的部分是作为 Windows 开发人员确保您的结构更改在 cmakelist.txt 文件中,而不是在解决方案或项目文件中,因为这些更改可能会丢失,即使没有丢失也不会转移到Mac 端也需要它们,Mac 人需要记住不要出于同样的原因修改 make 文件.

The hardest part was as a Windows developer making sure your structural changes were in the cmakelist.txt file and not in the solution or project files as those changes would probably get lost and even if not lost would not get transferred over to the Mac side who also needed them, and the Mac guys would need to remember not to modify the make file for the same reasons.

这只是需要一点思考和耐心,但一开始会有错误.但是,如果您在双方都使用持续集成,那么这些将很早就被淘汰,人们会最终养成习惯.

It just requires a little thought and patience, but there will be mistakes at first. But if you are using continuous integration on both sides then these will get shook out early, and people will eventually get in the habit.