summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy5
-rw-r--r--Auxiliary/vim/syntax/cmake.vim1
-rw-r--r--CONTRIBUTING.rst4
-rw-r--r--Copyright.txt2
-rw-r--r--Help/command/add_compile_options.rst39
-rw-r--r--Help/command/install.rst5
-rw-r--r--Help/command/target_compile_options.rst30
-rw-r--r--Help/dev/review.rst8
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0087.rst29
-rw-r--r--Help/release/dev/FindLibLZMA-target.rst4
-rw-r--r--Help/release/dev/install-code-script-genex.rst5
-rw-r--r--Modules/ExternalProject.cmake51
-rw-r--r--Modules/FindLibLZMA.cmake58
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx7
-rw-r--r--Source/CTest/cmCTestGIT.cxx12
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx1
-rw-r--r--Source/cmCPluginAPI.cxx7
-rw-r--r--Source/cmCTest.h7
-rw-r--r--Source/cmCacheManager.h11
-rw-r--r--Source/cmCommand.h7
-rw-r--r--Source/cmComputeLinkDepends.h14
-rw-r--r--Source/cmComputeLinkInformation.h11
-rw-r--r--Source/cmCustomCommand.cxx4
-rw-r--r--Source/cmDefinitions.h13
-rw-r--r--Source/cmDepends.cxx3
-rw-r--r--Source/cmDepends.h6
-rw-r--r--Source/cmDependsC.cxx1
-rw-r--r--Source/cmDependsC.h9
-rw-r--r--Source/cmDependsFortran.cxx1
-rw-r--r--Source/cmDependsFortran.h2
-rw-r--r--Source/cmDocumentation.h7
-rw-r--r--Source/cmDocumentationFormatter.cxx2
-rw-r--r--Source/cmDocumentationFormatter.h4
-rw-r--r--Source/cmExecutionStatus.h16
-rw-r--r--Source/cmExpandedCommandArgument.cxx1
-rw-r--r--Source/cmExpandedCommandArgument.h2
-rw-r--r--Source/cmExportCommand.cxx4
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx1
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx4
-rw-r--r--Source/cmExtraCodeLiteGenerator.h2
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx1
-rw-r--r--Source/cmExtraKateGenerator.cxx1
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx1
-rw-r--r--Source/cmFileCommand.cxx10
-rw-r--r--Source/cmFileLock.h5
-rw-r--r--Source/cmFileLockUnix.cxx1
-rw-r--r--Source/cmFileLockWin32.cxx1
-rw-r--r--Source/cmFindLibraryCommand.cxx7
-rw-r--r--Source/cmFindPackageCommand.cxx47
-rw-r--r--Source/cmGeneratedFileStream.cxx14
-rw-r--r--Source/cmGeneratedFileStream.h8
-rw-r--r--Source/cmGeneratorExpressionLexer.cxx2
-rw-r--r--Source/cmGeneratorExpressionLexer.h4
-rw-r--r--Source/cmGeneratorTarget.h44
-rw-r--r--Source/cmGlobVerificationManager.h7
-rw-r--r--Source/cmGlobalGenerator.h14
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h7
-rw-r--r--Source/cmInstallCommandArguments.cxx4
-rw-r--r--Source/cmInstallScriptGenerator.cxx70
-rw-r--r--Source/cmInstallScriptGenerator.h14
-rw-r--r--Source/cmInstalledFile.cxx1
-rw-r--r--Source/cmInstalledFile.h2
-rw-r--r--Source/cmLinkItem.cxx7
-rw-r--r--Source/cmLinkItem.h46
-rw-r--r--Source/cmListFileCache.h27
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h21
-rw-r--r--Source/cmMakefile.cxx10
-rw-r--r--Source/cmNewLineStyle.cxx1
-rw-r--r--Source/cmNewLineStyle.h2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx6
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx10
-rw-r--r--Source/cmPolicies.h6
-rw-r--r--Source/cmProcessTools.cxx5
-rw-r--r--Source/cmProcessTools.h6
-rw-r--r--Source/cmQtAutoGenInitializer.h10
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx5
-rw-r--r--Source/cmQtAutoGeneratorMocUic.h10
-rw-r--r--Source/cmQtAutoGeneratorRcc.cxx6
-rw-r--r--Source/cmQtAutoGeneratorRcc.h12
-rw-r--r--Source/cmScriptGenerator.h7
-rw-r--r--Source/cmSourceFileLocation.cxx3
-rw-r--r--Source/cmSourceFileLocation.h6
-rw-r--r--Source/cmState.cxx8
-rw-r--r--Source/cmState.h16
-rw-r--r--Source/cmStatePrivate.h3
-rw-r--r--Source/cmStateSnapshot.cxx1
-rw-r--r--Source/cmString.hxx3
-rw-r--r--Source/cmStringReplaceHelper.h1
-rw-r--r--Source/cmUVHandlePtr.h39
-rw-r--r--Source/cmVariableWatch.h13
-rw-r--r--Tests/CMakeLists.txt4
-rw-r--r--Tests/FindLibLZMA/CMakeLists.txt10
-rw-r--r--Tests/FindLibLZMA/Test/CMakeLists.txt14
-rw-r--r--Tests/FindLibLZMA/Test/main.c15
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt8
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake20
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt7
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake21
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/README.rst11
-rw-r--r--Tests/RunCMake/RunCMake.cmake4
-rw-r--r--Tests/RunCMake/install/CMP0087-NEW-check.cmake7
-rw-r--r--Tests/RunCMake/install/CMP0087-NEW.cmake3
-rw-r--r--Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/install/CMP0087-OLD-check.cmake8
-rw-r--r--Tests/RunCMake/install/CMP0087-OLD.cmake3
-rw-r--r--Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/install/CMP0087-WARN-stderr.txt5
-rw-r--r--Tests/RunCMake/install/CMP0087-WARN.cmake2
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake2
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake2
120 files changed, 639 insertions, 496 deletions
diff --git a/.clang-tidy b/.clang-tidy
index b35bc65..dc60714 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -15,7 +15,6 @@ modernize-*,\
-modernize-raw-string-literal,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
--modernize-use-default-member-init,\
-modernize-use-emplace,\
-modernize-use-equals-default,\
-modernize-use-equals-delete,\
@@ -33,8 +32,10 @@ readability-*,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
-readability-redundant-declaration,\
--readability-redundant-member-init,\
-readability-simplify-boolean-expr,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
+CheckOptions:
+ - key: modernize-use-default-member-init.UseAssignment
+ value: '1'
...
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index d4d0edf..b67ef06 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -877,6 +877,7 @@ syn keyword cmakeKWExternalProject contained
\ LOG_DOWNLOAD
\ LOG_INSTALL
\ LOG_MERGED_STDOUTERR
+ \ LOG_OUTPUT_ON_FAILURE
\ LOG_PATCH
\ LOG_TEST
\ LOG_UPDATE
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 84f6abb..7e71111 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -24,7 +24,8 @@ CMake uses `Kitware's GitLab Instance`_ to manage development and code review.
To contribute patches:
#. Fork the upstream `CMake Repository`_ into a personal account.
-#. Run `Utilities/SetupForDevelopment.sh`_ for local configuration.
+#. Run `Utilities/SetupForDevelopment.sh`_ for local git configuration.
+#. See `Building CMake`_ for building CMake locally.
#. See the `CMake Source Code Guide`_ for coding guidelines.
#. Base all new work on the upstream ``master`` branch.
Base work on the upstream ``release`` branch only if it fixes a
@@ -45,6 +46,7 @@ The merge request will enter the `CMake Review Process`_ for consideration.
.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh
+.. _`Building CMake`: README.rst#building-cmake
.. _`CMake Source Code Guide`: Help/dev/source.rst
.. _`commit messages`: Help/dev/review.rst#commit-messages
.. _`CMake Review Process`: Help/dev/review.rst
diff --git a/Copyright.txt b/Copyright.txt
index dc6deb9..f236214 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -1,5 +1,5 @@
CMake - Cross Platform Makefile Generator
-Copyright 2000-2018 Kitware, Inc. and Contributors
+Copyright 2000-2019 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst
index fcdcfd4..43805c3 100644
--- a/Help/command/add_compile_options.rst
+++ b/Help/command/add_compile_options.rst
@@ -7,15 +7,12 @@ Add options to the compilation of source files.
add_compile_options(<option> ...)
-Adds options 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_OPTIONS>` and
-:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties.
+Adds options to the :prop_dir:`COMPILE_OPTIONS` directory property.
+These options are used when compiling targets from the current
+directory and below.
-This command can be used to add any options, but alternative commands
-exist to add preprocessor definitions (:command:`target_compile_definitions`
-and :command:`add_compile_definitions`) or include directories
-(:command:`target_include_directories` and :command:`include_directories`).
+Arguments
+^^^^^^^^^
Arguments to ``add_compile_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
@@ -23,3 +20,29 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.txt
+
+Example
+^^^^^^^
+
+Since different compilers support different options, a typical use of
+this command is in a compiler-specific conditional clause:
+
+.. code-block:: cmake
+
+ if (MSVC)
+ # warning level 4 and all warnings as errors
+ add_compile_options(/W4 /WX)
+ else()
+ # lots of warnings and all warnings as errors
+ add_compile_options(-Wall -Wextra -pedantic -Werror)
+ endif()
+
+See Also
+^^^^^^^^
+
+This command can be used to add any options. However, for
+adding preprocessor definitions and include directories it is recommended
+to use the more specific commands :command:`add_compile_definitions`
+and :command:`include_directories`.
+
+The command :command:`target_compile_options` adds target-specific options.
diff --git a/Help/command/install.rst b/Help/command/install.rst
index 55c8485..a0e8c37 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -547,6 +547,11 @@ example, the code
will print a message during installation.
+``<file>`` or ``<code>`` may use "generator expressions" with the syntax
+``$<...>`` (in the case of ``<file>``, this refers to their use in the file
+name, not the file's contents). See the
+:manual:`cmake-generator-expressions(7)` manual for available expressions.
+
Installing Exports
^^^^^^^^^^^^^^^^^^
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index c26c926..47e7d86 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -9,22 +9,18 @@ Add compile options to a target.
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specifies compile options to use when compiling 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>`.
+Adds options to the :prop_tgt:`COMPILE_OPTIONS` or
+:prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties. These options
+are used when compiling the given ``<target>``, which 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>`.
+
+Arguments
+^^^^^^^^^
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 preprocessor definitions
-(:command:`target_compile_definitions` and :command:`add_compile_definitions`)
-or include directories (:command:`target_include_directories` and
-:command:`include_directories`). See documentation of the
-:prop_dir:`directory <COMPILE_OPTIONS>` and
-:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_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:`COMPILE_OPTIONS` property of
@@ -40,3 +36,13 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.txt
+
+See Also
+^^^^^^^^
+
+This command can be used to add any options. However, for adding
+preprocessor definitions and include directories it is recommended
+to use the more specific commands :command:`target_compile_definitions`
+and :command:`target_include_directories`.
+
+For directory-wide settings, there is the command :command:`add_compile_options`.
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index a524115..0c4eded 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -323,6 +323,14 @@ branch (e.g. ``master``) branch followed by a sequence of merges each
integrating changes from an open MR that has been staged for integration
testing. Each time the target integration branch is updated the stage
is rebuilt automatically by merging the staged MR topics again.
+The branch is stored in the upstream repository by special refs:
+
+* ``refs/stage/master/head``: The current topic stage branch.
+ This is used by continuous builds that report to CDash.
+* ``refs/stage/master/nightly/latest``: Topic stage as of 1am UTC each night.
+ This is used by most nightly builds that report to CDash.
+* ``refs/stage/master/nightly/<yyyy>/<mm>/<dd>``: Topic stage as of 1am UTC
+ on the date specified. This is used for historical reference.
`CMake GitLab Project Developers`_ may stage a MR for integration testing
by adding a comment with a command among the `comment trailing lines`_::
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index ed61ae0..40ec1ef 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.14
.. toctree::
:maxdepth: 1
+ CMP0087: install(SCRIPT | CODE) supports generator expressions. </policy/CMP0087>
CMP0086: UseSWIG honors SWIG_MODULE_NAME via -module flag. </policy/CMP0086>
CMP0085: IN_LIST generator expression handles empty list items. </policy/CMP0085>
CMP0084: The FindQt module does not exist for find_package(). </policy/CMP0084>
diff --git a/Help/policy/CMP0087.rst b/Help/policy/CMP0087.rst
new file mode 100644
index 0000000..4c45b99
--- /dev/null
+++ b/Help/policy/CMP0087.rst
@@ -0,0 +1,29 @@
+CMP0087
+-------
+
+:command:`install(CODE)` and :command:`install(SCRIPT)` support generator
+expressions.
+
+In CMake 3.13 and earlier, :command:`install(CODE)` and
+:command:`install(SCRIPT)` did not evaluate generator expressions. CMake 3.14
+and later will evaluate generator expressions for :command:`install(CODE)` and
+:command:`install(SCRIPT)`.
+
+The ``OLD`` behavior of this policy is for :command:`install(CODE)` and
+:command:`install(SCRIPT)` to not evaluate generator expressions. The ``NEW``
+behavior is to evaluate generator expressions for :command:`install(CODE)` and
+:command:`install(SCRIPT)`.
+
+Note that it is the value of this policy setting at the end of the directory
+scope that is important, not its setting at the time of the call to
+:command:`install(CODE)` or :command:`install(SCRIPT)`. This has implications
+for calling these commands from places that have their own policy scope but not
+their own directory scope (e.g. from files brought in via :command:`include()`
+rather than :command:`add_subdirectory()`).
+
+This policy was introduced in CMake version 3.14. CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/dev/FindLibLZMA-target.rst b/Help/release/dev/FindLibLZMA-target.rst
new file mode 100644
index 0000000..a13c45f
--- /dev/null
+++ b/Help/release/dev/FindLibLZMA-target.rst
@@ -0,0 +1,4 @@
+FindLibLZMA-target
+------------------
+
+* The :module:`FindLibLZMA` module now provides an imported target.
diff --git a/Help/release/dev/install-code-script-genex.rst b/Help/release/dev/install-code-script-genex.rst
new file mode 100644
index 0000000..a28a466
--- /dev/null
+++ b/Help/release/dev/install-code-script-genex.rst
@@ -0,0 +1,5 @@
+install-code-script-genex
+-------------------------
+
+* The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
+ learned to support generator expressions. See policy :policy:`CMP0087`.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 93cd74a..e763bab 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -550,6 +550,14 @@ External Project Definition
``LOG_MERGED_STDOUTERR <bool>``
When enabled, the output the step is not split by stdout and stderr.
+ ``LOG_OUTPUT_ON_FAILURE <bool>``
+ This option only has an effect if at least one of the other ``LOG_<step>``
+ options is enabled. If an error occurs for a step which has logging to
+ file enabled, that step's output will be printed to the console if
+ ``LOG_OUTPUT_ON_FAILURE`` is set to true. For cases where a large amount
+ of output is recorded, just the end of that output may be printed to the
+ console.
+
**Terminal Access Options:**
Steps can be given direct access to the terminal in some cases. Giving a
step access to the terminal may allow it to receive terminal input if
@@ -1953,6 +1961,7 @@ endif()
set(script ${stamp_dir}/${name}-${step}-$<CONFIG>.cmake)
set(logbase ${log_dir}/${name}-${step})
get_property(log_merged TARGET ${name} PROPERTY _EP_LOG_MERGED_STDOUTERR)
+ get_property(log_output_on_failure TARGET ${name} PROPERTY _EP_LOG_OUTPUT_ON_FAILURE)
if (log_merged)
set(stdout_log "${logbase}.log")
set(stderr_log "${logbase}.log")
@@ -1961,21 +1970,55 @@ endif()
set(stderr_log "${logbase}-err.log")
endif()
set(code "
+cmake_minimum_required(VERSION 3.13)
${code_cygpath_make}
set(command \"${command}\")
+set(log_merged \"${log_merged}\")
+set(log_output_on_failure \"${log_output_on_failure}\")
+set(stdout_log \"${stdout_log}\")
+set(stderr_log \"${stderr_log}\")
execute_process(
COMMAND \${command}
RESULT_VARIABLE result
- OUTPUT_FILE \"${stdout_log}\"
- ERROR_FILE \"${stderr_log}\"
+ OUTPUT_FILE \"\${stdout_log}\"
+ ERROR_FILE \"\${stderr_log}\"
)
+macro(read_up_to_max_size log_file output_var)
+ file(SIZE \${log_file} determined_size)
+ set(max_size 10240)
+ if (determined_size GREATER max_size)
+ math(EXPR seek_position \"\${determined_size} - \${max_size}\")
+ file(READ \${log_file} \${output_var} OFFSET \${seek_position})
+ set(\${output_var} \"...skipping to end...\\n\${\${output_var}}\")
+ else()
+ file(READ \${log_file} \${output_var})
+ endif()
+endmacro()
if(result)
set(msg \"Command failed: \${result}\\n\")
foreach(arg IN LISTS command)
set(msg \"\${msg} '\${arg}'\")
endforeach()
- set(msg \"\${msg}\\nSee also\\n ${stderr_log}\")
- message(FATAL_ERROR \"\${msg}\")
+ if (\${log_merged})
+ set(msg \"\${msg}\\nSee also\\n \${stderr_log}\")
+ else()
+ set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\")
+ endif()
+ if (\${log_output_on_failure})
+ message(SEND_ERROR \"\${msg}\")
+ if (\${log_merged})
+ read_up_to_max_size(\"\${stderr_log}\" error_log_contents)
+ message(STATUS \"Log output is:\\n\${error_log_contents}\")
+ else()
+ read_up_to_max_size(\"\${stdout_log}\" out_log_contents)
+ read_up_to_max_size(\"\${stderr_log}\" err_log_contents)
+ message(STATUS \"stdout output is:\\n\${out_log_contents}\")
+ message(STATUS \"stderr output is:\\n\${err_log_contents}\")
+ endif()
+ message(FATAL_ERROR \"Stopping after outputting logs.\")
+ else()
+ message(FATAL_ERROR \"\${msg}\")
+ endif()
else()
set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\")
message(STATUS \"\${msg}\")
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 6d30e57..6225744 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -5,22 +5,40 @@
FindLibLZMA
-----------
-Find LibLZMA
+Find LZMA compression algorithm headers and library.
-Find LibLZMA headers and library
-::
+Imported Targets
+^^^^^^^^^^^^^^^^
- LIBLZMA_FOUND - True if liblzma is found.
- LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located.
- LIBLZMA_LIBRARIES - Lzma libraries to link against.
- LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required).
- LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required).
- LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required).
- LIBLZMA_VERSION_MAJOR - The major version of lzma
- LIBLZMA_VERSION_MINOR - The minor version of lzma
- LIBLZMA_VERSION_PATCH - The patch version of lzma
- LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3")
+This module defines :prop_tgt:`IMPORTED` target ``LibLZMA::LibLZMA``, if
+liblzma has been found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``LIBLZMA_FOUND``
+ True if liblzma headers and library were found.
+``LIBLZMA_INCLUDE_DIRS``
+ Directory where liblzma headers are located.
+``LIBLZMA_LIBRARIES``
+ Lzma libraries to link against.
+``LIBLZMA_HAS_AUTO_DECODER``
+ True if lzma_auto_decoder() is found (required).
+``LIBLZMA_HAS_EASY_ENCODER``
+ True if lzma_easy_encoder() is found (required).
+``LIBLZMA_HAS_LZMA_PRESET``
+ True if lzma_lzma_preset() is found (required).
+``LIBLZMA_VERSION_MAJOR``
+ The major version of lzma
+``LIBLZMA_VERSION_MINOR``
+ The minor version of lzma
+``LIBLZMA_VERSION_PATCH``
+ The patch version of lzma
+``LIBLZMA_VERSION_STRING``
+ version number as a string (ex: "5.0.3")
#]=======================================================================]
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
@@ -51,17 +69,23 @@ if (LIBLZMA_LIBRARY)
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR
- LIBLZMA_LIBRARY
+find_package_handle_standard_args(LibLZMA REQUIRED_VARS LIBLZMA_LIBRARY
+ LIBLZMA_INCLUDE_DIR
LIBLZMA_HAS_AUTO_DECODER
LIBLZMA_HAS_EASY_ENCODER
LIBLZMA_HAS_LZMA_PRESET
VERSION_VAR LIBLZMA_VERSION_STRING
)
+mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
if (LIBLZMA_FOUND)
set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
+ if(NOT TARGET LibLZMA::LibLZMA)
+ add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED)
+ set_target_properties(LibLZMA::LibLZMA PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR}
+ IMPORTED_LINK_INTERFACE_LANGUAGES C
+ IMPORTED_LOCATION ${LIBLZMA_LIBRARY})
+ endif()
endif ()
-
-mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 5afaf7b..e89709e 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 13)
-set(CMake_VERSION_PATCH 20181218)
+set(CMake_VERSION_PATCH 20181223)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index a8309d9..539a0ce 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -503,10 +503,7 @@ public:
: FTC(ftc)
{
}
- FragmentCompare()
- : FTC(nullptr)
- {
- }
+ FragmentCompare() {}
bool operator()(std::string const& l, std::string const& r) const
{
// Order files by modification time. Use lexicographic order
@@ -520,7 +517,7 @@ public:
}
private:
- cmFileTimeComparison* FTC;
+ cmFileTimeComparison* FTC = nullptr;
};
void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 97c6b4f..4ede3d4 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -475,15 +475,9 @@ private:
{
std::string Name;
std::string EMail;
- unsigned long Time;
- long TimeZone;
- Person()
- : Name()
- , EMail()
- , Time(0)
- , TimeZone(0)
- {
- }
+ unsigned long Time = 0;
+ long TimeZone = 0;
+ Person() {}
};
void ParsePerson(const char* str, Person& person)
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 67c669c..3042480 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -119,7 +119,6 @@ static size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/,
}
cmCTestSubmitHandler::cmCTestSubmitHandler()
- : HTTPProxy()
{
this->Initialize();
}
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 22ae340..065a184 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -475,11 +475,8 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv)
// API for source files.
struct cmCPluginAPISourceFile
{
- cmCPluginAPISourceFile()
- : RealSourceFile(nullptr)
- {
- }
- cmSourceFile* RealSourceFile;
+ cmCPluginAPISourceFile() {}
+ cmSourceFile* RealSourceFile = nullptr;
std::string SourceName;
std::string SourceExtension;
std::string FullPath;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 7da0e1d..480204a 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -57,10 +57,7 @@ public:
/** Representation of one part. */
struct PartInfo
{
- PartInfo()
- : Enabled(false)
- {
- }
+ PartInfo() {}
void SetName(const std::string& name) { this->Name = name; }
const std::string& GetName() const { return this->Name; }
@@ -71,7 +68,7 @@ public:
std::vector<std::string> SubmitFiles;
private:
- bool Enabled;
+ bool Enabled = false;
std::string Name;
};
#ifdef CMAKE_BUILD_WITH_CMAKE
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index a269271..b39856e 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -34,20 +34,15 @@ private:
struct CacheEntry
{
std::string Value;
- cmStateEnums::CacheEntryType Type;
+ cmStateEnums::CacheEntryType Type = cmStateEnums::UNINITIALIZED;
cmPropertyMap Properties;
std::vector<std::string> GetPropertyList() const;
const char* GetProperty(const std::string&) const;
void SetProperty(const std::string& property, const char* value);
void AppendProperty(const std::string& property, const char* value,
bool asString = false);
- bool Initialized;
- CacheEntry()
- : Value("")
- , Type(cmStateEnums::UNINITIALIZED)
- , Initialized(false)
- {
- }
+ bool Initialized = false;
+ CacheEntry() {}
};
public:
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 2cc0b88..dfc3e78 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -30,10 +30,7 @@ public:
/**
* Construct the command. By default it has no makefile.
*/
- cmCommand()
- : Makefile(nullptr)
- {
- }
+ cmCommand() {}
/**
* Need virtual destructor to destroy real command type.
@@ -90,7 +87,7 @@ public:
void SetError(const std::string& e);
protected:
- cmMakefile* Makefile;
+ cmMakefile* Makefile = nullptr;
private:
std::string Error;
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 66fb1e6..32a2a62 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -35,16 +35,10 @@ public:
struct LinkEntry
{
std::string Item;
- cmGeneratorTarget const* Target;
- bool IsSharedDep;
- bool IsFlag;
- LinkEntry()
- : Item()
- , Target(nullptr)
- , IsSharedDep(false)
- , IsFlag(false)
- {
- }
+ cmGeneratorTarget const* Target = nullptr;
+ bool IsSharedDep = false;
+ bool IsFlag = false;
+ LinkEntry() {}
LinkEntry(LinkEntry const& r)
: Item(r.Item)
, Target(r.Target)
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index e00d230..db7eb96 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -30,12 +30,7 @@ public:
struct Item
{
- Item()
- : Value()
- , IsPath(true)
- , Target(nullptr)
- {
- }
+ Item() {}
Item(std::string const& v, bool p,
cmGeneratorTarget const* target = nullptr)
: Value(v)
@@ -44,8 +39,8 @@ public:
{
}
std::string Value;
- bool IsPath;
- cmGeneratorTarget const* Target;
+ bool IsPath = true;
+ cmGeneratorTarget const* Target = nullptr;
};
typedef std::vector<Item> ItemVector;
ItemVector const& GetItems() const;
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index e87eb1e..9dcec2f 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -15,13 +15,9 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
, Byproducts(byproducts)
, Depends(depends)
, CommandLines(commandLines)
- , Backtrace()
, Comment(comment ? comment : "")
, WorkingDirectory(workingDirectory ? workingDirectory : "")
, HaveComment(comment != nullptr)
- , EscapeAllowMakeVars(false)
- , EscapeOldStyle(true)
- , CommandExpandLists(false)
{
if (mf) {
this->Backtrace = mf->GetBacktrace();
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 4ab5be6..b2794fa 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -47,26 +47,19 @@ private:
typedef std::string std_string;
public:
- Def()
- : std_string()
- , Exists(false)
- , Used(false)
- {
- }
+ Def() {}
Def(const char* v)
: std_string(v ? v : "")
, Exists(v ? true : false)
- , Used(false)
{
}
Def(const std_string& v)
: std_string(v)
, Exists(true)
- , Used(false)
{
}
- bool Exists;
- bool Used;
+ bool Exists = false;
+ bool Used = false;
};
static Def NoDef;
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 6f1afd7..2acb015 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -15,10 +15,7 @@
cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
: LocalGenerator(lg)
- , Verbose(false)
- , FileComparison(nullptr)
, TargetDirectory(targetDir)
- , MaxPath(16384)
, Dependee(new char[MaxPath])
, Depender(new char[MaxPath])
{
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index 4b9e05a..705d215 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -96,15 +96,15 @@ protected:
cmLocalGenerator* LocalGenerator;
// Flag for verbose output.
- bool Verbose;
- cmFileTimeComparison* FileComparison;
+ bool Verbose = false;
+ cmFileTimeComparison* FileComparison = nullptr;
std::string Language;
// The full path to the target's build directory.
std::string TargetDirectory;
- size_t MaxPath;
+ size_t MaxPath = 16384;
char* Dependee;
char* Depender;
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index f7dd33b..072d116 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -20,7 +20,6 @@
#define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
cmDependsC::cmDependsC()
- : ValidDeps(nullptr)
{
}
diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h
index 2f76f62..f833888 100644
--- a/Source/cmDependsC.h
+++ b/Source/cmDependsC.h
@@ -75,16 +75,13 @@ public:
struct cmIncludeLines
{
- cmIncludeLines()
- : Used(false)
- {
- }
+ cmIncludeLines() {}
std::vector<UnscannedEntry> UnscannedEntries;
- bool Used;
+ bool Used = false;
};
protected:
- const std::map<std::string, DependencyVector>* ValidDeps;
+ const std::map<std::string, DependencyVector>* ValidDeps = nullptr;
std::set<std::string> Encountered;
std::queue<UnscannedEntry> Unscanned;
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 310af2d..e51f81e 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -69,7 +69,6 @@ public:
};
cmDependsFortran::cmDependsFortran()
- : Internal(nullptr)
{
}
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index bee9804..5d96dd4 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -76,7 +76,7 @@ protected:
std::set<std::string> PPDefinitions;
// Internal implementation details.
- cmDependsFortranInternals* Internal;
+ cmDependsFortranInternals* Internal = nullptr;
private:
std::string MaybeConvertToRelativePath(std::string const& base,
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index c80bed1..153bad6 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -116,11 +116,8 @@ private:
struct RequestedHelpItem
{
- RequestedHelpItem()
- : HelpType(None)
- {
- }
- cmDocumentationEnums::Type HelpType;
+ RequestedHelpItem() {}
+ cmDocumentationEnums::Type HelpType = None;
std::string Filename;
std::string Argument;
};
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index 2267ef9..678e408 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -11,8 +11,6 @@
#include <vector>
cmDocumentationFormatter::cmDocumentationFormatter()
- : TextWidth(77)
- , TextIndent("")
{
}
diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h
index 1f04250..17b63da 100644
--- a/Source/cmDocumentationFormatter.h
+++ b/Source/cmDocumentationFormatter.h
@@ -59,8 +59,8 @@ public:
void SetIndent(const char* indent);
private:
- int TextWidth;
- const char* TextIndent;
+ int TextWidth = 77;
+ const char* TextIndent = "";
};
#endif
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h
index ac5fe1d..1946231 100644
--- a/Source/cmExecutionStatus.h
+++ b/Source/cmExecutionStatus.h
@@ -11,13 +11,7 @@
class cmExecutionStatus
{
public:
- cmExecutionStatus()
- : ReturnInvoked(false)
- , BreakInvoked(false)
- , ContinueInvoked(false)
- , NestedError(false)
- {
- }
+ cmExecutionStatus() {}
void Clear()
{
@@ -40,10 +34,10 @@ public:
bool GetNestedError() const { return this->NestedError; }
private:
- bool ReturnInvoked;
- bool BreakInvoked;
- bool ContinueInvoked;
- bool NestedError;
+ bool ReturnInvoked = false;
+ bool BreakInvoked = false;
+ bool ContinueInvoked = false;
+ bool NestedError = false;
};
#endif
diff --git a/Source/cmExpandedCommandArgument.cxx b/Source/cmExpandedCommandArgument.cxx
index 1c0a721..650a5ad 100644
--- a/Source/cmExpandedCommandArgument.cxx
+++ b/Source/cmExpandedCommandArgument.cxx
@@ -3,7 +3,6 @@
#include "cmExpandedCommandArgument.h"
cmExpandedCommandArgument::cmExpandedCommandArgument()
- : Quoted(false)
{
}
diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h
index 302e8db..d71fc92 100644
--- a/Source/cmExpandedCommandArgument.h
+++ b/Source/cmExpandedCommandArgument.h
@@ -33,7 +33,7 @@ public:
private:
std::string Value;
- bool Quoted;
+ bool Quoted = false;
};
#endif
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index f965a29..3706a3c 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -25,9 +25,7 @@ class cmExecutionStatus;
#endif
cmExportCommand::cmExportCommand()
- : cmCommand()
- , ArgumentGroup()
- , Targets(&Helper, "TARGETS")
+ : Targets(&Helper, "TARGETS")
, Append(&Helper, "APPEND", &ArgumentGroup)
, ExportSetName(&Helper, "EXPORT", &ArgumentGroup)
, Namespace(&Helper, "NAMESPACE", &ArgumentGroup)
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 07a60de..d70352f 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -33,7 +33,6 @@ http://forums.codeblocks.org/index.php/topic,6789.0.html
*/
cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()
- : cmExternalMakefileProjectGenerator()
{
}
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 28106d1..bbc90a2 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -21,9 +21,7 @@
#include <utility>
cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator()
- : cmExternalMakefileProjectGenerator()
- , ConfigName("NoConfig")
- , CpuCount(2)
+ : ConfigName("NoConfig")
{
}
diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h
index 029054f..dea7ebc 100644
--- a/Source/cmExtraCodeLiteGenerator.h
+++ b/Source/cmExtraCodeLiteGenerator.h
@@ -23,7 +23,7 @@ class cmExtraCodeLiteGenerator : public cmExternalMakefileProjectGenerator
protected:
std::string ConfigName;
std::string WorkspacePath;
- unsigned int CpuCount;
+ unsigned int CpuCount = 2;
protected:
std::string GetCodeLiteCompilerName(const cmMakefile* mf) const;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index adb14ec..e7f3ada 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -41,7 +41,6 @@ void AppendDictionary(cmXMLWriter& xml, const char* key, T const& value)
}
cmExtraEclipseCDT4Generator::cmExtraEclipseCDT4Generator()
- : cmExternalMakefileProjectGenerator()
{
this->SupportsVirtualFolders = true;
this->GenerateLinkedResources = true;
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index 9410690..a9ed7fe 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -17,7 +17,6 @@
#include <vector>
cmExtraKateGenerator::cmExtraKateGenerator()
- : cmExternalMakefileProjectGenerator()
{
}
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 882d39f..0a1886a 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -55,7 +55,6 @@ cmExtraSublimeTextGenerator::GetFactory()
}
cmExtraSublimeTextGenerator::cmExtraSublimeTextGenerator()
- : cmExternalMakefileProjectGenerator()
{
this->ExcludeBuildFolder = false;
}
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index fb8e8d3..594cb67 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1095,13 +1095,9 @@ protected:
// Properties set by pattern and regex match rules.
struct MatchProperties
{
- bool Exclude;
- mode_t Permissions;
- MatchProperties()
- : Exclude(false)
- , Permissions(0)
- {
- }
+ bool Exclude = false;
+ mode_t Permissions = 0;
+ MatchProperties() {}
};
struct MatchRule
{
diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h
index 6c9a7b8..491a40b 100644
--- a/Source/cmFileLock.h
+++ b/Source/cmFileLock.h
@@ -51,14 +51,13 @@ private:
cmFileLockResult LockWithTimeout(unsigned long timeoutSec);
#if defined(_WIN32)
- typedef HANDLE FileId;
+ HANDLE File = INVALID_HANDLE_VALUE;
BOOL LockFile(DWORD flags);
#else
- typedef int FileId;
+ int File = -1;
int LockFile(int cmd, int type);
#endif
- FileId File;
std::string Filename;
};
diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx
index 7353b01..9b653e8 100644
--- a/Source/cmFileLockUnix.cxx
+++ b/Source/cmFileLockUnix.cxx
@@ -9,7 +9,6 @@
#include <unistd.h>
cmFileLock::cmFileLock()
- : File(-1)
{
}
diff --git a/Source/cmFileLockWin32.cxx b/Source/cmFileLockWin32.cxx
index 51ac249..a61d360 100644
--- a/Source/cmFileLockWin32.cxx
+++ b/Source/cmFileLockWin32.cxx
@@ -6,7 +6,6 @@
#include <windows.h> // CreateFileW
cmFileLock::cmFileLock()
- : File(INVALID_HANDLE_VALUE)
{
}
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 1e1ab14..5a5d036 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -198,13 +198,10 @@ struct cmFindLibraryHelper
// Current names under consideration.
struct Name
{
- bool TryRaw;
+ bool TryRaw = false;
std::string Raw;
cmsys::RegularExpression Regex;
- Name()
- : TryRaw(false)
- {
- }
+ Name() {}
};
std::vector<Name> Names;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index bf928fc..3d9cd08 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1675,11 +1675,7 @@ private:
class cmFileList
{
public:
- cmFileList()
- : First()
- , Last(nullptr)
- {
- }
+ cmFileList() {}
virtual ~cmFileList() {}
cmFileList& operator/(cmFileListGeneratorBase const& rhs)
{
@@ -1703,15 +1699,14 @@ private:
virtual bool Visit(std::string const& fullPath) = 0;
friend class cmFileListGeneratorBase;
std::unique_ptr<cmFileListGeneratorBase> First;
- cmFileListGeneratorBase* Last;
+ cmFileListGeneratorBase* Last = nullptr;
};
class cmFindPackageFileList : public cmFileList
{
public:
cmFindPackageFileList(cmFindPackageCommand* fpc, bool use_suffixes = true)
- : cmFileList()
- , FPC(fpc)
+ : FPC(fpc)
, UseSuffixes(use_suffixes)
{
}
@@ -1753,13 +1748,11 @@ class cmFileListGeneratorFixed : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorFixed(std::string const& str)
- : cmFileListGeneratorBase()
- , String(str)
+ : String(str)
{
}
cmFileListGeneratorFixed(cmFileListGeneratorFixed const& r)
- : cmFileListGeneratorBase()
- , String(r.String)
+ : String(r.String)
{
}
@@ -1782,13 +1775,11 @@ class cmFileListGeneratorEnumerate : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorEnumerate(std::vector<std::string> const& v)
- : cmFileListGeneratorBase()
- , Vector(v)
+ : Vector(v)
{
}
cmFileListGeneratorEnumerate(cmFileListGeneratorEnumerate const& r)
- : cmFileListGeneratorBase()
- , Vector(r.Vector)
+ : Vector(r.Vector)
{
}
@@ -1817,14 +1808,12 @@ public:
cmFileListGeneratorProject(std::vector<std::string> const& names,
cmFindPackageCommand::SortOrderType so,
cmFindPackageCommand::SortDirectionType sd)
- : cmFileListGeneratorBase()
- , Names(names)
+ : Names(names)
{
this->SetSort(so, sd);
}
cmFileListGeneratorProject(cmFileListGeneratorProject const& r)
- : cmFileListGeneratorBase()
- , Names(r.Names)
+ : Names(r.Names)
{
this->SetSort(r.SortOrder, r.SortDirection);
}
@@ -1888,14 +1877,12 @@ class cmFileListGeneratorMacProject : public cmFileListGeneratorBase
public:
cmFileListGeneratorMacProject(std::vector<std::string> const& names,
const char* ext)
- : cmFileListGeneratorBase()
- , Names(names)
+ : Names(names)
, Extension(ext)
{
}
cmFileListGeneratorMacProject(cmFileListGeneratorMacProject const& r)
- : cmFileListGeneratorBase()
- , Names(r.Names)
+ : Names(r.Names)
, Extension(r.Extension)
{
}
@@ -1941,14 +1928,12 @@ class cmFileListGeneratorCaseInsensitive : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorCaseInsensitive(std::string const& str)
- : cmFileListGeneratorBase()
- , String(str)
+ : String(str)
{
}
cmFileListGeneratorCaseInsensitive(
cmFileListGeneratorCaseInsensitive const& r)
- : cmFileListGeneratorBase()
- , String(r.String)
+ : String(r.String)
{
}
@@ -1985,13 +1970,11 @@ class cmFileListGeneratorGlob : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorGlob(std::string const& str)
- : cmFileListGeneratorBase()
- , Pattern(str)
+ : Pattern(str)
{
}
cmFileListGeneratorGlob(cmFileListGeneratorGlob const& r)
- : cmFileListGeneratorBase()
- , Pattern(r.Pattern)
+ : Pattern(r.Pattern)
{
}
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 186ec8c..bf53dbf 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -12,8 +12,6 @@
#endif
cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
- : cmGeneratedFileStreamBase()
- , Stream()
{
#ifdef CMAKE_BUILD_WITH_CMAKE
if (encoding != codecvt::None) {
@@ -105,22 +103,10 @@ void cmGeneratedFileStream::SetCompressionExtraExtension(bool ext)
}
cmGeneratedFileStreamBase::cmGeneratedFileStreamBase()
- : Name()
- , TempName()
- , CopyIfDifferent(false)
- , Okay(false)
- , Compress(false)
- , CompressExtraExtension(true)
{
}
cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(std::string const& name)
- : Name()
- , TempName()
- , CopyIfDifferent(false)
- , Okay(false)
- , Compress(false)
- , CompressExtraExtension(true)
{
this->Open(name);
}
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index dacd166..fd11889 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -45,16 +45,16 @@ protected:
std::string TempName;
// Whether to do a copy-if-different.
- bool CopyIfDifferent;
+ bool CopyIfDifferent = false;
// Whether the real file stream was valid when it was closed.
- bool Okay;
+ bool Okay = false;
// Whether the destination file is compressed
- bool Compress;
+ bool Compress = false;
// Whether the destination file is compressed
- bool CompressExtraExtension;
+ bool CompressExtraExtension = true;
};
/** \class cmGeneratedFileStream
diff --git a/Source/cmGeneratorExpressionLexer.cxx b/Source/cmGeneratorExpressionLexer.cxx
index e37f165..242915d 100644
--- a/Source/cmGeneratorExpressionLexer.cxx
+++ b/Source/cmGeneratorExpressionLexer.cxx
@@ -3,8 +3,6 @@
#include "cmGeneratorExpressionLexer.h"
cmGeneratorExpressionLexer::cmGeneratorExpressionLexer()
- : SawBeginExpression(false)
- , SawGeneratorExpression(false)
{
}
diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h
index e53f0b5..bf24308 100644
--- a/Source/cmGeneratorExpressionLexer.h
+++ b/Source/cmGeneratorExpressionLexer.h
@@ -46,8 +46,8 @@ public:
}
private:
- bool SawBeginExpression;
- bool SawGeneratorExpression;
+ bool SawBeginExpression = false;
+ bool SawGeneratorExpression = false;
};
#endif
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 52defee..cfd1df0 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -110,11 +110,8 @@ public:
std::set<std::string> ExpectedResxHeaders;
std::set<std::string> ExpectedXamlHeaders;
std::set<std::string> ExpectedXamlSources;
- bool Initialized;
- KindedSources()
- : Initialized(false)
- {
- }
+ bool Initialized = false;
+ KindedSources() {}
};
/** Get all sources needed for a configuration with kinds assigned. */
@@ -565,13 +562,9 @@ public:
};
struct SourceFileFlags
{
- SourceFileFlags()
- : Type(SourceFileTypeNormal)
- , MacFolder(nullptr)
- {
- }
- SourceFileType Type;
- const char* MacFolder; // location inside Mac content folders
+ SourceFileFlags() {}
+ SourceFileType Type = SourceFileTypeNormal;
+ const char* MacFolder = nullptr; // location inside Mac content folders
};
void GetAutoUicOptions(std::vector<std::string>& result,
const std::string& config) const;
@@ -757,11 +750,8 @@ private:
struct CompatibleInterfaces : public CompatibleInterfacesBase
{
- CompatibleInterfaces()
- : Done(false)
- {
- }
- bool Done;
+ CompatibleInterfaces() {}
+ bool Done = false;
};
mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
@@ -774,11 +764,8 @@ private:
struct LinkImplClosure : public std::vector<cmGeneratorTarget const*>
{
- LinkImplClosure()
- : Done(false)
- {
- }
- bool Done;
+ LinkImplClosure() {}
+ bool Done = false;
};
mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
@@ -797,15 +784,10 @@ private:
// Cache import information from properties for each configuration.
struct ImportInfo
{
- ImportInfo()
- : NoSOName(false)
- , Managed(Native)
- , Multiplicity(0)
- {
- }
- bool NoSOName;
- ManagedType Managed;
- unsigned int Multiplicity;
+ ImportInfo() {}
+ bool NoSOName = false;
+ ManagedType Managed = Native;
+ unsigned int Multiplicity = 0;
std::string Location;
std::string SOName;
std::string ImportLibrary;
diff --git a/Source/cmGlobVerificationManager.h b/Source/cmGlobVerificationManager.h
index cf04c97..cdbd275 100644
--- a/Source/cmGlobVerificationManager.h
+++ b/Source/cmGlobVerificationManager.h
@@ -70,13 +70,10 @@ private:
struct CacheEntryValue
{
- bool Initialized;
+ bool Initialized = false;
std::vector<std::string> Files;
std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces;
- CacheEntryValue()
- : Initialized(false)
- {
- }
+ CacheEntryValue() {}
};
typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 4e6b6de..36d3d10 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -478,11 +478,8 @@ protected:
cmCustomCommandLines CommandLines;
std::vector<std::string> Depends;
std::string WorkingDir;
- bool UsesTerminal;
- GlobalTargetInfo()
- : UsesTerminal(false)
- {
- }
+ bool UsesTerminal = false;
+ GlobalTargetInfo() {}
};
void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets);
@@ -608,13 +605,10 @@ private:
// Cache directory content and target files to be built.
struct DirectoryContent
{
- long LastDiskTime;
+ long LastDiskTime = -1;
std::set<std::string> All;
std::set<std::string> Generated;
- DirectoryContent()
- : LastDiskTime(-1)
- {
- }
+ DirectoryContent() {}
};
std::map<std::string, DirectoryContent> DirectoryContentMap;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 5316b19..dcd2585 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -447,8 +447,6 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
, BuildFileStream(nullptr)
, RulesFileStream(nullptr)
, CompileCommandsStream(nullptr)
- , Rules()
- , AllDependencies()
, UsingGCCOnWindows(false)
, ComputingUnknownDependencies(false)
, PolicyCMP0058(cmPolicies::WARN)
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index a2ad095..6199586 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -217,11 +217,8 @@ protected:
// Store per-target progress counters.
struct TargetProgress
{
- TargetProgress()
- : NumberOfActions(0)
- {
- }
- unsigned long NumberOfActions;
+ TargetProgress() {}
+ unsigned long NumberOfActions = 0;
std::string VariableFile;
std::vector<unsigned long> Marks;
void WriteProgressVariables(unsigned long total, unsigned long& current);
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 06eb8a6..538aa9f 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -17,9 +17,7 @@ const std::string cmInstallCommandArguments::EmptyString;
cmInstallCommandArguments::cmInstallCommandArguments(
const std::string& defaultComponent)
- : Parser()
- , ArgumentGroup()
- , Destination(&Parser, "DESTINATION", &ArgumentGroup)
+ : Destination(&Parser, "DESTINATION", &ArgumentGroup)
, Component(&Parser, "COMPONENT", &ArgumentGroup)
, NamelinkComponent(&Parser, "NAMELINK_COMPONENT", &ArgumentGroup)
, ExcludeFromAll(&Parser, "EXCLUDE_FROM_ALL", &ArgumentGroup)
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index 7d77b7c..b93debb 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -2,11 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallScriptGenerator.h"
-#include "cmScriptGenerator.h"
-
#include <ostream>
#include <vector>
+#include "cmGeneratorExpression.h"
+#include "cmLocalGenerator.h"
+#include "cmPolicies.h"
+#include "cmScriptGenerator.h"
+#include "cmake.h"
+
cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script,
bool code,
const char* component,
@@ -15,25 +19,71 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script,
MessageDefault, exclude_from_all)
, Script(script)
, Code(code)
+ , AllowGenex(false)
{
+ // We need per-config actions if the script has generator expressions.
+ if (cmGeneratorExpression::Find(Script) != std::string::npos) {
+ this->ActionsPerConfig = true;
+ }
}
cmInstallScriptGenerator::~cmInstallScriptGenerator()
{
}
-void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
+void cmInstallScriptGenerator::Compute(cmLocalGenerator* lg)
{
- Indent indent;
- std::string component_test =
- this->CreateComponentTest(this->Component.c_str(), this->ExcludeFromAll);
- os << indent << "if(" << component_test << ")\n";
+ this->LocalGenerator = lg;
+ if (this->ActionsPerConfig) {
+ switch (this->LocalGenerator->GetPolicyStatus(cmPolicies::CMP0087)) {
+ case cmPolicies::WARN:
+ this->LocalGenerator->IssueMessage(
+ cmake::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0087));
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ break;
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ this->AllowGenex = true;
+ break;
+ }
+ }
+}
+
+void cmInstallScriptGenerator::AddScriptInstallRule(std::ostream& os,
+ Indent indent,
+ std::string const& script)
+{
if (this->Code) {
- os << indent << this->Script << "\n";
+ os << indent << script << "\n";
} else {
- os << indent << "include(\"" << this->Script << "\")\n";
+ os << indent << "include(\"" << script << "\")\n";
}
+}
- os << indent << "endif()\n\n";
+void cmInstallScriptGenerator::GenerateScriptActions(std::ostream& os,
+ Indent indent)
+{
+ if (this->AllowGenex && this->ActionsPerConfig) {
+ this->cmInstallGenerator::GenerateScriptActions(os, indent);
+ } else {
+ this->AddScriptInstallRule(os, indent, this->Script);
+ }
+}
+
+void cmInstallScriptGenerator::GenerateScriptForConfig(
+ std::ostream& os, const std::string& config, Indent indent)
+{
+ if (this->AllowGenex) {
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(this->Script);
+ this->AddScriptInstallRule(os, indent,
+ cge->Evaluate(this->LocalGenerator, config));
+ } else {
+ this->AddScriptInstallRule(os, indent, this->Script);
+ }
}
diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h
index fe0f7c6..05199d7 100644
--- a/Source/cmInstallScriptGenerator.h
+++ b/Source/cmInstallScriptGenerator.h
@@ -6,10 +6,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
+#include "cmScriptGenerator.h"
#include <iosfwd>
#include <string>
+class cmLocalGenerator;
+
/** \class cmInstallScriptGenerator
* \brief Generate target installation rules.
*/
@@ -20,10 +23,19 @@ public:
const char* component, bool exclude_from_all);
~cmInstallScriptGenerator() override;
+ void Compute(cmLocalGenerator* lg) override;
+
protected:
- void GenerateScript(std::ostream& os) override;
+ void GenerateScriptActions(std::ostream& os, Indent indent) override;
+ void GenerateScriptForConfig(std::ostream& os, const std::string& config,
+ Indent indent) override;
+ void AddScriptInstallRule(std::ostream& os, Indent indent,
+ std::string const& script);
+
std::string Script;
bool Code;
+ cmLocalGenerator* LocalGenerator;
+ bool AllowGenex;
};
#endif
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index 0e06029..9f61e5b 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -10,7 +10,6 @@
#include <utility>
cmInstalledFile::cmInstalledFile()
- : NameExpression(nullptr)
{
}
diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h
index 47a4959..070b954 100644
--- a/Source/cmInstalledFile.h
+++ b/Source/cmInstalledFile.h
@@ -68,7 +68,7 @@ public:
private:
std::string Name;
- cmCompiledGeneratorExpression* NameExpression;
+ cmCompiledGeneratorExpression* NameExpression = nullptr;
PropertyMapType Properties;
};
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx
index 121731d..12a07f6 100644
--- a/Source/cmLinkItem.cxx
+++ b/Source/cmLinkItem.cxx
@@ -7,22 +7,18 @@
#include <utility> // IWYU pragma: keep
cmLinkItem::cmLinkItem()
- : String()
- , Target(nullptr)
{
}
cmLinkItem::cmLinkItem(std::string const& n, cmListFileBacktrace const& bt)
: String(n)
- , Target(nullptr)
, Backtrace(bt)
{
}
cmLinkItem::cmLinkItem(cmGeneratorTarget const* t,
cmListFileBacktrace const& bt)
- : String()
- , Target(t)
+ : Target(t)
, Backtrace(bt)
{
}
@@ -61,7 +57,6 @@ std::ostream& operator<<(std::ostream& os, cmLinkItem const& item)
cmLinkImplItem::cmLinkImplItem()
: cmLinkItem()
- , FromGenex(false)
{
}
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index e1ddd22..b841509 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -27,7 +27,7 @@ public:
cmLinkItem(std::string const& s, cmListFileBacktrace const& bt);
cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace const& bt);
std::string const& AsStr() const;
- cmGeneratorTarget const* Target;
+ cmGeneratorTarget const* Target = nullptr;
cmListFileBacktrace Backtrace;
friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
friend bool operator==(cmLinkItem const& l, cmLinkItem const& r);
@@ -39,7 +39,7 @@ class cmLinkImplItem : public cmLinkItem
public:
cmLinkImplItem();
cmLinkImplItem(cmLinkItem item, bool fromGenex);
- bool FromGenex;
+ bool FromGenex = false;
};
/** The link implementation specifies the direct library
@@ -70,36 +70,25 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries
// Number of repetitions of a strongly connected component of two
// or more static libraries.
- unsigned int Multiplicity;
+ unsigned int Multiplicity = 0;
// Libraries listed for other configurations.
// Needed only for OLD behavior of CMP0003.
std::vector<cmLinkItem> WrongConfigLibraries;
- bool ImplementationIsInterface;
+ bool ImplementationIsInterface = false;
- cmLinkInterface()
- : Multiplicity(0)
- , ImplementationIsInterface(false)
- {
- }
+ cmLinkInterface() {}
};
struct cmOptionalLinkInterface : public cmLinkInterface
{
- cmOptionalLinkInterface()
- : LibrariesDone(false)
- , AllDone(false)
- , Exists(false)
- , HadHeadSensitiveCondition(false)
- , ExplicitLibraries(nullptr)
- {
- }
- bool LibrariesDone;
- bool AllDone;
- bool Exists;
- bool HadHeadSensitiveCondition;
- const char* ExplicitLibraries;
+ cmOptionalLinkInterface() {}
+ bool LibrariesDone = false;
+ bool AllDone = false;
+ bool Exists = false;
+ bool HadHeadSensitiveCondition = false;
+ const char* ExplicitLibraries = nullptr;
};
struct cmHeadToLinkInterfaceMap
@@ -116,15 +105,10 @@ struct cmLinkImplementation : public cmLinkImplementationLibraries
// Cache link implementation computation from each configuration.
struct cmOptionalLinkImplementation : public cmLinkImplementation
{
- cmOptionalLinkImplementation()
- : LibrariesDone(false)
- , LanguagesDone(false)
- , HadHeadSensitiveCondition(false)
- {
- }
- bool LibrariesDone;
- bool LanguagesDone;
- bool HadHeadSensitiveCondition;
+ cmOptionalLinkImplementation() {}
+ bool LibrariesDone = false;
+ bool LanguagesDone = false;
+ bool HadHeadSensitiveCondition = false;
};
/** Compute the link type to use for the given configuration. */
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 9e4a833..4a247ba 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -33,11 +33,8 @@ struct cmCommandContext
cmCommandName(std::string const& name) { *this = name; }
cmCommandName& operator=(std::string const& name);
} Name;
- long Line;
- cmCommandContext()
- : Line(0)
- {
- }
+ long Line = 0;
+ cmCommandContext() {}
cmCommandContext(const char* name, int line)
: Name(name)
, Line(line)
@@ -53,12 +50,7 @@ struct cmListFileArgument
Quoted,
Bracket
};
- cmListFileArgument()
- : Value()
- , Delim(Unquoted)
- , Line(0)
- {
- }
+ cmListFileArgument() {}
cmListFileArgument(const std::string& v, Delimiter d, long line)
: Value(v)
, Delim(d)
@@ -71,8 +63,8 @@ struct cmListFileArgument
}
bool operator!=(const cmListFileArgument& r) const { return !(*this == r); }
std::string Value;
- Delimiter Delim;
- long Line;
+ Delimiter Delim = Unquoted;
+ long Line = 0;
};
class cmListFileContext
@@ -80,13 +72,8 @@ class cmListFileContext
public:
std::string Name;
std::string FilePath;
- long Line;
- cmListFileContext()
- : Name()
- , FilePath()
- , Line(0)
- {
- }
+ long Line = 0;
+ cmListFileContext() {}
static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
std::string const& fileName)
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 869ef1e..ee6b37b 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -264,13 +264,9 @@ private:
struct LocalObjectEntry
{
- cmGeneratorTarget* Target;
+ cmGeneratorTarget* Target = nullptr;
std::string Language;
- LocalObjectEntry()
- : Target(nullptr)
- , Language()
- {
- }
+ LocalObjectEntry() {}
LocalObjectEntry(cmGeneratorTarget* t, const std::string& lang)
: Target(t)
, Language(lang)
@@ -279,15 +275,10 @@ private:
};
struct LocalObjectInfo : public std::vector<LocalObjectEntry>
{
- bool HasSourceExtension;
- bool HasPreprocessRule;
- bool HasAssembleRule;
- LocalObjectInfo()
- : HasSourceExtension(false)
- , HasPreprocessRule(false)
- , HasAssembleRule(false)
- {
- }
+ bool HasSourceExtension = false;
+ bool HasPreprocessRule = false;
+ bool HasAssembleRule = false;
+ LocalObjectInfo() {}
};
void GetLocalObjectFiles(
std::map<std::string, LocalObjectInfo>& localObjectFiles);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5cd6ba5..d7c4f22 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2697,13 +2697,9 @@ typedef enum
} t_domain;
struct t_lookup
{
- t_lookup()
- : domain(NORMAL)
- , loc(0)
- {
- }
- t_domain domain;
- size_t loc;
+ t_lookup() {}
+ t_domain domain = NORMAL;
+ size_t loc = 0;
};
cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx
index 5500eba..12c18ee 100644
--- a/Source/cmNewLineStyle.cxx
+++ b/Source/cmNewLineStyle.cxx
@@ -5,7 +5,6 @@
#include <stddef.h>
cmNewLineStyle::cmNewLineStyle()
- : NewLineStyle(Invalid)
{
}
diff --git a/Source/cmNewLineStyle.h b/Source/cmNewLineStyle.h
index 397cd2c..f1a7bc6 100644
--- a/Source/cmNewLineStyle.h
+++ b/Source/cmNewLineStyle.h
@@ -33,7 +33,7 @@ public:
const std::string GetCharacters() const;
private:
- Style NewLineStyle;
+ Style NewLineStyle = Invalid;
};
#endif
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index c953d20..324afbf 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -37,13 +37,7 @@ class cmCustomCommand;
cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator(
cmGeneratorTarget* target)
: cmNinjaTargetGenerator(target)
- , TargetNameOut()
- , TargetNameSO()
- , TargetNameReal()
- , TargetNameImport()
- , TargetNamePDB()
, TargetLinkLanguage("")
- , DeviceLinkObject()
{
this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
if (target->GetType() == cmStateEnums::EXECUTABLE) {
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 7ac8d1b..228c9fb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -54,10 +54,8 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
: cmCommonTargetGenerator(target)
, MacOSXContentGenerator(nullptr)
, OSXBundleGenerator(nullptr)
- , MacContentFolders()
, LocalGenerator(
static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator()))
- , Objects()
{
MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
}
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 87c1ec0..ab1e699 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -28,11 +28,7 @@ public:
* Construct with dependency generation marked not done; instance
* not placed in cmMakefile's list.
*/
- cmDependInformation()
- : DependDone(false)
- , SourceFile(nullptr)
- {
- }
+ cmDependInformation() {}
/**
* The set of files on which this one depends.
@@ -44,13 +40,13 @@ public:
* This flag indicates whether dependency checking has been
* performed for this file.
*/
- bool DependDone;
+ bool DependDone = false;
/**
* If this object corresponds to a cmSourceFile instance, this points
* to it.
*/
- const cmSourceFile* SourceFile;
+ const cmSourceFile* SourceFile = nullptr;
/**
* Full path to this file.
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 7674877..206dd3d 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -254,7 +254,11 @@ class cmMakefile;
0, cmPolicies::WARN) \
SELECT(POLICY, CMP0086, \
"UseSWIG honors SWIG_MODULE_NAME via -module flag.", 3, 14, 0, \
- cmPolicies::WARN)
+ cmPolicies::WARN) \
+ SELECT(POLICY, CMP0087, \
+ "Install CODE|SCRIPT allow the use of generator " \
+ "expressions.", \
+ 3, 14, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx
index 7ab1fa3..facde5d 100644
--- a/Source/cmProcessTools.cxx
+++ b/Source/cmProcessTools.cxx
@@ -45,10 +45,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
}
cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR)
- : Log(nullptr)
- , Prefix(nullptr)
- , Separator(sep)
- , LineEnd('\0')
+ : Separator(sep)
, IgnoreCR(ignoreCR)
{
}
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index f1c2a22..da3693d 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -54,11 +54,11 @@ public:
void SetLog(std::ostream* log, const char* prefix);
protected:
- std::ostream* Log;
- const char* Prefix;
+ std::ostream* Log = nullptr;
+ const char* Prefix = nullptr;
std::string Line;
char Separator;
- char LineEnd;
+ char LineEnd = '\0';
bool IgnoreCR;
bool ProcessChunk(const char* data, int length) override;
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index d817848..5cef1b3 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -25,11 +25,7 @@ public:
class Qrc
{
public:
- Qrc()
- : Generated(false)
- , Unique(false)
- {
- }
+ Qrc() {}
public:
std::string LockFile;
@@ -40,8 +36,8 @@ public:
std::string SettingsFile;
std::map<std::string, std::string> ConfigSettingsFile;
std::string RccFile;
- bool Generated;
- bool Unique;
+ bool Generated = false;
+ bool Unique = false;
std::vector<std::string> Options;
std::vector<std::string> Resources;
};
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index 446ef9a..e6ee85b 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -1130,11 +1130,6 @@ void cmQtAutoGeneratorMocUic::WorkerT::UVProcessFinished()
cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
: Base_(&FileSys())
, Moc_(&FileSys())
- , Stage_(StageT::SETTINGS_READ)
- , JobsRemain_(0)
- , JobError_(false)
- , JobThreadsAbort_(false)
- , MocAutoFileUpdated_(false)
{
// Precompile regular expressions
Moc_.RegExpInclude.compile(
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index 2226954..edf597c 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -404,7 +404,7 @@ private:
MocSettingsT Moc_;
UicSettingsT Uic_;
// -- Progress
- StageT Stage_;
+ StageT Stage_ = StageT::SETTINGS_READ;
// -- Job queues
std::mutex JobsMutex_;
struct
@@ -416,15 +416,15 @@ private:
JobQueueT Uic;
} JobQueues_;
JobQueueT JobQueue_;
- std::size_t volatile JobsRemain_;
- bool volatile JobError_;
- bool volatile JobThreadsAbort_;
+ std::size_t volatile JobsRemain_ = 0;
+ bool volatile JobError_ = false;
+ bool volatile JobThreadsAbort_ = false;
std::condition_variable JobsConditionRead_;
// -- Moc meta
std::set<std::string> MocIncludedStrings_;
std::set<std::string> MocIncludedFiles_;
std::set<std::string> MocAutoFiles_;
- bool volatile MocAutoFileUpdated_;
+ bool volatile MocAutoFileUpdated_ = false;
// -- Settings file
std::string SettingsFile_;
std::string SettingsStringMoc_;
diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx
index 65c6741..29dc7a0 100644
--- a/Source/cmQtAutoGeneratorRcc.cxx
+++ b/Source/cmQtAutoGeneratorRcc.cxx
@@ -15,12 +15,6 @@
// -- Class methods
cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
- : MultiConfig_(false)
- , SettingsChanged_(false)
- , Stage_(StageT::SETTINGS_READ)
- , Error_(false)
- , Generate_(false)
- , BuildFileChanged_(false)
{
// Initialize libuv asynchronous iteration request
UVRequest().init(*UVLoop(), &cmQtAutoGeneratorRcc::UVPollStage, this);
diff --git a/Source/cmQtAutoGeneratorRcc.h b/Source/cmQtAutoGeneratorRcc.h
index 74cec36..1148071 100644
--- a/Source/cmQtAutoGeneratorRcc.h
+++ b/Source/cmQtAutoGeneratorRcc.h
@@ -70,7 +70,7 @@ private:
private:
// -- Config settings
- bool MultiConfig_;
+ bool MultiConfig_ = false;
// -- Directories
std::string AutogenBuildDir_;
std::string IncludeDir_;
@@ -95,12 +95,12 @@ private:
// -- Settings file
std::string SettingsFile_;
std::string SettingsString_;
- bool SettingsChanged_;
+ bool SettingsChanged_ = false;
// -- libuv loop
- StageT Stage_;
- bool Error_;
- bool Generate_;
- bool BuildFileChanged_;
+ StageT Stage_ = StageT::SETTINGS_READ;
+ bool Error_ = false;
+ bool Generate_ = false;
+ bool BuildFileChanged_ = false;
};
#endif
diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h
index c8fed19..0bb388e 100644
--- a/Source/cmScriptGenerator.h
+++ b/Source/cmScriptGenerator.h
@@ -12,10 +12,7 @@
class cmScriptGeneratorIndent
{
public:
- cmScriptGeneratorIndent()
- : Level(0)
- {
- }
+ cmScriptGeneratorIndent() {}
cmScriptGeneratorIndent(int level)
: Level(level)
{
@@ -32,7 +29,7 @@ public:
}
private:
- int Level;
+ int Level = 0;
};
inline std::ostream& operator<<(std::ostream& os,
cmScriptGeneratorIndent indent)
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 15433f9..90b9123 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -11,9 +11,6 @@
#include <assert.h>
cmSourceFileLocation::cmSourceFileLocation()
- : Makefile(nullptr)
- , AmbiguousDirectory(true)
- , AmbiguousExtension(true)
{
}
diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h
index 886a184..82747ba 100644
--- a/Source/cmSourceFileLocation.h
+++ b/Source/cmSourceFileLocation.h
@@ -83,9 +83,9 @@ public:
cmMakefile const* GetMakefile() const { return this->Makefile; }
private:
- cmMakefile const* const Makefile;
- bool AmbiguousDirectory;
- bool AmbiguousExtension;
+ cmMakefile const* const Makefile = nullptr;
+ bool AmbiguousDirectory = true;
+ bool AmbiguousExtension = true;
std::string Directory;
std::string Name;
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 4bbd2e0..f664000 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -22,14 +22,6 @@
#include "cmake.h"
cmState::cmState()
- : IsInTryCompile(false)
- , IsGeneratorMultiConfig(false)
- , WindowsShell(false)
- , WindowsVSIDE(false)
- , WatcomWMake(false)
- , MinGWMake(false)
- , NMake(false)
- , MSYSShell(false)
{
this->CacheManager = new cmCacheManager;
this->GlobVerificationManager = new cmGlobVerificationManager;
diff --git a/Source/cmState.h b/Source/cmState.h
index 916985d..abe93ed 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -202,14 +202,14 @@ private:
std::string SourceDirectory;
std::string BinaryDirectory;
- bool IsInTryCompile;
- bool IsGeneratorMultiConfig;
- bool WindowsShell;
- bool WindowsVSIDE;
- bool WatcomWMake;
- bool MinGWMake;
- bool NMake;
- bool MSYSShell;
+ bool IsInTryCompile = false;
+ bool IsGeneratorMultiConfig = false;
+ bool WindowsShell = false;
+ bool WindowsVSIDE = false;
+ bool WatcomWMake = false;
+ bool MinGWMake = false;
+ bool NMake = false;
+ bool MSYSShell = false;
};
#endif
diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h
index e76f2af..ec0ed6c 100644
--- a/Source/cmStatePrivate.h
+++ b/Source/cmStatePrivate.h
@@ -50,8 +50,7 @@ struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap
{
typedef cmPolicies::PolicyMap derived;
PolicyStackEntry(bool w = false)
- : derived()
- , Weak(w)
+ : Weak(w)
{
}
PolicyStackEntry(derived const& d, bool w)
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index a649f5e..a4305e6 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -28,7 +28,6 @@
cmStateSnapshot::cmStateSnapshot(cmState* state)
: State(state)
- , Position()
{
}
diff --git a/Source/cmString.hxx b/Source/cmString.hxx
index 1623a43..e5ece52 100644
--- a/Source/cmString.hxx
+++ b/Source/cmString.hxx
@@ -625,8 +625,7 @@ private:
// Internal constructor for view of statically allocated string.
String(string_view v, Private)
- : string_()
- , view_(v)
+ : view_(v)
{
}
diff --git a/Source/cmStringReplaceHelper.h b/Source/cmStringReplaceHelper.h
index 938325a..3e76d86 100644
--- a/Source/cmStringReplaceHelper.h
+++ b/Source/cmStringReplaceHelper.h
@@ -46,7 +46,6 @@ private:
}
RegexReplacement(int n)
: Number(n)
- , Value()
{
}
RegexReplacement() {}
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index 2937e0d..73ee334 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -3,7 +3,6 @@
#pragma once
#include "cmConfigure.h" // IWYU pragma: keep
-#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <memory>
@@ -11,12 +10,22 @@
#include "cm_uv.h"
-#define CM_PERFECT_FWD_CTOR(Class, FwdTo) \
- template <typename... Args> \
- Class(Args&&... args) \
- : FwdTo(std::forward<Args>(args)...) \
- { \
- }
+#if defined(__SUNPRO_CC)
+
+# include <utility>
+
+# define CM_INHERIT_CTOR(Class, Base, Tpl) \
+ template <typename... Args> \
+ Class(Args&&... args) \
+ : Base Tpl(std::forward<Args>(args)...) \
+ { \
+ }
+
+#else
+
+# define CM_INHERIT_CTOR(Class, Base, Tpl) using Base Tpl ::Base;
+
+#endif
namespace cm {
@@ -116,7 +125,7 @@ class uv_handle_ptr_ : public uv_handle_ptr_base_<T>
friend class uv_handle_ptr_;
public:
- CM_PERFECT_FWD_CTOR(uv_handle_ptr_, uv_handle_ptr_base_<T>);
+ CM_INHERIT_CTOR(uv_handle_ptr_, uv_handle_ptr_base_, <T>);
/***
* Allow less verbose calling of uv_<T> functions
@@ -133,13 +142,13 @@ template <>
class uv_handle_ptr_<uv_handle_t> : public uv_handle_ptr_base_<uv_handle_t>
{
public:
- CM_PERFECT_FWD_CTOR(uv_handle_ptr_, uv_handle_ptr_base_<uv_handle_t>);
+ CM_INHERIT_CTOR(uv_handle_ptr_, uv_handle_ptr_base_, <uv_handle_t>);
};
class uv_async_ptr : public uv_handle_ptr_<uv_async_t>
{
public:
- CM_PERFECT_FWD_CTOR(uv_async_ptr, uv_handle_ptr_<uv_async_t>);
+ CM_INHERIT_CTOR(uv_async_ptr, uv_handle_ptr_, <uv_async_t>);
int init(uv_loop_t& loop, uv_async_cb async_cb, void* data = nullptr);
@@ -148,7 +157,7 @@ public:
struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t>
{
- CM_PERFECT_FWD_CTOR(uv_signal_ptr, uv_handle_ptr_<uv_signal_t>);
+ CM_INHERIT_CTOR(uv_signal_ptr, uv_handle_ptr_, <uv_signal_t>);
int init(uv_loop_t& loop, void* data = nullptr);
@@ -159,7 +168,7 @@ struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t>
struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
{
- CM_PERFECT_FWD_CTOR(uv_pipe_ptr, uv_handle_ptr_<uv_pipe_t>);
+ CM_INHERIT_CTOR(uv_pipe_ptr, uv_handle_ptr_, <uv_pipe_t>);
operator uv_stream_t*() const;
@@ -168,7 +177,7 @@ struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
struct uv_process_ptr : public uv_handle_ptr_<uv_process_t>
{
- CM_PERFECT_FWD_CTOR(uv_process_ptr, uv_handle_ptr_<uv_process_t>);
+ CM_INHERIT_CTOR(uv_process_ptr, uv_handle_ptr_, <uv_process_t>);
int spawn(uv_loop_t& loop, uv_process_options_t const& options,
void* data = nullptr);
@@ -176,7 +185,7 @@ struct uv_process_ptr : public uv_handle_ptr_<uv_process_t>
struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
{
- CM_PERFECT_FWD_CTOR(uv_timer_ptr, uv_handle_ptr_<uv_timer_t>);
+ CM_INHERIT_CTOR(uv_timer_ptr, uv_handle_ptr_, <uv_timer_t>);
int init(uv_loop_t& loop, void* data = nullptr);
@@ -185,7 +194,7 @@ struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
struct uv_tty_ptr : public uv_handle_ptr_<uv_tty_t>
{
- CM_PERFECT_FWD_CTOR(uv_tty_ptr, uv_handle_ptr_<uv_tty_t>);
+ CM_INHERIT_CTOR(uv_tty_ptr, uv_handle_ptr_, <uv_tty_t>);
operator uv_stream_t*() const;
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index 27d1b12..2f444ed 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -63,15 +63,10 @@ public:
protected:
struct Pair
{
- WatchMethod Method;
- void* ClientData;
- DeleteData DeleteDataCall;
- Pair()
- : Method(nullptr)
- , ClientData(nullptr)
- , DeleteDataCall(nullptr)
- {
- }
+ WatchMethod Method = nullptr;
+ void* ClientData = nullptr;
+ DeleteData DeleteDataCall = nullptr;
+ Pair() {}
~Pair()
{
if (this->DeleteDataCall && this->ClientData) {
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 408c941..2a8d3e6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1417,6 +1417,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindJsonCpp)
endif()
+ if(CMake_TEST_FindLibLZMA)
+ add_subdirectory(FindLibLZMA)
+ endif()
+
if(CMake_TEST_FindLibRHash)
add_subdirectory(FindLibRHash)
endif()
diff --git a/Tests/FindLibLZMA/CMakeLists.txt b/Tests/FindLibLZMA/CMakeLists.txt
new file mode 100644
index 0000000..6dff0ef
--- /dev/null
+++ b/Tests/FindLibLZMA/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLibLZMA.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindLibLZMA/Test"
+ "${CMake_BINARY_DIR}/Tests/FindLibLZMA/Test"
+ ${build_generator_args}
+ --build-project TestFindLibLZMA
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindLibLZMA/Test/CMakeLists.txt b/Tests/FindLibLZMA/Test/CMakeLists.txt
new file mode 100644
index 0000000..c59dcdb
--- /dev/null
+++ b/Tests/FindLibLZMA/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindLZMA C)
+include(CTest)
+
+find_package(LibLZMA REQUIRED)
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt LibLZMA::LibLZMA)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${LIBLZMA_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${LIBLZMA_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindLibLZMA/Test/main.c b/Tests/FindLibLZMA/Test/main.c
new file mode 100644
index 0000000..06e8065
--- /dev/null
+++ b/Tests/FindLibLZMA/Test/main.c
@@ -0,0 +1,15 @@
+#include <assert.h>
+#include <lzma.h>
+#include <string.h>
+
+static const uint8_t test_string[9] = "123456789";
+
+int main()
+{
+ static const uint32_t test_vector = 0xCBF43926;
+
+ uint32_t crc = lzma_crc32(test_string, sizeof(test_string), 0);
+ assert(crc == test_vector);
+
+ return 0;
+}
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt
new file mode 100644
index 0000000..c20fd86
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt
@@ -0,0 +1 @@
+^[^0]
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt
new file mode 100644
index 0000000..87e5384
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt
@@ -0,0 +1,8 @@
+( )?-- stdout output is:
+( )?This is some dummy output with some long lines to ensure formatting is preserved
+( )? Including lines with leading spaces
+( )?
+( )?And also blank lines[
+ ]+
+( )?-- stderr output is:
+( )?cmake -E env: no command given
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake
new file mode 100644
index 0000000..863bbef
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake
@@ -0,0 +1,20 @@
+include(ExternalProject)
+
+set(dummyOutput [[
+This is some dummy output with some long lines to ensure formatting is preserved
+ Including lines with leading spaces
+
+And also blank lines
+]])
+
+ExternalProject_Add(FailsWithOutput
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput}
+ COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail
+ TEST_COMMAND ""
+ INSTALL_COMMAND ""
+ LOG_BUILD YES
+ LOG_OUTPUT_ON_FAILURE YES
+ USES_TERMINAL_BUILD YES
+)
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt
new file mode 100644
index 0000000..c20fd86
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt
@@ -0,0 +1 @@
+^[^0]
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt
new file mode 100644
index 0000000..11c7317
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt
@@ -0,0 +1,7 @@
+( )?-- Log output is:
+( )?This is some dummy output with some long lines to ensure formatting is preserved
+( )? Including lines with leading spaces
+( )?
+( )?And also blank lines[
+ ]+
+( )?cmake -E env: no command given
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake
new file mode 100644
index 0000000..116448b
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake
@@ -0,0 +1,21 @@
+include(ExternalProject)
+
+set(dummyOutput [[
+This is some dummy output with some long lines to ensure formatting is preserved
+ Including lines with leading spaces
+
+And also blank lines
+]])
+
+ExternalProject_Add(FailsWithOutput
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput}
+ COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail
+ TEST_COMMAND ""
+ INSTALL_COMMAND ""
+ LOG_BUILD YES
+ LOG_OUTPUT_ON_FAILURE YES
+ LOG_MERGED_STDOUTERR YES
+ USES_TERMINAL_BUILD YES
+)
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
index bf11381..caaf0d2 100644
--- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -29,6 +29,13 @@ endfunction()
__ep_test_with_build(MultiCommand)
+# Output is not predictable enough to be able to verify it reliably
+# when using the various different Visual Studio generators
+if(NOT RunCMake_GENERATOR MATCHES "Visual Studio")
+ __ep_test_with_build(LogOutputOnFailure)
+ __ep_test_with_build(LogOutputOnFailureMerged)
+endif()
+
# We can't test the substitution when using the old MSYS due to
# make/sh mangling the paths (substitution is performed correctly,
# but the mangling means we can't reliably test the output).
diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst
index 08b51d9..d8b43fe 100644
--- a/Tests/RunCMake/README.rst
+++ b/Tests/RunCMake/README.rst
@@ -65,3 +65,14 @@ but do not actually build anything. To add a test:
Top of test binary tree
and an failure must store a message in ``RunCMake_TEST_FAILED``.
+
+To speed up local testing, you can choose to run only a subset of
+``run_cmake()`` tests in a ``RunCMakeTest.cmake`` script by using the
+``RunCMake_TEST_FILTER`` environment variable. If this variable is set,
+it is treated as a regular expression, and any tests whose names don't
+match the regular expression are not run. For example::
+
+ $ RunCMake_TEST_FILTER="^example" ctest -R '^RunCMake\.Example$'
+
+This will only run subtests in ``RunCMake.Example`` that start with
+``example``.
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 4bacd96..ce71677 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -9,6 +9,10 @@ foreach(arg
endforeach()
function(run_cmake test)
+ if(DEFINED ENV{RunCMake_TEST_FILTER} AND NOT test MATCHES "$ENV{RunCMake_TEST_FILTER}")
+ return()
+ endif()
+
set(top_src "${RunCMake_SOURCE_DIR}")
set(top_bin "${RunCMake_BINARY_DIR}")
if(EXISTS ${top_src}/${test}-result.txt)
diff --git a/Tests/RunCMake/install/CMP0087-NEW-check.cmake b/Tests/RunCMake/install/CMP0087-NEW-check.cmake
new file mode 100644
index 0000000..422c532
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-NEW-check.cmake
@@ -0,0 +1,7 @@
+execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
+ OUTPUT_VARIABLE out ERROR_VARIABLE err)
+if(NOT out MATCHES "-- Install configuration: .*-- codegenexlib")
+ string(REGEX REPLACE "\n" "\n " out " ${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "\"-- codegenexlib\" was not found:\n${out}")
+endif()
diff --git a/Tests/RunCMake/install/CMP0087-NEW.cmake b/Tests/RunCMake/install/CMP0087-NEW.cmake
new file mode 100644
index 0000000..0177960
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-NEW.cmake
@@ -0,0 +1,3 @@
+# Need a new directory scope, not just a new policy scope
+# to test this correctly
+add_subdirectory(CMP0087-NEW)
diff --git a/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt
new file mode 100644
index 0000000..07b4589
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Note that it is the policy settings at the end of the directory
+# scope that will be used when deciding whether or not generator
+# expressions should be evaluated in the installed code.
+cmake_policy(VERSION 3.13)
+cmake_policy(SET CMP0087 NEW)
+add_library( codegenexlib INTERFACE )
+install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")")
diff --git a/Tests/RunCMake/install/CMP0087-OLD-check.cmake b/Tests/RunCMake/install/CMP0087-OLD-check.cmake
new file mode 100644
index 0000000..c5984bc
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-OLD-check.cmake
@@ -0,0 +1,8 @@
+execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
+ OUTPUT_VARIABLE out ERROR_VARIABLE err)
+
+if(NOT out MATCHES "-- Install configuration: .*-- \\$<TARGET_PROPERTY:codegenexlib,NAME>")
+ string(REGEX REPLACE "\n" "\n " out " ${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "\"-- $<TARGET_PROPERTY:codegenexlib,NAME>\" was not found:\n${out}")
+endif()
diff --git a/Tests/RunCMake/install/CMP0087-OLD.cmake b/Tests/RunCMake/install/CMP0087-OLD.cmake
new file mode 100644
index 0000000..e7ed4ee
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-OLD.cmake
@@ -0,0 +1,3 @@
+# Need a new directory scope, not just a new policy scope
+# to test this correctly
+add_subdirectory(CMP0087-OLD)
diff --git a/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt
new file mode 100644
index 0000000..b1d4e2e
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Note that it is the policy settings at the end of the directory
+# scope that will be used when deciding whether or not generator
+# expressions should be evaluated in the installed code.
+cmake_policy(VERSION 3.13)
+cmake_policy(SET CMP0087 OLD)
+install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")")
diff --git a/Tests/RunCMake/install/CMP0087-WARN-stderr.txt b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt
new file mode 100644
index 0000000..75fbf2c
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning (dev) in CMakeLists.txt:
+ Policy CMP0087 is not set: Install CODE|SCRIPT allow the use of generator
+ expressions. Run "cmake --help-policy CMP0087" for policy details. Use
+ the cmake_policy command to set the policy and suppress this warning.
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/install/CMP0087-WARN.cmake b/Tests/RunCMake/install/CMP0087-WARN.cmake
new file mode 100644
index 0000000..3b8513d
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-WARN.cmake
@@ -0,0 +1,2 @@
+add_library( codegenexlib INTERFACE )
+install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")")
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index f7e1dee..28e8ec4 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -63,6 +63,9 @@ run_cmake(EXPORT-OldIFace)
run_cmake(CMP0062-OLD)
run_cmake(CMP0062-NEW)
run_cmake(CMP0062-WARN)
+run_cmake(CMP0087-OLD)
+run_cmake(CMP0087-NEW)
+run_cmake(CMP0087-WARN)
run_cmake(TARGETS-NAMELINK_COMPONENT-bad-all)
run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc)
run_cmake(FILES-DESTINATION-TYPE)
diff --git a/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake b/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake
index 6fc735c..57ad6e1 100644
--- a/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake
+++ b/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake
@@ -21,8 +21,8 @@ elseif(CYGWIN)
[[lib4]]
[[lib4/cyglib4\.dll]]
[[mybin]]
- [[mybin/exe\.exe]]
[[mybin/cyglib1\.dll]]
+ [[mybin/exe\.exe]]
[[myinclude]]
[[myinclude/obj4\.h]]
[[myinclude/obj5\.h]]
diff --git a/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
index 59209e6..c41cb2a 100644
--- a/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
+++ b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
@@ -17,8 +17,8 @@ if(WIN32)
elseif(CYGWIN)
set(_check_files
[[bin]]
- [[bin/exe\.exe]]
[[bin/cyglib1\.dll]]
+ [[bin/exe\.exe]]
[[include]]
[[include/obj4\.h]]
[[include/obj5\.h]]