CMake is used to compile software platform-independent, recently required CMake, but due to network reasons to CMake official website is impossible downloaded elsewhere ... such as Gitee does fit, but not compiled, only the source code, searched the whole network only in Linux compiler tutorial, not of Windows. Here I will look at how to record compiled on Windows CMake
A. Download Source
First, the above Gitee download the source code package
do not go at GitHub, too slow, with who knows who
extract to your specified location after the download is good, as shown below (decompression is very slow, I do not demonstrate a it ...)
after you create a file called in this directory build
empty folder, used to store compiled files
II. Get .sln file
Here, I assume you have installed in the computer Visual Studio
the
first thing you need to have a low version of CMake. . . . . . .
So I'll just give a lower version of it . Extraction code: 0tyx
remember Added environment variable
to open the command line in the previous step to establish a build
folder, as shown in FIG
enter the command cmake ..
and then will begin to output code, like this child, I find this is another project to simulate the actual situation almost
is complete, open the build
folder, you can see this file structure, or analog, the actual situation of a lot more than the picture
we can see to get a sln file, this is it
Three. Visual Studio compiler
Click to get the sln file into the Visual Studio, click the Batch Build, select the following few
do not forget I still get a simulated demonstration project in Oh, the reality may be different. The selected four is mandatory, and the other that you need, then click Generate to begin the long process of generation ...
IV. Completed generation, remove the document
Reserved build directory in the following two folders, delete the rest
then this is the software you want to move them to the location you want, you can join an environment variable
V. Testing
Enter the cmake -version
command to check the software version
can be seen in 3.17.2
to compile a hello world try