如何在Ubuntu中创建launch.json和task.json来构建和调试cmake .. && make?

时间:2019-08-30 03:47:07

标签: c++ makefile cmake vscode-debugger vscode-tasks

我想学习如何为cmake .. && make项目创建task.json和launch.json,以便可以在Ubuntu中的VS Code中使用调试,监视变量功能。

目前,我已经创建了3个脚本clean.sh,build.sh和run.sh。清理,构建和运行项目。我希望能够在VS Code中使用调试,监视变量功能。我试图浏览文档,但这对我来说有点混乱。如果有人可以帮助我获得它的简化版本,我将不胜感激。

clean.sh

#!/bin/bash
# Script to clean the tree from all compiled files.
# You can rebuild them afterwards using "build.sh".

# Remove the dedicated output directories
cd `dirname $0`

rm -rf build

# We're done!
echo Cleaned up the project!

build.sh

#!/bin/bash
# Script to build all components from scratch, using the maximum available CPU power
#

# Go into the directory where this bash script is contained.
cd `dirname $0`

# Compile code.
mkdir -p build
cd build
cmake .. && make
cd ..

run.sh

#!/bin/bash
# Script to run the project
#

# Run
cd ./build
./show_lidar_top_view
cd ..

0 个答案:

没有答案