Zhu Jinchan
Source: http://blog.csdn.net/clever101
Cross-platform C + + open source code to adapt to the compilation of a variety of compilers, the use of two ways to fit. One is the makefile way. Taking the famous Spatial data format parsing library Gdal as an example, it provides the makefile to compile for various compilers.
Gdal mainly provides the Microsoft VC compiler and the GNU GCC compiler in two formats makefile, Gdal source root folder can find Makefile.vc and gnumakefile two makefile files. Among them, MAKEFILE.VC is the VC compiler's makefile,gnumakefile for the GNU GCC compiler makefile.
Another way is to use the CMake software. CMake software can be seen as a project format for building individual IDE vendors based on source code.
CMake is an open source software that CMake supported by some Ides (compilers) such as:
From being able to see that cmake can support very many Ides.
The output folder of the CMake software is accustomed to the CMake folder under the root folder of the open source code.
Cross-platform C + + Open source code generally supports at least makefile or CMake way to compile, and in some cases both are supported.
How do you infer which way an open source code supports? A superficial way is to see if the source root folder has a file named Makefile, fake, very likely to support makefile compiled, assuming that the source code root folder has CMakeLists.txt, should be supported CMake way to compile.
Two common ways to compile cross-platform C + + open source code