Environment: Centos6.6+tinyxml_2_6_2
1. Download and unzip Tinyxml_2_6_2.zip
Unzip Tinyxml_2_6_2.zip
2. Create a CMakeLists.txt file in the TinyXML folder and set the content to
cmake_minimum_required (VERSION 2.8)
Project (tinyxmllib)
include_directories (./)
aux_source_directory (./Lib_srcs)
#add_definitions (-DTIXML_USE_STL) #如果需要使用TIXML_USE_STL宏进行编译, turn this sentence on
add_library (TinyXML STATIC ${lib_srcs})
3. Because we do not need to compile the test program, so to remove the Xmltest.cpp file
rm-rf./xmltest.cpp
4. Compiling with the CMake tool
cmake-dcmake_build_type=release./
Make
5. A LIBTINYXML.A file is generated in the current directory
6. In addition to using the CMake tool, you can modify your own makefile file directly, but it looks a little more complicated.
See here ==>>> Portal
Using CMake to compile TinyXML static libraries under Linux