CMake is an open-source, cross-platform build system generator. It is designed to control the software compilation process using simple platform and compiler-independent configuration files, called CMakeLists.txt.
I use Visual Studio to start CMake projects because it's easier to create CMake files in Visual Studio.
-
- select
toolsin the toolbar, and selectget tools and features
- select
-
- check
Desktop with development with c++has been ticked.
- check
Desktop with development with c++ make sure you could use CMake in visual studio.
-
- create a new c++ CMake project
-
- add a new folder
in Solution Explorer, right-click the root folder and select add -> add new folder, named new_code_module.
-
- update the root
CMakeList.txtadd the code below
- update the root
add_subdirectory ("new_code_module)")




