Add instructions on how to use CMake to compile libxml

This commit is contained in:
Markus Rickert 2021-05-16 17:48:07 +02:00 committed by Nick Wellnhofer
parent 85b1792e37
commit 4fc473d7e8

View File

@ -27,6 +27,26 @@ Compilation
Please report test failures to the mailing list or bug tracker.
Another option for compiling libxml is using CMake:
cmake -E tar xf libxml2-xxx.tar.gz
cmake -S libxml2-xxx -B libxml2-xxx-build [possible options]
cmake --build libxml2-xxx-build
cmake --install libxml2-xxx-build
Common CMake options include:
-D BUILD_SHARED_LIBS=OFF # build static libraries
-D CMAKE_BUILD_TYPE=Release # specify build type
-D CMAKE_INSTALL_PREFIX=/usr/local # specify the install path
-D LIBXML2_WITH_ICONV=OFF # disable iconv
-D LIBXML2_WITH_LZMA=OFF # disable liblzma
-D LIBXML2_WITH_PYTHON=OFF # disable Python
-D LIBXML2_WITH_ZLIB=OFF # disable libz
You can also open the libxml source directory with its CMakeLists.txt
directly in various IDEs such as CLion, QtCreator, or Visual Studio.
2. What other libraries are needed to compile/install libxml?
Libxml does not require any other libraries. A platform with somewhat