Lines Matching full:cmake
2 Building LLVM with CMake
11 `CMake <http://www.cmake.org/>`_ is a cross-platform build-generator tool. CMake
20 `Quick start`_ section. If you are a CMake novice, start with `Basic CMake usage`_
23 you already have experience with CMake, this is the recommended starting point.
25 This page is geared towards users of the LLVM CMake build. If you're looking for
26 information about modifying the LLVM CMake build system you may want to see the
27 :doc:`CMakePrimer` page. It has a basic overview of the CMake language.
34 We use here the command-line, non-interactive CMake interface.
36 #. `Download <http://www.cmake.org/cmake/resources/software.html>`_ and install
37 CMake. Version 3.4.3 is the minimum required.
55 $ cmake path/to/llvm/source/root
57 CMake will detect your development environment, perform a series of tests, and
58 generate the files required for building LLVM. CMake will use default values
62 This can fail if CMake can't detect your toolset, or if it thinks that the
65 itself is the correct one for your development environment. CMake will refuse
67 environment variable, for instance. You can force CMake to use a given build
70 #. After CMake has finished running, proceed to use IDE project files, or start
75 $ cmake --build .
77 The ``--build`` option tells ``cmake`` to invoke the underlying build
87 $ cmake --build . --target install
90 the ``--build`` option tells ``cmake`` to build the ``install`` target.
93 by invoking the ``cmake_install.cmake`` script generated in the
98 $ cmake -DCMAKE_INSTALL_PREFIX=/tmp/llvm -P cmake_install.cmake
100 .. _Basic CMake usage:
103 Basic CMake usage
106 This section explains basic aspects of CMake
109 CMake comes with extensive documentation, in the form of html files, and as
110 online help accessible via the ``cmake`` executable itself. Execute ``cmake
113 CMake allows you to specify a build tool (e.g., GNU make, Visual Studio,
114 or Xcode). If not specified on the command line, CMake tries to guess which
116 build tool, CMake uses the corresponding *Generator* to create files for your
123 $ cmake --help
128 you should enter them exactly as they are listed in the ``cmake --help``
134 $ cmake -G "Visual Studio 12" path/to/llvm/source/root
138 for building with NMake. By default, CMake chooses the most specific generator
140 you must tell this to CMake with the ``-G`` option.
153 CMake command line like this:
157 $ cmake -DVARIABLE=value path/to/llvm/source
159 You can set a variable after the initial CMake invocation to change its
164 $ cmake -UVARIABLE path/to/llvm/source
166 Variables are stored in the CMake cache. This is a file named ``CMakeCache.txt``
167 stored at the root of your build directory that is generated by ``cmake``.
170 Variables are listed in the CMake cache and later in this document with
172 variable and type on the CMake command line:
176 $ cmake -DVARIABLE:TYPE=value path/to/llvm/source
178 Frequently-used CMake variables
181 Here are some of the CMake variables that are used often, along with a
183 CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``.
250 cmake must be invoked before the build. Defaults to OFF.
415 more information. Defaults to the CMake variable ``${PACKAGE_STRING}`` which
425 The path to the ``qhelpgenerator`` executable. Defaults to whatever CMake's
435 If specified, CMake will search for the ``sphinx-build`` executable and will make
436 the ``SPHINX_OUTPUT_HTML`` and ``SPHINX_OUTPUT_MAN`` CMake options available.
440 The path to the ``sphinx-build`` executable detected by CMake.
460 OS X Only: If enabled CMake will generate a target named
490 If enabled and building a debug or asserts build the CMake build system will
495 CMake Caches
500 CMake variables passed on the command line. Clang provides a collection of CMake
503 CMake cache files are utilized using CMake's -C flag:
507 $ cmake -C <path to cache file> <path to sources>
509 CMake cache scripts are processed in an isolated scope, only cached variables
510 remain set when the main configuration runs. CMake cached variables do not reset
513 A few notes about CMake Caches:
547 generic instructions on how to cross-compile with CMake. It goes into detailed
559 From LLVM 3.5 onwards both the CMake and autoconf/Makefile build systems export
560 LLVM libraries as importable CMake targets. This means that clients of LLVM can
561 now reliably use CMake to develop their own LLVM-based projects against an
567 .. code-block:: cmake
575 message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
596 example) will look for the ``LLVMConfig.cmake`` file in various locations (see
597 cmake manual for details). It creates a ``LLVM_DIR`` cache entry to save the
598 directory where ``LLVMConfig.cmake`` is found or allows the user to specify the
599 directory (e.g. by passing ``-DLLVM_DIR=/usr/lib/cmake/llvm`` to
600 the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
604 * ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where
606 On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
608 * ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where
610 available when building LLVM with CMake.**
618 The ``LLVMConfig.cmake`` file sets various useful variables. Notable variables
622 The path to the LLVM CMake directory (i.e. the directory containing
623 LLVMConfig.cmake).
643 The LLVM version. This string can be used with CMake conditionals, e.g., ``if
651 ``llvm_map_components_to_libnames()`` CMake function. For a list of available
679 .. code-block:: cmake
690 .. code-block:: cmake
702 .. code-block:: cmake
709 .. code-block:: cmake
734 Studio 2010 CMake generator. 0 means use all processors. Default is 0.