Two common compilation methods for cross-platform C ++ open-source code
The cross-platform C ++ open source code uses two methods to adapt to the compilation of various compilers. One is makefile. Taking the famous Spatial Data Format Parsing Library gdal as an example, it provides makefile for various compilers to compile. Gdal mainly provides makefile in two formats: Microsoft VC compiler and gnu gcc compiler. makefile can be found in the source code root directory of gdal. there are two makefile files: vc and GNUmakefile. vc is the makefile of the vc compiler, and GNUmakefile is the makefile of the gnu gcc compiler.
Another method is to use the CMake software. The CMake software can be seen as building the engineering format of each IDE Vendor Based on the source code. CMake is an open-source software. Some IDES (compilers) supported by CMake include:
It can be seen that CMake supports many ides. The output directory of the CMake software is used to the cmake folder under the root directory of the open source code.
Cross-platform C ++ open-source code generally supports at least makefile or CMake compilation. How can I determine the methods supported by an open source code? Compile, which should support CMake compiling.