I am using Sublime Text in Ubuntu and learning OpenCV. Until today, I was using Sublime Text to write and save the code, and using Terminal for compiling.
I am compiling with the following code:
cmake .
make
./a.out
But for fast processing, I am trying to make my build system and I want to make this all automatically by pressing Ctrl + B
I've tried the following code in a custom build system but it fails:
{
"cmd": ["cmake ."],
"cmd": ["make"],
"cmd": ["./a.o"],
"selector": "source.c++",
"shell": true,
"windows":
{
"cmd": ["cl", "/Fo${file_path}", "/O2", "$file"],
"selector": "source.c++",
"shell": true
}
}
Any ideas? Thanks.
You should only have one "cmd"
key in your build system. Please read the docs for more information. Instead, you can concatenate your commands using the &&
operator:
{
"cmd": ["cmake .", "&&", "make", "&&", "./a.out"],
"selector": "source.c++",
"shell": true,
}
Since you're on Linux, you don't need the Windows stuff at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With