From 3229c883b9446af4ae8d7d75efd62afc1976b72c Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 13 Feb 2015 16:15:32 +0000 Subject: [PATCH] Help: Document how to build and install with CMake. Resolves PR21569. Patch by: Stephen Kelly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229122 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CMake.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/CMake.rst b/docs/CMake.rst index ed3ae52de9a..4d96466c901 100644 --- a/docs/CMake.rst +++ b/docs/CMake.rst @@ -59,6 +59,36 @@ We use here the command-line, non-interactive CMake interface. environment variable, for instance. You can force CMake to use a given build tool, see the `Usage`_ section. +#. After CMake has finished running, proceed to use IDE project files or start + the build from the build directory: + + .. code-block:: console + + $ cmake --build . + + The ``--build`` option tells ``cmake`` to invoke the underlying build + tool (``make``, ``ninja``, ``xcodebuild``, ``msbuild``, etc). + + The underlying build tool can be invoked directly either of course, but + the ``--build`` option is portable. + +#. After LLVM has finished building, install it from the build directory: + + .. code-block:: console + + $ cmake --build . --target install + + The ``--target`` option with ``install`` parameter in addition to + the ``--build`` option tells ``cmake`` to build the ``install`` target. + + It is possible to set a different install prefix at installation time + by invoking the ``cmake_install.cmake`` script generated in the + build directory: + + .. code-block:: console + + $ cmake -DCMAKE_INSTALL_PREFIX=/tmp/llvm -P cmake_install.cmake + .. _Basic CMake usage: .. _Usage: -- 2.34.1