代码之家  ›  专栏  ›  技术社区  ›  sorosh_sabz

系统环境变量读入CMakeSettings.json文件

  •  0
  • sorosh_sabz  · 技术社区  · 4 年前

    vcpkgu根

    /etc/environment

    当我想读入这个变量时 CMakeSettings.json CMake 缓存已挂起。

    {
        "environments": [
            {
                "VcpkgRoot": "${env.VCPKG_ROOT}"
            }
        ],
        "configurations": [
            {
                "name": "x64-Debug",
                "generator": "Ninja",
                "configurationType": "Debug",
                "inheritEnvironments": [ "msvc_x64_x64" ],
                "buildRoot": "${projectDir}\\out\\build\\${name}",
                "installRoot": "${projectDir}\\out\\install\\${name}",
                "cmakeCommandArgs": "",
                "buildCommandArgs": "",
                "ctestCommandArgs": "",
                "variables": []
            },
            {
                "name": "WSL-GCC-Debug",
                "generator": "Ninja",
                "configurationType": "Debug",
                "buildRoot": "${projectDir}\\out\\build\\${name}",
                "installRoot": "${projectDir}\\out\\install\\${name}",
                "cmakeExecutable": "cmake",
                "cmakeCommandArgs": "",
                "buildCommandArgs": "",
                "ctestCommandArgs": "",
                "inheritEnvironments": [ "linux_x64" ],
                "wslPath": "${defaultWSLPath}",
                "addressSanitizerRuntimeFlags": "detect_leaks=0",
                "variables": [],
    //          "cmakeToolchain": "/scripts/buildsystems/vcpkg.cmake"
                "cmakeToolchain": "${env.VcpkgRoot}"
            }
        ]
    }
    

    visualstudio是这样说的

    1> CMake generation started for configuration: 'WSL-GCC-Debug'.
    1> Found cmake executable at $HOME/.vs/cmake/bin/cmake.
    1> $HOME/.vs/cmake/bin/cmake -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="/mnt/d/Source/Repos/GoldenWorkshop2020/out/install/WSL-GCC-Debug" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="/mnt//${env.VCPKG_ROOT}"  /mnt/d/Source/Repos/GoldenWorkshop2020/CMakeLists.txt;
    

    我的问题是什么?如何解决?

    0 回复  |  直到 4 年前