

I will show one example of this when I use Google Test in this project. With CMake, you can download, build, and use a large number of tools. You will see this when I port my project from Windows using the Visual Studio build tools to Linux using the gnu build tools. Aside from specifying the tools to use, no other changes are required to the CMake specification files.


You can specify the build tools that you want to use for example, you can use MSVC or LLVM on Windows, and gnu or LLVM on Unix-like systems, including Linux, OSX, and MSYS or MinGW. Because it can be called from the command line, it integrates well with continuous integration/continuous build systems. It can even create make files if you want to do everything from the command line. Similar capabilities are available for every other popular IDE. For example, CMake can generate solution (.sln) and project files (.vcxproj) that Visual Studio and Visual Studio Code use on Windows. CMake then takes that information and generates the files needed to build the system.
#How to write c code in visual studio how to
You specify what you want done, not how to do it. Why Use CMake?ĬMake is a powerful and robust build system. Most of the information is applicable to using almost any IDE, or indeed, no IDE at all. I will also use git and Google Test, and port the project from Windows to Linux. In this article and several more, I will be discussing developing a very simple C++ library and application using CMake and Visual Studio Code.
