• Home
  • Raw
  • Download

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``.
403 search. For example to link LLVM with the Gold linker, cmake can be invoked
455 more information. Defaults to the CMake variable ``${PACKAGE_STRING}`` which
465 The path to the ``qhelpgenerator`` executable. Defaults to whatever CMake's
480 If specified, CMake will search for the ``sphinx-build`` executable and will make
481 the ``SPHINX_OUTPUT_HTML`` and ``SPHINX_OUTPUT_MAN`` CMake options available.
485 The path to the ``sphinx-build`` executable detected by CMake.
517 OS X Only: If enabled CMake will generate a target named
547 If enabled and building a debug or asserts build the CMake build system will
570 CMake Caches
575 CMake variables passed on the command line. Clang provides a collection of CMake
578 CMake cache files are utilized using CMake's -C flag:
582 $ cmake -C <path to cache file> <path to sources>
584 CMake cache scripts are processed in an isolated scope, only cached variables
585 remain set when the main configuration runs. CMake cached variables do not reset
588 A few notes about CMake Caches:
622 generic instructions on how to cross-compile with CMake. It goes into detailed
634 From LLVM 3.5 onwards both the CMake and autoconf/Makefile build systems export
635 LLVM libraries as importable CMake targets. This means that clients of LLVM can
636 now reliably use CMake to develop their own LLVM-based projects against an
642 .. code-block:: cmake
650 message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
671 example) will look for the ``LLVMConfig.cmake`` file in various locations (see
672 cmake manual for details). It creates a ``LLVM_DIR`` cache entry to save the
673 directory where ``LLVMConfig.cmake`` is found or allows the user to specify the
674 directory (e.g. by passing ``-DLLVM_DIR=/usr/lib/cmake/llvm`` to
675 the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
679 * ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where
681 On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
683 * ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where
685 available when building LLVM with CMake.**
693 The ``LLVMConfig.cmake`` file sets various useful variables. Notable variables
697 The path to the LLVM CMake directory (i.e. the directory containing
698 LLVMConfig.cmake).
718 The LLVM version. This string can be used with CMake conditionals, e.g., ``if
726 ``llvm_map_components_to_libnames()`` CMake function. For a list of available
754 .. code-block:: cmake
765 .. code-block:: cmake
777 .. code-block:: cmake
784 .. code-block:: cmake
809 Studio 2010 CMake generator. 0 means use all processors. Default is 0.