CMake is a command line tool used to control the software compilation process and it can be used for cross-platform software development. In case you wonder, CMakeLists.txt is the input file of CMake. Let’s get started by creating a workspace in VSCĬreate a directory where your project will reside let’s say (in a very informal way) ~/Desktop/hello-vsc and open that directory on VSC (Command + O):
To Install the Microsoft C/C++ extension: Launch VS Code Quick Open ( ⌘+P) and paste the following commands, then press enter.In my case I have already installed Xcode that I use for my iOS projects so is convenient, but if you are only interested on pure C++ you can install any of the previously mentioned or both.
It runs with native performance on Windows, OS X and Linux and with a very adaptive UI that looks and feels native to the OS where it runs, which is a plus.Īt the time I started working on my micro-services project, VSC was quite new and there was not full support for C++ except for the syntax coloring and some very experimental integration with GDB and LLDB, but today after less than a year VSC is quite operational on the C++ development cycle, you can integrate it with CMake and build a C++ project from inside VSC and not only to use CMake but to use a C++ Debugger (GDB or LLDB) inside VSC. Visual Studio Code (VSC from now on) has a similar idea as Emacs has, to provide a very simple editing tool but powerful at the same time providing the full development cycle (editing, building and debugging all inside the tool). This made me think about returning to Emacs which, even when I used it in the past, I would say I’m not an expert and re-loading it in my brain will take me some time to interiorize the shortcut keys and so on, so I thought about looking for something similar but modern, for that I passed through TextMate, Atom, Sublime and Visual Studio Code. I tried disabling all code completion options in preferences without any success. Even when Xcode is a fine tool to work on a C++ project, with a very appealing UI and an not a super good debugging experience but useful IMHO, it has a really annoying feature: it is constantly indexing the code while I’m typing it and, in consequence, spinning my MacBook Pro’s fans up to 5000 rpm and making it really hot.
I started using Xcode on Mac OS X (now macOS). Through my journey I’ve seen to emerge quite a bunch of interesting tools to work with C++ on this field (micro-services and Docker). I’ve been working for almost a year implementing micro-services on C++11 running as Docker containers. C++ Development using Visual Studio Code, CMake and LLDB