Configure Visual Studio Code for CMake with some options

前端 未结 1 1538
离开以前
离开以前 2021-01-06 12:41

I want to use the CMake Tools extension for developing a CMake project in Visual Studio Code.

I build the project in the command line with following command:

1条回答
  •  礼貌的吻别
    2021-01-06 13:16

    The .vscode\.cmaketools.json file is only the "workspace cache" of Visual Studio Code - CMake Tools Extension. See their code:

    /**
     * The workspace cache stores extension state that is convenient to remember
     * between executions. Things like the active variant or enabled environments
     * are stored here so that they may be recalled quickly upon extension
     * restart.
    */
    

    I think what you want is a .vscode\settings.json as described here with e.g. the following content:

    {
        "cmake.generator": "Visual Studio 14 2015 Win64",
        "cmake.configureSettings": { "BOOST_ROOT": "some/path", "QT_ROOT": "another/path" }
    }
    

    0 讨论(0)
提交回复
热议问题