我正在按照https://blogs.msdn.microsoft.com/vcblog/2017/08/25/visual-c-for-linux-development-with-cmake/
所述的指南调试远程Linux cmake项目。我已经为我的Linux项目创建了一个samba共享,并使用Visual Studio打开了网络共享,因此不必将源复制到远程Linux机器上。所以我在"remoteCopySources": false
CMakeSettings.json
CMake生成器说:
...
...
1> -- Generating done
1> -- Build files have been written to: /home/ozfguah/Workspace/RemoteCMakeProject/Build/VS
1> Starting CMake target info extraction ...
1> Extracted includes paths.
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted global settings.
1> Extracted code model.
1> Collating data ...
1> Target info extraction done.
CMake scanning exception Path must be rooted
Parameter name: basePath at at Microsoft.VisualStudio.Workspace.PathHelper.MakeRelative(String basePath, String path)
at Microsoft.VisualStudio.CMake.Project.CMakeListsUtils.ComputeTargetNames(Boolean singleton, ICMakeLists data, CMakeConfiguration config)
at Microsoft.VisualStudio.CMake.Project.CMakeListsScanner.<AddTargetsAndBuildConfigToFDV>d__162.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.VisualStudio.CMake.Project.CMakeListsScanner.<ComputeFileDataValues>d__153.MoveNext()
CMake扫描异常路径必须扎根意味着什么?我应该怎么做才能解决这个问题。
CMakeSettings.json
{
"name": "Linux-Debug",
"generator": "Unix Makefiles",
"remoteMachineName": "${defaultRemoteMachineName}",
"configurationType": "Debug",
"remoteCMakeListsRoot": "/home/ozfguah/Workspace/RemoteCMakeProject/",
"cmakeExecutable": "/usr/local/bin/cmake",
"buildRoot": "Z:\\RemoteCMakeProject\\Build\\VS\\",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"remoteBuildRoot": "/home/ozfguah/Workspace/RemoteCMakeProject/Build/VS/",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": false,
"remoteCopySourcesOutputVerbosity": "Normal",
"remoteCopySourcesConcurrentCopies": "10",
"remoteCopySourcesMethod": "rsync",
"remoteCopyBuildOutput": false,
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ]
}