...
 
Commits (674)

Too many changes to show.

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

......@@ -3,29 +3,36 @@ Checks: "-*,\
bugprone-*,\
-bugprone-macro-parentheses,\
-bugprone-misplaced-widening-cast,\
-bugprone-narrowing-conversions,\
-bugprone-too-small-loop-variable,\
google-readability-casting,\
misc-*,\
-misc-incorrect-roundings,\
-misc-macro-parentheses,\
-misc-misplaced-widening-cast,\
-misc-non-private-member-variables-in-classes,\
-misc-static-assert,\
modernize-*,\
-modernize-avoid-c-arrays,\
-modernize-deprecated-headers,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
-modernize-use-nodiscard,\
-modernize-use-noexcept,\
-modernize-use-transparent-functors,\
-modernize-use-using,\
performance-*,\
-performance-inefficient-string-concatenation,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-cast,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-isolate-declaration,\
-readability-magic-numbers,\
-readability-named-parameter,\
-readability-redundant-declaration,\
-readability-uppercase-literal-suffix,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
CheckOptions:
......
.gitattributes export-ignore
.git* export-ignore
.hooks* export-ignore
# Custom attribute to mark sources as using our C code style.
......
;;; cmake-mode.el --- major-mode for editing CMake sources
;; Package-Requires: ((emacs "24.1"))
; Distributed under the OSI-approved BSD 3-Clause License. See accompanying
; file Copyright.txt or https://cmake.org/licensing for details.
......@@ -224,17 +226,11 @@ the indentation. Otherwise it retains the same position on the line"
;;
(defvar cmake-mode-hook nil)
;------------------------------------------------------------------------------
;; For compatibility with Emacs < 24
(defalias 'cmake--parent-mode
(if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
;;------------------------------------------------------------------------------
;; Mode definition.
;;
;;;###autoload
(define-derived-mode cmake-mode cmake--parent-mode "CMake"
(define-derived-mode cmake-mode prog-mode "CMake"
"Major mode for editing CMake source files."
; Setup font-lock mode.
......
......@@ -288,6 +288,7 @@ syn keyword cmakeProperty contained
\ SKIP_AUTORCC
\ SKIP_AUTOUIC
\ SKIP_BUILD_RPATH
\ SKIP_REGULAR_EXPRESSION
\ SKIP_RETURN_CODE
\ SOURCES
\ SOURCE_DIR
......@@ -915,6 +916,7 @@ syn keyword cmakeVariable contained
\ CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
\ CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
\ CMAKE_ECLIPSE_MAKE_ARGUMENTS
\ CMAKE_ECLIPSE_RESOURCE_ENCODING
\ CMAKE_ECLIPSE_VERSION
\ CMAKE_EDIT_COMMAND
\ CMAKE_ENABLE_EXPORTS
......@@ -948,6 +950,12 @@ syn keyword cmakeVariable contained
\ CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
\ CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
\ CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
\ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
\ CMAKE_FIND_USE_CMAKE_PATH
\ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH
\ CMAKE_FIND_USE_PACKAGE_REGISTRY
\ CMAKE_FIND_USE_PACKAGE_ROOT_PATH
\ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
\ CMAKE_FOLDER
\ CMAKE_FRAMEWORK
\ CMAKE_FRAMEWORK_PATH
......@@ -1765,6 +1773,7 @@ syn keyword cmakeKWadd_test contained
\ NAME
\ OFF
\ PASS_REGULAR_EXPRESSION
\ SKIP_REGULAR_EXPRESSION
\ TARGET_FILE
\ WILL_FAIL
\ WORKING_DIRECTORY
......
......@@ -429,10 +429,7 @@ macro (CMAKE_BUILD_UTILITIES)
set(_CMAKE_USE_OPENSSL_DEFAULT OFF)
if(NOT DEFINED CMAKE_USE_OPENSSL AND NOT WIN32 AND NOT APPLE
AND CMAKE_SYSTEM_NAME MATCHES "(Linux|FreeBSD)")
find_package(OpenSSL QUIET)
if(OPENSSL_FOUND)
set(_CMAKE_USE_OPENSSL_DEFAULT ON)
endif()
set(_CMAKE_USE_OPENSSL_DEFAULT ON)
endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL." ${_CMAKE_USE_OPENSSL_DEFAULT})
mark_as_advanced(CMAKE_USE_OPENSSL)
......@@ -629,8 +626,7 @@ endif()
# The main section of the CMakeLists file
#
#-----------------------------------------------------------------------
# Compute CMake_VERSION, etc.
include(Source/CMakeVersionCompute.cmake)
include(Source/CMakeVersion.cmake)
# Include the standard Dart testing module
enable_testing()
......@@ -817,7 +813,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
REGEX "Help/dev($|/)" EXCLUDE
REGEX "Help/(dev|guide|index.rst)($|/)" EXCLUDE
)
# Install auxiliary files integrating with other tools.
......
......@@ -89,7 +89,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
searched after paths from the current module,
i.e. ``<CurrentPackage>_ROOT``, ``ENV{<CurrentPackage>_ROOT}``,
``<ParentPackage>_ROOT``, ``ENV{<ParentPackage>_ROOT}``, etc.
This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed.
This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
See policy :policy:`CMP0074`.
* |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX|
......@@ -97,7 +98,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
2. Search paths specified in cmake-specific cache variables.
These are intended to be used on the command line with a ``-DVAR=value``.
The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed.
This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``.
* |CMAKE_PREFIX_PATH_XXX|
* |CMAKE_XXX_PATH|
......@@ -107,7 +109,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
These are intended to be set in the user's shell configuration,
and therefore use the host's native path separator
(``;`` on Windows and ``:`` on UNIX).
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed.
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or
by setting the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``.
* |CMAKE_PREFIX_PATH_XXX|
* |CMAKE_XXX_PATH|
......@@ -119,13 +122,16 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
Hard-coded guesses should be specified with the ``PATHS`` option.
5. Search the standard system environment variables.
This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is an argument.
This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by
setting the :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``.
* |SYSTEM_ENVIRONMENT_PATH_XXX|
* |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX|
6. Search cmake variables defined in the Platform files
for the current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH``
is passed.
is passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`
to ``FALSE``.
* |CMAKE_SYSTEM_PREFIX_PATH_XXX|
* |CMAKE_SYSTEM_XXX_PATH|
......
......@@ -7,7 +7,8 @@ Add a test to the project to be run by :manual:`ctest(1)`.
add_test(NAME <name> COMMAND <command> [<arg>...]
[CONFIGURATIONS <config>...]
[WORKING_DIRECTORY <dir>])
[WORKING_DIRECTORY <dir>]
[COMMAND_EXPAND_LISTS])
Adds a test called ``<name>``. The test name may not contain spaces,
quotes, or other characters special in CMake syntax. The options are:
......@@ -28,12 +29,18 @@ quotes, or other characters special in CMake syntax. The options are:
directory set to the build directory corresponding to the
current source directory.
``COMMAND_EXPAND_LISTS``
Lists in ``COMMAND`` arguments will be expanded, including those
created with
:manual:`generator expressions <cmake-generator-expressions(7)>`.
The given test command is expected to exit with code ``0`` to pass and
non-zero to fail, or vice-versa if the :prop_test:`WILL_FAIL` test
property is set. Any output written to stdout or stderr will be
captured by :manual:`ctest(1)` but does not affect the pass/fail status
unless the :prop_test:`PASS_REGULAR_EXPRESSION` or
:prop_test:`FAIL_REGULAR_EXPRESSION` test property is used.
unless the :prop_test:`PASS_REGULAR_EXPRESSION`,
:prop_test:`FAIL_REGULAR_EXPRESSION` or
:prop_test:`SKIP_REGULAR_EXPRESSION` test property is used.
The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator
expressions" with the syntax ``$<...>``. See the
......
This diff is collapsed.
......@@ -17,11 +17,10 @@ find_file
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``.
On Windows hosts:
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
directories in ``PATH`` itself.
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``.
.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts:
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|.
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
......
......@@ -17,11 +17,10 @@ find_library
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_LIBRARY_PATH`
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``LIB``.
On Windows hosts:
``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set,
and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|,
and the directories in ``PATH`` itself.
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``.
.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts:
``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|.
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set,
......
......@@ -293,13 +293,15 @@ enabled.
The package root variables are maintained as a stack so if
called from within a find module, root paths from the parent's find
module will also be searched after paths for the current package.
This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed.
This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
See policy :policy:`CMP0074`.
2. Search paths specified in cmake-specific cache variables. These
are intended to be used on the command line with a ``-DVAR=value``.
The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed::
This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``::
CMAKE_PREFIX_PATH
CMAKE_FRAMEWORK_PATH
......@@ -309,7 +311,8 @@ enabled.
These are intended to be set in the user's shell configuration,
and therefore use the host's native path separator
(``;`` on Windows and ``:`` on UNIX).
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed::
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or by setting
the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``::
<PackageName>_DIR
CMAKE_PREFIX_PATH
......@@ -322,7 +325,8 @@ enabled.
be specified with the ``PATHS`` option.
5. Search the standard system environment variables. This can be
skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed. Path entries
skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``. Path entries
ending in ``/bin`` or ``/sbin`` are automatically converted to their
parent directories::
......@@ -330,14 +334,17 @@ enabled.
6. Search paths stored in the CMake :ref:`User Package Registry`.
This can be skipped if ``NO_CMAKE_PACKAGE_REGISTRY`` is passed or by
setting the :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`
to ``TRUE``.
setting the variable :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`
to ``FALSE`` or the deprecated variable
:variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` to ``TRUE``.
See the :manual:`cmake-packages(7)` manual for details on the user
package registry.
7. Search cmake variables defined in the Platform files for the
current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is
passed::
passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`
to ``FALSE``::
CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_FRAMEWORK_PATH
......
......@@ -17,11 +17,10 @@ find_path
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``.
On Windows hosts:
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
directories in ``PATH`` itself.
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` and ``INCLUDE``.
.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts:
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|.
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
......
......@@ -15,7 +15,8 @@ find_program
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_PROGRAM_PATH`
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_APPBUNDLE_PATH`
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: ``PATH``
.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` itself.
.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts no extra search paths are included
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
|CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR|
......
......@@ -29,6 +29,8 @@ If used, it must be a verbatim
repeat of the argument of the opening
``if`` command.
.. _`Condition Syntax`:
Condition Syntax
^^^^^^^^^^^^^^^^
......
......@@ -126,6 +126,8 @@ project. There are several kinds of target files that may be installed:
marked with the ``FRAMEWORK`` property on macOS (see ``FRAMEWORK``
below.) For DLL platforms (all Windows-based systems including
Cygwin), the DLL import library is treated as an ``ARCHIVE`` target.
On AIX, the linker import file created for executables with
:prop_tgt:`ENABLE_EXPORTS` is treated as an ``ARCHIVE`` target.
``LIBRARY``
Module libraries are always treated as ``LIBRARY`` targets. For non-
......
......@@ -60,6 +60,11 @@ messages one at a time on a status line and other messages in an
interactive pop-up box. The ``--loglevel`` command-line option to each of
these tools can be used to control which messages will be shown.
Messages of log levels ``NOTICE`` and below will also have each line preceded
by the content of the :variable:`CMAKE_MESSAGE_INDENT` variable (converted to
a single string by concatenating its list items). For ``STATUS`` to ``TRACE``
messages, this indenting content will be inserted after the hyphens.
CMake Warning and Error message text displays using a simple markup
language. Non-indented text is formatted in line-wrapped paragraphs
delimited by newlines. Indented text is considered pre-formatted.
This diff is collapsed.
......@@ -92,6 +92,45 @@ Publish both ``master`` and ``release`` simultaneously:
.. _`CMake Review Process`: review.rst
.. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
Create Release Version
======================
When the ``release`` branch is ready to create a new release, follow the
steps in the above `Maintain Current Release`_ section to checkout a local
``release-$ver`` branch, where ``$ver`` is the version number of the
current release in the form ``$major.$minor``.
Edit ``Source/CMakeVersion.cmake`` to set the full version:
.. code-block:: cmake
# CMake version number components.
set(CMake_VERSION_MAJOR $major)
set(CMake_VERSION_MINOR $minor)
set(CMake_VERSION_PATCH $patch)
#set(CMake_VERSION_RC $rc) # uncomment for release candidates
In the following we use the placeholder ``$fullver`` for the full version
number of the new release with the form ``$major.$minor.$patch[-rc$rc]``.
If the version is not a release candidate, comment out the RC version
component above and leave off the ``-rc$rc`` suffix from ``$fullver``.
Commit the release version with the **exact** message ``CMake $fullver``:
.. code-block:: shell
git commit -m "CMake $fullver"
Tag the release using an annotated tag with the same message as the
commit and named with the **exact** form ``v$fullver``:
.. code-block:: shell
git tag -s -m "CMake $fullver" "v$fullver"
Follow the steps in the above `Maintain Current Release`_ section to
merge the ``release-$ver`` branch into ``master`` and publish both.
Branch a New Release
====================
......@@ -178,7 +217,7 @@ Commit with a message such as::
the CMake Release Notes index page.
Update ``Source/CMakeVersion.cmake`` to set the version to
``$major.$minor.0-rc1``:
``$major.$minor.0-rc0``:
.. code-block:: cmake
......@@ -186,7 +225,7 @@ Update ``Source/CMakeVersion.cmake`` to set the version to
set(CMake_VERSION_MAJOR $major)
set(CMake_VERSION_MINOR $minor)
set(CMake_VERSION_PATCH 0)
set(CMake_VERSION_RC 1)
set(CMake_VERSION_RC 0)
Update uses of ``DEVEL_CMAKE_VERSION`` in the source tree to mention the
actual version number:
......@@ -197,7 +236,7 @@ actual version number:
Commit with a message such as::
CMake $major.$minor.0-rc1 version update
Begin $ver release versioning
Merge the ``release-$ver`` branch to ``master``:
......@@ -225,7 +264,7 @@ Update ``Source/CMakeVersion.cmake`` to set the version to
set(CMake_VERSION_MAJOR $major)
set(CMake_VERSION_MINOR $minor)
set(CMake_VERSION_PATCH $date)
#set(CMake_VERSION_RC 1)
#set(CMake_VERSION_RC 0)
Commit with a message such as::
......
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.15)
project(Tutorial)
# control how we mark up Debug libraries compared to Release libraries
set(CMAKE_DEBUG_POSTFIX "-d")
add_library(tutorial_compiler_flags INTERFACE)
target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
# add compiler warning flags just when building this project via
# the BUILD_INTERFACE genex
set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU>")
set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
target_compile_options(tutorial_compiler_flags INTERFACE
"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
"$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
)
# set the version number</