...
 
Commits (461)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

---
# This configuration requires clang-format 3.8 or higher.
# This configuration requires clang-format version 6.0 exactly.
BasedOnStyle: Mozilla
AlignOperands: false
AlwaysBreakAfterReturnType: None
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterEnum: true
AfterFunction: true
AfterStruct: true
AfterUnion: true
BreakBeforeBraces: Custom
ColumnLimit: 79
IndentPPDirectives: AfterHash
SortUsingDeclarations: false
SpaceAfterTemplateKeyword: true
...
......@@ -2,11 +2,11 @@
.hooks* export-ignore
# Custom attribute to mark sources as using our C code style.
[attr]our-c-style whitespace=tab-in-indent format.clang-format
[attr]our-c-style whitespace=tab-in-indent format.clang-format-6.0
# Custom attribute to mark sources as generated.
# Do not perform whitespace checks. Do not format.
[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format
[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format-6.0
bootstrap eol=lf
configure eol=lf
......
......@@ -8,3 +8,6 @@ Testing
# Visual Studio work directory
.vs/
# Visual Studio Code
.vscode/
......@@ -55,7 +55,7 @@ set the path with these commands:
(* (or (not (any space "()#\\\n")) (and ?\\ nonl)))))
(defconst cmake-regex-token
(rx-to-string `(group (or (regexp ,cmake-regex-comment)
?( ?)
?\( ?\)
(regexp ,cmake-regex-argument-unquoted)
(regexp ,cmake-regex-argument-quoted)))))
(defconst cmake-regex-indented
......
......@@ -285,7 +285,7 @@ if(CMake_RUN_IWYU)
message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!")
endif()
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
"${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w")
"${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w;-DCMAKE_IWYU")
endif()
......
......@@ -78,6 +78,7 @@ The following individuals and institutions are among the Contributors:
* Nikita Krupen'ko <krnekit@gmail.com>
* NVIDIA Corporation <www.nvidia.com>
* OpenGamma Ltd. <opengamma.com>
* Patrick Stotko <stotko@cs.uni-bonn.de>
* Per Øyvind Karlsen <peroyvind@mandriva.org>
* Peter Collingbourne <peter@pcc.me.uk>
* Petr Gotthard <gotthard@honeywell.com>
......
......@@ -82,7 +82,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
as a stack so if called from nested find modules, root paths from the
parent's find module will be searched after paths from the current module,
i.e. ``CurrentPackage_ROOT``, ``ENV{CurrentPackage_ROOT}``,
``ParentPackage_ROOT``, ``ENV{ParentPacakge_ROOT}``, etc.
``ParentPackage_ROOT``, ``ENV{ParentPackage_ROOT}``, etc.
This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed.
See policy :policy:`CMP0074`.
......
To pass options to the linker tool, each compiler driver has is own syntax.
The ``LINKER:`` prefix can be used to specify, in a portable way, options
to pass to the linker tool. The ``LINKER:`` prefix is replaced by the required
driver option and the rest of the option string defines linker arguments using
``,`` as separator. These arguments will be formatted according to the
:variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG` and
:variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP` variables.
For example, ``"LINKER:-z,defs"`` becomes ``-Xlinker -z -Xlinker defs`` for
``Clang`` and ``-Wl,-z,defs`` for ``GNU GCC``.
The final set of compile options used for a target is constructed by
The final set of compile or link options used for a target is constructed by
accumulating options from the current target and the usage requirements of
it dependencies. The set of options is de-duplicated to avoid repetition.
While beneficial for individual options, the de-duplication step can break
......
......@@ -8,9 +8,9 @@ Adds preprocessor definitions to the compilation of source files.
add_compile_definitions(<definition> ...)
Adds preprocessor definitions to the compiler command line for targets in the
current directory and below that are added after this command is invoked.
See documentation of the :prop_dir:`directory <COMPILE_DEFINITIONS>` and
:prop_tgt:`target <COMPILE_DEFINITIONS>` ``COMPILE_DEFINITIONS`` properties.
current directory and below (whether added before or after this command is
invoked). See documentation of the :prop_dir:`directory <COMPILE_DEFINITIONS>`
and :prop_tgt:`target <COMPILE_DEFINITIONS>` ``COMPILE_DEFINITIONS`` properties.
Definitions are specified using the syntax ``VAR`` or ``VAR=value``.
Function-style definitions are not supported. CMake will automatically
......
......@@ -22,4 +22,4 @@ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: COMPILE_OPTIONS_SHELL.txt
.. include:: OPTIONS_SHELL.txt
......@@ -150,6 +150,7 @@ the interface target using the commands:
* :command:`set_property`,
* :command:`target_link_libraries(INTERFACE)`,
* :command:`target_link_options(INTERFACE)`,
* :command:`target_include_directories(INTERFACE)`,
* :command:`target_compile_options(INTERFACE)`,
* :command:`target_compile_definitions(INTERFACE)`, and
......
add_link_options
----------------
Adds options to the link of targets.
::
add_link_options(<option> ...)
Adds options to the link step for targets in the current directory and below
that are added after this command is invoked. See documentation of the
:prop_dir:`directory <LINK_OPTIONS>` and
:prop_tgt:`target <LINK_OPTIONS>` ``LINK_OPTIONS`` properties.
This command can be used to add any options, but alternative commands
exist to add libraries (:command:`target_link_libraries` or
:command:`link_libraries`).
Arguments to ``add_link_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: LINK_OPTIONS_LINKER.txt
.. include:: OPTIONS_SHELL.txt
......@@ -13,6 +13,10 @@ If the running version of CMake is lower than the ``<min>`` required
version it will stop processing the project and report an error.
The optional ``<max>`` version, if specified, must be at least the
``<min>`` version and affects policy settings as described below.
If the running version of CMake is older than 3.12, the extra ``...``
dots will be seen as version component separators, resulting in the
``...<max>`` part being ignored and preserving the pre-3.12 behavior
of basing policies on ``<min>``.
The ``FATAL_ERROR`` option is accepted but ignored by CMake 2.6 and
higher. It should be specified so CMake versions 2.4 and lower fail
......
......@@ -30,7 +30,10 @@ encourage projects to set policies based on CMake versions::
``major.minor[.patch[.tweak]]``, and the ``...`` is literal. The ``<min>``
version must be at least ``2.4`` and at most the running version of CMake.
The ``<max>`` version, if specified, must be at least the ``<min>`` version
but may exceed the running version of CMake.
but may exceed the running version of CMake. If the running version of
CMake is older than 3.12, the extra ``...`` dots will be seen as version
component separators, resulting in the ``...<max>`` part being ignored and
preserving the pre-3.12 behavior of basing policies on ``<min>``.
This specifies that the current CMake code is written for the given
range of CMake versions. All policies known to the running version of CMake
......
......@@ -280,6 +280,14 @@ targets that link to the object libraries in their implementation.
Installing a target with the :prop_tgt:`EXCLUDE_FROM_ALL` target property
set to ``TRUE`` has undefined behavior.
:command:`install(TARGETS)` can install targets that were created in
other directories. When using such cross-directory install rules, running
``make install`` (or similar) from a subdirectory will not guarantee that
targets from other directories are up-to-date. You can use
:command:`target_link_libraries` or :command:`add_dependencies`
to ensure that such out-of-directory targets are built before the
subdirectory-specific install rules are run.
The install destination given to the target install ``DESTINATION`` may
use "generator expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
......@@ -427,6 +435,10 @@ example, the code
will print a message during installation.
The contents of ``SCRIPT`` or ``CODE`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions.
Installing Exports
^^^^^^^^^^^^^^^^^^
......
......@@ -28,7 +28,7 @@ Synopsis
`Ordering`_
list(`REVERSE`_ <list>)
list(`SORT`_ <list>)
list(`SORT`_ <list> [...])
Introduction
^^^^^^^^^^^^
......@@ -253,7 +253,23 @@ Reverses the contents of the list in-place.
::
list(SORT <list>)
list(SORT <list> [COMPARE <compare>] [CASE <case>] [ORDER <order>])
Sorts the list in-place alphabetically.
Use the option ``<compare>`` to select the compare type for sorting.
The ``<compare>`` option may be one of:
* ``STRING``: Sorts a list of strings alphabetically.
* ``FILE_BASENAME``: Sort a list of pathnames of files by their basenames.
Use the option ``<case>`` to select a case sensitive or case insensitive sort mode.
The ``<case>`` option may be one of:
* ``SENSITIVE``: Sorts the list alphabetically.
* ``INSENSITIVE``: Sorts the list alphabetically in descending order.
Use the option ``<order>`` to select a case sensitive or case insensitive sort mode.
The ``<order>`` option may be one of:
* ``ASCENDING``: Sorts the list in ascending order.
* ``DESCENDING``: Sorts the list in descending order.
......@@ -5,10 +5,26 @@ Mathematical expressions.
::
math(EXPR <output-variable> <math-expression>)
math(EXPR <output-variable> <math-expression> [OUTPUT_FORMAT <format>])
``EXPR`` evaluates mathematical expression and returns result in the
output variable. Example mathematical expression is ``5 * (10 + 13)``.
Supported operators are ``+``, ``-``, ``*``, ``/``, ``%``, ``|``, ``&``,
``^``, ``~``, ``<<``, ``>>``, and ``(...)``. They have the same meaning
as they do in C code.
Numeric constants are evaluated in decimal or hexadecimal representation.
The result is formatted according to the option "OUTPUT_FORMAT" ,
where ``<format>`` is one of:
::
HEXADECIMAL = Result in output variable will be formatted in C code
Hexadecimal notation.
DECIMAL = Result in output variable will be formatted in decimal notation.
For example::
math(EXPR value "100 * 0xA" DECIMAL) results in value is set to "1000"
math(EXPR value "100 * 0xA" HEXADECIMAL) results in value is set to "0x3e8"
......@@ -9,7 +9,9 @@ Provides an option that the user can optionally select.
[initial value])
Provide an option for the user to select as ``ON`` or ``OFF``. If no
initial value is provided, ``OFF`` is used.
initial value is provided, ``OFF`` is used. If the option is already
set as a normal variable then the command does nothing
(see policy :policy:`CMP0077`).
If you have options that depend on the values of other options, see
the module help for :module:`CMakeDependentOption`.
......@@ -39,4 +39,4 @@ with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: COMPILE_OPTIONS_SHELL.txt
.. include:: OPTIONS_SHELL.txt
......@@ -70,7 +70,8 @@ Each ``<item>`` may be:
Link flags specified here are inserted into the link command in the same
place as the link libraries. This might not be correct, depending on
the linker. Use the :prop_tgt:`LINK_FLAGS` target property to add link
the linker. Use the :prop_tgt:`LINK_OPTIONS` target property or
:command:`target_link_options` command to add link
flags explicitly. The flags will then be placed at the toolchain-defined
flag position in the link command.
......
target_link_options
-------------------
Add link options to a target.
::
target_link_options(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
Specify link options to use when linking a given target. The
named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
If ``BEFORE`` is specified, the content will be prepended to the property
instead of being appended.
This command can be used to add any options, but
alternative commands exist to add libraries
(:command:`target_link_libraries` and :command:`link_libraries`).
See documentation of the :prop_dir:`directory <LINK_OPTIONS>` and
:prop_tgt:`target <LINK_OPTIONS>` ``LINK_OPTIONS`` properties.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`LINK_OPTIONS` property of
``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_LINK_OPTIONS` property of ``<target>``.
(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.)
The following arguments specify link options. Repeated calls for the same
``<target>`` append items in the order called.
Arguments to ``target_link_options`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: LINK_OPTIONS_LINKER.txt
.. include:: OPTIONS_SHELL.txt
......@@ -9,7 +9,9 @@ Add sources to a target.
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
Specify sources to use when compiling a given target. The
Specify sources to use when compiling a given target. Relative
source file paths are interpreted as being relative to the current
source directory (i.e. :variable:`CMAKE_CURRENT_SOURCE_DIR`). The
named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
......@@ -27,3 +29,6 @@ Arguments to ``target_sources`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
See also the :policy:`CMP0076` policy for older behavior related to the
handling of relative source file paths.
CPack Archive Generator
-----------------------
Archive CPack generator that supports packaging of sources and binaries in
different formats:
- 7Z - 7zip - (.7z)
- TBZ2 (.tar.bz2)
- TGZ (.tar.gz)
- TXZ (.tar.xz)
- TZ (.tar.Z)
- ZIP (.zip)
Variables specific to CPack Archive generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. variable:: CPACK_ARCHIVE_FILE_NAME
CPACK_ARCHIVE_<component>_FILE_NAME
Package file name without extension which is added automatically depending
on the archive format.
* Mandatory : YES
* Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].<extension>`` with
spaces replaced by '-'
.. variable:: CPACK_ARCHIVE_COMPONENT_INSTALL
Enable component packaging for CPackArchive
* Mandatory : NO
* Default : OFF
If enabled (ON) multiple packages are generated. By default a single package
containing files of all components is generated.
CPack Bundle Generator
----------------------
CPack Bundle generator (Mac OS X) specific options
Variables specific to CPack Bundle generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Installers built on Mac OS X using the Bundle generator use the
aforementioned DragNDrop (CPACK_DMG_xxx) variables, plus the following
Bundle-specific parameters (CPACK_BUNDLE_xxx).
.. variable:: CPACK_BUNDLE_NAME
The name of the generated bundle. This appears in the OSX finder as the
bundle name. Required.
.. variable:: CPACK_BUNDLE_PLIST
Path to an OSX plist file that will be used for the generated bundle. This
assumes that the caller has generated or specified their own Info.plist
file. Required.
.. variable:: CPACK_BUNDLE_ICON
Path to an OSX icon file that will be used as the icon for the generated
bundle. This is the icon that appears in the OSX finder for the bundle, and
in the OSX dock when the bundle is opened. Required.
.. variable:: CPACK_BUNDLE_STARTUP_COMMAND
Path to a startup script. This is a path to an executable or script that
will be run whenever an end-user double-clicks the generated bundle in the
OSX Finder. Optional.
.. variable:: CPACK_BUNDLE_APPLE_CERT_APP
The name of your Apple supplied code signing certificate for the application.
The name usually takes the form "Developer ID Application: [Name]" or
"3rd Party Mac Developer Application: [Name]". If this variable is not set
the application will not be signed.
.. variable:: CPACK_BUNDLE_APPLE_ENTITLEMENTS
The name of the plist file that contains your apple entitlements for sandboxing
your application. This file is required for submission to the Mac App Store.
.. variable:: CPACK_BUNDLE_APPLE_CODESIGN_FILES
A list of additional files that you wish to be signed. You do not need to
list the main application folder, or the main executable. You should
list any frameworks and plugins that are included in your app bundle.
.. variable:: CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER
Additional parameter that will passed to codesign.
Default value: "--deep -f"
.. variable:: CPACK_COMMAND_CODESIGN
Path to the codesign(1) command used to sign applications with an
Apple cert. This variable can be used to override the automatically
detected command (or specify its location if the auto-detection fails
to find it.)
CPack Cygwin Generator
----------------------
Cygwin CPack generator (Cygwin).
Variables specific to CPack Cygwin generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The
following variable is specific to installers build on and/or for
Cygwin:
.. variable:: CPACK_CYGWIN_PATCH_NUMBER
The Cygwin patch number. FIXME: This documentation is incomplete.
.. variable:: CPACK_CYGWIN_PATCH_FILE