Using CMake to compile TinyXML static libraries under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.