【问题标题】:CMake and editing codeCMake 和编辑代码
【发布时间】:2016-12-13 07:07:30
【问题描述】:

我见过很多开源项目使用 CMake 作为他们的构建系统。我也想使用它,但到目前为止,我所有的开发都是在 Visual Studio (2015) 上进行的。这让我想知道在使用 CMake 作为构建系统时应该如何编辑代码?我应该使用 Vim 或 emacs 之类的编辑器,还是仍然可以使用 Visual Studio(如果可能,使用 IntelliSense)?

【问题讨论】:

    标签: visual-studio cmake editor


    【解决方案1】:

    您可以使用 CMake 为您生成 Visual Studio 解决方案: https://cognitivewaves.wordpress.com/cmake-and-visual-studio/

    但不幸的是,相反的情况是不可能的(或者比预期的更难),对于每个新文件或包含文件夹生成,您必须分别更新您的 CMakeLists.txt 文件(编辑不需要更新 CMake),查看 Visual Studio编译时的标志可能会有所帮助,但该过程仍然是手动的:

    Using CMake to generate Visual Studio C++ project files

    cmake creating visual studio solution on the command line

    还有3rd Party tools可以方便你的生产周期,包括从Visual Studio到CMake的生成,但它们不是官方支持的

    【讨论】:

    • 谢谢,这有帮助!抱歉回复晚了,我批准了你的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-05
    相关资源
    最近更新 更多