From kwrobot at kitware.com Mon Jul 1 00:02:58 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 1 Jul 2019 00:02:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-167-g477a1ae Message-ID: <20190701040258.47A031890C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 477a1ae478633a74c4dfe431a0c1e6b51194013b (commit) from dae77e069e924c3b85565d602df0419c66a4a586 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=477a1ae478633a74c4dfe431a0c1e6b51194013b commit 477a1ae478633a74c4dfe431a0c1e6b51194013b Author: Kitware Robot AuthorDate: Mon Jul 1 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jul 1 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6de850d..cad28dd 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 15) -set(CMake_VERSION_PATCH 20190630) +set(CMake_VERSION_PATCH 20190701) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 1 07:43:01 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 1 Jul 2019 07:43:01 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-169-g56f5310 Message-ID: <20190701114301.88003113AA2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 56f5310112705c00e0e1ae876cfde633c04bd740 (commit) via 822abf1265eacdffee37d3ed55e41425b6602e27 (commit) from 477a1ae478633a74c4dfe431a0c1e6b51194013b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56f5310112705c00e0e1ae876cfde633c04bd740 commit 56f5310112705c00e0e1ae876cfde633c04bd740 Merge: 477a1ae 822abf1 Author: Craig Scott AuthorDate: Mon Jul 1 11:41:24 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 1 07:42:04 2019 -0400 Merge topic 'bug/19436' 822abf1265 list(POP_FRONT): Fix always assigning first item to output vars Acked-by: Kitware Robot Merge-request: !3497 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=822abf1265eacdffee37d3ed55e41425b6602e27 commit 822abf1265eacdffee37d3ed55e41425b6602e27 Author: Alex Turbov AuthorDate: Sun Jun 30 12:23:35 2019 +0300 Commit: Alex Turbov CommitDate: Sun Jun 30 13:15:29 2019 +0300 list(POP_FRONT): Fix always assigning first item to output vars Fixes: #19436 diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 5474afa..1b01ea2 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -344,7 +344,7 @@ bool cmListCommand::HandlePopFrontCommand(std::vector const& args) auto vi = varArgsExpanded.begin(); for (; vi != varArgsExpanded.end() && ai != args.cend(); ++ai, ++vi) { assert(!ai->empty()); - this->Makefile->AddDefinition(*ai, varArgsExpanded.front().c_str()); + this->Makefile->AddDefinition(*ai, vi->c_str()); } varArgsExpanded.erase(varArgsExpanded.begin(), vi); // Undefine the rest variables if the list gets empty earlier... diff --git a/Tests/RunCMake/list/POP_FRONT.cmake b/Tests/RunCMake/list/POP_FRONT.cmake index a2f8f3c..70f757a 100644 --- a/Tests/RunCMake/list/POP_FRONT.cmake +++ b/Tests/RunCMake/list/POP_FRONT.cmake @@ -77,3 +77,16 @@ endif() if(NOT test STREQUAL "two") message(FATAL_ERROR "`test` has unexpected value `${test}`") endif() + +# BUG 19436 +set(myList a b c) +list(POP_FRONT myList first second) +if(NOT first STREQUAL "a") + message(FATAL_ERROR "BUG#19436: `first` has unexpected value `${first}`") +endif() +if(NOT second STREQUAL "b") + message(FATAL_ERROR "BUG#19436: `second` has unexpected value `${second}`") +endif() +if(NOT myList STREQUAL "c") + message(FATAL_ERROR "BUG#19436: `myList` has unexpected value `${myList}`") +endif() ----------------------------------------------------------------------- Summary of changes: Source/cmListCommand.cxx | 2 +- Tests/RunCMake/list/POP_FRONT.cmake | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 1 07:52:57 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 1 Jul 2019 07:52:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-172-g7ea18c0 Message-ID: <20190701115257.E0AFC127936@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7ea18c02c388d43e09e806de16168e7090e7384d (commit) via 42294f43bd95f1380c07a563acf3021ddd00b995 (commit) via 9e0775cb6a4c08d2605894e9f8d09b8508cfd90d (commit) from 56f5310112705c00e0e1ae876cfde633c04bd740 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ea18c02c388d43e09e806de16168e7090e7384d commit 7ea18c02c388d43e09e806de16168e7090e7384d Merge: 56f5310 42294f4 Author: Craig Scott AuthorDate: Mon Jul 1 11:42:31 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 1 07:43:08 2019 -0400 Merge topic 'docs-project-code-injection' 42294f43bd Help: move code injection vars to their own section 9e0775cb6a Help: Remove self-references from project() docs Acked-by: Kitware Robot Merge-request: !3494 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42294f43bd95f1380c07a563acf3021ddd00b995 commit 42294f43bd95f1380c07a563acf3021ddd00b995 Author: Craig Scott AuthorDate: Sat Jun 29 22:14:57 2019 +1000 Commit: Craig Scott CommitDate: Mon Jul 1 08:01:49 2019 +1000 Help: move code injection vars to their own section The docs for CMAKE_PROJECT__INCLUDE and CMAKE_PROJECT_INCLUDE did not define the order of inclusion if both were set. diff --git a/Help/command/project.rst b/Help/command/project.rst index 19a8999..baf18be 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -31,14 +31,6 @@ Further variables are set by the optional arguments described in the following. If any of these arguments is not used, then the corresponding variables are set to the empty string. -If the variable :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` exists, the file -pointed to by that variable will be included as the first step of the project -command. - -If the variable :variable:`CMAKE_PROJECT__INCLUDE` -or :variable:`CMAKE_PROJECT_INCLUDE` exists, the file pointed to by that -variable will be included as the last step of the project command. - Options ^^^^^^^ @@ -106,6 +98,19 @@ The options are: The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL`` options are intended for use as default values in package metadata and documentation. +Code Injection +^^^^^^^^^^^^^^ + +If the :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variable is set, the file +pointed to by that variable will be included as the first step of the +``project()`` command. + +If the :variable:`CMAKE_PROJECT_INCLUDE` or +:variable:`CMAKE_PROJECT__INCLUDE` variables are set, the files +they point to will be included as the last step of the ``project()`` command. +If both are set, then :variable:`CMAKE_PROJECT_INCLUDE` will be included before +:variable:`CMAKE_PROJECT__INCLUDE`. + Usage ^^^^^ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e0775cb6a4c08d2605894e9f8d09b8508cfd90d commit 9e0775cb6a4c08d2605894e9f8d09b8508cfd90d Author: Craig Scott AuthorDate: Sat Jun 29 22:20:54 2019 +1000 Commit: Craig Scott CommitDate: Sat Jun 29 22:21:18 2019 +1000 Help: Remove self-references from project() docs diff --git a/Help/command/project.rst b/Help/command/project.rst index 41e1112..19a8999 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -63,7 +63,7 @@ The options are: * :variable:`PROJECT_VERSION_TWEAK`, :variable:`_VERSION_TWEAK`. - When the :command:`project()` command is called from the top-level ``CMakeLists.txt``, + When the ``project()`` command is called from the top-level ``CMakeLists.txt``, then the version is also stored in the variable :variable:`CMAKE_PROJECT_VERSION`. ``DESCRIPTION `` @@ -76,7 +76,7 @@ The options are: It is recommended that this description is a relatively short string, usually no more than a few words. - When the :command:`project()` command is called from the top-level ``CMakeLists.txt``, + When the ``project()`` command is called from the top-level ``CMakeLists.txt``, then the description is also stored in the variable :variable:`CMAKE_PROJECT_DESCRIPTION`. ``HOMEPAGE_URL `` @@ -87,7 +87,7 @@ The options are: to ````, which should be the canonical home URL for the project. - When the :command:`project()` command is called from the top-level ``CMakeLists.txt``, + When the ``project()`` command is called from the top-level ``CMakeLists.txt``, then the URL also is stored in the variable :variable:`CMAKE_PROJECT_HOMEPAGE_URL`. ``LANGUAGES ...`` @@ -110,14 +110,14 @@ Usage ^^^^^ The top-level ``CMakeLists.txt`` file for a project must contain a -literal, direct call to the :command:`project` command; loading one +literal, direct call to the ``project()`` command; loading one through the :command:`include` command is not sufficient. If no such call exists, CMake will issue a warning and pretend there is a ``project(Project)`` at the top to enable the default languages (``C`` and ``CXX``). .. note:: - Call the :command:`project()` command near the top of the top-level + Call the ``project()`` command near the top of the top-level ``CMakeLists.txt``, but *after* calling :command:`cmake_minimum_required`. It is important to establish version and policy settings before invoking other commands whose behavior they may affect. ----------------------------------------------------------------------- Summary of changes: Help/command/project.rst | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 1 08:02:57 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 1 Jul 2019 08:02:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-176-g1892bf2 Message-ID: <20190701120258.2A7AE1279B1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1892bf2d65062ce45092990b8226bd8cd36752fa (commit) via 3936e78bfe99329c69d833d2bee286a5c93d35a9 (commit) via 419a5144b17d2d488cacd2732b872036bc8f2017 (commit) via 32dae26975cab1f70f3bdf7078274615f3aa4040 (commit) from 7ea18c02c388d43e09e806de16168e7090e7384d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1892bf2d65062ce45092990b8226bd8cd36752fa commit 1892bf2d65062ce45092990b8226bd8cd36752fa Merge: 419a514 3936e78 Author: Craig Scott AuthorDate: Mon Jul 1 21:56:20 2019 +1000 Commit: Craig Scott CommitDate: Mon Jul 1 21:56:20 2019 +1000 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=419a5144b17d2d488cacd2732b872036bc8f2017 commit 419a5144b17d2d488cacd2732b872036bc8f2017 Merge: 7ea18c0 32dae26 Author: Craig Scott AuthorDate: Mon Jul 1 21:51:27 2019 +1000 Commit: Craig Scott CommitDate: Mon Jul 1 21:51:27 2019 +1000 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 1 08:02:58 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 1 Jul 2019 08:02:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-5-g3936e78 Message-ID: <20190701120258.7C48B1279AD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 3936e78bfe99329c69d833d2bee286a5c93d35a9 (commit) via 32dae26975cab1f70f3bdf7078274615f3aa4040 (commit) via 42294f43bd95f1380c07a563acf3021ddd00b995 (commit) via 822abf1265eacdffee37d3ed55e41425b6602e27 (commit) via 9e0775cb6a4c08d2605894e9f8d09b8508cfd90d (commit) from 753373579e3dd8cf19f0fc18f4d9bec43a2d82e8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/command/project.rst | 31 ++++++++++++++++++------------- Source/cmListCommand.cxx | 2 +- Tests/RunCMake/list/POP_FRONT.cmake | 13 +++++++++++++ 3 files changed, 32 insertions(+), 14 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 1 09:52:58 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 1 Jul 2019 09:52:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-178-gdd433c9 Message-ID: <20190701135258.DC918103367@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4 (commit) via 11e0009b7721262a0eb772fe45abb38ef19bf7b4 (commit) from 1892bf2d65062ce45092990b8226bd8cd36752fa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4 commit dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4 Merge: 1892bf2 11e0009 Author: Brad King AuthorDate: Mon Jul 1 13:52:32 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 1 09:52:44 2019 -0400 Merge topic 'FindMatlab-EXCLUDE_FROM_ALL' 11e0009b77 FindMatlab: EXCLUDE_FROM_ALL parameter to matlab_add_mex Acked-by: Kitware Robot Merge-request: !3474 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11e0009b7721262a0eb772fe45abb38ef19bf7b4 commit 11e0009b7721262a0eb772fe45abb38ef19bf7b4 Author: Raffi Enficiaud AuthorDate: Mon Jun 24 20:48:11 2019 +0200 Commit: Raffi Enficiaud CommitDate: Wed Jun 26 19:53:02 2019 +0200 FindMatlab: EXCLUDE_FROM_ALL parameter to matlab_add_mex Enabling a mex target to be excluded from the `all` target. diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 5138f2a..03f1500 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -889,6 +889,7 @@ endfunction() [DOCUMENTATION file.txt] [LINK_TO target1 target2 ...] [R2017b | R2018a] + [EXCLUDE_FROM_ALL] [...] ) @@ -918,6 +919,10 @@ endfunction() ``MODULE`` or ``SHARED`` may be given to specify the type of library to be created. ``EXECUTABLE`` may be given to create an executable instead of a library. If no type is given explicitly, the type is ``SHARED``. + ``EXCLUDE_FROM_ALL`` + This option has the same meaning as for :prop_tgt:`EXCLUDE_FROM_ALL` and + is forwarded to :command:`add_library` or :command:`add_executable` + commands. The documentation file is not processed and should be in the following format: @@ -944,7 +949,7 @@ function(matlab_add_mex) endif() - set(options EXECUTABLE MODULE SHARED R2017b R2018a) + set(options EXECUTABLE MODULE SHARED R2017b R2018a EXCLUDE_FROM_ALL) set(oneValueArgs NAME DOCUMENTATION OUTPUT_NAME) set(multiValueArgs LINK_TO SRC) @@ -974,8 +979,14 @@ function(matlab_add_mex) endif() endif() + set(_option_EXCLUDE_FROM_ALL) + if(${prefix}_EXCLUDE_FROM_ALL) + set(_option_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL") + endif() + if(${prefix}_EXECUTABLE) add_executable(${${prefix}_NAME} + ${_option_EXCLUDE_FROM_ALL} ${${prefix}_SRC} ${MEX_VERSION_FILE} ${${prefix}_DOCUMENTATION} @@ -989,6 +1000,7 @@ function(matlab_add_mex) add_library(${${prefix}_NAME} ${type} + ${_option_EXCLUDE_FROM_ALL} ${${prefix}_SRC} ${MEX_VERSION_FILE} ${${prefix}_DOCUMENTATION} diff --git a/Tests/FindMatlab/basic_checks/CMakeLists.txt b/Tests/FindMatlab/basic_checks/CMakeLists.txt index c5be1ea..c0c752a 100644 --- a/Tests/FindMatlab/basic_checks/CMakeLists.txt +++ b/Tests/FindMatlab/basic_checks/CMakeLists.txt @@ -71,3 +71,15 @@ if(RUN_UNIT_TESTS) ) set_tests_properties(${PROJECT_NAME}_matlabtest-4 PROPERTIES WILL_FAIL TRUE) endif() + + +# checking correct flags passed +# EXCLUDE_FROM_ALL appears after a multiargs (like SRC) +matlab_add_mex( + # target name + NAME cmake_matlab_test_exclude_from_all + # output name + OUTPUT_NAME cmake_matlab_mex_dummy + SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper_failure.cpp + EXCLUDE_FROM_ALL + ) diff --git a/Tests/FindMatlab/matlab_wrapper_failure.cpp b/Tests/FindMatlab/matlab_wrapper_failure.cpp new file mode 100644 index 0000000..3fe437b --- /dev/null +++ b/Tests/FindMatlab/matlab_wrapper_failure.cpp @@ -0,0 +1,13 @@ +// This should not link, as the mex function is missing. +// This is mostly for checking we are passing the right arguments to the +// add_library + +#include + +#include "mex.h" + +void mexFunctionXX(const int nlhs, mxArray* plhs[], const int nrhs, + const mxArray* prhs[]) +{ + mexErrMsgTxt("Should not be running"); +} ----------------------------------------------------------------------- Summary of changes: Modules/FindMatlab.cmake | 14 +++++++++++++- Tests/FindMatlab/basic_checks/CMakeLists.txt | 12 ++++++++++++ Tests/FindMatlab/matlab_wrapper_failure.cpp | 13 +++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Tests/FindMatlab/matlab_wrapper_failure.cpp hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 1 10:02:56 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 1 Jul 2019 10:02:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-182-gfccc59c Message-ID: <20190701140256.9F1EF10B099@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via fccc59c38c0bf56c21922fb1a79f0f3f653b2a1a (commit) via ecee33c3ae2396a46e7576277a3db3872d28dda1 (commit) via d2f20ab217c3e21bb573a3d4b1f90b1248f5b8b3 (commit) via 96b10e47bef6b78f64172d39b40b0a9e27b4cfdf (commit) from dd433c98e4297cc4b7bfeaa510f4c2cc84ea9da4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fccc59c38c0bf56c21922fb1a79f0f3f653b2a1a commit fccc59c38c0bf56c21922fb1a79f0f3f653b2a1a Merge: ecee33c 96b10e4 Author: Brad King AuthorDate: Mon Jul 1 13:59:41 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 1 09:59:51 2019 -0400 Merge topic 'remove_unneeded_variables_from_cmFindPackageCommand' 96b10e47be Remove unused variables from cmFindPackageCommand Acked-by: Kitware Robot Merge-request: !3488 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecee33c3ae2396a46e7576277a3db3872d28dda1 commit ecee33c3ae2396a46e7576277a3db3872d28dda1 Merge: dd433c9 d2f20ab Author: Brad King AuthorDate: Mon Jul 1 13:52:50 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 1 09:54:19 2019 -0400 Merge topic 'override-rules-RC' d2f20ab217 RC: Honor CMAKE_USER_MAKE_RULES_OVERRIDE Acked-by: Kitware Robot Merge-request: !3489 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2f20ab217c3e21bb573a3d4b1f90b1248f5b8b3 commit d2f20ab217c3e21bb573a3d4b1f90b1248f5b8b3 Author: Brad King AuthorDate: Thu Jun 27 07:39:24 2019 -0400 Commit: Brad King CommitDate: Thu Jun 27 07:39:24 2019 -0400 RC: Honor CMAKE_USER_MAKE_RULES_OVERRIDE Since the refactoring in commit 48f7e2d300 (Unhardcode the CMAKE_CONFIGURATION_TYPES values, 2017-11-27, v3.11.0-rc1~130^2~1), `CMAKE_BUILD_TYPE` is initialized while enabling the RC language. Therefore we need to honor `CMAKE_USER_MAKE_RULES_OVERRIDE` as part of enabling RC so that a `CMAKE_BUILD_TYPE_INIT` setting in the override file is honored. Fixes: #19401 diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake index 7bf6567..7c3a5ab 100644 --- a/Modules/CMakeRCInformation.cmake +++ b/Modules/CMakeRCInformation.cmake @@ -17,6 +17,17 @@ set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) +# This should be included before the _INIT variables are +# used to initialize the cache. Since the rule variables +# have if blocks on them, users can still define them here. +# But, it should still be after the platform file so changes can +# be made to those values. +if(CMAKE_USER_MAKE_RULES_OVERRIDE) + # Save the full path of the file so try_compile can use it. + include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override) + set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}") +endif() + set(CMAKE_RC_FLAGS_INIT "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}") cmake_initialize_per_config_variable(CMAKE_RC_FLAGS "Flags for Windows Resource Compiler") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96b10e47bef6b78f64172d39b40b0a9e27b4cfdf commit 96b10e47bef6b78f64172d39b40b0a9e27b4cfdf Author: Robert Maynard AuthorDate: Wed Jun 26 16:06:21 2019 -0400 Commit: Robert Maynard CommitDate: Wed Jun 26 16:06:21 2019 -0400 Remove unused variables from cmFindPackageCommand diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 828488f..557069b 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -732,12 +732,6 @@ bool cmFindPackageCommand::HandlePackageMode( { this->ConsideredConfigs.clear(); - // Support old capitalization behavior. - std::string upperDir = cmSystemTools::UpperCase(this->Name); - std::string upperFound = cmSystemTools::UpperCase(this->Name); - upperDir += "_DIR"; - upperFound += "_FOUND"; - // Try to find the config file. const char* def = this->Makefile->GetDefinition(this->Variable); ----------------------------------------------------------------------- Summary of changes: Modules/CMakeRCInformation.cmake | 11 +++++++++++ Source/cmFindPackageCommand.cxx | 6 ------ 2 files changed, 11 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 2 00:02:59 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 2 Jul 2019 00:02:59 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-183-g9fad9b5 Message-ID: <20190702040259.2C34711200E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9fad9b56f8b0e8d2714bc867eb0f67facbf5f3c7 (commit) from fccc59c38c0bf56c21922fb1a79f0f3f653b2a1a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fad9b56f8b0e8d2714bc867eb0f67facbf5f3c7 commit 9fad9b56f8b0e8d2714bc867eb0f67facbf5f3c7 Author: Kitware Robot AuthorDate: Tue Jul 2 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Tue Jul 2 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index cad28dd..8f7aea8 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 15) -set(CMake_VERSION_PATCH 20190701) +set(CMake_VERSION_PATCH 20190702) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 2 04:42:57 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 2 Jul 2019 04:42:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-185-g554c2ed Message-ID: <20190702084257.B1DBC1034D3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 554c2ed743f4134df5552d4702c6b1e1dee97079 (commit) via 5affe415a3ca6852c1c43bc439129db56b63649f (commit) from 9fad9b56f8b0e8d2714bc867eb0f67facbf5f3c7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=554c2ed743f4134df5552d4702c6b1e1dee97079 commit 554c2ed743f4134df5552d4702c6b1e1dee97079 Merge: 9fad9b5 5affe41 Author: Marc Chevrier AuthorDate: Tue Jul 2 08:39:06 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 04:39:19 2019 -0400 Merge topic 'FindMPI-AddSuffixes' 5affe415a3 FindMPI: Add MPI_EXECUTABLE_SUFFIX to every item in lists Acked-by: Kitware Robot Merge-request: !3496 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5affe415a3ca6852c1c43bc439129db56b63649f commit 5affe415a3ca6852c1c43bc439129db56b63649f Author: Brian Carlson AuthorDate: Fri Jun 28 16:11:51 2019 -0400 Commit: Brian Carlson CommitDate: Sat Jun 29 13:35:01 2019 -0400 FindMPI: Add MPI_EXECUTABLE_SUFFIX to every item in lists Add the `${MPI_EXECUTABLE_SUFFIX}` to each of the items in the `_MPI_${id}_${LANG}_COMPILER_NAMES` and `_MPI_${LANG}_GENERIC_COMPILER_NAMES` rather than just adding the suffix to the last item in each list. diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index fc9810c..2ff6afe 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -310,11 +310,15 @@ foreach (LANG IN ITEMS C CXX Fortran) set(_MPI_${LANG}_COMPILER_NAMES "") foreach (id IN ITEMS GNU Intel MSVC PGI XL) if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) + foreach(_COMPILER_NAME IN LISTS _MPI_${id}_${LANG}_COMPILER_NAMES) + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_COMPILER_NAME}${MPI_EXECUTABLE_SUFFIX}) + endforeach() endif() unset(_MPI_${id}_${LANG}_COMPILER_NAMES) endforeach() - list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) + foreach(_COMPILER_NAME IN LISTS _MPI_${LANG}_GENERIC_COMPILER_NAMES) + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_COMPILER_NAME}${MPI_EXECUTABLE_SUFFIX}) + endforeach() unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES) endforeach() ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 2 08:43:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 2 Jul 2019 08:43:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-198-gcba6c59 Message-ID: <20190702124304.8AC8F11200D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via cba6c59e7061b1aac74626a456cc14a094285916 (commit) via 021d147d26cb332f88e90d8a2dca9ff940942b7a (commit) via 5d8dcdf5be57e66ab3a50d9f17f94baf24424582 (commit) via 41acd44625f63d0730fdbd983ea598b227622087 (commit) via c56201bdac81d3d74efa9437a7ed2cef4285de6d (commit) via 9d0ad814f6df30f5a94156f3aa0118d70e9fa34f (commit) via 0998f6396a51248aa307c3254f876d2699597a5b (commit) via ba13dc2aa88097649b4c9084a5188fbf7f56a901 (commit) via 7449c63f3ea8026cd14e7b88d44253375dd9c298 (commit) via 963ddafeaabd2853002df66b6e873a379a75c45a (commit) via 1a2d6bdefcd7cb0f3f3a4f5ccd0bee0ddb1e7faa (commit) via 7a3d9b08b9f481a9bdf682051b118523a2da922d (commit) via a4d502a5bfc38254ccb49615be8d7070fca6819e (commit) from 554c2ed743f4134df5552d4702c6b1e1dee97079 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cba6c59e7061b1aac74626a456cc14a094285916 commit cba6c59e7061b1aac74626a456cc14a094285916 Merge: 021d147 c56201b Author: Brad King AuthorDate: Tue Jul 2 08:41:36 2019 -0400 Commit: Brad King CommitDate: Tue Jul 2 08:41:36 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=021d147d26cb332f88e90d8a2dca9ff940942b7a commit 021d147d26cb332f88e90d8a2dca9ff940942b7a Merge: 5d8dcdf 963ddaf Author: Brad King AuthorDate: Tue Jul 2 12:36:55 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 08:39:38 2019 -0400 Merge topic 'qt-5.13' 963ddafeaa QtDialog: Use QPalette::WindowText instead of QPalette::Foreground 1a2d6bdefc Tests: Autogen: Use valid rcc compression levels Acked-by: Kitware Robot Merge-request: !3500 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d8dcdf5be57e66ab3a50d9f17f94baf24424582 commit 5d8dcdf5be57e66ab3a50d9f17f94baf24424582 Merge: 41acd44 0998f63 Author: Brad King AuthorDate: Tue Jul 2 12:37:18 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 08:38:24 2019 -0400 Merge topic 'update-expat' 0998f6396a Merge branch 'upstream-expat' into update-expat ba13dc2aa8 expat 2019-06-19 (d3b78b42) 7449c63f3e expat: Update script to get Expat 2.2.7 Acked-by: Kitware Robot Merge-request: !3501 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41acd44625f63d0730fdbd983ea598b227622087 commit 41acd44625f63d0730fdbd983ea598b227622087 Merge: 554c2ed a4d502a Author: Brad King AuthorDate: Tue Jul 2 12:36:45 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 08:36:56 2019 -0400 Merge topic 'cuda-no-device-link-when-disabled' a4d502a5bf CUDA: Do not device link if CUDA is not an enabled language Acked-by: Kitware Robot Merge-request: !3491 ----------------------------------------------------------------------- Summary of changes: Source/QtDialog/RegexExplorer.cxx | 2 +- Source/cmLinkLineDeviceComputer.cxx | 4 + Source/cmMakefileExecutableTargetGenerator.cxx | 6 +- Source/cmMakefileLibraryTargetGenerator.cxx | 8 +- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- Tests/Cuda/CMakeLists.txt | 1 + Tests/Cuda/NotEnabled/CMakeLists.txt | 14 + Tests/Cuda/NotEnabled/lib.cxx | 5 + .../main.cu => NotEnabled/main.cxx} | 3 +- Tests/QtAutogen/SameName/CMakeLists.txt | 8 +- Utilities/Scripts/update-expat.bash | 2 +- Utilities/cmexpat/ConfigureChecks.cmake | 35 +- Utilities/cmexpat/README.md | 55 +- Utilities/cmexpat/expat_config.h.cmake | 30 +- Utilities/cmexpat/lib/ascii.h | 32 +- Utilities/cmexpat/lib/asciitab.h | 32 +- Utilities/cmexpat/lib/expat.h | 36 +- Utilities/cmexpat/lib/expat_external.h | 92 +- Utilities/cmexpat/lib/iasciitab.h | 32 +- Utilities/cmexpat/lib/internal.h | 36 +- Utilities/cmexpat/lib/latin1tab.h | 32 +- Utilities/cmexpat/lib/loadlibrary.c | 4 +- Utilities/cmexpat/lib/nametab.h | 32 + Utilities/cmexpat/lib/siphash.h | 17 + Utilities/cmexpat/lib/utf8tab.h | 33 +- Utilities/cmexpat/lib/winconfig.h | 41 +- Utilities/cmexpat/lib/xmlparse.c | 2715 ++++++++++---------- Utilities/cmexpat/lib/xmlrole.c | 32 +- Utilities/cmexpat/lib/xmlrole.h | 32 +- Utilities/cmexpat/lib/xmltok.c | 90 +- Utilities/cmexpat/lib/xmltok.h | 37 +- Utilities/cmexpat/lib/xmltok_impl.c | 115 +- Utilities/cmexpat/lib/xmltok_impl.h | 31 +- Utilities/cmexpat/lib/xmltok_ns.c | 33 +- 34 files changed, 2091 insertions(+), 1588 deletions(-) create mode 100644 Tests/Cuda/NotEnabled/CMakeLists.txt create mode 100644 Tests/Cuda/NotEnabled/lib.cxx copy Tests/Cuda/{MixedStandardLevels/main.cu => NotEnabled/main.cxx} (52%) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 2 08:43:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 2 Jul 2019 08:43:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-14-gc56201b Message-ID: <20190702124305.23A59113530@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via c56201bdac81d3d74efa9437a7ed2cef4285de6d (commit) via 9d0ad814f6df30f5a94156f3aa0118d70e9fa34f (commit) via 0998f6396a51248aa307c3254f876d2699597a5b (commit) via ba13dc2aa88097649b4c9084a5188fbf7f56a901 (commit) via 7449c63f3ea8026cd14e7b88d44253375dd9c298 (commit) via 963ddafeaabd2853002df66b6e873a379a75c45a (commit) via 1a2d6bdefcd7cb0f3f3a4f5ccd0bee0ddb1e7faa (commit) via 7a3d9b08b9f481a9bdf682051b118523a2da922d (commit) via a4d502a5bfc38254ccb49615be8d7070fca6819e (commit) from 3936e78bfe99329c69d833d2bee286a5c93d35a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/QtDialog/RegexExplorer.cxx | 2 +- Source/cmLinkLineDeviceComputer.cxx | 4 + Source/cmMakefileExecutableTargetGenerator.cxx | 6 +- Source/cmMakefileLibraryTargetGenerator.cxx | 8 +- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- Tests/Cuda/CMakeLists.txt | 1 + Tests/Cuda/NotEnabled/CMakeLists.txt | 14 + Tests/Cuda/NotEnabled/lib.cxx | 5 + .../main.cu => NotEnabled/main.cxx} | 3 +- Tests/QtAutogen/SameName/CMakeLists.txt | 8 +- Utilities/Scripts/update-expat.bash | 2 +- Utilities/cmexpat/ConfigureChecks.cmake | 35 +- Utilities/cmexpat/README.md | 55 +- Utilities/cmexpat/expat_config.h.cmake | 30 +- Utilities/cmexpat/lib/ascii.h | 32 +- Utilities/cmexpat/lib/asciitab.h | 32 +- Utilities/cmexpat/lib/expat.h | 36 +- Utilities/cmexpat/lib/expat_external.h | 92 +- Utilities/cmexpat/lib/iasciitab.h | 32 +- Utilities/cmexpat/lib/internal.h | 36 +- Utilities/cmexpat/lib/latin1tab.h | 32 +- Utilities/cmexpat/lib/loadlibrary.c | 4 +- Utilities/cmexpat/lib/nametab.h | 32 + Utilities/cmexpat/lib/siphash.h | 17 + Utilities/cmexpat/lib/utf8tab.h | 33 +- Utilities/cmexpat/lib/winconfig.h | 41 +- Utilities/cmexpat/lib/xmlparse.c | 2715 ++++++++++---------- Utilities/cmexpat/lib/xmlrole.c | 32 +- Utilities/cmexpat/lib/xmlrole.h | 32 +- Utilities/cmexpat/lib/xmltok.c | 90 +- Utilities/cmexpat/lib/xmltok.h | 37 +- Utilities/cmexpat/lib/xmltok_impl.c | 115 +- Utilities/cmexpat/lib/xmltok_impl.h | 31 +- Utilities/cmexpat/lib/xmltok_ns.c | 33 +- 34 files changed, 2091 insertions(+), 1588 deletions(-) create mode 100644 Tests/Cuda/NotEnabled/CMakeLists.txt create mode 100644 Tests/Cuda/NotEnabled/lib.cxx copy Tests/Cuda/{MixedStandardLevels/main.cu => NotEnabled/main.cxx} (52%) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 2 08:52:56 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 2 Jul 2019 08:52:56 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-207-g8a42cd1 Message-ID: <20190702125256.3393A11200E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8a42cd155f00d9418fa60f995b466fff7c1afaa5 (commit) via 67859b3d79606d0fe37a4e0d9dc40e58236d5b80 (commit) via b08b640926828fc090fd88395502da27dc337203 (commit) via 0b83df71e73956749fd266e9c9c9054a23a957da (commit) via cf821ff3c4b893374a575691f1cd6409ae7e1218 (commit) via 8aa0b63bc68ebd5d7eb3f7a02f9520dac54bf813 (commit) via d3ebef4f708f92cd348232d8629c918a6057e521 (commit) via 27d6e51ae9b57657289a4db6092d8a47472b842e (commit) via 49cfd390075ba1f92aa96bbf3d3510a813e0b068 (commit) from cba6c59e7061b1aac74626a456cc14a094285916 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a42cd155f00d9418fa60f995b466fff7c1afaa5 commit 8a42cd155f00d9418fa60f995b466fff7c1afaa5 Merge: 67859b3 8aa0b63 Author: Brad King AuthorDate: Tue Jul 2 12:44:37 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 08:45:58 2019 -0400 Merge topic 'static' 8aa0b63bc6 Swift: add rules for static linking Acked-by: Kitware Robot Merge-request: !3492 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=67859b3d79606d0fe37a4e0d9dc40e58236d5b80 commit 67859b3d79606d0fe37a4e0d9dc40e58236d5b80 Merge: b08b640 d3ebef4 Author: Brad King AuthorDate: Tue Jul 2 12:44:06 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 08:44:54 2019 -0400 Merge topic 'cross_ref_CUDAHOSTCXX_in_CMAKE_CUDA_HOST_COMPILER' d3ebef4f70 CMAKE_CUDA_HOST_COMPILER: Document it takes priority over CUDAHOSTCXX Acked-by: Kitware Robot Merge-request: !3490 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b08b640926828fc090fd88395502da27dc337203 commit b08b640926828fc090fd88395502da27dc337203 Merge: 0b83df7 cf821ff Author: Brad King AuthorDate: Tue Jul 2 12:43:54 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 08:44:02 2019 -0400 Merge topic 'deprecate-policy-old' cf821ff3c4 Add deprecation warnings for policies CMP0067 and below Acked-by: Kitware Robot Merge-request: !3502 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b83df71e73956749fd266e9c9c9054a23a957da commit 0b83df71e73956749fd266e9c9c9054a23a957da Merge: cba6c59 27d6e51 Author: Brad King AuthorDate: Tue Jul 2 12:42:43 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 2 08:42:55 2019 -0400 Merge topic 'double-export-error-message' 27d6e51ae9 Tests: add tests for export set error messages 49cfd39007 cmExportBuildFileGenerator: improve error message Acked-by: Kitware Robot Merge-request: !3486 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf821ff3c4b893374a575691f1cd6409ae7e1218 commit cf821ff3c4b893374a575691f1cd6409ae7e1218 Author: Brad King AuthorDate: Mon Jul 1 10:18:02 2019 -0400 Commit: Brad King CommitDate: Mon Jul 1 10:21:06 2019 -0400 Add deprecation warnings for policies CMP0067 and below The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.8 and below to encourage projects to port away from setting policies to OLD. diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst new file mode 100644 index 0000000..440efa9 --- /dev/null +++ b/Help/release/dev/deprecate-policy-old.rst @@ -0,0 +1,8 @@ +deprecate-policy-old +-------------------- + +* An explicit deprecation diagnostic was added for policy ``CMP0067`` + (``CMP0066`` and below were already deprecated). + The :manual:`cmake-policies(7)` manual explains that the OLD behaviors + of all policies are deprecated and that projects should port to the + NEW behaviors. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e0f69cb..bd98f08 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4300,7 +4300,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, // Deprecate old policies, especially those that require a lot // of code to maintain the old behavior. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0066 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0067 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. diff --git a/Tests/RunCMake/try_compile/CMP0067-stderr.txt b/Tests/RunCMake/try_compile/CMP0067-stderr.txt index e2677ed..d955dda 100644 --- a/Tests/RunCMake/try_compile/CMP0067-stderr.txt +++ b/Tests/RunCMake/try_compile/CMP0067-stderr.txt @@ -19,6 +19,17 @@ Call Stack \(most recent call first\): This warning is for project developers. Use -Wno-dev to suppress it. after try_compile with CMP0067 WARN-enabled +CMake Deprecation Warning at CMP0067.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0067 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ before try_compile with CMP0067 OLD after try_compile with CMP0067 OLD before try_compile with CMP0067 NEW https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8aa0b63bc68ebd5d7eb3f7a02f9520dac54bf813 commit 8aa0b63bc68ebd5d7eb3f7a02f9520dac54bf813 Author: Saleem Abdulrasool AuthorDate: Thu Jun 27 21:28:48 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Thu Jun 27 21:28:48 2019 -0700 Swift: add rules for static linking The Swift driver recently learnt how to generate static libraries using the `-static` flag. This enables us to generate proper static libraries with dependency tracking with Swift as well. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 6f99c1f..f62f61b 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -70,6 +70,12 @@ if(NOT CMAKE_Swift_LINK_EXECUTABLE) endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) + if(CMAKE_Swift_COMPILER_TARGET) + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + else() + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + endif() + set(CMAKE_Swift_ARCHIVE_CREATE " crs ") set(CMAKE_Swift_ARCHIVE_FINISH "") endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3ebef4f708f92cd348232d8629c918a6057e521 commit d3ebef4f708f92cd348232d8629c918a6057e521 Author: Robert Maynard AuthorDate: Thu Jun 27 14:39:24 2019 -0400 Commit: Robert Maynard CommitDate: Thu Jun 27 14:39:24 2019 -0400 CMAKE_CUDA_HOST_COMPILER: Document it takes priority over CUDAHOSTCXX diff --git a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst index eea2c4f..6d34c5c 100644 --- a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst +++ b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst @@ -4,4 +4,5 @@ CMAKE_CUDA_HOST_COMPILER Executable to use when compiling host code when compiling ``CUDA`` language files. Maps to the ``nvcc -ccbin`` option. Will only be used by CMake on the first configuration to determine a valid host compiler for ``CUDA``. After a valid -host compiler has been found, this value is read-only. +host compiler has been found, this value is read-only. This variable takes +priority over the :envvar:`CUDAHOSTCXX` environment variable. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27d6e51ae9b57657289a4db6092d8a47472b842e commit 27d6e51ae9b57657289a4db6092d8a47472b842e Author: Ben Boeckel AuthorDate: Thu Jun 27 08:50:57 2019 -0400 Commit: Ben Boeckel CommitDate: Thu Jun 27 10:57:34 2019 -0400 Tests: add tests for export set error messages diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/export/DependOnDoubleExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/DependOnDoubleExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt new file mode 100644 index 0000000..b78c7e4 --- /dev/null +++ b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt @@ -0,0 +1,13 @@ +CMake Error in CMakeLists.txt: + export called with target "exported" which requires target "doubleexported" + that is not in this export set, but in multiple other export sets: + .*/Tests/RunCMake/export/DependOnDoubleExport-build/exportset.cmake, + .*/Tests/RunCMake/export/DependOnDoubleExport-build/manual.cmake. + + + An exported target cannot depend upon another target which is exported + multiple times. Consider consolidating the exports of the "doubleexported" + target to a single export. + + +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/export/DependOnDoubleExport.cmake b/Tests/RunCMake/export/DependOnDoubleExport.cmake new file mode 100644 index 0000000..8d108d7 --- /dev/null +++ b/Tests/RunCMake/export/DependOnDoubleExport.cmake @@ -0,0 +1,7 @@ +add_library(doubleexported INTERFACE) +install(TARGETS doubleexported EXPORT exportset) +export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake") +export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake") +add_library(exported INTERFACE) +target_link_libraries(exported INTERFACE doubleexported) +export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake") diff --git a/Tests/RunCMake/export/DependOnNotExport-result.txt b/Tests/RunCMake/export/DependOnNotExport-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/DependOnNotExport-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/DependOnNotExport-stderr.txt b/Tests/RunCMake/export/DependOnNotExport-stderr.txt new file mode 100644 index 0000000..80f5758 --- /dev/null +++ b/Tests/RunCMake/export/DependOnNotExport-stderr.txt @@ -0,0 +1,6 @@ +CMake Error in CMakeLists.txt: + export called with target "exported" which requires target "notexported" + that is not in any export set. + + +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/export/DependOnNotExport.cmake b/Tests/RunCMake/export/DependOnNotExport.cmake new file mode 100644 index 0000000..06c1ad9 --- /dev/null +++ b/Tests/RunCMake/export/DependOnNotExport.cmake @@ -0,0 +1,4 @@ +add_library(notexported INTERFACE) +add_library(exported INTERFACE) +target_link_libraries(exported INTERFACE notexported) +export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake") diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake index 97a0ca6..4d2f217 100644 --- a/Tests/RunCMake/export/RunCMakeTest.cmake +++ b/Tests/RunCMake/export/RunCMakeTest.cmake @@ -10,3 +10,5 @@ run_cmake(ForbiddenToExportInterfaceProperties) run_cmake(ForbiddenToExportImportedProperties) run_cmake(ForbiddenToExportPropertyWithGenExp) run_cmake(ExportPropertiesUndefined) +run_cmake(DependOnNotExport) +run_cmake(DependOnDoubleExport) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49cfd390075ba1f92aa96bbf3d3510a813e0b068 commit 49cfd390075ba1f92aa96bbf3d3510a813e0b068 Author: Ben Boeckel AuthorDate: Wed Jun 26 13:48:59 2019 -0400 Commit: Ben Boeckel CommitDate: Thu Jun 27 10:57:34 2019 -0400 cmExportBuildFileGenerator: improve error message When an exported target depends on another exported target that is included in multiple build export sets, the error message was woefully unhelpful. Now, include information about what build exports the dependent target was included in with instructions for fixing the problem that are actually helpful. diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 3fe84a9..5800629 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -12,7 +12,6 @@ #include "cmMessageType.h" #include "cmPolicies.h" #include "cmStateTypes.h" -#include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetExport.h" #include "cmake.h" @@ -259,11 +258,11 @@ void cmExportBuildFileGenerator::HandleMissingTarget( const std::string name = dependee->GetName(); cmGlobalGenerator* gg = dependee->GetLocalGenerator()->GetGlobalGenerator(); - std::vector namespaces = this->FindNamespaces(gg, name); + auto exportInfo = this->FindBuildExportInfo(gg, name); + std::vector const& exportFiles = exportInfo.first; - int targetOccurrences = static_cast(namespaces.size()); - if (targetOccurrences == 1) { - std::string missingTarget = namespaces[0]; + if (exportFiles.size() == 1) { + std::string missingTarget = exportInfo.second; missingTarget += dependee->GetExportName(); link_libs += missingTarget; @@ -272,7 +271,7 @@ void cmExportBuildFileGenerator::HandleMissingTarget( } // We are not appending, so all exported targets should be // known here. This is probably user-error. - this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences); + this->ComplainAboutMissingTarget(depender, dependee, exportFiles); } // Assume the target will be exported by another command. // Append it with the export namespace. @@ -292,10 +291,12 @@ void cmExportBuildFileGenerator::GetTargets( targets = this->Targets; } -std::vector cmExportBuildFileGenerator::FindNamespaces( - cmGlobalGenerator* gg, const std::string& name) +std::pair, std::string> +cmExportBuildFileGenerator::FindBuildExportInfo(cmGlobalGenerator* gg, + const std::string& name) { - std::vector namespaces; + std::vector exportFiles; + std::string ns; std::map& exportSets = gg->GetBuildExportSets(); @@ -305,31 +306,31 @@ std::vector cmExportBuildFileGenerator::FindNamespaces( std::vector targets; exportSet->GetTargets(targets); if (std::find(targets.begin(), targets.end(), name) != targets.end()) { - namespaces.push_back(exportSet->GetNamespace()); + exportFiles.push_back(exp.first); + ns = exportSet->GetNamespace(); } } - return namespaces; + return std::make_pair(exportFiles, ns); } void cmExportBuildFileGenerator::ComplainAboutMissingTarget( - cmGeneratorTarget* depender, cmGeneratorTarget* dependee, int occurrences) + cmGeneratorTarget* depender, cmGeneratorTarget* dependee, + std::vector const& exportFiles) { - if (cmSystemTools::GetErrorOccuredFlag()) { - return; - } - std::ostringstream e; e << "export called with target \"" << depender->GetName() << "\" which requires target \"" << dependee->GetName() << "\" "; - if (occurrences == 0) { - e << "that is not in the export set.\n"; + if (exportFiles.empty()) { + e << "that is not in any export set."; } else { - e << "that is not in this export set, but " << occurrences - << " times in others.\n"; + e << "that is not in this export set, but in multiple other export sets: " + << cmJoin(exportFiles, ", ") << ".\n"; + e << "An exported target cannot depend upon another target which is " + "exported multiple times. Consider consolidating the exports of the " + "\"" + << dependee->GetName() << "\" target to a single export."; } - e << "If the required target is not easy to reference in this call, " - << "consider using the APPEND option with multiple separate calls."; this->LG->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage( MessageType::FATAL_ERROR, e.str(), diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h index 0a1e755..e5b6597 100644 --- a/Source/cmExportBuildFileGenerator.h +++ b/Source/cmExportBuildFileGenerator.h @@ -11,6 +11,7 @@ #include #include +#include #include class cmExportSet; @@ -64,7 +65,7 @@ protected: void ComplainAboutMissingTarget(cmGeneratorTarget* depender, cmGeneratorTarget* dependee, - int occurrences); + std::vector const& namespaces); /** Fill in properties indicating built file locations. */ void SetImportLocationProperty(const std::string& config, @@ -75,8 +76,8 @@ protected: std::string InstallNameDir(cmGeneratorTarget* target, const std::string& config) override; - std::vector FindNamespaces(cmGlobalGenerator* gg, - const std::string& name); + std::pair, std::string> FindBuildExportInfo( + cmGlobalGenerator* gg, const std::string& name); std::vector Targets; cmExportSet* ExportSet; ----------------------------------------------------------------------- Summary of changes: Help/release/dev/deprecate-policy-old.rst | 8 ++++ Help/variable/CMAKE_CUDA_HOST_COMPILER.rst | 3 +- Modules/CMakeSwiftInformation.cmake | 6 +++ Source/cmExportBuildFileGenerator.cxx | 45 +++++++++++----------- Source/cmExportBuildFileGenerator.h | 7 ++-- Source/cmMakefile.cxx | 2 +- .../DependOnDoubleExport-result.txt} | 0 .../export/DependOnDoubleExport-stderr.txt | 13 +++++++ Tests/RunCMake/export/DependOnDoubleExport.cmake | 7 ++++ .../DependOnNotExport-result.txt} | 0 Tests/RunCMake/export/DependOnNotExport-stderr.txt | 6 +++ Tests/RunCMake/export/DependOnNotExport.cmake | 4 ++ Tests/RunCMake/export/RunCMakeTest.cmake | 2 + Tests/RunCMake/try_compile/CMP0067-stderr.txt | 11 ++++++ 14 files changed, 87 insertions(+), 27 deletions(-) create mode 100644 Help/release/dev/deprecate-policy-old.rst copy Tests/RunCMake/{while/MissingArgument-result.txt => export/DependOnDoubleExport-result.txt} (100%) create mode 100644 Tests/RunCMake/export/DependOnDoubleExport-stderr.txt create mode 100644 Tests/RunCMake/export/DependOnDoubleExport.cmake copy Tests/RunCMake/{while/MissingArgument-result.txt => export/DependOnNotExport-result.txt} (100%) create mode 100644 Tests/RunCMake/export/DependOnNotExport-stderr.txt create mode 100644 Tests/RunCMake/export/DependOnNotExport.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 3 00:02:57 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 3 Jul 2019 00:02:57 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-208-gf219b48 Message-ID: <20190703040257.937BCF98CD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f219b48d8afdaf1b72065158e00b3f42383cbb16 (commit) from 8a42cd155f00d9418fa60f995b466fff7c1afaa5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f219b48d8afdaf1b72065158e00b3f42383cbb16 commit f219b48d8afdaf1b72065158e00b3f42383cbb16 Author: Kitware Robot AuthorDate: Wed Jul 3 00:01:09 2019 -0400 Commit: Kitware Robot CommitDate: Wed Jul 3 00:01:09 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8f7aea8..7177393 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 15) -set(CMake_VERSION_PATCH 20190702) +set(CMake_VERSION_PATCH 20190703) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 3 05:02:58 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 3 Jul 2019 05:02:58 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-210-g1cc8f85 Message-ID: <20190703090258.7E5EF10B2E0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1cc8f85e1a167b786ecd2acb13c1455c9ecd5f61 (commit) via 16434fe303a6bd8394a07177e3cef928b446f918 (commit) from f219b48d8afdaf1b72065158e00b3f42383cbb16 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cc8f85e1a167b786ecd2acb13c1455c9ecd5f61 commit 1cc8f85e1a167b786ecd2acb13c1455c9ecd5f61 Merge: f219b48 16434fe Author: Craig Scott AuthorDate: Wed Jul 3 09:00:58 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 3 05:01:13 2019 -0400 Merge topic 'doc-toolchain-file-CMAKE_SOURCE_DIR' 16434fe303 Help: Discourage using CMAKE_SOURCE_DIR in toolchain files Acked-by: Kitware Robot Merge-request: !3495 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16434fe303a6bd8394a07177e3cef928b446f918 commit 16434fe303a6bd8394a07177e3cef928b446f918 Author: Oleg Chernovskiy AuthorDate: Sat Jun 29 17:01:14 2019 +0300 Commit: Craig Scott CommitDate: Wed Jul 3 08:45:29 2019 +1000 Help: Discourage using CMAKE_SOURCE_DIR in toolchain files Fixes: #19390 diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index df4531b..7435d9a 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -101,6 +101,14 @@ values for the compilers. The :variable:`CMAKE_CROSSCOMPILING` variable is set to true when CMake is cross-compiling. +Note that using the :variable:`CMAKE_SOURCE_DIR` or :variable:`CMAKE_BINARY_DIR` +variables inside a toolchain file is typically undesirable. The toolchain +file is used in contexts where these variables have different values when used +in different places (e.g. as part of a call to :command:`try_compile`). In most +cases, where there is a need to evaluate paths inside a toolchain file, the more +appropriate variable to use would be :variable:`CMAKE_CURRENT_LIST_DIR`, since +it always has an unambiguous, predictable value. + Cross Compiling for Linux ------------------------- ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-toolchains.7.rst | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 3 05:22:55 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 3 Jul 2019 05:22:55 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-212-g8f93d76 Message-ID: <20190703092255.3AF89F72BF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8f93d76b795abc24661a423b5923312ebfbf6857 (commit) via 581e011cefefea4a5ad826aac6bcbd66b4b68f3b (commit) from 1cc8f85e1a167b786ecd2acb13c1455c9ecd5f61 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f93d76b795abc24661a423b5923312ebfbf6857 commit 8f93d76b795abc24661a423b5923312ebfbf6857 Merge: 1cc8f85 581e011 Author: Craig Scott AuthorDate: Wed Jul 3 19:09:44 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 3 19:09:44 2019 +1000 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 3 05:22:55 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 3 Jul 2019 05:22:55 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-16-g581e011 Message-ID: <20190703092255.5C4C5F792F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 581e011cefefea4a5ad826aac6bcbd66b4b68f3b (commit) via 16434fe303a6bd8394a07177e3cef928b446f918 (commit) from c56201bdac81d3d74efa9437a7ed2cef4285de6d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-toolchains.7.rst | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 3 07:33:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 3 Jul 2019 07:33:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-18-g1f389b4 Message-ID: <20190703113303.59C6912795A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 1f389b4498e0f096eb1ad60ebf62c871179ff7fa (commit) via d21b890a4c3d6c6d9a7457906fe8b1629eed41b0 (commit) from 581e011cefefea4a5ad826aac6bcbd66b4b68f3b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/FindPostgreSQL.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 3 07:33:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 3 Jul 2019 07:33:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-216-g0bddcce Message-ID: <20190703113303.39AAB127996@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0bddcce987d15b92f7f98a5bddcb74a8bc0251d3 (commit) via c723ff216f247f05be0f51cb653e7d3499ab2399 (commit) via 1f389b4498e0f096eb1ad60ebf62c871179ff7fa (commit) via d21b890a4c3d6c6d9a7457906fe8b1629eed41b0 (commit) from 8f93d76b795abc24661a423b5923312ebfbf6857 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bddcce987d15b92f7f98a5bddcb74a8bc0251d3 commit 0bddcce987d15b92f7f98a5bddcb74a8bc0251d3 Merge: c723ff2 1f389b4 Author: Brad King AuthorDate: Wed Jul 3 07:32:12 2019 -0400 Commit: Brad King CommitDate: Wed Jul 3 07:32:12 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c723ff216f247f05be0f51cb653e7d3499ab2399 commit c723ff216f247f05be0f51cb653e7d3499ab2399 Merge: 8f93d76 d21b890 Author: Brad King AuthorDate: Wed Jul 3 11:30:57 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 3 07:31:10 2019 -0400 Merge topic 'FindPostgreSQL-lib-dir' d21b890a4c FindPostgreSQL: Fix regression in computation of library directory Acked-by: Kitware Robot Merge-request: !3505 ----------------------------------------------------------------------- Summary of changes: Modules/FindPostgreSQL.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 4 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 4 Jul 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-217-gf889e03 Message-ID: <20190704040306.D58CC112E6E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f889e0320cf27b364c718db50c9462ca7211b73e (commit) from 0bddcce987d15b92f7f98a5bddcb74a8bc0251d3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f889e0320cf27b364c718db50c9462ca7211b73e commit f889e0320cf27b364c718db50c9462ca7211b73e Author: Kitware Robot AuthorDate: Thu Jul 4 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Thu Jul 4 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7177393..6974b16 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 15) -set(CMake_VERSION_PATCH 20190703) +set(CMake_VERSION_PATCH 20190704) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 4 08:33:10 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 4 Jul 2019 08:33:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-223-g01c0d86 Message-ID: <20190704123310.47C86FA6EF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 01c0d863f4e7a0ff0e95bec51aeaf6d95c763fcc (commit) via d5b722bbbd684477e8b8a979ba62a2f1b45a720c (commit) via ddc7ea46961da54fe00d13f20e6192540f801949 (commit) via c509f38b7b8c80e0174be75b6f8d5e99343213b7 (commit) via 9cc6befe1b7de68910787c5732e436393de2bdfc (commit) via 074fbdb73f052212003ef65804c3532380c76dcd (commit) from f889e0320cf27b364c718db50c9462ca7211b73e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01c0d863f4e7a0ff0e95bec51aeaf6d95c763fcc commit 01c0d863f4e7a0ff0e95bec51aeaf6d95c763fcc Merge: f889e03 d5b722b Author: Craig Scott AuthorDate: Thu Jul 4 12:25:08 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 4 08:25:25 2019 -0400 Merge topic 'docs-misc-trivial-cleanups' d5b722bbbd Help: Remove mention of CMAKE_INSTALL_DO_STRIP ddc7ea4696 Help: Clarify how to provide multiple targets with cmake --target c509f38b7b Help: Add missing xref for CMAKE_EXECUTE_PROCESS_COMMAND_ECHO 9cc6befe1b Help: Improve formatting of list(TRANSFORM) sub-options 074fbdb73f Help: Clean up trivial typos and grammar Acked-by: Kitware Robot Acked-by: Brad King Merge-request: !3498 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5b722bbbd684477e8b8a979ba62a2f1b45a720c commit d5b722bbbd684477e8b8a979ba62a2f1b45a720c Author: Craig Scott AuthorDate: Wed Jul 3 23:37:54 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 3 23:38:25 2019 +1000 Help: Remove mention of CMAKE_INSTALL_DO_STRIP It isn't yet clear whether we want to make this part of the documented API for the install script. Remove it from the docs before it appears in an official release for now. Relates: #18997 diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index e91f060..ff099dd 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -343,7 +343,7 @@ The options are: Override the installation prefix, :variable:`CMAKE_INSTALL_PREFIX`. ``--strip`` - Strip before installing by setting ``CMAKE_INSTALL_DO_STRIP``. + Strip before installing. ``-v, --verbose`` Enable verbose output. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ddc7ea46961da54fe00d13f20e6192540f801949 commit ddc7ea46961da54fe00d13f20e6192540f801949 Author: Craig Scott AuthorDate: Tue Jul 2 23:14:31 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 3 23:38:25 2019 +1000 Help: Clarify how to provide multiple targets with cmake --target diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index dccf797..e91f060 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -290,7 +290,8 @@ following options: value of ``1`` can be used to limit to a single job. ``--target ..., -t ...`` - Build ```` instead of default targets. May be specified multiple times. + Build ```` instead of the default target. Multiple targets may be + given, separated by spaces. ``--config `` For multi-configuration tools, choose configuration ````. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c509f38b7b8c80e0174be75b6f8d5e99343213b7 commit c509f38b7b8c80e0174be75b6f8d5e99343213b7 Author: Craig Scott AuthorDate: Sun Jun 30 21:15:35 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 3 23:38:25 2019 +1000 Help: Add missing xref for CMAKE_EXECUTE_PROCESS_COMMAND_ECHO diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst index b11d1ac..14f879d 100644 --- a/Help/command/execute_process.rst +++ b/Help/command/execute_process.rst @@ -81,6 +81,8 @@ Options: ``COMMAND_ECHO `` The command being run will be echo'ed to ```` with ```` being set to one of ``STDERR``, ``STDOUT`` or ``NONE``. + See the :variable:`CMAKE_EXECUTE_PROCESS_COMMAND_ECHO` variable for a way + to control the default behavior when this option is not present. ``ENCODING `` On Windows, the encoding that is used to decode output from the process. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9cc6befe1b7de68910787c5732e436393de2bdfc commit 9cc6befe1b7de68910787c5732e436393de2bdfc Author: Craig Scott AuthorDate: Sun Jun 30 19:43:11 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 3 23:38:25 2019 +1000 Help: Improve formatting of list(TRANSFORM) sub-options diff --git a/Help/command/list.rst b/Help/command/list.rst index 866a597..39e7e2a 100644 --- a/Help/command/list.rst +++ b/Help/command/list.rst @@ -223,41 +223,41 @@ The actions have exactly the same semantics as sub-commands of the ``APPEND``, ``PREPEND``: Append, prepend specified value to each element of the list. -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM ...) + list(TRANSFORM ...) ``TOUPPER``, ``TOLOWER``: Convert each element of the list to upper, lower characters. -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM ...) + list(TRANSFORM ...) ``STRIP``: Remove leading and trailing spaces from each element of the list. -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM STRIP ...) + list(TRANSFORM STRIP ...) ``GENEX_STRIP``: Strip any :manual:`generator expressions ` from each element of the list. -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM GENEX_STRIP ...) + list(TRANSFORM GENEX_STRIP ...) ``REPLACE``: Match the regular expression as many times as possible and substitute the replacement expression for the match for each element of the list (Same semantic as ``REGEX REPLACE`` from :command:`string` command). -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM REPLACE - ...) + list(TRANSFORM REPLACE + ...) ```` determines which elements of the list will be transformed. Only one type of selector can be specified at a time. When given, @@ -265,23 +265,23 @@ Only one type of selector can be specified at a time. When given, ``AT``: Specify a list of indexes. -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM AT [ ...] ...) + list(TRANSFORM AT [ ...] ...) ``FOR``: Specify a range with, optionally, an increment used to iterate over the range. -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM FOR [] ...) + list(TRANSFORM FOR [] ...) ``REGEX``: Specify a regular expression. Only elements matching the regular expression will be transformed. -.. code-block:: cmake + .. code-block:: cmake - list(TRANSFORM REGEX ...) + list(TRANSFORM REGEX ...) Ordering https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=074fbdb73f052212003ef65804c3532380c76dcd commit 074fbdb73f052212003ef65804c3532380c76dcd Author: Craig Scott AuthorDate: Sat Jun 29 22:05:22 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 3 23:38:25 2019 +1000 Help: Clean up trivial typos and grammar diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst index e6ad037..b11d1ac 100644 --- a/Help/command/execute_process.rst +++ b/Help/command/execute_process.rst @@ -80,7 +80,7 @@ Options: ``COMMAND_ECHO `` The command being run will be echo'ed to ```` with ```` - being set to ``STDERR``|``STDOUT``|``NONE``. + being set to one of ``STDERR``, ``STDOUT`` or ``NONE``. ``ENCODING `` On Windows, the encoding that is used to decode output from the process. diff --git a/Help/command/list.rst b/Help/command/list.rst index 4444af7..866a597 100644 --- a/Help/command/list.rst +++ b/Help/command/list.rst @@ -207,20 +207,18 @@ but if duplicates are encountered, only the first instance is preserved. [OUTPUT_VARIABLE ]) Transforms the list by applying an action to all or, by specifying a -````, to the selected elements of the list, storing result in-place -or in the specified output variable. +````, to the selected elements of the list, storing the result +in-place or in the specified output variable. .. note:: - ``TRANSFORM`` sub-command does not change the number of elements of the + The ``TRANSFORM`` sub-command does not change the number of elements in the list. If a ```` is specified, only some elements will be changed, - the other ones will remain same as before the transformation. + the other ones will remain the same as before the transformation. -```` specify the action to apply to the elements of list. -The actions have exactly the same semantics as sub-commands of -:command:`string` command. - -The ```` may be one of: +```` specifies the action to apply to the elements of the list. +The actions have exactly the same semantics as sub-commands of the +:command:`string` command. ```` must be one of the following: ``APPEND``, ``PREPEND``: Append, prepend specified value to each element of the list. @@ -261,10 +259,9 @@ of the list list(TRANSFORM REPLACE ...) -```` select which elements of the list will be transformed. Only one -type of selector can be specified at a time. - -The ```` may be one of: +```` determines which elements of the list will be transformed. +Only one type of selector can be specified at a time. When given, +```` must be one of the following: ``AT``: Specify a list of indexes. diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 13cba71..dccf797 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -333,13 +333,13 @@ The options are: Project binary directory to install. This is required and must be first. ``--config `` - For multi-configuration tools, choose configuration ````. + For multi-configuration generators, choose configuration ````. ``--component `` Component-based install. Only install component ````. ``--prefix `` - The installation prefix :variable:`CMAKE_INSTALL_PREFIX`. + Override the installation prefix, :variable:`CMAKE_INSTALL_PREFIX`. ``--strip`` Strip before installing by setting ``CMAKE_INSTALL_DO_STRIP``. diff --git a/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst b/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst index 893a298..b6f6160 100644 --- a/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst +++ b/Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst @@ -13,5 +13,5 @@ part of the ``make clean`` target. Arguments to :prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES` may use :manual:`generator expressions `. -This property only works for the the Makefile generators. +This property only works for the Makefile generators. It is ignored on other generators. diff --git a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst index 4a3121c..76561d8 100644 --- a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst +++ b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst @@ -1,6 +1,6 @@ CMAKE_EXECUTE_PROCESS_COMMAND_ECHO ---------------------------------- -If this variable is set to ``STDERR``|``STDOUT``|``NONE`` then commands in -:command:`execute_process` calls will be printed to either stderr or stdout -or not at all. +If this variable is set to ``STDERR``, ``STDOUT`` or ``NONE`` then commands +in :command:`execute_process` calls will be printed to either stderr or +stdout or not at all. ----------------------------------------------------------------------- Summary of changes: Help/command/execute_process.rst | 4 +- Help/command/list.rst | 57 ++++++++++------------ Help/manual/cmake.1.rst | 9 ++-- Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst | 2 +- .../CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst | 6 +-- 5 files changed, 39 insertions(+), 39 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 4 08:43:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 4 Jul 2019 08:43:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-225-gd09b228 Message-ID: <20190704124305.9C02DFA6EF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d09b2287b386dfd8f6ee6e14112d0944e88b0429 (commit) via 12e46dc413193c42589918bc588b5a41774329a8 (commit) from 01c0d863f4e7a0ff0e95bec51aeaf6d95c763fcc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d09b2287b386dfd8f6ee6e14112d0944e88b0429 commit d09b2287b386dfd8f6ee6e14112d0944e88b0429 Merge: 01c0d86 12e46dc Author: Craig Scott AuthorDate: Thu Jul 4 22:31:21 2019 +1000 Commit: Craig Scott CommitDate: Thu Jul 4 22:31:21 2019 +1000 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 4 08:43:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 4 Jul 2019 08:43:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-24-g12e46dc Message-ID: <20190704124305.CB07AFB006@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 12e46dc413193c42589918bc588b5a41774329a8 (commit) via d5b722bbbd684477e8b8a979ba62a2f1b45a720c (commit) via ddc7ea46961da54fe00d13f20e6192540f801949 (commit) via c509f38b7b8c80e0174be75b6f8d5e99343213b7 (commit) via 9cc6befe1b7de68910787c5732e436393de2bdfc (commit) via 074fbdb73f052212003ef65804c3532380c76dcd (commit) from 1f389b4498e0f096eb1ad60ebf62c871179ff7fa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/command/execute_process.rst | 4 +- Help/command/list.rst | 57 ++++++++++------------ Help/manual/cmake.1.rst | 9 ++-- Help/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES.rst | 2 +- .../CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst | 6 +-- 5 files changed, 39 insertions(+), 39 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 5 00:03:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 5 Jul 2019 00:03:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-226-gf56393f Message-ID: <20190705040308.639E91A92@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f56393f0bd4d54db7885e89e8019c5e790bd6aa6 (commit) from d09b2287b386dfd8f6ee6e14112d0944e88b0429 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f56393f0bd4d54db7885e89e8019c5e790bd6aa6 commit f56393f0bd4d54db7885e89e8019c5e790bd6aa6 Author: Kitware Robot AuthorDate: Fri Jul 5 00:01:09 2019 -0400 Commit: Kitware Robot CommitDate: Fri Jul 5 00:01:09 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6974b16..de66762 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 15) -set(CMake_VERSION_PATCH 20190704) +set(CMake_VERSION_PATCH 20190705) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jul 6 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 6 Jul 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-227-gb9c4d26 Message-ID: <20190706040306.BC1F511EFB4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b9c4d26c5d5627a95eb40c4fcaddee763c446986 (commit) from f56393f0bd4d54db7885e89e8019c5e790bd6aa6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9c4d26c5d5627a95eb40c4fcaddee763c446986 commit b9c4d26c5d5627a95eb40c4fcaddee763c446986 Author: Kitware Robot AuthorDate: Sat Jul 6 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jul 6 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index de66762..2965bd6 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 15) -set(CMake_VERSION_PATCH 20190705) +set(CMake_VERSION_PATCH 20190706) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jul 7 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 7 Jul 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-228-g580c694 Message-ID: <20190707040306.1E659111C00@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 580c694363a74de9489090785020b5dc1fece817 (commit) from b9c4d26c5d5627a95eb40c4fcaddee763c446986 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=580c694363a74de9489090785020b5dc1fece817 commit 580c694363a74de9489090785020b5dc1fece817 Author: Kitware Robot AuthorDate: Sun Jul 7 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jul 7 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2965bd6..05ba936 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 15) -set(CMake_VERSION_PATCH 20190706) +set(CMake_VERSION_PATCH 20190707) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 8 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 8 Jul 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-229-g5f2f163 Message-ID: <20190708040306.745A7111EE8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 5f2f16319ab5832da4b3c7b0c1a5a4587a3991eb (commit) from 580c694363a74de9489090785020b5dc1fece817 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f2f16319ab5832da4b3c7b0c1a5a4587a3991eb commit 5f2f16319ab5832da4b3c7b0c1a5a4587a3991eb Author: Kitware Robot AuthorDate: Mon Jul 8 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jul 8 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 05ba936..b8a909c 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 15) -set(CMake_VERSION_PATCH 20190707) +set(CMake_VERSION_PATCH 20190708) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 8 11:33:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 8 Jul 2019 11:33:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-234-ga6a698a Message-ID: <20190708153306.341DE102F2F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a6a698aafb8fea7191669d9e9ca2bce0fb3be73f (commit) via bf7f5d0a22c735cd1ebb3e40b8e9c0f6140c6d6a (commit) via 59a30f2acfdf4bd9d9bd4fffbb9945a372957499 (commit) via 194adaf985e86e4cdcc61dc8abd9be4d1a3498b9 (commit) via 08cd7f6a02fcfb711f776a8083e53040b48aec8a (commit) from 5f2f16319ab5832da4b3c7b0c1a5a4587a3991eb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6a698aafb8fea7191669d9e9ca2bce0fb3be73f commit a6a698aafb8fea7191669d9e9ca2bce0fb3be73f Merge: bf7f5d0 59a30f2 Author: Brad King AuthorDate: Mon Jul 8 15:28:18 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 8 11:28:27 2019 -0400 Merge topic 'pb-cxx11' 59a30f2acf FindProtobuf: libprotoc also needs C++11 194adaf985 Tests: require C++11 for some protobuf tests Acked-by: Kitware Robot Merge-request: !3503 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf7f5d0a22c735cd1ebb3e40b8e9c0f6140c6d6a commit bf7f5d0a22c735cd1ebb3e40b8e9c0f6140c6d6a Merge: 5f2f163 08cd7f6 Author: Brad King AuthorDate: Mon Jul 8 15:26:20 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 8 11:26:29 2019 -0400 Merge topic 'threads-are-good' 08cd7f6a02 Swift: support multithreaded compilation Acked-by: Kitware Robot Merge-request: !3506 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59a30f2acfdf4bd9d9bd4fffbb9945a372957499 commit 59a30f2acfdf4bd9d9bd4fffbb9945a372957499 Author: Rolf Eike Beer AuthorDate: Tue Jul 2 14:40:20 2019 +0200 Commit: Rolf Eike Beer CommitDate: Wed Jul 3 18:49:49 2019 +0200 FindProtobuf: libprotoc also needs C++11 diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 085e96c..670352c 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -582,6 +582,11 @@ if(Protobuf_INCLUDE_DIR) set_target_properties(protobuf::libprotoc PROPERTIES IMPORTED_LOCATION_DEBUG "${Protobuf_PROTOC_LIBRARY_DEBUG}") endif() + if (Protobuf_VERSION VERSION_GREATER_EQUAL "3.6") + set_property(TARGET protobuf::libprotoc APPEND PROPERTY + INTERFACE_COMPILE_FEATURES cxx_std_11 + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotoc APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=194adaf985e86e4cdcc61dc8abd9be4d1a3498b9 commit 194adaf985e86e4cdcc61dc8abd9be4d1a3498b9 Author: Rolf Eike Beer AuthorDate: Mon Jul 1 17:03:00 2019 +0200 Commit: Rolf Eike Beer CommitDate: Wed Jul 3 18:49:49 2019 +0200 Tests: require C++11 for some protobuf tests Newer versions of Protobuf require C++11, which is reflected in the imported target created by FindProtobuf. Manually set this for all tests that only use the variables. diff --git a/Tests/FindProtobuf/Test/CMakeLists.txt b/Tests/FindProtobuf/Test/CMakeLists.txt index bc89190..fc6b37e 100644 --- a/Tests/FindProtobuf/Test/CMakeLists.txt +++ b/Tests/FindProtobuf/Test/CMakeLists.txt @@ -29,6 +29,7 @@ add_test(NAME test_tgt_protoc COMMAND test_tgt_protoc) add_executable(test_var_protoc main-protoc.cxx) target_include_directories(test_var_protoc PRIVATE ${Protobuf_INCLUDE_DIRS}) target_link_libraries(test_var_protoc PRIVATE ${Protobuf_PROTOC_LIBRARIES}) +target_compile_features(test_var_protoc PRIVATE cxx_std_11) add_test(NAME test_var_protoc COMMAND test_var_protoc) add_test(NAME test_tgt_protoc_version COMMAND protobuf::protoc --version) @@ -37,14 +38,17 @@ set(Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIRS}) PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER msgs/example.proto) PROTOBUF_GENERATE_CPP(DESC_PROTO_SRC DESC_PROTO_HEADER DESCRIPTORS DESC_PROTO_DESC msgs/example_desc.proto) add_library(msgs ${PROTO_SRC} ${PROTO_HEADER}) +target_compile_features(msgs PRIVATE cxx_std_11) add_executable(test_generate main-generate.cxx ${PROTO_SRC}) target_include_directories(test_generate PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(test_generate msgs ${Protobuf_LIBRARIES}) +target_compile_features(test_generate PRIVATE cxx_std_11) add_test(NAME test_generate COMMAND test_generate) add_executable(test_desc main-desc.cxx ${DESC_PROTO_SRC}) target_compile_features(test_desc PRIVATE cxx_std_11) target_include_directories(test_desc PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(test_desc msgs ${Protobuf_LIBRARIES}) +target_compile_features(test_desc PRIVATE cxx_std_11) add_test(NAME test_desc COMMAND test_desc ${DESC_PROTO_DESC}) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08cd7f6a02fcfb711f776a8083e53040b48aec8a commit 08cd7f6a02fcfb711f776a8083e53040b48aec8a Author: Saleem Abdulrasool AuthorDate: Sun Jun 30 20:50:08 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Tue Jul 2 10:45:07 2019 -0700 Swift: support multithreaded compilation Query the number of logical CPUs available to enable parallel compilation for Swift. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index cc6a7d2..d4dbcca 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -98,6 +98,7 @@ Variables that Provide Information /variable/CMAKE_STATIC_LIBRARY_PREFIX /variable/CMAKE_STATIC_LIBRARY_SUFFIX /variable/CMAKE_Swift_MODULE_DIRECTORY + /variable/CMAKE_Swift_NUM_THREADS /variable/CMAKE_TOOLCHAIN_FILE /variable/CMAKE_TWEAK_VERSION /variable/CMAKE_VERBOSE_MAKEFILE diff --git a/Help/variable/CMAKE_Swift_NUM_THREADS.rst b/Help/variable/CMAKE_Swift_NUM_THREADS.rst new file mode 100644 index 0000000..cb33678 --- /dev/null +++ b/Help/variable/CMAKE_Swift_NUM_THREADS.rst @@ -0,0 +1,8 @@ +CMAKE_Swift_NUM_THREADS +----------------------- + +Number of threads for parallel compilation for Swift targets. + +This variable controls the number of parallel jobs that the swift driver creates +for building targets. If not specified, it will default to the number of +logical CPUs on the host. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index f62f61b..0f84cce 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -49,11 +49,15 @@ if(NOT CMAKE_Swift_COMPILE_OBJECT) set(CMAKE_Swift_COMPILE_OBJECT ":") endif() +if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$") + cmake_host_system_information(RESULT CMAKE_Swift_NUM_THREADS QUERY NUMBER_OF_LOGICAL_CORES) +endif() + if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") endif() endif() @@ -63,17 +67,17 @@ endif() if(NOT CMAKE_Swift_LINK_EXECUTABLE) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") endif() endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") endif() set(CMAKE_Swift_ARCHIVE_CREATE " crs ") ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-variables.7.rst | 1 + Help/variable/CMAKE_Swift_NUM_THREADS.rst | 8 ++++++++ Modules/CMakeSwiftInformation.cmake | 16 ++++++++++------ Modules/FindProtobuf.cmake | 5 +++++ Tests/FindProtobuf/Test/CMakeLists.txt | 4 ++++ 5 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 Help/variable/CMAKE_Swift_NUM_THREADS.rst hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 8 11:53:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 8 Jul 2019 11:53:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-239-g09fe666 Message-ID: <20190708155305.831BE113662@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 09fe6664afd2270d1d3b851adb4125b86bd59202 (commit) via 58d10debe1d71d15d3d0a1731211f4d0ee9e0daa (commit) via 1555837ccbdee95cedb9a5ba0e617a62fe74b9a3 (commit) via b0bcd4d7d2cb9defb790514375b78efbf60cc2e8 (commit) via 33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc (commit) from a6a698aafb8fea7191669d9e9ca2bce0fb3be73f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09fe6664afd2270d1d3b851adb4125b86bd59202 commit 09fe6664afd2270d1d3b851adb4125b86bd59202 Merge: 58d10de 1555837 Author: Brad King AuthorDate: Mon Jul 8 11:45:10 2019 -0400 Commit: Brad King CommitDate: Mon Jul 8 11:45:10 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58d10debe1d71d15d3d0a1731211f4d0ee9e0daa commit 58d10debe1d71d15d3d0a1731211f4d0ee9e0daa Merge: a6a698a b0bcd4d Author: Brad King AuthorDate: Mon Jul 8 15:43:31 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 8 11:43:39 2019 -0400 Merge topic 'fortran-submodule-cray' b0bcd4d7d2 Fortran: Add support for submodules on Cray 33de4d27eb Fortran: Support compilers using no module prefix on submodule files Acked-by: Kitware Robot Merge-request: !3504 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1555837ccbdee95cedb9a5ba0e617a62fe74b9a3 commit 1555837ccbdee95cedb9a5ba0e617a62fe74b9a3 Merge: 12e46dc b0bcd4d Author: Brad King AuthorDate: Mon Jul 8 11:33:02 2019 -0400 Commit: Brad King CommitDate: Mon Jul 8 11:33:02 2019 -0400 Merge branch 'fortran-submodule-cray' into release-3.15 Merge-request: !3504 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0bcd4d7d2cb9defb790514375b78efbf60cc2e8 commit b0bcd4d7d2cb9defb790514375b78efbf60cc2e8 Author: Willem Deconinck AuthorDate: Wed Jul 3 08:11:44 2019 +0000 Commit: Brad King CommitDate: Mon Jul 8 11:28:27 2019 -0400 Fortran: Add support for submodules on Cray Define `CMAKE_Fortran_SUBMODULE_{SEP,EXT}` for the Cray Fortran compiler. Use an empty separator to tell CMake that this compiler does not use the enclosing module name as a prefix on submodule files. Issue: #18925 diff --git a/Modules/Compiler/Cray-Fortran.cmake b/Modules/Compiler/Cray-Fortran.cmake index dbf28e3..ccb7c2e 100644 --- a/Modules/Compiler/Cray-Fortran.cmake +++ b/Modules/Compiler/Cray-Fortran.cmake @@ -4,6 +4,8 @@ include(Compiler/Cray) __compiler_cray(Fortran) +set(CMAKE_Fortran_SUBMODULE_SEP "") +set(CMAKE_Fortran_SUBMODULE_EXT ".mod") set(CMAKE_Fortran_MODOUT_FLAG -em) set(CMAKE_Fortran_MODDIR_FLAG -J) set(CMAKE_Fortran_MODDIR_DEFAULT .) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc commit 33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc Author: Willem Deconinck AuthorDate: Tue Jul 2 09:10:26 2019 +0000 Commit: Brad King CommitDate: Mon Jul 8 11:28:27 2019 -0400 Fortran: Support compilers using no module prefix on submodule files Define `CMAKE_Fortran_SUBMODULE_SEP` with an empty string to mean that the compiler uses no module prefix on its submodule files. Also add a default fallback to use the `.mod` extension when `CMAKE_Fortran_SUBMODULE_EXT` is not set. This is a better guess than no extension at all. diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index 18e3c10..e8b1da8 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -79,7 +79,13 @@ std::string cmFortranParser_s::ModName(std::string const& mod_name) const std::string cmFortranParser_s::SModName(std::string const& mod_name, std::string const& sub_name) const { - return mod_name + this->Compiler.SModSep + sub_name + this->Compiler.SModExt; + std::string const& SModExt = + this->Compiler.SModExt.empty() ? ".mod" : this->Compiler.SModExt; + // An empty separator means that the compiler does not use a prefix. + if (this->Compiler.SModSep.empty()) { + return sub_name + SModExt; + } + return mod_name + this->Compiler.SModSep + sub_name + SModExt; } bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname) ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/Cray-Fortran.cmake | 2 ++ Source/cmFortranParserImpl.cxx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 8 13:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 8 Jul 2019 13:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-245-g80d9836 Message-ID: <20190708170307.3A95B125D08@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 80d9836a35cc72618cc79b27108d42c016b93a34 (commit) via f8a310c9d141c750fd7747f8d7eecf1142231d6e (commit) via 90b5289c55c29f0c183e878944924203bf1832db (commit) via e50fa44a351cb4ea10267f98868d5a54efaa1a1d (commit) via 8214ad442fd7dabf8d8aafa8a50ccb99e5b28b8d (commit) via 4a9154537c12e5f47e71018a7d485530a376c6da (commit) from 09fe6664afd2270d1d3b851adb4125b86bd59202 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80d9836a35cc72618cc79b27108d42c016b93a34 commit 80d9836a35cc72618cc79b27108d42c016b93a34 Merge: 09fe666 f8a310c Author: Brad King AuthorDate: Mon Jul 8 17:00:33 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 8 13:00:45 2019 -0400 Merge topic 'autogen_header_extension' f8a310c9d1 cmSystemTools: Remove cmSystemTools::FileFormat method 90b5289c55 cmExtraCodeLiteGenerator: Use cmake::Is*Extension for file type detection e50fa44a35 cmake: Refactor file extension list setup 8214ad442f Tests: Autogen: Extend SameName test with additional header extensions 4a9154537c Autogen: Use cmake::IsHeader/SourceExtension for file type detection Acked-by: Kitware Robot Merge-request: !3511 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f8a310c9d141c750fd7747f8d7eecf1142231d6e commit f8a310c9d141c750fd7747f8d7eecf1142231d6e Author: Sebastian Holtermann AuthorDate: Thu Jul 4 13:11:39 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu Jul 4 13:46:19 2019 +0200 cmSystemTools: Remove cmSystemTools::FileFormat method diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1501481..723f280 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1264,65 +1264,6 @@ bool cmSystemTools::SimpleGlob(const std::string& glob, return res; } -cmSystemTools::FileFormat cmSystemTools::GetFileFormat(std::string const& ext) -{ - if (ext.empty()) { - return cmSystemTools::NO_FILE_FORMAT; - } - if (ext == "c" || ext == ".c" || ext == "m" || ext == ".m") { - return cmSystemTools::C_FILE_FORMAT; - } - if (ext == "C" || ext == ".C" || ext == "M" || ext == ".M" || ext == "c++" || - ext == ".c++" || ext == "cc" || ext == ".cc" || ext == "cpp" || - ext == ".cpp" || ext == "cxx" || ext == ".cxx" || ext == "mm" || - ext == ".mm") { - return cmSystemTools::CXX_FILE_FORMAT; - } - if (ext == "f" || ext == ".f" || ext == "F" || ext == ".F" || ext == "f77" || - ext == ".f77" || ext == "f90" || ext == ".f90" || ext == "for" || - ext == ".for" || ext == "f95" || ext == ".f95") { - return cmSystemTools::FORTRAN_FILE_FORMAT; - } - if (ext == "java" || ext == ".java") { - return cmSystemTools::JAVA_FILE_FORMAT; - } - if (ext == "cu" || ext == ".cu") { - return cmSystemTools::CUDA_FILE_FORMAT; - } - if (ext == "H" || ext == ".H" || ext == "h" || ext == ".h" || ext == "h++" || - ext == ".h++" || ext == "hm" || ext == ".hm" || ext == "hpp" || - ext == ".hpp" || ext == "hxx" || ext == ".hxx" || ext == "in" || - ext == ".in" || ext == "txx" || ext == ".txx") { - return cmSystemTools::HEADER_FILE_FORMAT; - } - if (ext == "rc" || ext == ".rc") { - return cmSystemTools::RESOURCE_FILE_FORMAT; - } - if (ext == "def" || ext == ".def") { - return cmSystemTools::DEFINITION_FILE_FORMAT; - } - if (ext == "lib" || ext == ".lib" || ext == "a" || ext == ".a") { - return cmSystemTools::STATIC_LIBRARY_FILE_FORMAT; - } - if (ext == "o" || ext == ".o" || ext == "obj" || ext == ".obj") { - return cmSystemTools::OBJECT_FILE_FORMAT; - } -#ifdef __APPLE__ - if (ext == "dylib" || ext == ".dylib") { - return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT; - } - if (ext == "so" || ext == ".so" || ext == "bundle" || ext == ".bundle") { - return cmSystemTools::MODULE_FILE_FORMAT; - } -#else // __APPLE__ - if (ext == "so" || ext == ".so" || ext == "sl" || ext == ".sl" || - ext == "dll" || ext == ".dll") { - return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT; - } -#endif // __APPLE__ - return cmSystemTools::UNKNOWN_FILE_FORMAT; -} - std::string cmSystemTools::ConvertToOutputPath(std::string const& path) { #if defined(_WIN32) && !defined(__CYGWIN__) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 016c266..a9c03bd 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -299,27 +299,6 @@ public: static void EnableRunCommandOutput() { s_DisableRunCommandOutput = false; } static bool GetRunCommandOutput() { return s_DisableRunCommandOutput; } - /** - * Some constants for different file formats. - */ - enum FileFormat - { - NO_FILE_FORMAT = 0, - C_FILE_FORMAT, - CXX_FILE_FORMAT, - FORTRAN_FILE_FORMAT, - JAVA_FILE_FORMAT, - CUDA_FILE_FORMAT, - HEADER_FILE_FORMAT, - RESOURCE_FILE_FORMAT, - DEFINITION_FILE_FORMAT, - STATIC_LIBRARY_FILE_FORMAT, - SHARED_LIBRARY_FILE_FORMAT, - MODULE_FILE_FORMAT, - OBJECT_FILE_FORMAT, - UNKNOWN_FILE_FORMAT - }; - enum CompareOp { OP_EQUAL = 1, @@ -350,11 +329,6 @@ public: */ static int strverscmp(std::string const& lhs, std::string const& rhs); - /** - * Determine the file type based on the extension - */ - static FileFormat GetFileFormat(std::string const& ext); - /** Windows if this is true, the CreateProcess in RunCommand will * not show new console windows when running programs. */ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90b5289c55c29f0c183e878944924203bf1832db commit 90b5289c55c29f0c183e878944924203bf1832db Author: Sebastian Holtermann AuthorDate: Thu Jul 4 12:59:55 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu Jul 4 13:46:19 2019 +0200 cmExtraCodeLiteGenerator: Use cmake::Is*Extension for file type detection In cmExtraCodeLiteGenerator.cxx use `cmake::Is*Extension` methods instead of `cmSystemTools::GetFileFormat` for file type detection. diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 6fe8c14..30b3f0d 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -217,22 +217,21 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles( case cmStateEnums::STATIC_LIBRARY: case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::MODULE_LIBRARY: { + cmake const* cm = makefile->GetCMakeInstance(); std::vector sources; gt->GetSourceFiles(sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (cmSourceFile* s : sources) { + std::string const& fullPath = s->GetFullPath(); + std::string const& extLower = + cmSystemTools::LowerCase(s->GetExtension()); // check whether it is a source or a include file // then put it accordingly into one of the two containers - switch (cmSystemTools::GetFileFormat(s->GetExtension())) { - case cmSystemTools::C_FILE_FORMAT: - case cmSystemTools::CXX_FILE_FORMAT: - case cmSystemTools::CUDA_FILE_FORMAT: - case cmSystemTools::FORTRAN_FILE_FORMAT: { - cFiles[s->GetFullPath()] = s; - } break; - default: { - otherFiles.insert(s->GetFullPath()); - } + if (cm->IsSourceExtension(extLower) || cm->IsCudaExtension(extLower) || + cm->IsFortranExtension(extLower)) { + cFiles[fullPath] = s; + } else { + otherFiles.insert(fullPath); } } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e50fa44a351cb4ea10267f98868d5a54efaa1a1d commit e50fa44a351cb4ea10267f98868d5a54efaa1a1d Author: Sebastian Holtermann AuthorDate: Thu Jul 4 11:22:20 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu Jul 4 13:46:15 2019 +0200 cmake: Refactor file extension list setup Refactor the file extention list setup in cmake.h/cxx and add file extensions lists for Cuda and Fortran. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8f2f86d..ca3b405 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -104,7 +104,6 @@ #include #include #include -#include #include // IWYU pragma: keep #include #include @@ -122,9 +121,9 @@ typedef std::unordered_map JsonValueMapType; static bool cmakeCheckStampFile(const std::string& stampName); static bool cmakeCheckStampList(const std::string& stampList); -void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/, - void* ctx, const char* /*unused*/, - const cmMakefile* /*unused*/) +static void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/, + void* ctx, const char* /*unused*/, + const cmMakefile* /*unused*/) { cmake* cm = reinterpret_cast(ctx); cm->MarkCliAsUsed(variable); @@ -184,40 +183,36 @@ cmake::cmake(Role role, cmState::Mode mode) // Make sure we can capture the build tool output. cmSystemTools::EnableVSConsoleOutput(); - // Set up a list of source and header extensions - // these are used to find files when the extension - // is not given - // The "c" extension MUST precede the "C" extension. - this->SourceFileExtensions.emplace_back("c"); - this->SourceFileExtensions.emplace_back("C"); - - this->SourceFileExtensions.emplace_back("c++"); - this->SourceFileExtensions.emplace_back("cc"); - this->SourceFileExtensions.emplace_back("cpp"); - this->SourceFileExtensions.emplace_back("cxx"); - this->SourceFileExtensions.emplace_back("cu"); - this->SourceFileExtensions.emplace_back("m"); - this->SourceFileExtensions.emplace_back("M"); - this->SourceFileExtensions.emplace_back("mm"); - - std::copy(this->SourceFileExtensions.begin(), - this->SourceFileExtensions.end(), - std::inserter(this->SourceFileExtensionsSet, - this->SourceFileExtensionsSet.end())); - - this->HeaderFileExtensions.emplace_back("h"); - this->HeaderFileExtensions.emplace_back("hh"); - this->HeaderFileExtensions.emplace_back("h++"); - this->HeaderFileExtensions.emplace_back("hm"); - this->HeaderFileExtensions.emplace_back("hpp"); - this->HeaderFileExtensions.emplace_back("hxx"); - this->HeaderFileExtensions.emplace_back("in"); - this->HeaderFileExtensions.emplace_back("txx"); - - std::copy(this->HeaderFileExtensions.begin(), - this->HeaderFileExtensions.end(), - std::inserter(this->HeaderFileExtensionsSet, - this->HeaderFileExtensionsSet.end())); + // Set up a list of source and header extensions. + // These are used to find files when the extension is not given. + { + auto fillExts = [](FileExtensions& exts, + std::initializer_list extList) { + // Fill ordered vector + exts.ordered.reserve(extList.size()); + for (const char* ext : extList) { + exts.ordered.emplace_back(ext); + }; + // Fill unordered set + exts.unordered.insert(exts.ordered.begin(), exts.ordered.end()); + }; + + // Source extensions + // The "c" extension MUST precede the "C" extension. + fillExts(this->SourceFileExtensions, + { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" }); + + // Header extensions + fillExts(this->HeaderFileExtensions, + { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" }); + + // Cuda extensions + fillExts(this->CudaFileExtensions, { "cu" }); + + // Fortran extensions + fillExts(this->FortranFileExtensions, + { "f", "F", "for", "f77", "f90", "f95", "f03" }); + } } cmake::~cmake() diff --git a/Source/cmake.h b/Source/cmake.h index e14a081..c03872b 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -121,6 +121,17 @@ public: bool isAlias; }; + struct FileExtensions + { + bool Test(std::string const& ext) const + { + return (this->unordered.find(ext) != this->unordered.end()); + } + + std::vector ordered; + std::unordered_set unordered; + }; + typedef std::map InstalledFilesMap; static const int NO_BUILD_PARALLEL_LEVEL = -1; @@ -233,24 +244,42 @@ public: const std::vector& GetSourceExtensions() const { - return this->SourceFileExtensions; + return this->SourceFileExtensions.ordered; } bool IsSourceExtension(const std::string& ext) const { - return this->SourceFileExtensionsSet.find(ext) != - this->SourceFileExtensionsSet.end(); + return this->SourceFileExtensions.Test(ext); } const std::vector& GetHeaderExtensions() const { - return this->HeaderFileExtensions; + return this->HeaderFileExtensions.ordered; } bool IsHeaderExtension(const std::string& ext) const { - return this->HeaderFileExtensionsSet.find(ext) != - this->HeaderFileExtensionsSet.end(); + return this->HeaderFileExtensions.Test(ext); + } + + const std::vector& GetCudaExtensions() const + { + return this->CudaFileExtensions.ordered; + } + + bool IsCudaExtension(const std::string& ext) const + { + return this->CudaFileExtensions.Test(ext); + } + + const std::vector& GetFortranExtensions() const + { + return this->FortranFileExtensions.ordered; + } + + bool IsFortranExtension(const std::string& ext) const + { + return this->FortranFileExtensions.Test(ext); } // Strips the extension (if present and known) from a filename @@ -531,10 +560,10 @@ private: std::string CheckStampList; std::string VSSolutionFile; std::string EnvironmentGenerator; - std::vector SourceFileExtensions; - std::unordered_set SourceFileExtensionsSet; - std::vector HeaderFileExtensions; - std::unordered_set HeaderFileExtensionsSet; + FileExtensions SourceFileExtensions; + FileExtensions HeaderFileExtensions; + FileExtensions CudaFileExtensions; + FileExtensions FortranFileExtensions; bool ClearBuildSystem; bool DebugTryCompile; std::unique_ptr FileTimeCache; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8214ad442fd7dabf8d8aafa8a50ccb99e5b28b8d commit 8214ad442fd7dabf8d8aafa8a50ccb99e5b28b8d Author: Sebastian Holtermann AuthorDate: Thu Jul 4 11:49:10 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu Jul 4 12:30:40 2019 +0200 Tests: Autogen: Extend SameName test with additional header extensions This adds additional headers with suffixes ".hh" and uppercase ".H" to the QtAutogen/SameName test. diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt index 0a80d5e..1919cc7 100644 --- a/Tests/QtAutogen/SameName/CMakeLists.txt +++ b/Tests/QtAutogen/SameName/CMakeLists.txt @@ -18,9 +18,11 @@ add_executable(sameName ccc/data.qrc item.cpp object.h + object.hh object.h++ object.hpp object.hxx + object_upper_ext.H data.qrc main.cpp ) diff --git a/Tests/QtAutogen/SameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp index 92f15cd..725f4cd 100644 --- a/Tests/QtAutogen/SameName/main.cpp +++ b/Tests/QtAutogen/SameName/main.cpp @@ -6,8 +6,10 @@ #include "item.hpp" #include "object.h" #include "object.h++" +#include "object.hh" #include "object.hpp" #include "object.hxx" +#include "object_upper_ext.H" int main(int argv, char** args) { @@ -20,8 +22,10 @@ int main(int argv, char** args) ::ccc::Item ccc_item; // Object instances ::Object_h obj_h; + ::Object_hh obj_hh; ::Object_hplpl obj_hplpl; ::Object_hpp obj_hpp; ::Object_hxx obj_hxx; + ::Object_Upper_Ext_H obj_upper_ext_h; return 0; } diff --git a/Tests/QtAutogen/SameName/object.hh b/Tests/QtAutogen/SameName/object.hh new file mode 100644 index 0000000..3e16f83 --- /dev/null +++ b/Tests/QtAutogen/SameName/object.hh @@ -0,0 +1,13 @@ +#ifndef OBJECT_HH +#define OBJECT_HH + +#include + +class Object_hh : public QObject +{ + Q_OBJECT + Q_SLOT + void go(){}; +}; + +#endif diff --git a/Tests/QtAutogen/SameName/object_upper_ext.H b/Tests/QtAutogen/SameName/object_upper_ext.H new file mode 100644 index 0000000..3266087 --- /dev/null +++ b/Tests/QtAutogen/SameName/object_upper_ext.H @@ -0,0 +1,13 @@ +#ifndef OBJECT_UPPER_EXT_H +#define OBJECT_UPPER_EXT_H + +#include + +class Object_Upper_Ext_H : public QObject +{ + Q_OBJECT + Q_SLOT + void go(){}; +}; + +#endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a9154537c12e5f47e71018a7d485530a376c6da commit 4a9154537c12e5f47e71018a7d485530a376c6da Author: Sebastian Holtermann AuthorDate: Tue Jul 2 18:04:53 2019 +0200 Commit: Sebastian Holtermann CommitDate: Thu Jul 4 12:30:40 2019 +0200 Autogen: Use cmake::IsHeader/SourceExtension for file type detection In the QtAutogen initializer use `cmake::IsHeaderExtension` and `cmake::IsSourceExtension` instead of `cmSystemTools::GetFileFormat` for file type detection. Closes: #13904 diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 9985f93..83a1bc4 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -620,6 +620,7 @@ bool cmQtAutoGenInitializer::InitRcc() bool cmQtAutoGenInitializer::InitScanFiles() { cmMakefile* makefile = this->Target->Target->GetMakefile(); + cmake const* cm = makefile->GetCMakeInstance(); auto const& kw = this->GlobalInitializer->kw(); auto makeMUFile = [this, &kw](cmSourceFile* sf, std::string const& fullPath, @@ -665,25 +666,21 @@ bool cmQtAutoGenInitializer::InitScanFiles() if (!pathError.empty() || fullPath.empty()) { continue; } - std::string const& ext = sf->GetExtension(); + std::string const& extLower = + cmSystemTools::LowerCase(sf->GetExtension()); // Register files that will be scanned by moc or uic if (this->MocOrUicEnabled()) { - switch (cmSystemTools::GetFileFormat(ext)) { - case cmSystemTools::HEADER_FILE_FORMAT: - addMUFile(makeMUFile(sf, fullPath, true), true); - break; - case cmSystemTools::CXX_FILE_FORMAT: - addMUFile(makeMUFile(sf, fullPath, true), false); - break; - default: - break; + if (cm->IsHeaderExtension(extLower)) { + addMUFile(makeMUFile(sf, fullPath, true), true); + } else if (cm->IsSourceExtension(extLower)) { + addMUFile(makeMUFile(sf, fullPath, true), false); } } // Register rcc enabled files if (this->Rcc.Enabled) { - if ((ext == kw.qrc) && !sf->GetPropertyAsBool(kw.SKIP_AUTOGEN) && + if ((extLower == kw.qrc) && !sf->GetPropertyAsBool(kw.SKIP_AUTOGEN) && !sf->GetPropertyAsBool(kw.SKIP_AUTORCC)) { // Register qrc file Qrc qrc; @@ -715,7 +712,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() extraHeaders.reserve(this->AutogenTarget.Sources.size() * 2); // Header search suffixes and extensions std::array const suffixes{ { "", "_p" } }; - auto const& exts = makefile->GetCMakeInstance()->GetHeaderExtensions(); + auto const& exts = cm->GetHeaderExtensions(); // Scan through sources for (auto const& pair : this->AutogenTarget.Sources) { MUFile const& muf = *pair.second; @@ -784,10 +781,10 @@ bool cmQtAutoGenInitializer::InitScanFiles() if (!pathError.empty() || fullPath.empty()) { continue; } - std::string const& ext = sf->GetExtension(); + std::string const& extLower = + cmSystemTools::LowerCase(sf->GetExtension()); - auto const fileFormat = cmSystemTools::GetFileFormat(ext); - if (fileFormat == cmSystemTools::HEADER_FILE_FORMAT) { + if (cm->IsHeaderExtension(extLower)) { if (this->AutogenTarget.Headers.find(sf) == this->AutogenTarget.Headers.end()) { auto muf = makeMUFile(sf, fullPath, false); @@ -795,7 +792,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() this->AutogenTarget.Headers.emplace(sf, std::move(muf)); } } - } else if (fileFormat == cmSystemTools::CXX_FILE_FORMAT) { + } else if (cm->IsSourceExtension(extLower)) { if (this->AutogenTarget.Sources.find(sf) == this->AutogenTarget.Sources.end()) { auto muf = makeMUFile(sf, fullPath, false); @@ -803,7 +800,7 @@ bool cmQtAutoGenInitializer::InitScanFiles() this->AutogenTarget.Sources.emplace(sf, std::move(muf)); } } - } else if (this->Uic.Enabled && (ext == kw.ui)) { + } else if (this->Uic.Enabled && (extLower == kw.ui)) { // .ui file std::string realPath = cmSystemTools::GetRealPath(fullPath); bool const skipAutogen = sf->GetPropertyAsBool(kw.SKIP_AUTOGEN); ----------------------------------------------------------------------- Summary of changes: Source/cmExtraCodeLiteGenerator.cxx | 19 +++---- Source/cmQtAutoGenInitializer.cxx | 31 +++++------ Source/cmSystemTools.cxx | 59 -------------------- Source/cmSystemTools.h | 26 --------- Source/cmake.cxx | 71 +++++++++++------------- Source/cmake.h | 49 ++++++++++++---- Tests/QtAutogen/SameName/CMakeLists.txt | 2 + Tests/QtAutogen/SameName/main.cpp | 4 ++ Tests/QtAutogen/SameName/{object.h => object.hh} | 6 +- Tests/QtAutogen/SameName/object_upper_ext.H | 13 +++++ 10 files changed, 117 insertions(+), 163 deletions(-) copy Tests/QtAutogen/SameName/{object.h => object.hh} (50%) create mode 100644 Tests/QtAutogen/SameName/object_upper_ext.H hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 9 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 9 Jul 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-246-ge559a3e Message-ID: <20190709040307.BBB4B11E2C8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e559a3e9900a7c040de2faf36a196b59e82cdd73 (commit) from 80d9836a35cc72618cc79b27108d42c016b93a34 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e559a3e9900a7c040de2faf36a196b59e82cdd73 commit e559a3e9900a7c040de2faf36a196b59e82cdd73 Author: Kitware Robot AuthorDate: Tue Jul 9 00:01:09 2019 -0400 Commit: Kitware Robot CommitDate: Tue Jul 9 00:01:09 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b8a909c..300aab7 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 15) -set(CMake_VERSION_PATCH 20190708) +set(CMake_VERSION_PATCH 20190709) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 9 08:43:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 9 Jul 2019 08:43:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-250-g2113705 Message-ID: <20190709124307.BBFA0FA724@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 2113705c5b4d2b86d6ad62eed33ac26c54894025 (commit) via f02ea912ac9cff2cec857202aecd186cc407163c (commit) via 14ed40d670e522e33b89102a1e2bb2aed10d0590 (commit) via 365ee32db88f6de20b01a386dc26d3450800daaf (commit) from e559a3e9900a7c040de2faf36a196b59e82cdd73 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2113705c5b4d2b86d6ad62eed33ac26c54894025 commit 2113705c5b4d2b86d6ad62eed33ac26c54894025 Merge: f02ea91 14ed40d Author: Craig Scott AuthorDate: Tue Jul 9 12:40:19 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 9 08:40:29 2019 -0400 Merge topic 'loglevel-option-case-consistency' 14ed40d670 Help: Use consistent levels for cmake --loglevel and message() Acked-by: Kitware Robot Merge-request: !3521 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f02ea912ac9cff2cec857202aecd186cc407163c commit f02ea912ac9cff2cec857202aecd186cc407163c Merge: e559a3e 365ee32 Author: Craig Scott AuthorDate: Tue Jul 9 12:37:04 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 9 08:37:17 2019 -0400 Merge topic 'doc-SKIP_RETURN_CODE-range' 365ee32db8 Help: Valid range for test property, SKIP_RETURN_CODE, is 0 to 255, inclusive Acked-by: Kitware Robot Merge-request: !3507 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14ed40d670e522e33b89102a1e2bb2aed10d0590 commit 14ed40d670e522e33b89102a1e2bb2aed10d0590 Author: Craig Scott AuthorDate: Sun Jul 7 18:51:23 2019 +1000 Commit: Craig Scott CommitDate: Mon Jul 8 20:11:33 2019 +1000 Help: Use consistent levels for cmake --loglevel and message() The message() command requires uppercase log levels. Even though the cmake --loglevel option is not case sensitive, show the supported values as uppercase to match the message() docs as closely as possible, since they are related to the same feature. Also fixes the wrong string being shown for the warning level by cmake --help. diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 13cba71..fe32c51 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -200,11 +200,11 @@ Options from the top of a binary tree for a CMake project it will dump additional information such as the cache, log files etc. -``--loglevel=`` +``--loglevel=`` Set the log level. The :command:`message` command will only output messages of the specified - log level or higher. The default log level is ``status``. + log level or higher. The default log level is ``STATUS``. ``--debug-trycompile`` Do not delete the :command:`try_compile` build tree. diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 64026ca..a6348b3 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -96,7 +96,7 @@ static const char* cmDocumentationOptions[][2] = { "Generate graphviz of dependencies, see " "CMakeGraphVizOptions.cmake for more." }, { "--system-information [file]", "Dump information about this system." }, - { "--loglevel=", + { "--loglevel=", "Set the verbosity of messages from CMake files." }, { "--debug-trycompile", "Do not delete the try_compile build tree. Only " https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=365ee32db88f6de20b01a386dc26d3450800daaf commit 365ee32db88f6de20b01a386dc26d3450800daaf Author: Stephen Manz <6985-SRManz at users.noreply.gitlab.kitware.com> AuthorDate: Wed Jun 26 09:00:21 2019 -0700 Commit: Stephen Manz <6985-SRManz at users.noreply.gitlab.kitware.com> CommitDate: Tue Jul 2 08:46:49 2019 -0700 Help: Valid range for test property, SKIP_RETURN_CODE, is 0 to 255, inclusive diff --git a/Help/prop_test/SKIP_RETURN_CODE.rst b/Help/prop_test/SKIP_RETURN_CODE.rst index a05fbf3..3d48c2f 100644 --- a/Help/prop_test/SKIP_RETURN_CODE.rst +++ b/Help/prop_test/SKIP_RETURN_CODE.rst @@ -6,4 +6,5 @@ Return code to mark a test as skipped. Sometimes only a test itself can determine if all requirements for the test are met. If such a situation should not be considered a hard failure a return code of the process can be specified that will mark the test as -``Not Run`` if it is encountered. +``Not Run`` if it is encountered. Valid values are in the range of +0 to 255, inclusive. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 4 ++-- Help/prop_test/SKIP_RETURN_CODE.rst | 3 ++- Source/cmakemain.cxx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 9 08:53:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 9 Jul 2019 08:53:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-252-ge73893e Message-ID: <20190709125307.28589FA724@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e73893ea32d295eb091b40a339ceff7d19c0f3f3 (commit) via d7673a203ca41c2d05462839b818b0803b05ae1e (commit) from 2113705c5b4d2b86d6ad62eed33ac26c54894025 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e73893ea32d295eb091b40a339ceff7d19c0f3f3 commit e73893ea32d295eb091b40a339ceff7d19c0f3f3 Merge: 2113705 d7673a2 Author: Craig Scott AuthorDate: Tue Jul 9 22:43:43 2019 +1000 Commit: Craig Scott CommitDate: Tue Jul 9 22:43:43 2019 +1000 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 9 08:53:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 9 Jul 2019 08:53:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-26-gd7673a2 Message-ID: <20190709125307.62343FD611@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via d7673a203ca41c2d05462839b818b0803b05ae1e (commit) via 14ed40d670e522e33b89102a1e2bb2aed10d0590 (commit) from 12e46dc413193c42589918bc588b5a41774329a8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 4 ++-- Source/cmakemain.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 9 09:43:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 9 Jul 2019 09:43:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-263-gf374ffb Message-ID: <20190709134308.3629EFA724@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 (commit) via 0575c81b5dab6abd8050d675e3180e0f78cc8741 (commit) via 82bbf976d13f662c18bb20b3ab4129560071b799 (commit) via 1b52415cd40aea33a254040807ad930739a859d6 (commit) via 45030c5a24b890ef8e4baa2da16f82ca1ebab877 (commit) via dd1257e2de4c4dc63cf51738d85588956a02b9da (commit) via b66d61a8d07718ad496080c86e6f4299e50d7c55 (commit) via c242187875303219db49089e401d62a47f79207e (commit) via 7929912b371f8fc7ec7637a9e834e784b4a4414c (commit) via 3d11c63c9c338c4ed6e5d171f86af9cf6a7fca0f (commit) via 09cf0520794d3716c0931584f908a575cd8b59d0 (commit) from e73893ea32d295eb091b40a339ceff7d19c0f3f3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 commit f374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 Merge: 0575c81 7929912 Author: Brad King AuthorDate: Tue Jul 9 13:36:58 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 9 09:38:40 2019 -0400 Merge topic 'cpack-deb-test' 7929912b37 CPackComponentsDEB test: simplify error reporting 3d11c63c9c CPackComponentsDEB test: simplify if() arguments 09cf052079 CPackComponentsDEB test: simplify package version generation Acked-by: Kitware Robot Acked-by: Raffi Enficiaud Merge-request: !3514 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0575c81b5dab6abd8050d675e3180e0f78cc8741 commit 0575c81b5dab6abd8050d675e3180e0f78cc8741 Merge: 82bbf97 1b52415 Author: Brad King AuthorDate: Tue Jul 9 09:37:31 2019 -0400 Commit: Brad King CommitDate: Tue Jul 9 09:37:31 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82bbf976d13f662c18bb20b3ab4129560071b799 commit 82bbf976d13f662c18bb20b3ab4129560071b799 Merge: 45030c5 b66d61a Author: Brad King AuthorDate: Tue Jul 9 13:35:00 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 9 09:36:04 2019 -0400 Merge topic 'ccmake-clear-aliases' b66d61a8d0 cmGlobalGenerator: Do not persist alias targets across configures Acked-by: Kitware Robot Merge-request: !3529 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45030c5a24b890ef8e4baa2da16f82ca1ebab877 commit 45030c5a24b890ef8e4baa2da16f82ca1ebab877 Merge: e73893e c242187 Author: Brad King AuthorDate: Tue Jul 9 13:34:51 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 9 09:35:01 2019 -0400 Merge topic 'iar-riscv' c242187875 IAR: Add support for the RISC-V compiler Acked-by: Kitware Robot Merge-request: !3510 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7929912b371f8fc7ec7637a9e834e784b4a4414c commit 7929912b371f8fc7ec7637a9e834e784b4a4414c Author: Rolf Eike Beer AuthorDate: Fri Jul 5 12:16:48 2019 +0200 Commit: Rolf Eike Beer CommitDate: Fri Jul 5 16:25:05 2019 +0200 CPackComponentsDEB test: simplify error reporting diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake index fa8b5a4..beccc46 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake @@ -36,7 +36,6 @@ endif() # dpkg-deb checks for the dependencies of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -56,30 +55,21 @@ if(DPKGDEB_EXECUTABLE) if(dpkg_package_name STREQUAL "mylib-applications") if(NOT dpkg_depends STREQUAL "depend-application") - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-headers") if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-libraries") if(NOT dpkg_depends STREQUAL "depend-default") - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() else() - set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") + message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") endif() endforeach() - - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake index 1d45b78..88f3248 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake @@ -36,7 +36,6 @@ endif() # dpkg-deb checks for the summary of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -57,10 +56,8 @@ if(DPKGDEB_EXECUTABLE) if(dpkg_package_name STREQUAL "mylib-applications") find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps) if(DPKG_SHLIBDEP_EXECUTABLE) - string(FIND "${dpkg_depends}" "lib" index_libwhatever) - if(NOT index_libwhatever GREATER "-1") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n") + if(NOT dpkg_depends MATCHES "lib") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n") endif() else() message("dpkg-shlibdeps executable not found - skipping dpkg-shlibdeps test") @@ -69,29 +66,20 @@ if(DPKGDEB_EXECUTABLE) # should not contain the default string(FIND "${dpkg_depends}" "depend-default" index_default) if(index_default GREATER "0") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-headers") if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif(dpkg_package_name STREQUAL "mylib-libraries") if(NOT dpkg_depends STREQUAL "depend-default") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() else() - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") + message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n") endif() - endforeach() - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake index 3830ca5..3454dca 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake @@ -36,7 +36,6 @@ endif() # dpkg-deb checks for the summary of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -56,20 +55,14 @@ if(DPKGDEB_EXECUTABLE) if(NOT dpkg_package_name STREQUAL "mylib-applications") if(NOT dpkg_package_source STREQUAL "test-source") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n") endif() else() if(NOT dpkg_package_source STREQUAL "test-other-source") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n") + message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n") endif() endif() endforeach() - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake index 06d24c4..764fe9d 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake @@ -33,7 +33,6 @@ endif() # dpkg-deb checks find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) run_dpkgdeb(dpkg_output FILENAME "${_f}" @@ -41,14 +40,9 @@ if(DPKGDEB_EXECUTABLE) # message(FATAL_ERROR "output = '${dpkg_output}'") if(dpkg_output STREQUAL "") - set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: empty content returned by dpkg-deb") + message(SEND_ERROR "dpkg-deb: ${_f}: empty content returned by dpkg-deb") endif() endforeach() - - if(NOT dpkgdeb_output_errors_all STREQUAL "") - message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") - endif() else() message("dpkg-deb executable not found - skipping dpkg-deb test") endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d11c63c9c338c4ed6e5d171f86af9cf6a7fca0f commit 3d11c63c9c338c4ed6e5d171f86af9cf6a7fca0f Author: Rolf Eike Beer AuthorDate: Fri Jul 5 11:50:38 2019 +0200 Commit: Rolf Eike Beer CommitDate: Fri Jul 5 16:24:58 2019 +0200 CPackComponentsDEB test: simplify if() arguments diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake index dc25516..fa8b5a4 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake @@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") - if(NOT "${dpkg_depends}" STREQUAL "depend-application") + if(dpkg_package_name STREQUAL "mylib-applications") + if(NOT dpkg_depends STREQUAL "depend-application") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_depends}" STREQUAL "depend-default") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_depends STREQUAL "depend-default") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() @@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake index 1f2f408..1d45b78 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake @@ -54,7 +54,7 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") + if(dpkg_package_name STREQUAL "mylib-applications") find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps) if(DPKG_SHLIBDEP_EXECUTABLE) string(FIND "${dpkg_depends}" "lib" index_libwhatever) @@ -72,13 +72,13 @@ if(DPKGDEB_EXECUTABLE) set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_depends}" STREQUAL "depend-default") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_depends STREQUAL "depend-default") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n") endif() @@ -89,7 +89,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake index ba94127..f74137c 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake @@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") + if(dpkg_package_name STREQUAL "mylib-applications") if(NOT "${dpkg_description}" STREQUAL "applications_description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_description}" STREQUAL "headers_description") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_description STREQUAL "headers_description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_description}" STREQUAL "main description") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_description STREQUAL "main description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'") endif() @@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake index 1cc5a18..241dda5 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake @@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") - if(NOT "${dpkg_description}" STREQUAL "main description 2") + if(dpkg_package_name STREQUAL "mylib-applications") + if(NOT dpkg_description STREQUAL "main description 2") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_description}" STREQUAL "main description 2") + elseif(dpkg_package_name STREQUAL "mylib-headers") + if(NOT dpkg_description STREQUAL "main description 2") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description") endif() - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") - if(NOT "${dpkg_description}" STREQUAL "library description") + elseif(dpkg_package_name STREQUAL "mylib-libraries") + if(NOT dpkg_description STREQUAL "library description") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'") endif() @@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake index 9f927ee..7cfbb16 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake @@ -44,7 +44,7 @@ if(LINTIAN_EXECUTABLE) string(APPEND lintian_output_errors_all "${lintian_output_errors}") endforeach() - if(NOT "${lintian_output_errors_all}" STREQUAL "") + if(NOT lintian_output_errors_all STREQUAL "") message(FATAL_ERROR "Lintian checks failed:\n${lintian_output_errors_all}") endif() else() @@ -64,13 +64,13 @@ if(DPKGDEB_EXECUTABLE) DPKGDEB_OUTPUT "${dpkg_output}" METAENTRY "Maintainer:") - if(NOT "${dpkgentry}" STREQUAL "None") + if(NOT dpkgentry STREQUAL "None") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect value for Maintainer: ${dpkgentry} != None\n") endif() endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake index 03d003e..6eff3db 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake @@ -39,7 +39,7 @@ endif() # dpkg-deb checks for the summary of the packages find_program(DPKGDEB_EXECUTABLE dpkg-deb) if(DPKGDEB_EXECUTABLE) - set(dpkgdeb_output_errors_all) + set(dpkgdeb_output_errors_all "") foreach(_f IN LISTS actual_output) # extracts the metadata from the package @@ -53,11 +53,11 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${dpkg_package_name}'") - if("${dpkg_package_name}" STREQUAL "mylib-applications") + if(dpkg_package_name STREQUAL "mylib-applications") # pass - elseif("${dpkg_package_name}" STREQUAL "mylib-headers") + elseif(dpkg_package_name STREQUAL "mylib-headers") # pass - elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") + elseif(dpkg_package_name STREQUAL "mylib-libraries") # pass else() set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} @@ -67,7 +67,7 @@ if(DPKGDEB_EXECUTABLE) endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake index 47956c6..3830ca5 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake @@ -54,20 +54,20 @@ if(DPKGDEB_EXECUTABLE) message(STATUS "package='${_f}', source='${dpkg_package_source}'") - if(NOT ("${dpkg_package_name}" STREQUAL "mylib-applications")) - if(NOT ("${dpkg_package_source}" STREQUAL "test-source")) + if(NOT dpkg_package_name STREQUAL "mylib-applications") + if(NOT dpkg_package_source STREQUAL "test-source") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n") endif() else() - if(NOT ("${dpkg_package_source}" STREQUAL "test-other-source")) + if(NOT dpkg_package_source STREQUAL "test-other-source") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n") endif() endif() endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake index d2fbc91..06d24c4 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake @@ -40,13 +40,13 @@ if(DPKGDEB_EXECUTABLE) ) # message(FATAL_ERROR "output = '${dpkg_output}'") - if("${dpkg_output}" STREQUAL "") + if(dpkg_output STREQUAL "") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" "dpkg-deb: ${_f}: empty content returned by dpkg-deb") endif() endforeach() - if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "") + if(NOT dpkgdeb_output_errors_all STREQUAL "") message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}") endif() else() diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake index 2f9e2fc..2093e7e 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake @@ -119,13 +119,13 @@ function(lintian_check_specific_errors output_errors) # regex to avoid foreach(_s IN LISTS lintian_check_specific_errors_deb_ERROR_REGEX_STRINGS) - if("${_s}" STREQUAL "") + if(_s STREQUAL "") continue() endif() string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}") - if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "") + if(NOT _TMP_CHECK_ERROR STREQUAL "") string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}") endif() endforeach() @@ -167,7 +167,7 @@ function(run_dpkgdeb dpkg_deb_output) ERROR_VARIABLE DPKGDEB_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(NOT ("${DPKGDEB_RESULT}" EQUAL "0")) + if(NOT DPKGDEB_RESULT EQUAL "0") message(FATAL_ERROR "Error '${DPKGDEB_RESULT}' returned by dpkg-deb: '${DPKGDEB_ERROR}'") endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09cf0520794d3716c0931584f908a575cd8b59d0 commit 09cf0520794d3716c0931584f908a575cd8b59d0 Author: Rolf Eike Beer AuthorDate: Fri Jul 5 11:49:10 2019 +0200 Commit: Rolf Eike Beer CommitDate: Fri Jul 5 16:24:52 2019 +0200 CPackComponentsDEB test: simplify package version generation diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt index 9d4b5e9..bc5b6a9 100644 --- a/Tests/CPackComponentsDEB/CMakeLists.txt +++ b/Tests/CPackComponentsDEB/CMakeLists.txt @@ -4,8 +4,8 @@ # application (mylibapp). We create a binary installer (a CPack Generator) # which supports CPack components. -cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR) -project(CPackComponentsDEB) +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) +project(CPackComponentsDEB VERSION 1.0.3) # Use GNUInstallDirs in order to enforce lib64 if needed include(GNUInstallDirs) @@ -44,10 +44,6 @@ set(CPACK_PACKAGE_NAME "MyLib") set(CPACK_PACKAGE_CONTACT "None") set(CPACK_PACKAGE_VENDOR "CMake.org") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example") -set(CPACK_PACKAGE_VERSION "1.0.2") -set(CPACK_PACKAGE_VERSION_MAJOR "1") -set(CPACK_PACKAGE_VERSION_MINOR "0") -set(CPACK_PACKAGE_VERSION_PATCH "2") set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake index 73fd0ab..dc25516 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) @@ -60,9 +60,9 @@ if(DPKGDEB_EXECUTABLE) "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers") + if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all} - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n") + "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") if(NOT "${dpkg_depends}" STREQUAL "depend-default") diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake index 81dbbc5..1f2f408 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) set(config_verbose -V) @@ -73,9 +73,9 @@ if(DPKGDEB_EXECUTABLE) "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-headers") - if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers") + if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers") set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}" - "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n") + "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n") endif() elseif("${dpkg_package_name}" STREQUAL "mylib-libraries") if(NOT "${dpkg_depends}" STREQUAL "depend-default") diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake index ad52f56..ba94127 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake index af27c51..1cc5a18 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake @@ -7,7 +7,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake index ec75d61..9f927ee 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake @@ -5,7 +5,7 @@ endif() include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # TODO: currently debian doesn't produce lower cased names -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake index e57488c..03d003e 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake @@ -9,7 +9,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # requirements # debian now produces lower case names -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake index 5ee057a..47956c6 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake @@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # expected results -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb") set(expected_count 3) set(config_verbose -V) diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake index 8c0bc4b..d2fbc91 100644 --- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake +++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake @@ -5,7 +5,7 @@ endif() include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake) # TODO: currently debian doesn't produce lower cased names -set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.2_*.deb") +set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.3_*.deb") set(expected_count 1) set(actual_output) ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineASMCompiler.cmake | 2 +- Modules/CMakePlatformId.h.in | 3 ++ Modules/Compiler/IAR-ASM.cmake | 5 +++ Modules/Compiler/IAR-C.cmake | 4 +++ Modules/Compiler/IAR-CXX.cmake | 4 +++ Modules/Compiler/IAR-DetermineCompiler.cmake | 2 +- Modules/Compiler/IAR-FindBinUtils.cmake | 3 +- Source/cmGlobalGenerator.cxx | 1 + Tests/CPackComponentsDEB/CMakeLists.txt | 8 ++--- .../RunCPackVerifyResult-components-depend1.cmake | 32 +++++++------------ .../RunCPackVerifyResult-components-depend2.cmake | 36 ++++++++-------------- ...CPackVerifyResult-components-description1.cmake | 14 ++++----- ...CPackVerifyResult-components-description2.cmake | 16 +++++----- ...yResult-components-lintian-dpkgdeb-checks.cmake | 8 ++--- ...unCPackVerifyResult-components-shlibdeps1.cmake | 12 ++++---- .../RunCPackVerifyResult-components-source.cmake | 19 ++++-------- .../RunCPackVerifyResult-compression.cmake | 12 ++------ .../CPackComponentsDEB/RunCPackVerifyResult.cmake | 6 ++-- 18 files changed, 83 insertions(+), 104 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 9 09:43:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 9 Jul 2019 09:43:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-30-g1b52415 Message-ID: <20190709134308.8266510929B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 1b52415cd40aea33a254040807ad930739a859d6 (commit) via dd1257e2de4c4dc63cf51738d85588956a02b9da (commit) via b66d61a8d07718ad496080c86e6f4299e50d7c55 (commit) via c242187875303219db49089e401d62a47f79207e (commit) from d7673a203ca41c2d05462839b818b0803b05ae1e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineASMCompiler.cmake | 2 +- Modules/CMakePlatformId.h.in | 3 +++ Modules/Compiler/IAR-ASM.cmake | 5 +++++ Modules/Compiler/IAR-C.cmake | 4 ++++ Modules/Compiler/IAR-CXX.cmake | 4 ++++ Modules/Compiler/IAR-DetermineCompiler.cmake | 2 +- Modules/Compiler/IAR-FindBinUtils.cmake | 3 ++- Source/cmGlobalGenerator.cxx | 1 + 8 files changed, 21 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 9 19:33:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 9 Jul 2019 19:33:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-267-gf7eb765 Message-ID: <20190709233308.6C46F10335A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f7eb76501224a028c2e2bcacaef6018ece7b3738 (commit) via 447a96f5905ed1fb0ef17a8732cac7014da99cf6 (commit) via 1d00ba9ccf62087016e41f237dbae7f94d3aa1f6 (commit) via 704e3a2ca89a3ea75b3cf55efe9bd5d6826168da (commit) from f374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7eb76501224a028c2e2bcacaef6018ece7b3738 commit f7eb76501224a028c2e2bcacaef6018ece7b3738 Merge: f374ffb 447a96f Author: Craig Scott AuthorDate: Tue Jul 9 23:32:40 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 9 19:32:54 2019 -0400 Merge topic 'add_cmake_find_use_package_registry' 447a96f590 vim: Update cmake.vim to include the CMAKE_FIND_USE variables 1d00ba9ccf Find: find_package prefers variable CMAKE_FIND_USE_REGISTRY 704e3a2ca8 Find: Correct spelling and layout issues in CMAKE_FIND_USE_ docs Acked-by: Kitware Robot Merge-request: !3487 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=447a96f5905ed1fb0ef17a8732cac7014da99cf6 commit 447a96f5905ed1fb0ef17a8732cac7014da99cf6 Author: Robert Maynard AuthorDate: Wed Jun 26 15:47:53 2019 -0400 Commit: Robert Maynard CommitDate: Tue Jul 9 09:38:35 2019 -0400 vim: Update cmake.vim to include the CMAKE_FIND_USE variables diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index cd8385b..2616920 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -948,6 +948,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 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1d00ba9ccf62087016e41f237dbae7f94d3aa1f6 commit 1d00ba9ccf62087016e41f237dbae7f94d3aa1f6 Author: Robert Maynard AuthorDate: Tue Nov 13 08:39:27 2018 -0600 Commit: Robert Maynard CommitDate: Tue Jul 9 09:38:35 2019 -0400 Find: find_package prefers variable CMAKE_FIND_USE_REGISTRY CMake's find control flags should all have a consistent name. To make this happen we are introducing `CMAKE_FIND_USE_REGISTRY` and deprecating `CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`. diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index e5e5b2c..6e1d232 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -330,8 +330,10 @@ 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. diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index f5aa42d..4b2934a 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -654,8 +654,13 @@ allows one to disable them using the following variables: :command:`export(PACKAGE)` populates the user package registry unless the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable explicitly disables it. -* :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` disables the - User Package Registry in all the :command:`find_package` calls. +* :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` disables the + User Package Registry in all the :command:`find_package` calls when + set to ``FALSE``. +* Deprecated :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` disables the + User Package Registry in all the :command:`find_package` calls when set + to ``TRUE``. This variable is ignored when + :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` has been set. * :variable:`CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY` disables the System Package Registry in all the :command:`find_package` calls. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 0591f98..7653e0f 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -183,6 +183,7 @@ Variables that Change Behavior /variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH /variable/CMAKE_FIND_USE_CMAKE_PATH /variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH + /variable/CMAKE_FIND_USE_PACKAGE_REGISTRY /variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH /variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH /variable/CMAKE_FRAMEWORK_PATH diff --git a/Help/release/dev/add_cmake_find_use_package_registry.rst b/Help/release/dev/add_cmake_find_use_package_registry.rst new file mode 100644 index 0000000..1b02bad --- /dev/null +++ b/Help/release/dev/add_cmake_find_use_package_registry.rst @@ -0,0 +1,11 @@ +add_cmake_find_use_package_registry +----------------------------------- + +* The :command:`find_package` command has learned to check the following + variables to control searching + + * :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` - Controls the searching the + cmake user registry. + +* The :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` has been deprecated. + Instead use :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst index 9058471..ffb8a2c 100644 --- a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst +++ b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst @@ -1,12 +1,23 @@ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY -------------------------------------- -Skip :ref:`User Package Registry` in :command:`find_package` calls. +.. deprecated:: 3.16 + + Use the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variable instead. + +By default this variable is not set. If neither +:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` nor +``CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`` is set, then +:command:`find_package()` will use the `User Package Registry` unless the +`NO_CMAKE_PACKAGE_REGISTRY` option is provided. + +``CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`` is ignored if +:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` is set. In some cases, for example to locate only system wide installations, it is not desirable to use the :ref:`User Package Registry` when searching for packages. If the :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` -variable is enabled, all the :command:`find_package` commands will skip +variable is ``TRUE``, all the :command:`find_package` commands will skip the :ref:`User Package Registry` as if they were called with the ``NO_CMAKE_PACKAGE_REGISTRY`` argument. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst index 36a8a26..33514a0 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst @@ -14,4 +14,5 @@ commands take precedence over this variable. See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`, and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst index 8abb07a..cefc645 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst @@ -14,4 +14,5 @@ commands take precedence over this variable. See also the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`, and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst index 0f9bba5..2aa544d 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst @@ -14,4 +14,5 @@ commands take precedence over this variable. See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`, and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst new file mode 100644 index 0000000..75e910f --- /dev/null +++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst @@ -0,0 +1,29 @@ +CMAKE_FIND_USE_PACKAGE_REGISTRY +------------------------------- + +Controls the searching the :ref:`User Package Registry` by the :command:`find_package` +command. + +By default this variable is not set and the behavior will fall back +to that determined by the deprecated :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` +variable. If that is also not set, then `find_package()` will use the +`User Package Registry` unless the `NO_CMAKE_PACKAGE_REGISTRY` option +is provided. + +This variable takes precedence over :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` +when both are set. + +In some cases, for example to locate only system wide installations, it +is not desirable to use the :ref:`User Package Registry` when searching +for packages. If the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` +variable is ``FALSE``, all the :command:`find_package` commands will skip +the :ref:`User Package Registry` as if they were called with the +``NO_CMAKE_PACKAGE_REGISTRY`` argument. + +See also :ref:`Disabling the Package Registry`. + +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst index 9731ade..899e62e 100644 --- a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst @@ -14,4 +14,5 @@ commands take precedence over this variable. See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, -and :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` variables. +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +and :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variables. diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst index 0865687..604c710 100644 --- a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst @@ -14,4 +14,5 @@ commands take precedence over this variable. See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +:variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`, and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 828488f..4dd009e 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -188,7 +188,12 @@ bool cmFindPackageCommand::InitialPass(std::vector const& args, } // Check if User Package Registry should be disabled - if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) { + // The `CMAKE_FIND_USE_PACKAGE_REGISTRY` has + // priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY + if (const char* def = + this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) { + this->NoUserRegistry = !cmSystemTools::IsOn(def); + } else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) { this->NoUserRegistry = true; } diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index affe5d5..2f0c051 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -391,16 +391,44 @@ try_compile(EXPORTER_COMPILED message(STATUS "Searching for export(PACKAGE) test project") set(CMakeTestExportPackage_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) + +message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE") +set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE) +find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED) +if(NOT CMakeTestExportPackage_FOUND) + message(SEND_ERROR "CMakeTestExportPackage should be FOUND!") +endif() +unset(CMAKE_FIND_USE_PACKAGE_REGISTRY) + +message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE") +set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE) find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED) +if(NOT CMakeTestExportPackage_FOUND) + message(SEND_ERROR "CMakeTestExportPackage should be FOUND!") +endif() +unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY) -message(STATUS "Searching for export(PACKAGE) test project with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE") +message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE") +set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE) set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY TRUE) +set(CMakeTestExportPackage_DIR FALSE) +find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED) +if(NOT CMakeTestExportPackage_FOUND) + message(SEND_ERROR "CMakeTestExportPackage should be FOUND!") +endif() +unset(CMAKE_FIND_USE_PACKAGE_REGISTRY) +unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY) + +message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE") +set(CMAKE_FIND_USE_PACKAGE_REGISTRY FALSE) +set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE) set(CMakeTestExportPackage_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -find_package(CMakeTestExportPackage 1.${version} EXACT QUIET) +find_package(CMakeTestExportPackage 1.${version} EXACT QUIET) if(CMakeTestExportPackage_FOUND) - message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!") + message(SEND_ERROR "CMakeTestExportPackage should be not FOUND!") endif() +unset(CMAKE_FIND_USE_PACKAGE_REGISTRY) unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY) message(STATUS "Remove export(PACKAGE) test project") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=704e3a2ca89a3ea75b3cf55efe9bd5d6826168da commit 704e3a2ca89a3ea75b3cf55efe9bd5d6826168da Author: Robert Maynard AuthorDate: Wed Jun 26 17:51:21 2019 -0400 Commit: Robert Maynard CommitDate: Tue Jul 9 09:37:55 2019 -0400 Find: Correct spelling and layout issues in CMAKE_FIND_USE_ docs diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt index fc8c55e..40f1c1a 100644 --- a/Help/command/FIND_XXX.txt +++ b/Help/command/FIND_XXX.txt @@ -90,7 +90,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: i.e. ``_ROOT``, ``ENV{_ROOT}``, ``_ROOT``, ``ENV{_ROOT}``, etc. This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting - the :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` to ``FALSE``. + the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``. See policy :policy:`CMP0074`. * |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX| diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index cc6a7d2..0591f98 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -183,7 +183,7 @@ Variables that Change Behavior /variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH /variable/CMAKE_FIND_USE_CMAKE_PATH /variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH - /variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH + /variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH /variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH /variable/CMAKE_FRAMEWORK_PATH /variable/CMAKE_IGNORE_PATH diff --git a/Help/release/dev/global-controls-over-find-locations.rst b/Help/release/dev/global-controls-over-find-locations.rst index d915fbb..79bc869 100644 --- a/Help/release/dev/global-controls-over-find-locations.rst +++ b/Help/release/dev/global-controls-over-find-locations.rst @@ -4,8 +4,18 @@ global-controls-over-find-locations * The :command:`find_file`, :command:`find_library`, :command:`find_path`, and :command:`find_program` commands have learned to check the following variables to control searching - * :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` - Controls the searching the cmake-specific environment variables. - * :variable:`CMAKE_FIND_USE_CMAKE_PATH` - Controls the searching the cmake-specific cache variables. - * :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` - Controls the searching cmake platform specific variables. - * :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` - Controls the searching of :variable:`_ROOT` variables. - * :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` - Controls the searching the standard system environment variables. + + * :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` - Controls the searching + the cmake-specific environment variables. + + * :variable:`CMAKE_FIND_USE_CMAKE_PATH` - Controls the searching the + cmake-specific cache variables. + + * :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` - Controls the searching + cmake platform specific variables. + + * :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` - Controls the searching of + :variable:`_ROOT` variables. + + * :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` - Controls the searching + the standard system environment variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst index 3db510f..36a8a26 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst @@ -1,11 +1,17 @@ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH ------------------------------------- -Controls the searching the cmake-specific environment variables by the :command:`find_program`, -:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +Controls the searching the cmake-specific environment variables by the +:command:`find_program`, :command:`find_library`, :command:`find_file`, +and :command:`find_path` commands. This is useful in cross-compiling environments. -By default this this is set to ``TRUE``. +By default this variable is not set, which is equivalent to it having +a value of ``TRUE``. Explicit options given to the :command:`find_program`, +:command:`find_library`, :command:`find_file`, and :command:`find_path` +commands take precedence over this variable. -See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, -:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst index 86a6186..8abb07a 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst @@ -1,11 +1,17 @@ CMAKE_FIND_USE_CMAKE_PATH ------------------------- -Controls the searching the cmake-specific cache variables by the :command:`find_program`, -:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +Controls the searching the cmake-specific cache variables by the +:command:`find_program`, :command:`find_library`, :command:`find_file`, +and :command:`find_path` commands. This is useful in cross-compiling environments. -By default this this is set to ``TRUE``. +By default this variable is not set, which is equivalent to it having +a value of ``TRUE``. Explicit options given to the :command:`find_program`, +:command:`find_library`, :command:`find_file`, and :command:`find_path` +commands take precedence over this variable. -See also the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, -:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. +See also the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst index b4171c0..0f9bba5 100644 --- a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst @@ -1,11 +1,17 @@ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH -------------------------------- -Controls the searching cmake platform specific variables by the :command:`find_program`, -:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +Controls the searching cmake platform specific variables by the +:command:`find_program`, :command:`find_library`, :command:`find_file`, +and :command:`find_path` commands. This is useful in cross-compiling environments. -By default this this is set to ``TRUE``. +By default this variable is not set, which is equivalent to it having +a value of ``TRUE``. Explicit options given to the :command:`find_program`, +:command:`find_library`, :command:`find_file`, and :command:`find_path` +commands take precedence over this variable. -See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, -:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`, +and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst deleted file mode 100644 index ac25ec9..0000000 --- a/Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst +++ /dev/null @@ -1,11 +0,0 @@ -CMAKE_FIND_USE_PACAKGE_ROOT_PATH --------------------------------- - -Controls the searching of :variable:`_ROOT` variables by the :command:`find_program`, -:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. -This is useful in cross-compiling environments. - -By default this this is set to ``TRUE``. - -See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, -:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, and :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst new file mode 100644 index 0000000..9731ade --- /dev/null +++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst @@ -0,0 +1,17 @@ +CMAKE_FIND_USE_PACKAGE_ROOT_PATH +-------------------------------- + +Controls the searching of :variable:`_ROOT` variables by the +:command:`find_program`, :command:`find_library`, :command:`find_file`, +and :command:`find_path` commands. +This is useful in cross-compiling environments. + +By default this variable is not set, which is equivalent to it having +a value of ``TRUE``. Explicit options given to the :command:`find_program`, +:command:`find_library`, :command:`find_file`, and :command:`find_path` +commands take precedence over this variable. + +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +and :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` variables. diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst index fd0582f..0865687 100644 --- a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst +++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst @@ -1,11 +1,17 @@ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH -------------------------------------- -Controls the searching the standard system environment variables by the :command:`find_program`, -:command:`find_library`, :command:`find_file`, :command:`find_package`, and :command:`find_path`. +Controls the searching the standard system environment variables by the +:command:`find_program`, :command:`find_library`, :command:`find_file`, +and :command:`find_path` commands. This is useful in cross-compiling environments. -By default this this is set to ``TRUE``. +By default this variable is not set, which is equivalent to it having +a value of ``TRUE``. Explicit options given to the :command:`find_program`, +:command:`find_library`, :command:`find_file`, and :command:`find_path` +commands take precedence over this variable. -See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, -:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, and :variable:`CMAKE_FIND_USE_PACAKGE_ROOT_PATH` variables. +See also the :variable:`CMAKE_FIND_USE_CMAKE_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`, +:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`, +and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables. diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index c6b9049..a5937a0 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -148,7 +148,7 @@ void cmFindCommon::SelectDefaultMacMode() void cmFindCommon::SelectDefaultSearchModes() { const std::array, 5> search_paths = { - { { this->NoPackageRootPath, "CMAKE_FIND_USE_PACAKGE_ROOT_PATH" }, + { { this->NoPackageRootPath, "CMAKE_FIND_USE_PACKAGE_ROOT_PATH" }, { this->NoCMakePath, "CMAKE_FIND_USE_CMAKE_PATH" }, { this->NoCMakeEnvironmentPath, "CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH" }, diff --git a/Tests/RunCMake/find_program/RelAndAbsPath.cmake b/Tests/RunCMake/find_program/RelAndAbsPath.cmake index e6bdef7..3c60a20 100644 --- a/Tests/RunCMake/find_program/RelAndAbsPath.cmake +++ b/Tests/RunCMake/find_program/RelAndAbsPath.cmake @@ -46,7 +46,7 @@ set(CMAKE_PREFIX_PATH ".") set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) set(CMAKE_FIND_USE_CMAKE_PATH OFF) set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH OFF) -set(CMAKE_FIND_USE_PACAKGE_ROOT_PATH OFF) +set(CMAKE_FIND_USE_PACKAGE_ROOT_PATH OFF) set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF) find_program(PROG_CWD NAMES testCWD ----------------------------------------------------------------------- Summary of changes: Auxiliary/vim/syntax/cmake.vim | 6 ++++ Help/command/FIND_XXX.txt | 2 +- Help/command/find_package.rst | 6 ++-- Help/manual/cmake-packages.7.rst | 9 ++++-- Help/manual/cmake-variables.7.rst | 3 +- .../dev/add_cmake_find_use_package_registry.rst | 11 +++++++ .../dev/global-controls-over-find-locations.rst | 20 +++++++++---- .../CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst | 15 ++++++++-- .../CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst | 17 +++++++---- Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst | 17 +++++++---- Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst | 17 +++++++---- Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst | 11 ------- Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst | 29 ++++++++++++++++++ Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst | 18 ++++++++++++ .../CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst | 17 +++++++---- Source/cmFindCommon.cxx | 2 +- Source/cmFindPackageCommand.cxx | 7 ++++- Tests/FindPackageTest/CMakeLists.txt | 34 ++++++++++++++++++++-- Tests/RunCMake/find_program/RelAndAbsPath.cmake | 2 +- 19 files changed, 193 insertions(+), 50 deletions(-) create mode 100644 Help/release/dev/add_cmake_find_use_package_registry.rst delete mode 100644 Help/variable/CMAKE_FIND_USE_PACAKGE_ROOT_PATH.rst create mode 100644 Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst create mode 100644 Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-268-g522b687 Message-ID: <20190710040306.AF75311ED22@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 522b687c89237853538680b9a6300f47645768bb (commit) from f7eb76501224a028c2e2bcacaef6018ece7b3738 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=522b687c89237853538680b9a6300f47645768bb commit 522b687c89237853538680b9a6300f47645768bb Author: Kitware Robot AuthorDate: Wed Jul 10 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Wed Jul 10 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 300aab7..9ff6d79 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 15) -set(CMake_VERSION_PATCH 20190709) +set(CMake_VERSION_PATCH 20190710) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 06:53:15 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 06:53:15 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-270-g3b62d5e Message-ID: <20190710105315.5A45EF69E4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3b62d5e677d708d1c89df5cbd63ccd778d8ccb5b (commit) via 42a9e610564ddbae1f9749bebe3a6737482d93dd (commit) from 522b687c89237853538680b9a6300f47645768bb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b62d5e677d708d1c89df5cbd63ccd778d8ccb5b commit 3b62d5e677d708d1c89df5cbd63ccd778d8ccb5b Merge: 522b687 42a9e61 Author: Craig Scott AuthorDate: Wed Jul 10 10:44:04 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 06:44:17 2019 -0400 Merge topic 'docs-message-cmake-gui' 42a9e61056 message() help: Clarify how logs are displayed in various tools Acked-by: Kitware Robot Merge-request: !3523 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42a9e610564ddbae1f9749bebe3a6737482d93dd commit 42a9e610564ddbae1f9749bebe3a6737482d93dd Author: Frank Dana AuthorDate: Sun Jul 7 20:49:42 2019 -0400 Commit: Craig Scott CommitDate: Wed Jul 10 09:40:11 2019 +1000 message() help: Clarify how logs are displayed in various tools diff --git a/Help/command/message.rst b/Help/command/message.rst index 3f9216a..5dca6b4 100644 --- a/Help/command/message.rst +++ b/Help/command/message.rst @@ -53,12 +53,12 @@ The optional ```` keyword determines the type of message: The CMake command-line tool displays ``STATUS`` to ``TRACE`` messages on stdout with the message preceded by two hyphens and a space. All other message types -are sent to stderr and are not prefixed with hyphens. The CMake GUI displays -all messages in its log area. The interactive dialogs (:manual:`ccmake(1)` -and :manual:`cmake-gui(1)`) show ``STATUS`` to ``TRACE`` messages one at a -time on a status line and other messages in interactive pop-up boxes. -The ``--loglevel`` command-line option to each of these tools can be used to -control which messages will be shown. +are sent to stderr and are not prefixed with hyphens. The +:manual:`CMake GUI ` displays all messages in its log area. +The :manual:`curses interface ` shows ``STATUS`` to ``TRACE`` +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. CMake Warning and Error message text displays using a simple markup language. Non-indented text is formatted in line-wrapped paragraphs ----------------------------------------------------------------------- Summary of changes: Help/command/message.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 07:03:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 07:03:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-272-g8c7a627 Message-ID: <20190710110308.5D908FA733@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8c7a627f38f4eeeef81b9c5a89d20ddbcd3c1752 (commit) via 844536f681126fcb844c769224b6e690238d5589 (commit) from 3b62d5e677d708d1c89df5cbd63ccd778d8ccb5b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c7a627f38f4eeeef81b9c5a89d20ddbcd3c1752 commit 8c7a627f38f4eeeef81b9c5a89d20ddbcd3c1752 Merge: 3b62d5e 844536f Author: Craig Scott AuthorDate: Wed Jul 10 20:54:00 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 10 20:54:00 2019 +1000 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 07:03:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 07:03:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-32-g844536f Message-ID: <20190710110308.9A35C103021@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 844536f681126fcb844c769224b6e690238d5589 (commit) via 42a9e610564ddbae1f9749bebe3a6737482d93dd (commit) from 1b52415cd40aea33a254040807ad930739a859d6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/command/message.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 09:23:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 09:23:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-284-g70290a2 Message-ID: <20190710132309.D5338FA9CD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 70290a2abf9e192bb1e0267ec9a6abedde9ba7db (commit) via 88bb13827e39c4286dea1b2a4ff75f975816005f (commit) via 96a35a8eed624ec326f13d1e7d3d735c7b35bcae (commit) via 29a1a68e903640bd79483e4b6ba13bd93fe3a3f5 (commit) via 27bd921b38121fb6be54e8b200252c2914049dea (commit) via 98844aaa6f2309ebac5bf18e2cb24f5c44e6aa07 (commit) via e902a111182b27058cdea9d3f71b3fcb4d729476 (commit) via 366746bbef613f9d258e66a32f8fbacd407acfba (commit) via 0a7b61269c48b43cbc6677c0871ce3d519d460d6 (commit) via 98e371f13e0a8dc35367f98b027f62802b3ed280 (commit) via 88954496488e5b41b599d580d8b673168295d841 (commit) via 8e1664d108a183a9e1e53a3a42bc58a2a0104d60 (commit) from 8c7a627f38f4eeeef81b9c5a89d20ddbcd3c1752 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70290a2abf9e192bb1e0267ec9a6abedde9ba7db commit 70290a2abf9e192bb1e0267ec9a6abedde9ba7db Merge: 88bb138 98844aa Author: Brad King AuthorDate: Wed Jul 10 09:22:19 2019 -0400 Commit: Brad King CommitDate: Wed Jul 10 09:22:19 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88bb13827e39c4286dea1b2a4ff75f975816005f commit 88bb13827e39c4286dea1b2a4ff75f975816005f Merge: 96a35a8 366746b Author: Brad King AuthorDate: Wed Jul 10 09:22:02 2019 -0400 Commit: Brad King CommitDate: Wed Jul 10 09:22:02 2019 -0400 Merge branch 'release-3.14' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96a35a8eed624ec326f13d1e7d3d735c7b35bcae commit 96a35a8eed624ec326f13d1e7d3d735c7b35bcae Merge: 29a1a68 0a7b612 Author: Brad King AuthorDate: Wed Jul 10 13:20:55 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 09:21:24 2019 -0400 Merge topic 'implicit-includes-cray-hlist' 0a7b61269c Merge branch 'backport-implicit-includes-cray-hlist' 98e371f13e Cray: Fix include parsing when the -hlist= flag is present Acked-by: Kitware Robot Merge-request: !3532 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29a1a68e903640bd79483e4b6ba13bd93fe3a3f5 commit 29a1a68e903640bd79483e4b6ba13bd93fe3a3f5 Merge: 27bd921 8895449 Author: Brad King AuthorDate: Wed Jul 10 13:20:23 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 09:20:32 2019 -0400 Merge topic 'cuda-imported-library-device-linking' 8895449648 CUDA: Restore device linking to imported static library targets Acked-by: Kitware Robot Merge-request: !3526 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27bd921b38121fb6be54e8b200252c2914049dea commit 27bd921b38121fb6be54e8b200252c2914049dea Merge: 8c7a627 8e1664d Author: Brad King AuthorDate: Wed Jul 10 13:19:20 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 09:19:36 2019 -0400 Merge topic 'emacs/drop-23' 8e1664d108 cmake-mode.el: Drop support for Emacs < 24 Acked-by: Kitware Robot Merge-request: !3520 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=366746bbef613f9d258e66a32f8fbacd407acfba commit 366746bbef613f9d258e66a32f8fbacd407acfba Merge: c54fc82 98e371f Author: Brad King AuthorDate: Tue Jul 9 13:14:24 2019 -0400 Commit: Brad King CommitDate: Tue Jul 9 13:14:24 2019 -0400 Merge branch 'backport-implicit-includes-cray-hlist' into release-3.14 Merge-request: !3532 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8e1664d108a183a9e1e53a3a42bc58a2a0104d60 commit 8e1664d108a183a9e1e53a3a42bc58a2a0104d60 Author: Hong Xu AuthorDate: Sat Jul 6 18:09:50 2019 -0700 Commit: Brad King CommitDate: Tue Jul 9 10:50:19 2019 -0400 cmake-mode.el: Drop support for Emacs < 24 The `cmake--parent-mode` alias exists only for compatibility and breaks Emacs packages and scripts that make use of `prog-mode-hook` because Emacs does not examine whether the parent mode is an alias or not. Remove the alias and require Emacs 24 or higher. Emacs 24 was released in 2012 and this is already 2019, thus the loss to drop support for versions < 24 is negligible. diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index e4fa6c1..caaf0d5 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -1,5 +1,7 @@ ;;; 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. ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-mode.el | 10 ++-- Modules/CMakeParseImplicitIncludeInfo.cmake | 4 +- Source/cmLinkLineDeviceComputer.cxx | 17 ++++--- .../ParseImplicitIncludeInfo.cmake | 1 + .../data/craype-C-Cray-9.0-hlist-ad.input | 54 ++++++++++++++++++++++ .../data/craype-C-Cray-9.0-hlist-ad.output | 1 + .../data/craype-CXX-Cray-9.0-hlist-ad.input | 54 ++++++++++++++++++++++ .../data/craype-CXX-Cray-9.0-hlist-ad.output | 1 + .../data/craype-Fortran-Cray-9.0-hlist-ad.input | 53 +++++++++++++++++++++ .../data/craype-Fortran-Cray-9.0-hlist-ad.output | 1 + 10 files changed, 181 insertions(+), 15 deletions(-) create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 09:23:10 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 09:23:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-37-g98844aa Message-ID: <20190710132310.7F8CA102CDB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 98844aaa6f2309ebac5bf18e2cb24f5c44e6aa07 (commit) via e902a111182b27058cdea9d3f71b3fcb4d729476 (commit) via 0a7b61269c48b43cbc6677c0871ce3d519d460d6 (commit) via 98e371f13e0a8dc35367f98b027f62802b3ed280 (commit) via 88954496488e5b41b599d580d8b673168295d841 (commit) from 844536f681126fcb844c769224b6e690238d5589 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/CMakeParseImplicitIncludeInfo.cmake | 4 +- Source/cmLinkLineDeviceComputer.cxx | 17 ++++--- .../ParseImplicitIncludeInfo.cmake | 1 + .../data/craype-C-Cray-9.0-hlist-ad.input | 54 ++++++++++++++++++++++ .../data/craype-C-Cray-9.0-hlist-ad.output | 1 + .../data/craype-CXX-Cray-9.0-hlist-ad.input | 54 ++++++++++++++++++++++ .../data/craype-CXX-Cray-9.0-hlist-ad.output | 1 + .../data/craype-Fortran-Cray-9.0-hlist-ad.input | 53 +++++++++++++++++++++ .../data/craype-Fortran-Cray-9.0-hlist-ad.output | 1 + 9 files changed, 178 insertions(+), 8 deletions(-) create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input create mode 100644 Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 09:33:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 09:33:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-290-g4fc1043 Message-ID: <20190710133304.1A22AF69E4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4fc10431f06a07cd7ac1fafa7f3a8e633bea204c (commit) via fe8f6e362a42ae621dc0f6fd73e86eee307ce23b (commit) via 2161f810d986b76e774c522408a0e1e648a1f92e (commit) via 417eb5739a35a57bc345bf32c56c80d13e33b292 (commit) via 0a65768068e85d69a10012f9d628ddc7d31a81d0 (commit) via f4ed56ab632000d51132bafe191137dd6012b9d6 (commit) from 70290a2abf9e192bb1e0267ec9a6abedde9ba7db (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4fc10431f06a07cd7ac1fafa7f3a8e633bea204c commit 4fc10431f06a07cd7ac1fafa7f3a8e633bea204c Merge: fe8f6e3 f4ed56a Author: Brad King AuthorDate: Wed Jul 10 13:26:30 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 09:26:39 2019 -0400 Merge topic 'elseif' f4ed56ab63 Fix elseif() in place of else() Acked-by: Kitware Robot Acked-by: Alex Turbov Acked-by: Rolf Eike Beer Merge-request: !3515 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe8f6e362a42ae621dc0f6fd73e86eee307ce23b commit fe8f6e362a42ae621dc0f6fd73e86eee307ce23b Merge: 2161f81 417eb57 Author: Brad King AuthorDate: Wed Jul 10 13:25:39 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 09:25:48 2019 -0400 Merge topic 'clang-test-fixes' 417eb5739a Tests: fix some Clang failures on Windows Acked-by: Kitware Robot Merge-request: !3518 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2161f810d986b76e774c522408a0e1e648a1f92e commit 2161f810d986b76e774c522408a0e1e648a1f92e Merge: 70290a2 0a65768 Author: Brad King AuthorDate: Wed Jul 10 13:24:14 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 09:24:23 2019 -0400 Merge topic 'eclipse-init-members' 0a65768068 Eclpise: Fix compiler warnings about uninitialized member variables Acked-by: Kitware Robot Merge-request: !3524 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=417eb5739a35a57bc345bf32c56c80d13e33b292 commit 417eb5739a35a57bc345bf32c56c80d13e33b292 Author: Zsolt Parragi AuthorDate: Sat Jul 6 14:56:54 2019 +0200 Commit: Brad King CommitDate: Tue Jul 9 11:30:25 2019 -0400 Tests: fix some Clang failures on Windows * Execute MSVCRuntimeLibrary tests for GNU command line mode Clang on Windows using the MSVC ABI * Assembler tests should be executed with the Ninja generator * Assembler tests shouldn't be executed with clang-cl * Fixed a condition in the Preprocess test for clang-cl * Adjusted the conditions on some MSVC specific tests diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index fb17ebb..21b265c 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -7,9 +7,10 @@ set(SRCS) # (at least) the following toolchains can process assembler files directly # and also generate assembler files from C: -if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND +if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND NOT CMAKE_OSX_ARCHITECTURES) - if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX)) + if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX) + AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")) set(C_FLAGS "${CMAKE_C_FLAGS}") separate_arguments(C_FLAGS) if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};") diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index b8b7e21..d951316 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1877,9 +1877,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH endif () list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") - if(MSVC) - ADD_TEST_MACRO(ForceInclude foo) + if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_SIMULATE_ID STREQUAL "MSVC")) ADD_TEST_MACRO(PDBDirectoryAndName myexe) + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + ADD_TEST_MACRO(ForceInclude foo) + endif() if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") ADD_TEST_MACRO(PrecompiledHeader foo) endif() diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt index 6d8d6cc..44194ca 100644 --- a/Tests/PDBDirectoryAndName/CMakeLists.txt +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -3,8 +3,8 @@ cmake_policy(SET CMP0054 NEW) project(PDBDirectoryAndName C) # Make sure the proper compiler is in use. -if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") - message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel") +if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC, Clang or Intel") endif() # Intel 11.1 does not support /Fd but Intel 14.0 does. diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 588af03..bce1b3f 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -29,7 +29,10 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND - "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" AND + "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") + set(CLANG_MSVC_WINDOWS 1) +endif() +if(CLANG_MSVC_WINDOWS AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") set(CLANG_GNULIKE_WINDOWS 1) endif() @@ -106,7 +109,7 @@ endif() set(EXPR_OP1 "/") if((NOT MSVC OR PP_NMAKE) AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND - NOT CLANG_GNULIKE_WINDOWS) + NOT CLANG_MSVC_WINDOWS) # MSVC cl, Intel icl: % # When the cl compiler is invoked from the command line then % must # be written %% (to distinguish from %ENV% syntax). However cl does https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a65768068e85d69a10012f9d628ddc7d31a81d0 commit 0a65768068e85d69a10012f9d628ddc7d31a81d0 Author: Martin Gerhardy AuthorDate: Mon Jul 8 09:19:33 2019 +0200 Commit: Brad King CommitDate: Tue Jul 9 11:08:50 2019 -0400 Eclpise: Fix compiler warnings about uninitialized member variables diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index aece3bc..d6f7021 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -44,6 +44,8 @@ void AppendDictionary(cmXMLWriter& xml, const char* key, T const& value) cmExtraEclipseCDT4Generator::cmExtraEclipseCDT4Generator() { + this->IsOutOfSourceBuild = false; + this->GenerateSourceProject = false; this->SupportsVirtualFolders = true; this->GenerateLinkedResources = true; this->SupportsGmakeErrorParser = true; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4ed56ab632000d51132bafe191137dd6012b9d6 commit f4ed56ab632000d51132bafe191137dd6012b9d6 Author: Artalus AuthorDate: Wed Jul 3 11:57:08 2019 +0300 Commit: Artalus CommitDate: Wed Jul 3 11:57:53 2019 +0300 Fix elseif() in place of else() diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake index 4b02a9a..2b37e25 100644 --- a/Modules/Compiler/IAR-C.cmake +++ b/Modules/Compiler/IAR-C.cmake @@ -15,7 +15,7 @@ if(CMAKE_C_COMPILER_VERSION_INTERNAL VERSION_GREATER 7) set(CMAKE_C90_EXTENSION_COMPILE_OPTION --c89 -e) set(CMAKE_C99_STANDARD_COMPILE_OPTION "") set(CMAKE_C99_EXTENSION_COMPILE_OPTION -e) -elseif() +else() set(CMAKE_C90_STANDARD_COMPILE_OPTION "") set(CMAKE_C90_EXTENSION_COMPILE_OPTION -e) endif() diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake index cf1632a..3d8ce88 100644 --- a/Modules/FindBacktrace.cmake +++ b/Modules/FindBacktrace.cmake @@ -74,7 +74,7 @@ else() if(Backtrace_INCLUDE_DIR) # OpenBSD has libbacktrace renamed to libexecinfo find_library(Backtrace_LIBRARY "execinfo") - elseif() # respect user wishes + else() # respect user wishes set(_Backtrace_HEADER_TRY "backtrace.h") find_path(Backtrace_INCLUDE_DIR ${_Backtrace_HEADER_TRY}) find_library(Backtrace_LIBRARY "backtrace") diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index a145b46..3993968 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -670,7 +670,7 @@ if (QT_QMAKE_EXECUTABLE AND get_filename_component(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE) set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE) endif() - elseif() + else() message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}") message("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.") endif() diff --git a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake index 4ff5327..512a1c9 100644 --- a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake +++ b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake @@ -25,7 +25,7 @@ foreach(i 1 2) if(line MATCHES "^ *$") set(Library${i}Found TRUE) message(STATUS "foo.vcxproj is using package reference ${testLibrary} with version ${testVersion}") - elseif() + else() message(STATUS "foo.vcxproj failed to define reference ${testLibrary} with version ${testVersion}") set(Library${i}Found FALSE) endif() diff --git a/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake b/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake index 15ba46e..60ee8e6 100644 --- a/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake +++ b/Utilities/cmcurl/CMake/CurlSymbolHiding.cmake @@ -53,7 +53,7 @@ elseif(MSVC) message(WARNING "Hiding private symbols regardless CURL_HIDDEN_SYMBOLS being disabled.") set(HIDES_CURL_PRIVATE_SYMBOLS TRUE) endif() -elseif() +else() set(HIDES_CURL_PRIVATE_SYMBOLS FALSE) endif() ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/IAR-C.cmake | 2 +- Modules/FindBacktrace.cmake | 2 +- Modules/FindQt4.cmake | 2 +- Source/cmExtraEclipseCDT4Generator.cxx | 2 ++ Tests/Assembler/CMakeLists.txt | 5 +++-- Tests/CMakeLists.txt | 6 ++++-- Tests/PDBDirectoryAndName/CMakeLists.txt | 4 ++-- Tests/Preprocess/CMakeLists.txt | 7 +++++-- Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake | 2 +- Utilities/cmcurl/CMake/CurlSymbolHiding.cmake | 2 +- 10 files changed, 21 insertions(+), 13 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 12:53:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 12:53:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-292-gbb4b394 Message-ID: <20190710165309.666AA1034A3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via bb4b394fac234c453b3f76ff7d1b85a62167617d (commit) via 98617f1be07ecded94085f0aac41284604d3c684 (commit) from 4fc10431f06a07cd7ac1fafa7f3a8e633bea204c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb4b394fac234c453b3f76ff7d1b85a62167617d commit bb4b394fac234c453b3f76ff7d1b85a62167617d Merge: 4fc1043 98617f1 Author: Kyle Edwards AuthorDate: Wed Jul 10 16:48:01 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 10 12:48:12 2019 -0400 Merge topic 'fix/move-more-cpack-internals' 98617f1be0 Refactor: Move CPack internal files to `Internal/CPack/` directory Acked-by: Kitware Robot Merge-request: !3530 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98617f1be07ecded94085f0aac41284604d3c684 commit 98617f1be07ecded94085f0aac41284604d3c684 Author: Alex Turbov AuthorDate: Tue Jul 9 15:45:03 2019 +0300 Commit: Alex Turbov CommitDate: Tue Jul 9 15:45:03 2019 +0300 Refactor: Move CPack internal files to `Internal/CPack/` directory Some commits ago all CPack internal `*.cmake` files have been moved to `Internal/CPack/`. This commit also move some templates internally used by generators to the same location to make `Modules/` directory less noisy w/ files the end users don't need to use/see. diff --git a/Modules/CPack.DS_Store.in b/Modules/Internal/CPack/CPack.DS_Store.in similarity index 100% rename from Modules/CPack.DS_Store.in rename to Modules/Internal/CPack/CPack.DS_Store.in diff --git a/Modules/CPack.Description.plist.in b/Modules/Internal/CPack/CPack.Description.plist.in similarity index 100% rename from Modules/CPack.Description.plist.in rename to Modules/Internal/CPack/CPack.Description.plist.in diff --git a/Modules/CPack.Info.plist.in b/Modules/Internal/CPack/CPack.Info.plist.in similarity index 100% rename from Modules/CPack.Info.plist.in rename to Modules/Internal/CPack/CPack.Info.plist.in diff --git a/Modules/CPack.NuGet.nuspec.in b/Modules/Internal/CPack/CPack.NuGet.nuspec.in similarity index 100% rename from Modules/CPack.NuGet.nuspec.in rename to Modules/Internal/CPack/CPack.NuGet.nuspec.in diff --git a/Modules/CPack.OSXScriptLauncher.in b/Modules/Internal/CPack/CPack.OSXScriptLauncher.in old mode 100755 new mode 100644 similarity index 100% rename from Modules/CPack.OSXScriptLauncher.in rename to Modules/Internal/CPack/CPack.OSXScriptLauncher.in diff --git a/Modules/CPack.OSXScriptLauncher.rsrc.in b/Modules/Internal/CPack/CPack.OSXScriptLauncher.rsrc.in similarity index 100% rename from Modules/CPack.OSXScriptLauncher.rsrc.in rename to Modules/Internal/CPack/CPack.OSXScriptLauncher.rsrc.in diff --git a/Modules/CPack.OSXX11.Info.plist.in b/Modules/Internal/CPack/CPack.OSXX11.Info.plist.in similarity index 100% rename from Modules/CPack.OSXX11.Info.plist.in rename to Modules/Internal/CPack/CPack.OSXX11.Info.plist.in diff --git a/Modules/CPack.OSXX11.main.scpt.in b/Modules/Internal/CPack/CPack.OSXX11.main.scpt.in similarity index 100% rename from Modules/CPack.OSXX11.main.scpt.in rename to Modules/Internal/CPack/CPack.OSXX11.main.scpt.in diff --git a/Modules/CPack.RuntimeScript.in b/Modules/Internal/CPack/CPack.RuntimeScript.in similarity index 100% rename from Modules/CPack.RuntimeScript.in rename to Modules/Internal/CPack/CPack.RuntimeScript.in diff --git a/Modules/CPack.STGZ_Header.sh.in b/Modules/Internal/CPack/CPack.STGZ_Header.sh.in similarity index 99% rename from Modules/CPack.STGZ_Header.sh.in rename to Modules/Internal/CPack/CPack.STGZ_Header.sh.in index 70f63d2..003fcfe 100755 --- a/Modules/CPack.STGZ_Header.sh.in +++ b/Modules/Internal/CPack/CPack.STGZ_Header.sh.in @@ -43,10 +43,10 @@ for a in "$@CPACK_AT_SIGN@"; do cpack_prefix_dir=`cpack_fix_slashes "${cpack_prefix_dir}"` fi if echo $a | grep "^--help" > /dev/null 2> /dev/null; then - cpack_usage + cpack_usage fi if echo $a | grep "^--version" > /dev/null 2> /dev/null; then - cpack_version + cpack_version exit 2 fi if echo $a | grep "^--include-subdir" > /dev/null 2> /dev/null; then @@ -143,4 +143,3 @@ exit 0 #----------------------------------------------------------- # Start of TAR.GZ file #-----------------------------------------------------------; - diff --git a/Modules/CPack.VolumeIcon.icns.in b/Modules/Internal/CPack/CPack.VolumeIcon.icns.in similarity index 100% rename from Modules/CPack.VolumeIcon.icns.in rename to Modules/Internal/CPack/CPack.VolumeIcon.icns.in diff --git a/Modules/CPack.background.png.in b/Modules/Internal/CPack/CPack.background.png.in similarity index 100% rename from Modules/CPack.background.png.in rename to Modules/Internal/CPack/CPack.background.png.in diff --git a/Modules/CPack.distribution.dist.in b/Modules/Internal/CPack/CPack.distribution.dist.in similarity index 100% rename from Modules/CPack.distribution.dist.in rename to Modules/Internal/CPack/CPack.distribution.dist.in diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake index 4b2ce92..82053b2 100644 --- a/Modules/Internal/CPack/CPackNuGet.cmake +++ b/Modules/Internal/CPack/CPackNuGet.cmake @@ -262,7 +262,7 @@ function(_cpack_nuget_render_spec) # NuGet will name it properly. _cpack_nuget_debug("Rendering `${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec` file...") configure_file( - "${CMAKE_ROOT}/Modules/CPack.NuGet.nuspec.in" + "${CMAKE_ROOT}/Modules/Internal/CPack/CPack.NuGet.nuspec.in" "${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec" @ONLY ) diff --git a/Modules/NSIS.InstallOptions.ini.in b/Modules/Internal/CPack/NSIS.InstallOptions.ini.in similarity index 100% rename from Modules/NSIS.InstallOptions.ini.in rename to Modules/Internal/CPack/NSIS.InstallOptions.ini.in diff --git a/Modules/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in similarity index 100% rename from Modules/NSIS.template.in rename to Modules/Internal/CPack/NSIS.template.in diff --git a/Modules/WIX.template.in b/Modules/Internal/CPack/WIX.template.in similarity index 100% rename from Modules/WIX.template.in rename to Modules/Internal/CPack/WIX.template.in diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 045d93d..fa64d79 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -604,7 +604,7 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate() { - std::string wixTemplate = FindTemplate("WIX.template.in"); + std::string wixTemplate = FindTemplate("Internal/CPack/WIX.template.in"); if (GetOption("CPACK_WIX_TEMPLATE") != 0) { wixTemplate = GetOption("CPACK_WIX_TEMPLATE"); } diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index e2020c5..87c36fa 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -36,7 +36,8 @@ int cmCPackNSISGenerator::PackageFiles() { // TODO: Fix nsis to force out file name - std::string nsisInFileName = this->FindTemplate("NSIS.template.in"); + std::string nsisInFileName = + this->FindTemplate("Internal/CPack/NSIS.template.in"); if (nsisInFileName.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack error: Could not find NSIS installer template file." @@ -44,7 +45,7 @@ int cmCPackNSISGenerator::PackageFiles() return false; } std::string nsisInInstallOptions = - this->FindTemplate("NSIS.InstallOptions.ini.in"); + this->FindTemplate("Internal/CPack/NSIS.InstallOptions.ini.in"); if (nsisInInstallOptions.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack error: Could not find NSIS installer options file." diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 90e0afe..41470c9 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -245,7 +245,7 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile( const std::string& name, const std::string& dir, const char* outputFileName /* = 0 */, bool copyOnly /* = false */) { - std::string inFName = "CPack."; + std::string inFName = "Internal/CPack/CPack."; inFName += name; inFName += ".in"; std::string inFileName = this->FindTemplate(inFName.c_str()); diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 8c22c65..d361921 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -48,7 +48,7 @@ std::string cmCPackPKGGenerator::GetPackageName( void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile) { std::string distributionTemplate = - this->FindTemplate("CPack.distribution.dist.in"); + this->FindTemplate("Internal/CPack/CPack.distribution.dist.in"); if (distributionTemplate.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find input file: " << distributionTemplate @@ -305,7 +305,7 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name, outName = name.c_str(); } - std::string inFName = "CPack."; + std::string inFName = "Internal/CPack/CPack."; inFName += name; inFName += ".in"; std::string inFileName = this->FindTemplate(inFName.c_str()); diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index aba15d2..4666dc2 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -21,7 +21,8 @@ int cmCPackSTGZGenerator::InitializeInternal() { this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "0"); - std::string inFile = this->FindTemplate("CPack.STGZ_Header.sh.in"); + std::string inFile = + this->FindTemplate("Internal/CPack/CPack.STGZ_Header.sh.in"); if (inFile.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find template file: " << inFile << std::endl); ----------------------------------------------------------------------- Summary of changes: Modules/{ => Internal/CPack}/CPack.DS_Store.in | Bin Modules/{ => Internal/CPack}/CPack.Description.plist.in | 0 Modules/{ => Internal/CPack}/CPack.Info.plist.in | 0 Modules/{ => Internal/CPack}/CPack.NuGet.nuspec.in | 0 Modules/{ => Internal/CPack}/CPack.OSXScriptLauncher.in | Bin .../{ => Internal/CPack}/CPack.OSXScriptLauncher.rsrc.in | Bin Modules/{ => Internal/CPack}/CPack.OSXX11.Info.plist.in | 0 Modules/{ => Internal/CPack}/CPack.OSXX11.main.scpt.in | Bin Modules/{ => Internal/CPack}/CPack.RuntimeScript.in | 0 Modules/{ => Internal/CPack}/CPack.STGZ_Header.sh.in | 5 ++--- Modules/{ => Internal/CPack}/CPack.VolumeIcon.icns.in | Bin Modules/{ => Internal/CPack}/CPack.background.png.in | Bin Modules/{ => Internal/CPack}/CPack.distribution.dist.in | 0 Modules/Internal/CPack/CPackNuGet.cmake | 2 +- Modules/{ => Internal/CPack}/NSIS.InstallOptions.ini.in | 0 Modules/{ => Internal/CPack}/NSIS.template.in | 0 Modules/{ => Internal/CPack}/WIX.template.in | 0 Source/CPack/WiX/cmCPackWIXGenerator.cxx | 2 +- Source/CPack/cmCPackNSISGenerator.cxx | 5 +++-- Source/CPack/cmCPackOSXX11Generator.cxx | 2 +- Source/CPack/cmCPackPKGGenerator.cxx | 4 ++-- Source/CPack/cmCPackSTGZGenerator.cxx | 3 ++- 22 files changed, 12 insertions(+), 11 deletions(-) rename Modules/{ => Internal/CPack}/CPack.DS_Store.in (100%) rename Modules/{ => Internal/CPack}/CPack.Description.plist.in (100%) rename Modules/{ => Internal/CPack}/CPack.Info.plist.in (100%) rename Modules/{ => Internal/CPack}/CPack.NuGet.nuspec.in (100%) rename Modules/{ => Internal/CPack}/CPack.OSXScriptLauncher.in (100%) mode change 100755 => 100644 rename Modules/{ => Internal/CPack}/CPack.OSXScriptLauncher.rsrc.in (100%) rename Modules/{ => Internal/CPack}/CPack.OSXX11.Info.plist.in (100%) rename Modules/{ => Internal/CPack}/CPack.OSXX11.main.scpt.in (100%) rename Modules/{ => Internal/CPack}/CPack.RuntimeScript.in (100%) rename Modules/{ => Internal/CPack}/CPack.STGZ_Header.sh.in (99%) rename Modules/{ => Internal/CPack}/CPack.VolumeIcon.icns.in (100%) rename Modules/{ => Internal/CPack}/CPack.background.png.in (100%) rename Modules/{ => Internal/CPack}/CPack.distribution.dist.in (100%) rename Modules/{ => Internal/CPack}/NSIS.InstallOptions.ini.in (100%) rename Modules/{ => Internal/CPack}/NSIS.template.in (100%) rename Modules/{ => Internal/CPack}/WIX.template.in (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 13:23:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 13:23:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-294-gf758e8a Message-ID: <20190710172305.4BB0D68A52@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f758e8a927fee1c8bad1beffc021c76c55c51fc9 (commit) via 86ead0b5a32ee48907084a7cf85d00196cbf0366 (commit) from bb4b394fac234c453b3f76ff7d1b85a62167617d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f758e8a927fee1c8bad1beffc021c76c55c51fc9 commit f758e8a927fee1c8bad1beffc021c76c55c51fc9 Merge: bb4b394 86ead0b Author: Brad King AuthorDate: Wed Jul 10 13:21:28 2019 -0400 Commit: Brad King CommitDate: Wed Jul 10 13:21:28 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 13:23:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 13:23:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc3-38-g86ead0b Message-ID: <20190710172305.76B3674D04@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 86ead0b5a32ee48907084a7cf85d00196cbf0366 (commit) from 98844aaa6f2309ebac5bf18e2cb24f5c44e6aa07 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 10 13:43:02 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 10 Jul 2019 13:43:02 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.15.0-rc4, created. v3.15.0-rc4 Message-ID: <20190710174302.ED09068A52@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The annotated tag, v3.15.0-rc4 has been created at 5c0505fbec6ec5cecea9a2b48d3449b3a9e6b6c3 (tag) tagging 86ead0b5a32ee48907084a7cf85d00196cbf0366 (commit) replaces v3.15.0-rc3 tagged by Brad King on Wed Jul 10 13:37:55 2019 -0400 - Log ----------------------------------------------------------------- CMake 3.15.0-rc4 -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEExsJlMku+vcNQtRPQLSzvEDSSFoQFAl0mInMWHGJyYWQua2lu Z0BraXR3YXJlLmNvbQAKCRAtLO8QNJIWhAenD/4kN+MPNY+fs4m8uKsEFOYRkwvU gTs2T2r07eLc79wuxZc+3iXpkBYFDddXErMcrM+gOqFaXqoTeSvPWl6TEwdRb8x7 nZ17CbEm1Nm5y831dCLQiGGb2VagyKV66Uqlyxsw1vH8CCn9q4+7bNsx6X4qz7rV HcPvSHTPgt8AlMcHbV7zLZ3Ymx8kuJFWZPVtyBniSr7EBKBaxKhVRUOpghyCtmqq 7v6Sku6wUeiVnPCg2CrXZUoNbqqO9HNWlXdRzdmj78CbTfcQSzv17e7BMjCywPob a7UfDfpTp2kMO/zYyISvQOVvBlnPNjFQs5LACAYWTmrw6Av7wIFI19Jnv7E6NgPJ lnNRvNATNbv0kH4oljr0CPuS3caKFJ+mbGt9WDoL2Hz+8F8M+rsfQ/MHo/bucB5b ok+3/DqMODH0qEUaFDZxouJ2WCqzlYTuO0fHvWHYO84S5u/peRsGyUYsVHZuuxw4 awMcUG6tCUGu6CVbKLQfV6D/yOm7ewN+vw5O74KuuZ1llLjnwaARGOY6NVjrVH1/ JnadtIuppL+Z8kBhuMYweMe5+s/2DYDzZ48M5k/1r73rJW9Uhag9rizY2SilGfys BFAs+qpjd5gy+Tco0kE+HFbLWIBgliP5Ronnw7jppO5cpHrOXGg+zAVgTKZn2wde eC/0CVGXuPRKGi0aSw== =k+Jg -----END PGP SIGNATURE----- Alex Turbov (1): list(POP_FRONT): Fix always assigning first item to output vars Brad King (14): Merge branch 'cuda-no-device-link-when-disabled' into release-3.15 expat: Update script to get Expat 2.2.7 Merge branch 'upstream-expat' into update-expat Merge branch 'update-expat' into release-3.15 Merge branch 'qt-5.13' into release-3.15 FindPostgreSQL: Fix regression in computation of library directory Merge branch 'FindPostgreSQL-lib-dir' into release-3.15 cmGlobalGenerator: Do not persist alias targets across configures Merge branch 'iar-riscv' into release-3.15 Merge branch 'ccmake-clear-aliases' into release-3.15 Merge branch 'backport-implicit-includes-cray-hlist' Merge branch 'cuda-imported-library-device-linking' into release-3.15 Merge branch 'implicit-includes-cray-hlist' into release-3.15 CMake 3.15.0-rc4 Chuck Atkins (1): Cray: Fix include parsing when the -hlist= flag is present Craig Scott (14): Help: Remove self-references from project() docs Help: move code injection vars to their own section Merge branch 'bug/19436' into release-3.15 Merge branch 'docs-project-code-injection' into release-3.15 Merge topic 'doc-toolchain-file-CMAKE_SOURCE_DIR' into release-3.15 Help: Clean up trivial typos and grammar Help: Improve formatting of list(TRANSFORM) sub-options Help: Add missing xref for CMAKE_EXECUTE_PROCESS_COMMAND_ECHO Help: Clarify how to provide multiple targets with cmake --target Help: Remove mention of CMAKE_INSTALL_DO_STRIP Merge branch 'docs-misc-trivial-cleanups' into release-3.15 Help: Use consistent levels for cmake --loglevel and message() Merge branch 'loglevel-option-case-consistency' into release-3.15 Merge topic 'docs-message-cmake-gui' into release-3.15 Expat Upstream (1): expat 2019-06-19 (d3b78b42) Frank Dana (1): message() help: Clarify how logs are displayed in various tools Oleg Chernovskiy (1): Help: Discourage using CMAKE_SOURCE_DIR in toolchain files Robert Maynard (2): CUDA: Do not device link if CUDA is not an enabled language CUDA: Restore device linking to imported static library targets Sebastian Holtermann (2): Tests: Autogen: Use valid rcc compression levels QtDialog: Use QPalette::WindowText instead of QPalette::Foreground Stefan Andersson (1): IAR: Add support for the RISC-V compiler ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 11 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 11 Jul 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-257-g7c98e2d Message-ID: <20190711040307.1278510D466@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7c98e2d1ad35610c51b6604a6476b365ccb0c05d (commit) from f758e8a927fee1c8bad1beffc021c76c55c51fc9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c98e2d1ad35610c51b6604a6476b365ccb0c05d commit 7c98e2d1ad35610c51b6604a6476b365ccb0c05d Author: Kitware Robot AuthorDate: Thu Jul 11 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Thu Jul 11 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9ff6d79..f2aeb5d 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 15) -set(CMake_VERSION_PATCH 20190710) +set(CMake_VERSION_PATCH 20190711) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 11 06:13:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 11 Jul 2019 06:13:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-259-g24722b7 Message-ID: <20190711101307.D47C7F6528@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 24722b7860ebab15baaf124b84378d323494813e (commit) via c65f296960c7d464c57e5d48abecdcadd6258190 (commit) from 7c98e2d1ad35610c51b6604a6476b365ccb0c05d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=24722b7860ebab15baaf124b84378d323494813e commit 24722b7860ebab15baaf124b84378d323494813e Merge: 7c98e2d c65f296 Author: Craig Scott AuthorDate: Thu Jul 11 10:07:06 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 11 06:07:26 2019 -0400 Merge topic 'docs-file-GLOB-case-sensitivity' c65f296960 Help: Mention file(GLOB)'s case-sensitivity Acked-by: Kitware Robot Merge-request: !3516 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c65f296960c7d464c57e5d48abecdcadd6258190 commit c65f296960c7d464c57e5d48abecdcadd6258190 Author: Steve Mokris AuthorDate: Fri Jul 5 14:13:12 2019 -0400 Commit: Brad King CommitDate: Wed Jul 10 09:29:29 2019 -0400 Help: Mention file(GLOB)'s case-sensitivity Based on the KWSYS_GLOB_CASE_INDEPENDENT flag in `Source/kwsys/Glob.cxx`. diff --git a/Help/command/file.rst b/Help/command/file.rst index 666a532..c06451a 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -503,6 +503,11 @@ regular expressions, but much simpler. If ``RELATIVE`` flag is specified, the results will be returned as relative paths to the given path. The results will be ordered lexicographically. +On Windows and macOS, globbing is case-insensitive even if the underlying +filesystem is case-sensitive (both filenames and globbing expressions are +converted to lowercase before matching). On other platforms, globbing is +case-sensitive. + If the ``CONFIGURE_DEPENDS`` flag is specified, CMake will add logic to the main build system check target to rerun the flagged ``GLOB`` commands at build time. If any of the outputs change, CMake will regenerate the build ----------------------------------------------------------------------- Summary of changes: Help/command/file.rst | 5 +++++ 1 file changed, 5 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 11 08:53:13 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 11 Jul 2019 08:53:13 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-268-ge153144 Message-ID: <20190711125313.E2712C0205@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e15314420c8ccf08e7855a0400a3ce76bddff95e (commit) via c30939a7130b154c384cc9becb3386b67c7f3ad2 (commit) via 6e4e79e1b054fd7f9f697e67136dc2c4ef405dc8 (commit) via 01a8b89f292c031e7a35bedf92b7cda98bef7f6d (commit) via 71fbebd1dc3a24e2478bb5704d9ac20f36cbf704 (commit) via bf2244681b2cbbd2684187e628e00c0600ae4122 (commit) via cafaa5883a0ef4371a1435de5e56a7825679bb2b (commit) via 09c1991895baf0eeca028672a6730f2101d3b2b7 (commit) via adcbdb143cfd302c6b3ae6da9b53f469e01a900b (commit) from 24722b7860ebab15baaf124b84378d323494813e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e15314420c8ccf08e7855a0400a3ce76bddff95e commit e15314420c8ccf08e7855a0400a3ce76bddff95e Merge: c30939a 71fbebd Author: Brad King AuthorDate: Thu Jul 11 12:52:28 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 11 08:52:36 2019 -0400 Merge topic 'iwyu-memory' 71fbebd1dc IWYU: Fix handling of standard header Acked-by: Kitware Robot Acked-by: Marc Chevrier Merge-request: !3536 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c30939a7130b154c384cc9becb3386b67c7f3ad2 commit c30939a7130b154c384cc9becb3386b67c7f3ad2 Merge: 6e4e79e bf22446 Author: Brad King AuthorDate: Thu Jul 11 12:50:49 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 11 08:51:22 2019 -0400 Merge topic 'CheckSymbolExists-doc' bf2244681b CheckSymbolExists: Add examples for check_symbol_exists cafaa5883a CheckCXXSymbolExists: Clarify documented role Acked-by: Kitware Robot Merge-request: !3522 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e4e79e1b054fd7f9f697e67136dc2c4ef405dc8 commit 6e4e79e1b054fd7f9f697e67136dc2c4ef405dc8 Merge: 01a8b89 adcbdb1 Author: Brad King AuthorDate: Thu Jul 11 12:50:26 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 11 08:50:36 2019 -0400 Merge topic 'fix_ctest_output' adcbdb143c CTest: Clean up stdout and logfile output for Pass/Fail regex Acked-by: Kitware Robot Merge-request: !3509 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01a8b89f292c031e7a35bedf92b7cda98bef7f6d commit 01a8b89f292c031e7a35bedf92b7cda98bef7f6d Merge: 24722b7 09c1991 Author: Brad King AuthorDate: Thu Jul 11 12:49:25 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 11 08:49:34 2019 -0400 Merge topic 'eclipse-resource-encoding' 09c1991895 Eclipse: Add option to set the resource encoding Acked-by: Kitware Robot Merge-request: !3525 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71fbebd1dc3a24e2478bb5704d9ac20f36cbf704 commit 71fbebd1dc3a24e2478bb5704d9ac20f36cbf704 Author: Brad King AuthorDate: Wed Jul 10 11:38:48 2019 -0400 Commit: Brad King CommitDate: Wed Jul 10 11:48:56 2019 -0400 IWYU: Fix handling of standard header An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of ``. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `` inclusions to follow the now-correct IWYU lints. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 7e07ff4..4a91698 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -7,7 +7,7 @@ #include "cmsys/RegularExpression.hxx" #include #include -#include // IWYU pragma: keep +#include #include #include "cmCPackComponentGroup.h" diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 58b9e70..67b7ea6 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -5,7 +5,6 @@ #include "cmsys/Encoding.hxx" #include #include -#include // IWYU pragma: keep #include #include #include diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index a96513e..237ca82 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -6,7 +6,6 @@ #include "cmsys/Process.h" #include "cmsys/RegularExpression.hxx" #include -#include // IWYU pragma: keep #include #include diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index ef63073..37a8abf 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -29,11 +29,13 @@ #include #include #include +#include #include #include #include #include #include +#include namespace cmsys { class RegularExpression; diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 38cc417..43dfe8e 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include #include #include #include @@ -12,7 +13,7 @@ #include "cmCTestTestHandler.h" #include "cmDuration.h" -#include "cmProcess.h" // IWYU pragma: keep (for unique_ptr) +#include "cmProcess.h" class cmCTest; class cmCTestMultiProcessHandler; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 0ed56c8..46ef809 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -11,7 +11,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 5cfc4a7..fb97e9b 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -18,7 +18,7 @@ #include "cmXMLWriter.h" #include -#include // IWYU pragma: keep +#include #include static const char* cmCTestUpdateHandlerUpdateStrings[] = { diff --git a/Source/cmBinUtilsLinuxELFLinker.h b/Source/cmBinUtilsLinuxELFLinker.h index 348edc4..e209637 100644 --- a/Source/cmBinUtilsLinuxELFLinker.h +++ b/Source/cmBinUtilsLinuxELFLinker.h @@ -9,7 +9,7 @@ #include "cmLDConfigTool.h" #include "cmStateTypes.h" -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmBinUtilsMacOSMachOLinker.h b/Source/cmBinUtilsMacOSMachOLinker.h index 0350d1e..f4f309d 100644 --- a/Source/cmBinUtilsMacOSMachOLinker.h +++ b/Source/cmBinUtilsMacOSMachOLinker.h @@ -8,7 +8,7 @@ #include "cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.h" #include "cmStateTypes.h" -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmBinUtilsWindowsPELinker.h b/Source/cmBinUtilsWindowsPELinker.h index d742195..8d2bf4b 100644 --- a/Source/cmBinUtilsWindowsPELinker.h +++ b/Source/cmBinUtilsWindowsPELinker.h @@ -8,7 +8,7 @@ #include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h" #include "cmStateTypes.h" -#include // IWYU pragma: keep +#include #include class cmRuntimeDependencyArchive; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index d1226c3..536ca35 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -15,7 +15,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmCTest.h b/Source/cmCTest.h index d300c33..7f66378 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -10,7 +10,7 @@ #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 0b1f00c..839c27a 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -10,6 +10,7 @@ #include "cmTargetLinkLibraryType.h" #include +#include #include #include #include diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index d914eb1..4310eed 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -8,7 +8,7 @@ #include "cmsys/FStream.hxx" #include -#include // IWYU pragma: keep +#include static unsigned int const cmCryptoHashAlgoToId[] = { /* clang-format needs this comment to break after the opening brace */ diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index b712f09..c7d3377 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 89aaad0..5e8731a 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -12,7 +12,7 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 2226463..51eb814 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -6,7 +6,7 @@ #include "cm_kwiml.h" #include "cmsys/FStream.hxx" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 494afbb..121f33f 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -4,10 +4,13 @@ #include "cm_static_string_view.hxx" #include "cmsys/Process.h" + #include #include /* isspace */ #include +#include #include +#include #include "cmAlgorithms.h" #include "cmArgumentParser.h" diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index ced27c9..e693155 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -3,7 +3,6 @@ #include "cmExportBuildAndroidMKGenerator.h" #include -#include // IWYU pragma: keep #include #include diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index c366183..e1c098d 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -20,7 +20,7 @@ #include "cmsys/FStream.hxx" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index b60a053..2e86533 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -4,7 +4,7 @@ #include "cmsys/FStream.hxx" #include -#include // IWYU pragma: keep +#include #include #include "cmAlgorithms.h" diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index c169032..a3c9802 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -13,7 +13,7 @@ #include "cmTarget.h" #include -#include // IWYU pragma: keep +#include #include cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator( diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h index 602efa8..aa5a42f 100644 --- a/Source/cmFileAPI.h +++ b/Source/cmFileAPI.h @@ -10,7 +10,7 @@ #include "cm_jsoncpp_writer.h" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 0fb166a..73b4123 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 980ad21..dfba910 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -13,7 +13,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmFileTimes.h b/Source/cmFileTimes.h index cbf0fe2..191d89e 100644 --- a/Source/cmFileTimes.h +++ b/Source/cmFileTimes.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include // IWYU pragma: keep +#include #include /** \class cmFileTimes diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 50ae6a9..783b5f6 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -13,7 +13,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 08003eb..7f189d6 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmForEachCommand.h" -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 175a26d..4d3a005 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -3,7 +3,7 @@ #include "cmGeneratorExpression.h" #include "cmsys/RegularExpression.hxx" -#include // IWYU pragma: keep +#include #include #include "assert.h" diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index fd36c4b..ef76651 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -8,7 +8,7 @@ #include "cmListFileCache.h" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 326cb0e..11c2dcc 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -3,7 +3,7 @@ #include "cmGeneratorExpressionEvaluationFile.h" #include "cmsys/FStream.hxx" -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h index 89a2390..06ebeac 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.h +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index a60c75c..d828dac 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -33,7 +33,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 85a8dbb..845937a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -7,7 +7,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index b80da72..997595b 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -22,9 +22,11 @@ #include "cmTarget.h" #include +#include #include #include #include +#include cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target) : GeneratorTarget(target) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 7fd5433..e36825c 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 2d52356..98e8339 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -9,7 +9,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 15dd404..99afc1d 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -7,7 +7,7 @@ #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index aa584ad..93f5482 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7c2bcd3..78e8f30 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -5,7 +5,7 @@ #include "cmsys/RegularExpression.hxx" #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index a75d8a9..9befb78 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -4,7 +4,7 @@ #include #include -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index d1f8f58..6f32861 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -11,7 +11,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include // IWYU pragma: keep +#include static std::string cmIfCommandError( std::vector const& args) diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index 14288f6..c8ebc8c 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -8,7 +8,7 @@ #include "cmMakefile.h" #include "cmSystemTools.h" -#include // IWYU pragma: keep +#include cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( std::vector const& dirs, const char* dest, diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index 2ed9f73..e8e82cc 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -6,7 +6,7 @@ #include "cmInstallType.h" #include "cmSystemTools.h" -#include // IWYU pragma: keep +#include class cmLocalGenerator; diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index 5832d27..b7b7817 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallScriptGenerator.h" +#include #include #include diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 0774436..d891ad8 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -4,6 +4,7 @@ #include #include +#include #include #include #include diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index b7d602e..eb827be 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -8,7 +8,7 @@ #include "cmGeneratorExpression.h" #include -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 8d065e1..505188f 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 1b01ea2..e9a4a6f 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -7,12 +7,14 @@ #include #include #include +#include #include #include #include #include #include // required for atoi #include +#include #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 9457415..5de1a74 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 801f0e8..0f730c9 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -26,22 +26,24 @@ #include "cmTestGenerator.h" #include "cmVersion.h" #include "cmake.h" +#include "cmsys/RegularExpression.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) # define CM_LG_ENCODE_OBJECT_NAMES # include "cmCryptoHash.h" #endif -#include "cmsys/RegularExpression.hxx" #include #include #include #include +#include #include #include #include #include #include +#include #if defined(__HAIKU__) # include diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 81cafa3..248f4a6 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -5,7 +5,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index c392e97..1b4f428 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -5,7 +5,7 @@ #include "cmsys/FStream.hxx" #include "cmsys/Terminal.h" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 3fdafd2..585eb3c 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include -#include // IWYU pragma: keep +#include #include #include "cmGlobalVisualStudioGenerator.h" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bd98f08..5f22a07 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -9,7 +9,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d223347..d0b70d9 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -8,7 +8,7 @@ #include "cmsys/RegularExpression.hxx" #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 6b9b9c7..2001c1f 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileExecutableTargetGenerator.h" -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index b9f7c6d..e5aed01 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b3bab4b..b5a6246 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileTargetGenerator.h" -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index c570a7c..9eeeed0 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 4236995..70d9fca 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileUtilityTargetGenerator.h" +#include #include #include #include diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index f65abc8..d1af9e6 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -6,7 +6,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 2139a45..57e500e 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -8,7 +8,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 3055e18..a99d8e7 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -13,7 +13,7 @@ #include "cmOSXBundleGenerator.h" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 585db42..2d055ff 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -13,6 +13,7 @@ #include #include #include +#include /* Directory ordering computation. diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h index 9c52129..619fff1 100644 --- a/Source/cmQtAutoGen.h +++ b/Source/cmQtAutoGen.h @@ -5,7 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h index d56153a..d7f4cc6 100644 --- a/Source/cmQtAutoGenGlobalInitializer.h +++ b/Source/cmQtAutoGenGlobalInitializer.h @@ -8,7 +8,7 @@ #include "cmQtAutoGen.h" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index aa073d1..eb0d35e 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -8,7 +8,7 @@ #include "cmQtAutoGen.h" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index e1c435b..3a3162d 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -14,6 +14,8 @@ #include "cmSystemTools.h" #include "cmake.h" +#include + cmQtAutoGenerator::Logger::Logger() { // Initialize logger diff --git a/Source/cmQtAutoMocUic.h b/Source/cmQtAutoMocUic.h index 8061c13..dc18328 100644 --- a/Source/cmQtAutoMocUic.h +++ b/Source/cmQtAutoMocUic.h @@ -14,7 +14,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmRuntimeDependencyArchive.h b/Source/cmRuntimeDependencyArchive.h index ec3ecd4..67efec7 100644 --- a/Source/cmRuntimeDependencyArchive.h +++ b/Source/cmRuntimeDependencyArchive.h @@ -9,7 +9,7 @@ #include "cmsys/RegularExpression.hxx" #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmServer.h b/Source/cmServer.h index aba4924..ab2ad23 100644 --- a/Source/cmServer.h +++ b/Source/cmServer.h @@ -10,7 +10,7 @@ #include "cmUVHandlePtr.h" -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmState.h b/Source/cmState.h index accd838..0649ace 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include +#include #include #include #include diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 6ca1c9f..3f70ed3 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -6,6 +6,7 @@ #include #include #include +#include #include "cmAlgorithms.h" #include "cmProperty.h" diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 998f904..10ccac0 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -8,7 +8,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmTarget.h b/Source/cmTarget.h index fdcca47..f47cc14 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 498953e..916784c 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -2,8 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTestGenerator.h" +#include #include #include +#include #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h index 2b33520..75f8f66 100644 --- a/Source/cmUVProcessChain.h +++ b/Source/cmUVProcessChain.h @@ -7,7 +7,7 @@ #include #include -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h index 1230101..acac2c1 100644 --- a/Source/cmVariableWatch.h +++ b/Source/cmVariableWatch.h @@ -6,7 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include -#include // IWYU pragma: keep +#include #include #include diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 0420881..d17a6d8 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -19,7 +19,7 @@ #include "windows.h" #include -#include // IWYU pragma: keep +#include #include static void ConvertToWindowsSlash(std::string& s); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index a01fa6f..0d3bdf8 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -9,7 +9,7 @@ #include "cmMessageType.h" #include "cmSystemTools.h" -#include // IWYU pragma: keep +#include cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h index f08bb4f..5cc308b 100644 --- a/Source/cmWorkerPool.h +++ b/Source/cmWorkerPool.h @@ -7,7 +7,7 @@ #include "cmAlgorithms.h" // IWYU pragma: keep -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ca3b405..b8238a2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -104,7 +104,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmake.h b/Source/cmake.h index c03872b..6aa00e1 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -7,7 +7,7 @@ #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 86082e5..effc094 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -41,7 +41,7 @@ #include #include #include -#include // IWYU pragma: keep +#include #include #include #include diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index 72ae602..e926350 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/Tests/CMakeServerLib/testServerBuffering.cpp b/Tests/CMakeServerLib/testServerBuffering.cpp index 7330ead..8b0b89b 100644 --- a/Tests/CMakeServerLib/testServerBuffering.cpp +++ b/Tests/CMakeServerLib/testServerBuffering.cpp @@ -1,6 +1,8 @@ #include "cmConnection.h" #include "cmServerConnection.h" + #include +#include #include #include diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 0393ff1..4e00214 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -42,10 +42,17 @@ { symbol: [ "std::istringstream", private, "", public ] }, { symbol: [ "std::ostringstream", private, "", public ] }, - # HACK: iwyu suggests those two files each time vector[] is used. + # HACK: iwyu suggests and each time vector[] is used. # https://github.com/include-what-you-use/include-what-you-use/issues/166 { include: [ "", private, "", public ] }, - { include: [ "", public, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits > >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits, std::allocator > > > >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, # TODO: enable this block and remove some includes? #{ symbol: [ "std::pair", private, "", public ] }, https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf2244681b2cbbd2684187e628e00c0600ae4122 commit bf2244681b2cbbd2684187e628e00c0600ae4122 Author: Hong Xu AuthorDate: Sun Jul 7 15:59:47 2019 -0700 Commit: Brad King CommitDate: Wed Jul 10 09:51:38 2019 -0400 CheckSymbolExists: Add examples for check_symbol_exists Add examples in `CheckCXXSymbolExists` too. Co-Author: Brad King diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index 3364e2f..b112094 100644 --- a/Modules/CheckCXXSymbolExists.cmake +++ b/Modules/CheckCXXSymbolExists.cmake @@ -44,6 +44,17 @@ the way the check is run: command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` execute quietly without messages. + +For example: + +.. code-block:: cmake + + include(CheckCXXSymbolExists) + + # Check for macro SEEK_SET + check_cxx_symbol_exists(SEEK_SET "cstdio" HAVE_SEEK_SET) + # Check for function std::fopen + check_cxx_symbol_exists(std::fopen "cstdio" HAVE_STD_FOPEN) #]=======================================================================] include_guard(GLOBAL) diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index b9ef808..c2f488a 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -45,6 +45,17 @@ the way the check is run: command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` execute quietly without messages. + +For example: + +.. code-block:: cmake + + include(CheckSymbolExists) + + # Check for macro SEEK_SET + check_symbol_exists(SEEK_SET "stdio.h" HAVE_SEEK_SET) + # Check for function fopen + check_symbol_exists(fopen "stdio.h" HAVE_FOPEN) #]=======================================================================] include_guard(GLOBAL) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cafaa5883a0ef4371a1435de5e56a7825679bb2b commit cafaa5883a0ef4371a1435de5e56a7825679bb2b Author: Brad King AuthorDate: Wed Jul 10 09:50:04 2019 -0400 Commit: Brad King CommitDate: Wed Jul 10 09:51:38 2019 -0400 CheckCXXSymbolExists: Clarify documented role diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index 2cccd09..3364e2f 100644 --- a/Modules/CheckCXXSymbolExists.cmake +++ b/Modules/CheckCXXSymbolExists.cmake @@ -5,26 +5,27 @@ CheckCXXSymbolExists -------------------- -Check if a symbol exists as a function, variable, or macro in C++ +Check if a symbol exists as a function, variable, or macro in ``C++``. -.. command:: CHECK_CXX_SYMBOL_EXISTS +.. command:: check_cxx_symbol_exists .. code-block:: cmake - CHECK_CXX_SYMBOL_EXISTS( ) + check_cxx_symbol_exists( ) Check that the ```` is available after including given header ```` and store the result in a ````. Specify the list of files in one argument as a semicolon-separated list. - ``CHECK_CXX_SYMBOL_EXISTS()`` can be used to check in C++ files, as - opposed to ``CHECK_SYMBOL_EXISTS()``, which works only for ``C``. + ``check_cxx_symbol_exists()`` can be used to check for symbols as seen by + the C++ compiler, as opposed to :command:`check_symbol_exists`, which always + uses the ``C`` compiler. If the header files define the symbol as a macro it is considered available and assumed to work. If the header files declare the symbol as a function or variable then the symbol must also be available for - linking. If the symbol is a type or enum value it will not be - recognized (consider using :module:`CheckTypeSize` - or :module:`CheckCXXSourceCompiles`). + linking. If the symbol is a type, enum value, or C++ template it will + not be recognized: consider using the :module:`CheckTypeSize` + or :module:`CheckCXXSourceCompiles` module instead. The following variables may be set before calling this macro to modify the way the check is run: https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09c1991895baf0eeca028672a6730f2101d3b2b7 commit 09c1991895baf0eeca028672a6730f2101d3b2b7 Author: Martin Gerhardy AuthorDate: Mon Jul 8 10:57:34 2019 +0200 Commit: Brad King CommitDate: Tue Jul 9 13:34:29 2019 -0400 Eclipse: Add option to set the resource encoding diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index cd8385b..69e199f 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -915,6 +915,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 diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index cc6a7d2..b9f17d0 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -157,6 +157,7 @@ Variables that Change Behavior /variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES /variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT /variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS + /variable/CMAKE_ECLIPSE_RESOURCE_ENCODING /variable/CMAKE_ECLIPSE_VERSION /variable/CMAKE_ERROR_DEPRECATED /variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION diff --git a/Help/release/dev/eclipse-resource-encoding.rst b/Help/release/dev/eclipse-resource-encoding.rst new file mode 100644 index 0000000..6ceca0c --- /dev/null +++ b/Help/release/dev/eclipse-resource-encoding.rst @@ -0,0 +1,6 @@ +eclipse-resource-encoding +------------------------- + +* The :generator:`Eclipse CDT4` extra generator gained a new + :variable:`CMAKE_ECLIPSE_RESOURCE_ENCODING` option to specify + the resource encoding. diff --git a/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst new file mode 100644 index 0000000..314efe5 --- /dev/null +++ b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst @@ -0,0 +1,6 @@ +CMAKE_ECLIPSE_RESOURCE_ENCODING +------------------------------- + +This cache variable tells the :generator:`Eclipse CDT4` project generator +to set the resource encoding to the given value in generated project files. +If no value is given, no encoding will be set. diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index aece3bc..73984a8 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -164,6 +164,29 @@ void cmExtraEclipseCDT4Generator::Generate() // create a .cproject file this->CreateCProjectFile(); + + // create resource settings + this->CreateSettingsResourcePrefsFile(); +} + +void cmExtraEclipseCDT4Generator::CreateSettingsResourcePrefsFile() +{ + cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0]; + cmMakefile* mf = lg->GetMakefile(); + + const std::string filename = + this->HomeOutputDirectory + "/.settings/org.eclipse.core.resources.prefs"; + + cmGeneratedFileStream fout(filename); + if (!fout) { + return; + } + + fout << "eclipse.preferences.version=1" << std::endl; + const char* encoding = mf->GetDefinition("CMAKE_ECLIPSE_RESOURCE_ENCODING"); + if (encoding) { + fout << "encoding/=" << encoding << std::endl; + } } void cmExtraEclipseCDT4Generator::CreateSourceProjectFile() diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 5136660..ef038d9 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -43,6 +43,9 @@ private: // create .project file in the source tree void CreateSourceProjectFile(); + // create .settings/org.eclipse.core.resources.prefs + void CreateSettingsResourcePrefsFile(); + // create .project file void CreateProjectFile(); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=adcbdb143cfd302c6b3ae6da9b53f469e01a900b commit adcbdb143cfd302c6b3ae6da9b53f469e01a900b Author: Stephen Manz <6985-SRManz at users.noreply.gitlab.kitware.com> AuthorDate: Wed Jun 26 09:01:45 2019 -0700 Commit: Stephen Manz <6985-SRManz at users.noreply.gitlab.kitware.com> CommitDate: Tue Jul 9 09:01:04 2019 -0700 CTest: Clean up stdout and logfile output for Pass/Fail regex For pass regex, display only the element that was found, rather than all elements Rename loop variable for fail regex, from pass to fail For consistency, add space in output for pass Add tests that find and don't find PASS_REGULAR_EXPRESSION, and a test that finds FAIL_REGULAR_EXPRESSION, whose LastTest.log files are checked using *-check.cmake. diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 31976b9..b865cab 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -85,27 +85,30 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) if (pass.first.find(this->ProcessOutput)) { found = true; reason = "Required regular expression found."; + reason += " Regex=["; + reason += pass.second; + reason += "]"; break; } } if (!found) { reason = "Required regular expression not found."; + reason += " Regex=["; + for (auto& pass : this->TestProperties->RequiredRegularExpressions) { + reason += pass.second; + reason += "\n"; + } + reason += "]"; forceFail = true; } - reason += "Regex=["; - for (auto& pass : this->TestProperties->RequiredRegularExpressions) { - reason += pass.second; - reason += "\n"; - } - reason += "]"; } if (!this->TestProperties->ErrorRegularExpressions.empty() && this->FailedDependencies.empty()) { - for (auto& pass : this->TestProperties->ErrorRegularExpressions) { - if (pass.first.find(this->ProcessOutput)) { + for (auto& fail : this->TestProperties->ErrorRegularExpressions) { + if (fail.first.find(this->ProcessOutput)) { reason = "Error regular expression found in output."; reason += " Regex=["; - reason += pass.second; + reason += fail.second; reason += "]"; forceFail = true; break; diff --git a/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake new file mode 100644 index 0000000..1097788 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake @@ -0,0 +1,13 @@ +set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log") +if(EXISTS "${last_test_log}") + file(READ "${last_test_log}" last_test_log_content) + string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}") + if(NOT last_test_log_content MATCHES " +Test Pass Reason: +Error regular expression found in output. Regex=[[]test1]") + string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}") + set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}") + endif() +else() + set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}") +endif() diff --git a/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake new file mode 100644 index 0000000..bde60d1 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake @@ -0,0 +1,13 @@ +set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log") +if(EXISTS "${last_test_log}") + file(READ "${last_test_log}" last_test_log_content) + string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}") + if(NOT last_test_log_content MATCHES " +Test Pass Reason: +Required regular expression found. Regex=[[]test1]") + string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}") + set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}") + endif() +else() + set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}") +endif() diff --git a/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake b/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake new file mode 100644 index 0000000..6d420f3 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake @@ -0,0 +1,16 @@ +set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log") +if(EXISTS "${last_test_log}") + file(READ "${last_test_log}" last_test_log_content) + string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}") + if(NOT last_test_log_content MATCHES " +Test Pass Reason: +Required regular expression not found. Regex=[[]foo +toast1 +bar +]") + string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}") + set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}") + endif() +else() + set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}") +endif() diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index d524f41..f417db0 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -78,6 +78,48 @@ endfunction() run_LabelCount() +function(run_RequiredRegexFoundTest) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RequiredRegexFound) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " +add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\") +set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION \"foo;test1;bar\") +") + + run_cmake_command(RequiredRegexFound ${CMAKE_CTEST_COMMAND} -V) +endfunction() +run_RequiredRegexFoundTest() + +function(run_RequiredRegexNotFoundTest) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RequiredRegexNotFound) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " +add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\") +set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION \"foo;toast1;bar\" WILL_FAIL True) +") + + run_cmake_command(RequiredRegexNotFound ${CMAKE_CTEST_COMMAND} -V) +endfunction() +run_RequiredRegexNotFoundTest() + +function(run_FailRegexFoundTest) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/FailRegexFound) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " +add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\") +set_tests_properties(test1 PROPERTIES FAIL_REGULAR_EXPRESSION \"foo;test1;bar\" WILL_FAIL True) +") + + run_cmake_command(FailRegexFound ${CMAKE_CTEST_COMMAND} -V) +endfunction() +run_FailRegexFoundTest() + function(run_SerialFailed) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SerialFailed) set(RunCMake_TEST_NO_CLEAN 1) ----------------------------------------------------------------------- Summary of changes: Auxiliary/vim/syntax/cmake.vim | 1 + Help/manual/cmake-variables.7.rst | 1 + Help/release/dev/eclipse-resource-encoding.rst | 6 ++++ Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst | 6 ++++ Modules/CheckCXXSymbolExists.cmake | 28 ++++++++++----- Modules/CheckSymbolExists.cmake | 11 ++++++ Source/CPack/cmCPackGenerator.cxx | 2 +- Source/CPack/cpack.cxx | 1 - Source/CTest/cmCTestLaunch.cxx | 1 - Source/CTest/cmCTestMultiProcessHandler.cxx | 2 ++ Source/CTest/cmCTestRunTest.cxx | 21 ++++++----- Source/CTest/cmCTestRunTest.h | 3 +- Source/CTest/cmCTestTestHandler.cxx | 2 +- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/cmBinUtilsLinuxELFLinker.h | 2 +- Source/cmBinUtilsMacOSMachOLinker.h | 2 +- Source/cmBinUtilsWindowsPELinker.h | 2 +- Source/cmCTest.cxx | 2 +- Source/cmCTest.h | 2 +- Source/cmComputeLinkDepends.h | 1 + Source/cmCryptoHash.cxx | 2 +- Source/cmCryptoHash.h | 2 +- Source/cmCustomCommandGenerator.cxx | 2 +- Source/cmELF.cxx | 2 +- Source/cmExecuteProcessCommand.cxx | 3 ++ Source/cmExportBuildAndroidMKGenerator.cxx | 1 - Source/cmExportFileGenerator.cxx | 2 +- Source/cmExportLibraryDependenciesCommand.cxx | 2 +- Source/cmExportTryCompileFileGenerator.cxx | 2 +- Source/cmExtraEclipseCDT4Generator.cxx | 23 ++++++++++++ Source/cmExtraEclipseCDT4Generator.h | 3 ++ Source/cmFileAPI.h | 2 +- Source/cmFileAPICodemodel.cxx | 1 + Source/cmFileCommand.cxx | 2 +- Source/cmFileTimes.h | 2 +- Source/cmFindPackageCommand.cxx | 2 +- Source/cmForEachCommand.cxx | 2 +- Source/cmGeneratorExpression.cxx | 2 +- Source/cmGeneratorExpression.h | 2 +- Source/cmGeneratorExpressionEvaluationFile.cxx | 2 +- Source/cmGeneratorExpressionEvaluationFile.h | 2 +- Source/cmGeneratorExpressionNode.cxx | 2 +- Source/cmGeneratorTarget.cxx | 2 +- Source/cmGhsMultiTargetGenerator.cxx | 2 ++ Source/cmGlobalGenerator.h | 1 + Source/cmGlobalNinjaGenerator.cxx | 2 +- Source/cmGlobalNinjaGenerator.h | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 1 + Source/cmGlobalXCodeGenerator.cxx | 2 +- Source/cmGraphVizWriter.cxx | 2 +- Source/cmIfCommand.cxx | 2 +- Source/cmInstallDirectoryGenerator.cxx | 2 +- Source/cmInstallFilesGenerator.cxx | 2 +- Source/cmInstallScriptGenerator.cxx | 1 + Source/cmInstallTargetGenerator.cxx | 1 + Source/cmInstalledFile.h | 2 +- Source/cmJsonObjects.cxx | 1 + Source/cmListCommand.cxx | 2 ++ Source/cmListFileCache.h | 2 +- Source/cmLocalGenerator.cxx | 4 ++- Source/cmLocalNinjaGenerator.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- Source/cmLocalVisualStudioGenerator.h | 2 +- Source/cmMakefile.cxx | 2 +- Source/cmMakefile.h | 2 +- Source/cmMakefileExecutableTargetGenerator.cxx | 2 +- Source/cmMakefileLibraryTargetGenerator.cxx | 2 +- Source/cmMakefileTargetGenerator.cxx | 2 +- Source/cmMakefileTargetGenerator.h | 1 + Source/cmMakefileUtilityTargetGenerator.cxx | 1 + Source/cmNinjaNormalTargetGenerator.cxx | 2 +- Source/cmNinjaTargetGenerator.cxx | 2 +- Source/cmNinjaTargetGenerator.h | 2 +- Source/cmOrderDirectories.cxx | 1 + Source/cmQtAutoGen.h | 2 +- Source/cmQtAutoGenGlobalInitializer.h | 2 +- Source/cmQtAutoGenInitializer.h | 2 +- Source/cmQtAutoGenerator.cxx | 2 ++ Source/cmQtAutoMocUic.h | 2 +- Source/cmRuntimeDependencyArchive.h | 2 +- Source/cmServer.h | 2 +- Source/cmState.h | 1 + Source/cmStateDirectory.cxx | 1 + Source/cmStringCommand.cxx | 2 +- Source/cmTarget.h | 2 +- Source/cmTestGenerator.cxx | 2 ++ Source/cmUVProcessChain.h | 2 +- Source/cmVariableWatch.h | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- Source/cmWhileCommand.cxx | 2 +- Source/cmWorkerPool.h | 2 +- Source/cmake.cxx | 2 +- Source/cmake.h | 2 +- Source/cmcmd.cxx | 2 +- Tests/CMakeLib/testUVProcessChain.cxx | 1 + Tests/CMakeServerLib/testServerBuffering.cpp | 2 ++ .../CTestCommandLine/FailRegexFound-check.cmake | 13 +++++++ .../RequiredRegexFound-check.cmake | 13 +++++++ .../RequiredRegexNotFound-check.cmake | 16 +++++++++ Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 42 ++++++++++++++++++++++ Utilities/IWYU/mapping.imp | 11 ++++-- 101 files changed, 271 insertions(+), 86 deletions(-) create mode 100644 Help/release/dev/eclipse-resource-encoding.rst create mode 100644 Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst create mode 100644 Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake create mode 100644 Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake create mode 100644 Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 11 11:33:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 11 Jul 2019 11:33:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-270-g0a690fc Message-ID: <20190711153306.64D60102D05@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0a690fc47427a2ed5656cb0dd4bc17aa172e143a (commit) via 329f0a64b02bb76a61744b4d03ea4de70fdde0b8 (commit) from e15314420c8ccf08e7855a0400a3ce76bddff95e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a690fc47427a2ed5656cb0dd4bc17aa172e143a commit 0a690fc47427a2ed5656cb0dd4bc17aa172e143a Merge: e153144 329f0a6 Author: Brad King AuthorDate: Thu Jul 11 15:10:33 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 11 11:27:15 2019 -0400 Merge topic 'rel-scripts' 329f0a64b0 Utilities/Release: Replace batch scripts with individual scripts Acked-by: Kitware Robot Merge-request: !3540 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=329f0a64b02bb76a61744b4d03ea4de70fdde0b8 commit 329f0a64b02bb76a61744b4d03ea4de70fdde0b8 Author: Brad King AuthorDate: Thu Jul 11 10:12:23 2019 -0400 Commit: Brad King CommitDate: Thu Jul 11 10:24:28 2019 -0400 Utilities/Release: Replace batch scripts with individual scripts Provide a more granular per-platform workflow. diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake index b3cc352..0622ad8 100644 --- a/Utilities/Release/create-cmake-release.cmake +++ b/Utilities/Release/create-cmake-release.cmake @@ -5,30 +5,10 @@ endif() file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/logs) -set(RELEASE_SCRIPTS_BATCH_1 - win32_release.cmake # Windows x86 - osx_release.cmake # OS X x86_64 - linux64_release.cmake # Linux x86_64 -) - -set(RELEASE_SCRIPTS_BATCH_2 - win64_release.cmake # Windows x64 -) - -function(write_batch_shell_script filename) - set(scripts ${ARGN}) - set(i 0) - file(WRITE ${filename} "#!/bin/bash") - foreach(f ${scripts}) - math(EXPR x "420*(${i}/4)") - math(EXPR y "160*(${i}%4)") - file(APPEND ${filename} - " -\"${CMAKE_COMMAND}\" -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -DCMAKE_DOC_TARBALL=\"${CMAKE_DOC_TARBALL}\" -P \"${CMAKE_ROOT}/Utilities/Release/${f}\" < /dev/null >& \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log\" & -xterm -geometry 64x6+${x}+${y} -sb -sl 2000 -T ${f}-${CMAKE_CREATE_VERSION}.log -e tail -f \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log\" & +function(write_rel_shell_script filename script) + file(WRITE ${filename} "#!/usr/bin/env bash +\"${CMAKE_COMMAND}\" -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -DCMAKE_DOC_TARBALL=\"${CMAKE_DOC_TARBALL}\" -P \"${CMAKE_CURRENT_LIST_DIR}/${script}.cmake\" < /dev/null 2>&1 | tee \"${CMAKE_CURRENT_SOURCE_DIR}/logs/${script}-${CMAKE_CREATE_VERSION}.log\" ") - math(EXPR i "${i}+1") - endforeach() execute_process(COMMAND chmod a+x ${filename}) endfunction() @@ -65,12 +45,16 @@ echo 'Failed to create \${name}.tar.gz' endfunction() write_docs_shell_script("create-${CMAKE_CREATE_VERSION}-docs.sh") -write_batch_shell_script("create-${CMAKE_CREATE_VERSION}-batch1.sh" ${RELEASE_SCRIPTS_BATCH_1}) -write_batch_shell_script("create-${CMAKE_CREATE_VERSION}-batch2.sh" ${RELEASE_SCRIPTS_BATCH_2}) - -message("Run one at a time: - ./create-${CMAKE_CREATE_VERSION}-docs.sh && - ./create-${CMAKE_CREATE_VERSION}-batch1.sh && - ./create-${CMAKE_CREATE_VERSION}-batch2.sh && +write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-linux64.sh" linux64_release) # Linux x86_64 +write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-macos.sh" osx_release ) # macOS x86_64 +write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-win64.sh" win64_release ) # Windows x64 +write_rel_shell_script("create-${CMAKE_CREATE_VERSION}-win32.sh" win32_release ) # Windows x86 + +message("Build docs first and then build for each platform: + ./create-${CMAKE_CREATE_VERSION}-docs.sh && + ./create-${CMAKE_CREATE_VERSION}-linux64.sh && + ./create-${CMAKE_CREATE_VERSION}-macos.sh && + ./create-${CMAKE_CREATE_VERSION}-win64.sh && + ./create-${CMAKE_CREATE_VERSION}-win32.sh && echo done ") ----------------------------------------------------------------------- Summary of changes: Utilities/Release/create-cmake-release.cmake | 44 +++++++++------------------- 1 file changed, 14 insertions(+), 30 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 11 13:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 11 Jul 2019 13:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-272-g09f9ed6 Message-ID: <20190711170305.A49F910335A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 09f9ed600954bba2cd51529471554f49ec9e855e (commit) via 14f69fab54291838170e6e2e9988c81fa8c66a88 (commit) from 0a690fc47427a2ed5656cb0dd4bc17aa172e143a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09f9ed600954bba2cd51529471554f49ec9e855e commit 09f9ed600954bba2cd51529471554f49ec9e855e Merge: 0a690fc 14f69fa Author: Brad King AuthorDate: Thu Jul 11 13:02:13 2019 -0400 Commit: Brad King CommitDate: Thu Jul 11 13:02:13 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 11 13:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 11 Jul 2019 13:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc4-3-g14f69fa Message-ID: <20190711170305.CEB8710335A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 14f69fab54291838170e6e2e9988c81fa8c66a88 (commit) via b0bcd4d7d2cb9defb790514375b78efbf60cc2e8 (commit) via 33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc (commit) from 86ead0b5a32ee48907084a7cf85d00196cbf0366 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/Cray-Fortran.cmake | 2 ++ Source/cmFortranParserImpl.cxx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 12 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 12 Jul 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-273-g93f10f0 Message-ID: <20190712040307.A4EB6113887@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 93f10f06b3b86085a180e5259f653646e1705baf (commit) from 09f9ed600954bba2cd51529471554f49ec9e855e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93f10f06b3b86085a180e5259f653646e1705baf commit 93f10f06b3b86085a180e5259f653646e1705baf Author: Kitware Robot AuthorDate: Fri Jul 12 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Fri Jul 12 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f2aeb5d..7143749 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 15) -set(CMake_VERSION_PATCH 20190711) +set(CMake_VERSION_PATCH 20190712) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 12 07:23:10 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 12 Jul 2019 07:23:10 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-275-g609d86e Message-ID: <20190712112310.1ADF9111F53@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 609d86e8131547e95269c2a5bd53336f948cae05 (commit) via 54290adcba5fa730a4e93d3a53b5d0451c6872e6 (commit) from 93f10f06b3b86085a180e5259f653646e1705baf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=609d86e8131547e95269c2a5bd53336f948cae05 commit 609d86e8131547e95269c2a5bd53336f948cae05 Merge: 93f10f0 54290ad Author: Brad King AuthorDate: Fri Jul 12 11:22:45 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 12 07:22:55 2019 -0400 Merge topic 'object-library-sbcs' 54290adcba VS: Fix SBCS support for object libraries Acked-by: Kitware Robot Merge-request: !3537 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54290adcba5fa730a4e93d3a53b5d0451c6872e6 commit 54290adcba5fa730a4e93d3a53b5d0451c6872e6 Author: Brad King AuthorDate: Thu Jul 11 07:52:35 2019 -0400 Commit: Brad King CommitDate: Fri Jul 12 07:20:23 2019 -0400 VS: Fix SBCS support for object libraries In commit 3a53005f7d (Build object library targets in VS, 2012-03-12, v2.8.8~29^2~13) we updated the condition for unicode but accidentally left out the SBCS case support for object libraries. Fixes: #19469 diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index cba7bef..ee5f9b4 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1213,7 +1213,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues( this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS")) { e1.Element("CharacterSet", "Unicode"); } else if (this->GeneratorTarget->GetType() <= - cmStateEnums::MODULE_LIBRARY && + cmStateEnums::OBJECT_LIBRARY && this->ClOptions[config]->UsingSBCS()) { e1.Element("CharacterSet", "NotSet"); } else { ----------------------------------------------------------------------- Summary of changes: Source/cmVisualStudio10TargetGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 12 07:33:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 12 Jul 2019 07:33:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-279-gf9e0cf6 Message-ID: <20190712113304.E44B61135BE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f9e0cf64176628d07871741da2c6f585f52c4e39 (commit) via 207a48602a32f762e2bbe4eef75e6ff4bdb4945c (commit) via 1810a61b394eee2fe9465d5460bb578f833078da (commit) via d1f38ba65d7a6860ceac0d60dc77971e9ccfdd05 (commit) from 609d86e8131547e95269c2a5bd53336f948cae05 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f9e0cf64176628d07871741da2c6f585f52c4e39 commit f9e0cf64176628d07871741da2c6f585f52c4e39 Merge: 207a486 d1f38ba Author: Brad King AuthorDate: Fri Jul 12 11:24:44 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 12 07:24:52 2019 -0400 Merge topic 'compiler-id-encoding' d1f38ba65d CMakeDetermineCompilerId: Consider UTF-16 encodings of INFO strings Acked-by: Kitware Robot Merge-request: !3539 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=207a48602a32f762e2bbe4eef75e6ff4bdb4945c commit 207a48602a32f762e2bbe4eef75e6ff4bdb4945c Merge: 609d86e 1810a61 Author: Brad King AuthorDate: Fri Jul 12 07:23:11 2019 -0400 Commit: Brad King CommitDate: Fri Jul 12 07:23:11 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1f38ba65d7a6860ceac0d60dc77971e9ccfdd05 commit d1f38ba65d7a6860ceac0d60dc77971e9ccfdd05 Author: Brad King AuthorDate: Thu Jul 11 09:50:30 2019 -0400 Commit: Brad King CommitDate: Thu Jul 11 09:50:30 2019 -0400 CMakeDetermineCompilerId: Consider UTF-16 encodings of INFO strings Our compiler identification source encodes `INFO:compiler[...]` and similar strings in compiled objects or binaries that we then extract to get information about the compiler. With most compilers the strings are encoded in the binaries as a simple byte sequence. However, some compilers use other encodings. For example, the MS CSharp compiler uses UTF-16LE and a TI compiler uses UTF-16BE. Try each encoding. Fixes: #19459 diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake index dab9414..da860a8 100644 --- a/Modules/CMakeDetermineCSharpCompiler.cmake +++ b/Modules/CMakeDetermineCSharpCompiler.cmake @@ -18,7 +18,6 @@ if(NOT CMAKE_CSharp_COMPILER_ID_RUN) set(CMAKE_CSharp_COMPILER_ID_RUN 1) # Try to identify the compiler. - set(CMAKE_CSharp_COMPILER_ID_STRINGS_PARAMETERS ENCODING UTF-16LE) set(CMAKE_CSharp_COMPILER_ID) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) CMAKE_DETERMINE_COMPILER_ID(CSharp CSFLAGS CMakeCSharpCompilerId.cs) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6083358..1914f52 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -640,10 +640,14 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(ARCHITECTURE_ID) set(SIMULATE_ID) set(SIMULATE_VERSION) - file(STRINGS ${file} - CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 38 - ${CMAKE_${lang}_COMPILER_ID_STRINGS_PARAMETERS} - REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]") + foreach(encoding "" "ENCODING;UTF-16LE" "ENCODING;UTF-16BE") + file(STRINGS "${file}" CMAKE_${lang}_COMPILER_ID_STRINGS + LIMIT_COUNT 38 ${encoding} + REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]") + if(NOT CMAKE_${lang}_COMPILER_ID_STRINGS STREQUAL "") + break() + endif() + endforeach() set(COMPILER_ID_TWICE) # With the IAR Compiler, some strings are found twice, first time as incomplete # list like "?". Remove the incomplete copies. ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCSharpCompiler.cmake | 1 - Modules/CMakeDetermineCompilerId.cmake | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 12 07:33:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 12 Jul 2019 07:33:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc4-5-g1810a61 Message-ID: <20190712113305.7058C1135CE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 1810a61b394eee2fe9465d5460bb578f833078da (commit) via 54290adcba5fa730a4e93d3a53b5d0451c6872e6 (commit) from 14f69fab54291838170e6e2e9988c81fa8c66a88 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/cmVisualStudio10TargetGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 12 16:13:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 12 Jul 2019 16:13:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-283-g8212b08 Message-ID: <20190712201307.AA2D9E48EE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8212b0880d4b481496306535b58adcd9121fd71b (commit) via 82a72bfc1b90373c936c5010ece28423906e1e74 (commit) via b8828ecbbab89f7ab4f99ee0905ab380d855744a (commit) via cd681f1f414487978009bf489607325c2966824b (commit) from f9e0cf64176628d07871741da2c6f585f52c4e39 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8212b0880d4b481496306535b58adcd9121fd71b commit 8212b0880d4b481496306535b58adcd9121fd71b Merge: 82a72bf b8828ec Author: Brad King AuthorDate: Fri Jul 12 20:12:12 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 12 16:12:20 2019 -0400 Merge topic 'cmake-e-true-false' b8828ecbba cmake -E: Add true and false commands Acked-by: Kitware Robot Merge-request: !3542 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82a72bfc1b90373c936c5010ece28423906e1e74 commit 82a72bfc1b90373c936c5010ece28423906e1e74 Merge: f9e0cf6 cd681f1 Author: Brad King AuthorDate: Fri Jul 12 20:10:19 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 12 16:10:32 2019 -0400 Merge topic 'ctest_make_program__propagated_to_cmake_configure_pass' cd681f1f41 ctest: propagate make program to cmake Acked-by: Kitware Robot Merge-request: !3483 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8828ecbbab89f7ab4f99ee0905ab380d855744a commit b8828ecbbab89f7ab4f99ee0905ab380d855744a Author: Kyle Edwards AuthorDate: Thu Jul 11 13:41:30 2019 -0400 Commit: Kyle Edwards CommitDate: Thu Jul 11 13:41:30 2019 -0400 cmake -E: Add true and false commands diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 7b5399d..68d88e7 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -604,6 +604,12 @@ Available commands are: .. note:: Path to where ```` symbolic link will be created has to exist beforehand. +``true`` + Do nothing, with an exit code of 0. + +``false`` + Do nothing, with an exit code of 1. + Windows-specific Command-Line Tools ----------------------------------- diff --git a/Help/release/dev/cmake-e-true-false.rst b/Help/release/dev/cmake-e-true-false.rst new file mode 100644 index 0000000..173fabd --- /dev/null +++ b/Help/release/dev/cmake-e-true-false.rst @@ -0,0 +1,5 @@ +cmake-e-true-false +------------------ + +* :manual:`cmake(1)` ``-E`` now supports ``true`` and ``false`` commands, which + do nothing while returning exit codes of 0 and 1, respectively. diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index effc094..503dce1 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -114,6 +114,8 @@ void CMakeCommandUsage(const char* program) << " touch ... - touch a .\n" << " touch_nocreate ... - touch a but do not create it.\n" << " create_symlink old new - create a symbolic link new -> old\n" + << " true - do nothing with an exit code of 0\n" + << " false - do nothing with an exit code of 1\n" #if defined(_WIN32) && !defined(__CYGWIN__) << "Available on Windows only:\n" << " delete_regv key - delete registry value\n" @@ -891,6 +893,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector const& args) return 0; } + // Command to do nothing with an exit code of 0. + if (args[1] == "true") { + return 0; + } + + // Command to do nothing with an exit code of 1. + if (args[1] == "false") { + return 1; + } + // Internal CMake shared library support. if (args[1] == "cmake_symlink_library" && args.size() == 5) { return cmcmd::SymlinkLibrary(args); diff --git a/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt b/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_false-result.txt b/Tests/RunCMake/CommandLine/E_false-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_false-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index c9d3a4d..4e19871 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -26,6 +26,10 @@ run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append) run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg) run_cmake_command(E_server-pipe ${CMAKE_COMMAND} -E server --pipe=) +run_cmake_command(E_true ${CMAKE_COMMAND} -E true) +run_cmake_command(E_true-extraargs ${CMAKE_COMMAND} -E true ignored) +run_cmake_command(E_false ${CMAKE_COMMAND} -E false) +run_cmake_command(E_false-extraargs ${CMAKE_COMMAND} -E false ignored) run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate) run_cmake_command(E_touch-nonexistent-dir ${CMAKE_COMMAND} -E touch "${RunCMake_BINARY_DIR}/touch-nonexistent-dir/foo") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd681f1f414487978009bf489607325c2966824b commit cd681f1f414487978009bf489607325c2966824b Author: Robert Maynard AuthorDate: Tue Jun 25 11:03:24 2019 -0400 Commit: Robert Maynard CommitDate: Thu Jul 11 08:28:35 2019 -0400 ctest: propagate make program to cmake diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 5773176..c6b1425 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -443,7 +443,8 @@ this mode include: Specify the name of the project to build. ``--build-makeprogram`` - Override the make program chosen by CTest with a given one. + Specify the explicit make program to be used by CMake when configuring and + building the project. Only applicable for Make and Ninja based generators. ``--build-noclean`` Skip the make clean step. diff --git a/Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst b/Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst new file mode 100644 index 0000000..4465de8 --- /dev/null +++ b/Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst @@ -0,0 +1,6 @@ +ctest-build-makeprogram-propagated-configure-pass +------------------------------------------------- + +* :manual:`ctest(1)` ``--build-makeprogram`` now specifies the make program + used when configuring a project with the Ninja and Makefiles generators + in addition to building it. diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 9ad9669..3aea1f4 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -76,6 +76,11 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, if (config) { args.push_back("-DCMAKE_BUILD_TYPE:STRING=" + std::string(config)); } + if (!this->BuildMakeProgram.empty() && + (this->BuildGenerator.find("Make") != std::string::npos || + this->BuildGenerator.find("Ninja") != std::string::npos)) { + args.push_back("-DCMAKE_MAKE_PROGRAM:FILEPATH=" + this->BuildMakeProgram); + } for (std::string const& opt : this->BuildOptions) { args.push_back(opt); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index b766838..c50007f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -14,8 +14,8 @@ macro(ADD_TEST_MACRO NAME) ${build_generator_args} --build-project ${proj} ${${NAME}_CTEST_OPTIONS} - --build-options ${build_options} - ${${NAME}_BUILD_OPTIONS} + --build-options + ${${NAME}_BUILD_OPTIONS} ${_test_command}) unset(_test_command) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") @@ -127,9 +127,10 @@ if(BUILD_TESTING) ) endif() - set(build_options) if(CMake_TEST_EXPLICIT_MAKE_PROGRAM) - list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}) + list(APPEND build_generator_args + --build-makeprogram ${CMake_TEST_EXPLICIT_MAKE_PROGRAM} + ) endif() # Look for rpmbuild to use for tests. @@ -528,7 +529,6 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/BundleUtilities" ${build_generator_args} --build-project BundleUtilities - --build-options ${build_options} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") @@ -541,9 +541,9 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Qt4Deploy" ${build_generator_args} --build-project Qt4Deploy - --build-options ${build_options} - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} + --build-options + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy") endif() @@ -590,7 +590,7 @@ if(BUILD_TESTING) --build-project ExternalDataTest --build-noclean --force-new-ctest-process - --build-options ${build_options} + --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V ) @@ -633,7 +633,6 @@ if(BUILD_TESTING) "${CMake_BINARY_DIR}/Tests/Visibility" ${build_generator_args} --build-project Visibility - --build-options ${build_options} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Visibility" @@ -648,7 +647,7 @@ if(BUILD_TESTING) ${build_generator_args} --build-project LinkFlags --build-target LinkFlags - --build-options ${build_options} + --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags") @@ -709,7 +708,6 @@ if(BUILD_TESTING) --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" --build-project Simple - --build-options ${build_options} --test-command Simple) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}") endif () @@ -729,7 +727,6 @@ if(BUILD_TESTING) --build-project SubProject ${build_generator_args} --build-target car - --build-options ${build_options} --test-command car ) @@ -755,7 +752,6 @@ if(BUILD_TESTING) --build-project foo --build-target foo --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo" - --build-options ${build_options} --test-command foo ) set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) @@ -797,7 +793,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project Framework - --build-options ${build_options} + --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install" --test-command bar) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework") @@ -809,7 +805,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project TargetName - --build-options ${build_options} --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world) @@ -823,7 +818,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project LibName --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib" - --build-options ${build_options} --test-command foobar ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName") @@ -836,7 +830,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project CustComDepend --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin" - --build-options ${build_options} --test-command foo bar.c ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend") @@ -848,7 +841,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project ArgumentExpansion --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin" - --build-options ${build_options} ) set_tests_properties(ArgumentExpansion PROPERTIES FAIL_REGULAR_EXPRESSION "Unexpected: ") @@ -861,7 +853,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/GeneratorExpression" ${build_generator_args} --build-project GeneratorExpression - --build-options ${build_options} + --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V ) @@ -875,7 +867,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project CustomCommand --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin" - --build-options ${build_options} + --build-options --test-command CustomCommand ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") @@ -893,7 +885,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project TestWorkingDir - --build-options ${build_options} --test-command working ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory") @@ -905,7 +896,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project OutOfSource --build-two-config - --build-options ${build_options} --test-command "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource") @@ -918,7 +908,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/BuildDepends" ${build_generator_args} --build-project BuildDepends - --build-options ${build_options} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends") @@ -931,7 +920,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project TestMissingInstall --build-two-config - --build-options ${build_options} + --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${MissingInstallInstallDir}") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MissingInstall") @@ -977,7 +966,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/CPackWiXGenerator" ${build_generator_args} --build-project CPackWiXGenerator - --build-options ${build_options} + --build-options --test-command ${CMAKE_CMAKE_COMMAND} "-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator" "-Dconfig=\${CTEST_CONFIGURATION_TYPE}" @@ -997,7 +986,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project CPackUseDefaultVersion --build-two-config - --build-options ${build_options} + --build-options ${CPackUseDefaultVersion_BUILD_OPTIONS}) set_tests_properties(CPackUseDefaultVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=0\\.1\\.1") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseDefaultVersion") @@ -1009,7 +998,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project CPackUseProjectVersion --build-two-config - --build-options ${build_options} + --build-options ${CPackUseProjectVersion_BUILD_OPTIONS}) set_tests_properties(CPackUseProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=1\\.2\\.3") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseProjectVersion") @@ -1021,7 +1010,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project CPackUseShortProjectVersion --build-two-config - --build-options ${build_options} + --build-options ${CPackUseProjectVersion_BUILD_OPTIONS}) set_tests_properties(CPackUseShortProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=2") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseShortProjectVersion") @@ -1049,7 +1038,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project CPackComponents --build-two-config --build-target package - --build-options ${build_options} + --build-options -DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB} -DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM} ${CPackComponents_BUILD_OPTIONS} @@ -1109,7 +1098,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" ${build_generator_args} --build-project CPackComponentsForAll - --build-options ${build_options} + --build-options -DCPACK_GENERATOR:STRING=${CPACK_GENERATOR_STRING_${CPackGen}} -DCPACK_BINARY_${CPackGen}:BOOL=ON ${CPackRun_CPackComponentWay} @@ -1148,7 +1137,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/${DEB_TEST_NAMES}/build${CPackGen}-${CPackDEBConfiguration}" ${build_generator_args} --build-project CPackComponentsDEB - --build-options ${build_options} + --build-options -DCPACK_GENERATOR:STRING=${CPackGen} -DCPACK_BINARY_${CPackGen}:BOOL=ON ${CPackRun_CPackDEBConfiguration} @@ -1188,7 +1177,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators" ${build_generator_args} --build-project CPackTestAllGenerators - --build-options ${build_options} --test-command ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators @@ -1219,7 +1207,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project CPackComponentsPrefix --build-two-config --build-target package - --build-options ${build_options} + --build-options -DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB} -DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM} -DCPACK_BINARY_ZIP:BOOL=ON @@ -1242,7 +1230,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project UseX11 --build-two-config ${X11_build_target_arg} - --build-options ${build_options} --test-command UseX11) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11") @@ -1285,7 +1272,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" ${build_generator_args} --build-project LoadCommand - --build-options ${build_options} --test-command LoadedCommand ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") @@ -1300,7 +1286,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project Complex --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin" - --build-options ${build_options} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex ) @@ -1313,7 +1298,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project Complex --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin" - --build-options ${build_options} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig") @@ -1328,7 +1312,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project EnvironmentProj --build-exe-dir "${CMake_BINARY_DIR}/Tests/Environment" --force-new-ctest-process - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment") @@ -1339,7 +1322,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt" ${build_generator_args} --build-project QtAutomocNoQt - --build-options ${build_options} + --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt") @@ -1364,7 +1347,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project Qt4Targets --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Targets" --force-new-ctest-process - --build-options ${build_options} + --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} --test-command ${CMAKE_CTEST_COMMAND} -V ) @@ -1379,7 +1362,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project Qt4And5Automoc --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward" --force-new-ctest-process - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward") @@ -1391,7 +1373,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project Qt4And5Automoc --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse" --force-new-ctest-process - --build-options ${build_options} -DQT_REVERSE_FIND_ORDER=1 + --build-options -DQT_REVERSE_FIND_ORDER=1 --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse") @@ -1623,7 +1605,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project ExternalProjectTest --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProject" --force-new-ctest-process - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject") @@ -1639,7 +1620,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project ExternalProjectSubdir --force-new-ctest-process - --build-options ${build_options} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir") @@ -1651,7 +1631,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project ExternalProjectSourceSubdir --force-new-ctest-process - --build-options ${build_options} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir") @@ -1663,7 +1642,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project ExternalProjectSourceSubdirNotCMake --force-new-ctest-process - --build-options ${build_options} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdirNotCMake") @@ -1675,7 +1653,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project ExternalProjectLocalTest --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal" --force-new-ctest-process - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal") @@ -1691,7 +1668,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project ExternalProjectUpdateTest --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate" --force-new-ctest-process - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate") @@ -1733,7 +1709,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${tutorial_build_dir}_Build ${build_generator_args} --build-project Tutorial - --build-options ${build_options} ${tutorial_build_options} + --build-options ${tutorial_build_options} --test-command Tutorial 25.0) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/${tutorial_build_dir}_Build") endfunction() @@ -1755,7 +1731,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/Testing" ${build_generator_args} --build-project Testing - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} ) set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed") @@ -1768,7 +1743,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project Wrapping --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" - --build-options ${build_options} --test-command wrapping ) add_test(qtwrapping ${CMAKE_CTEST_COMMAND} @@ -1778,7 +1752,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project Wrapping --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" - --build-options ${build_options} --test-command qtwrapping ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping") @@ -1790,7 +1763,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-project TestDriverTest - --build-options ${build_options} --test-command TestDriverTest test1 ) @@ -1801,7 +1773,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-project TestDriverTest - --build-options ${build_options} --test-command TestDriverTest test2 ) @@ -1812,7 +1783,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --build-project TestDriverTest - --build-options ${build_options} --test-command TestDriverTest subdir/test3 ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver") @@ -1824,7 +1794,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/Exec" ${build_generator_args} --build-project Dependency - --build-options ${build_options} --test-command exec ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency") @@ -1854,8 +1823,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable" --build-project Jump ${build_generator_args} - --build-options ${build_options} - -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib + --build-options + -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib --test-command jumpExecutable ) @@ -1867,7 +1836,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" --build-project Jump ${build_generator_args} - --build-options ${build_options} --test-command jumpExecutable ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump") @@ -1879,7 +1847,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project Plugin --build-two-config - --build-options ${build_options} --test-command bin/example) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin") @@ -1895,7 +1862,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/MacRuntimePath" ${build_generator_args} --build-project MacRuntimePath - --build-options ${build_options} + --build-options -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} ) endif() @@ -1913,7 +1880,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/LinkLineOrder" ${build_generator_args} --build-project LinkLineOrder - --build-options ${build_options} --test-command Exec1 ) @@ -1923,7 +1889,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/LinkLineOrder" ${build_generator_args} --build-project LinkLineOrder - --build-options ${build_options} --test-command Exec2 ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder") @@ -1943,7 +1908,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/LinkStatic" ${build_generator_args} --build-project LinkStatic - --build-options ${build_options} + --build-options -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a --test-command LinkStatic ) @@ -1958,7 +1923,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources" ${build_generator_args} --build-project SUBDIR - --build-options ${build_options} --test-command test "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj" @@ -1974,7 +1938,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable" ${build_generator_args} --build-project SUBDIR - --build-options ${build_options} --test-command test "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj" @@ -1987,7 +1950,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable" ${build_generator_args} --build-project SUBDIR - --build-options ${build_options} --test-command test "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o" @@ -2022,7 +1984,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project MakeClean --build-exe-dir "${CMake_BINARY_DIR}/MakeClean" - --build-options ${build_options} --test-command check_clean ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") @@ -2131,7 +2092,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project mfc_driver - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -VV) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC") @@ -2161,7 +2121,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project VSExternalInclude - --build-options ${build_options} --test-command VSExternalInclude) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude") @@ -2172,7 +2131,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project VSMidl - --build-options ${build_options} --test-command VSMidl) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") @@ -2459,7 +2417,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project BundleTest --build-target install # --build-target package - --build-options ${build_options} + --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}" "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" --test-command @@ -2474,7 +2432,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project CFBundleTest --build-config $ - --build-options ${build_options} --test-command ${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=$ -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest @@ -2495,7 +2452,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project BundleGeneratorTest --build-target package - --build-options ${build_options} + --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") @@ -2508,7 +2465,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-noclean --build-project WarnUnusedUnusedViaSet - --build-options ${build_options} + --build-options "--warn-unused-vars") set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'") @@ -2523,7 +2480,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-noclean --build-project WarnUnusedUnusedViaUnset - --build-options ${build_options} + --build-options "--warn-unused-vars") set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES PASS_REGULAR_EXPRESSION "CMake Warning \\(dev\\) at CMakeLists.txt:7 \\(set\\):") @@ -2537,7 +2494,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" ${build_generator_args} --build-project WarnUnusedCliUnused - --build-options ${build_options} + --build-options "-DUNUSED_CLI_VARIABLE=Unused") set_tests_properties(WarnUnusedCliUnused PROPERTIES PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE") @@ -2550,7 +2507,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-noclean --build-project WarnUnusedCliUsed - --build-options ${build_options} + --build-options "-DUSED_VARIABLE=Usage proven") set_tests_properties(WarnUnusedCliUsed PROPERTIES PASS_REGULAR_EXPRESSION "Usage proven") @@ -2565,7 +2522,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-noclean --build-project WarnUninitialized - --build-options ${build_options} + --build-options "--warn-uninitialized") set_tests_properties(WarnUninitialized PROPERTIES PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'") @@ -2580,7 +2537,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project TestsWorkingDirectoryProj --build-exe-dir "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory" --force-new-ctest-process - --build-options ${build_options} --test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE} ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory") @@ -3378,7 +3334,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project testf --build-two-config - --build-options ${build_options} --test-command testf) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") @@ -3389,7 +3344,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/FortranModules" ${build_generator_args} --build-project FortranModules - --build-options ${build_options} + --build-options -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} -DCMake_TEST_Fortran_SUBMODULES:BOOL=${CMake_TEST_Fortran_SUBMODULES} ${CMake_TEST_FortranModules_BUILD_OPTIONS} @@ -3412,7 +3367,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project FortranC --build-two-config - --build-options ${build_options} --test-command CMakeFiles/FortranCInterface/FortranCInterface) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC") endif() @@ -3441,7 +3395,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-target hello --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJar/" - --build-options ${build_options} --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJar") add_test(Java.JarSourceList ${CMAKE_CTEST_COMMAND} @@ -3453,7 +3406,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-target hello2 --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceList/" - --build-options ${build_options} --test-command ${JAVA_RUNTIME} -classpath hello2.jar HelloWorld) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceList") add_test(Java.JarSourceListAndOutput ${CMAKE_CTEST_COMMAND} @@ -3465,7 +3417,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-target hello3 --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput/hello3" - --build-options ${build_options} --test-command ${JAVA_RUNTIME} -classpath hello3.jar HelloWorld) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput") @@ -3491,7 +3442,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project helloJavah --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJavah/" - --build-options ${build_options} --test-command ${JAVA_RUNTIME} -Djava.library.path=${JAVAH_LIBRARY_PATH} -classpath hello3.jar HelloWorld2) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJavah") endif() @@ -3510,7 +3460,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-project helloJavaNativeHeaders --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders/" - --build-options ${build_options} --test-command ${JAVA_RUNTIME} -Djava.library.path=${JAVANATIVEHEADERS_LIBRARY_PATH} -classpath hello4.jar HelloWorld3) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders") endif() @@ -3532,9 +3481,9 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc" ${build_generator_args} --build-project SimpleC - --build-options ${build_options} - "-DCMAKE_SYSTEM_NAME=Generic" - "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") + --build-options + "-DCMAKE_SYSTEM_NAME=Generic" + "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") endif() @@ -3550,11 +3499,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win" ${build_generator_args} --build-project Simple - --build-options ${build_options} - "-DCMAKE_SYSTEM_NAME=Windows" - "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}" - "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}" - "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}" + --build-options + "-DCMAKE_SYSTEM_NAME=Windows" + "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}" + "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}" + "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") endif() @@ -3640,7 +3589,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project IncludeDirectories - --build-options ${build_options} --test-command IncludeDirectories) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories") @@ -3654,8 +3602,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH "${CMake_BINARY_DIR}/Tests/IncludeDirectoriesCPATH" --build-two-config ${build_generator_args} - --build-project IncludeDirectoriesCPATH - --build-options ${build_options}) + --build-project IncludeDirectoriesCPATH) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectoriesCPATH") set_tests_properties(IncludeDirectoriesCPATH PROPERTIES @@ -3669,7 +3616,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH --build-two-config ${build_generator_args} --build-project InterfaceLinkLibraries - --build-options ${build_options} --test-command InterfaceLinkLibraries) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceLinkLibraries") ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 6 + Help/manual/ctest.1.rst | 3 +- Help/release/dev/cmake-e-true-false.rst | 5 + ...build-makeprogram-propagated-configure-pass.rst | 6 + Source/CTest/cmCTestBuildAndTestHandler.cxx | 5 + Source/cmcmd.cxx | 12 ++ Tests/CMakeLists.txt | 148 +++++++-------------- .../E_false-extraargs-result.txt} | 0 .../E_false-result.txt} | 0 Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 4 + 10 files changed, 87 insertions(+), 102 deletions(-) create mode 100644 Help/release/dev/cmake-e-true-false.rst create mode 100644 Help/release/dev/ctest-build-makeprogram-propagated-configure-pass.rst copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/E_false-extraargs-result.txt} (100%) copy Tests/RunCMake/{while/MissingArgument-result.txt => CommandLine/E_false-result.txt} (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 12 20:33:11 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 12 Jul 2019 20:33:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-288-ga2319c0 Message-ID: <20190713003311.11ABDC0484@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a2319c04f6c6b881b2cd37ec33378c4781f415e1 (commit) via af75ab7645545bc046d18c8af48f3198a9de4080 (commit) via 0db458a0ce7d5dce245d7489c852c3ba2367aa5d (commit) via 0328b64efdf102206e855d16cd9b765f268c6bc9 (commit) via b821f9ad62d97b975255380674aaedfce296a8b8 (commit) from 8212b0880d4b481496306535b58adcd9121fd71b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2319c04f6c6b881b2cd37ec33378c4781f415e1 commit a2319c04f6c6b881b2cd37ec33378c4781f415e1 Merge: 8212b08 af75ab7 Author: Craig Scott AuthorDate: Sat Jul 13 00:25:50 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 12 20:26:12 2019 -0400 Merge topic 'cleanup-statics-stream-flush' af75ab7645 Refactor: Use anonymous namespace instead of `static`s in `cpack.cxx` 0db458a0ce Refactor: Use anonymous namespace instead of `static`s 0328b64efd Refactor: Remove one-time used macros b821f9ad62 Refactor: Optimize some stream output operations Acked-by: Kitware Robot Merge-request: !3535 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af75ab7645545bc046d18c8af48f3198a9de4080 commit af75ab7645545bc046d18c8af48f3198a9de4080 Author: Alex Turbov AuthorDate: Thu Jul 4 23:05:24 2019 +0300 Commit: Alex Turbov CommitDate: Wed Jul 10 01:07:18 2019 +0300 Refactor: Use anonymous namespace instead of `static`s in `cpack.cxx` Signed-off-by: Alex Turbov diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 58b9e70..3edcbaf 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -29,19 +29,20 @@ #include "cmSystemTools.h" #include "cmake.h" -static const char* cmDocumentationName[][2] = { +namespace { +const char* cmDocumentationName[][2] = { { nullptr, " cpack - Packaging driver provided by CMake." }, { nullptr, nullptr } }; -static const char* cmDocumentationUsage[][2] = { +const char* cmDocumentationUsage[][2] = { // clang-format off { nullptr, " cpack [options]" }, { nullptr, nullptr } // clang-format on }; -static const char* cmDocumentationOptions[][2] = { +const char* cmDocumentationOptions[][2] = { { "-G ", "Override/define CPACK_GENERATOR" }, { "-C ", "Specify the project configuration" }, { "-D =", "Set a CPack variable." }, @@ -90,10 +91,11 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, return 1; } -static void cpackProgressCallback(const std::string& message, float /*unused*/) +void cpackProgressCallback(const std::string& message, float /*unused*/) { std::cout << "-- " << message << std::endl; } +} // namespace // this is CPack. int main(int argc, char const* const* argv) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0db458a0ce7d5dce245d7489c852c3ba2367aa5d commit 0db458a0ce7d5dce245d7489c852c3ba2367aa5d Author: Alex Turbov AuthorDate: Thu Jul 4 22:48:43 2019 +0300 Commit: Alex Turbov CommitDate: Wed Jul 10 01:06:58 2019 +0300 Refactor: Use anonymous namespace instead of `static`s Signed-off-by: Alex Turbov diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 4f088a8..cfb3cee 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -31,13 +31,14 @@ #include #include +namespace { #ifdef CMAKE_BUILD_WITH_CMAKE -static const char* cmDocumentationName[][2] = { +const char* cmDocumentationName[][2] = { { nullptr, " cmake - Cross-Platform Makefile Generator." }, { nullptr, nullptr } }; -static const char* cmDocumentationUsage[][2] = { +const char* cmDocumentationUsage[][2] = { { nullptr, " cmake [options] \n" " cmake [options] \n" @@ -49,12 +50,12 @@ static const char* cmDocumentationUsage[][2] = { { nullptr, nullptr } }; -static const char* cmDocumentationUsageNote[][2] = { +const char* cmDocumentationUsageNote[][2] = { { nullptr, "Run 'cmake --help' for more information." }, { nullptr, nullptr } }; -static const char* cmDocumentationOptions[][2] = { +const char* cmDocumentationOptions[][2] = { CMAKE_STANDARD_OPTIONS_TABLE, { "-E", "CMake command mode." }, { "-L[A][H]", "List non-advanced cached variables." }, @@ -89,7 +90,7 @@ static const char* cmDocumentationOptions[][2] = { #endif -static int do_command(int ac, char const* const* av) +int do_command(int ac, char const* const* av) { std::vector args; args.reserve(ac - 1); @@ -98,12 +99,7 @@ static int do_command(int ac, char const* const* av) return cmcmd::ExecuteCMakeCommand(args); } -int do_cmake(int ac, char const* const* av); -static int do_build(int ac, char const* const* av); -static int do_install(int ac, char const* const* av); -static int do_open(int ac, char const* const* av); - -static cmMakefile* cmakemainGetMakefile(cmake* cm) +cmMakefile* cmakemainGetMakefile(cmake* cm) { if (cm && cm->GetDebugOutput()) { cmGlobalGenerator* gg = cm->GetGlobalGenerator(); @@ -114,7 +110,7 @@ static cmMakefile* cmakemainGetMakefile(cmake* cm) return nullptr; } -static std::string cmakemainGetStack(cmake* cm) +std::string cmakemainGetStack(cmake* cm) { std::string msg; cmMakefile* mf = cmakemainGetMakefile(cm); @@ -128,14 +124,13 @@ static std::string cmakemainGetStack(cmake* cm) return msg; } -static void cmakemainMessageCallback(const std::string& m, - const char* /*unused*/, cmake* cm) +void cmakemainMessageCallback(const std::string& m, const char* /*unused*/, + cmake* cm) { std::cerr << m << cmakemainGetStack(cm) << std::endl; } -static void cmakemainProgressCallback(const std::string& m, float prog, - cmake* cm) +void cmakemainProgressCallback(const std::string& m, float prog, cmake* cm) { cmMakefile* mf = cmakemainGetMakefile(cm); std::string dir; @@ -152,46 +147,6 @@ static void cmakemainProgressCallback(const std::string& m, float prog, } } -int main(int ac, char const* const* av) -{ - cmSystemTools::EnsureStdPipes(); -#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) - // Replace streambuf so we can output Unicode to console - cmsys::ConsoleBuf::Manager consoleOut(std::cout); - consoleOut.SetUTF8Pipes(); - cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); - consoleErr.SetUTF8Pipes(); -#endif - cmsys::Encoding::CommandLineArguments args = - cmsys::Encoding::CommandLineArguments::Main(ac, av); - ac = args.argc(); - av = args.argv(); - - cmSystemTools::EnableMSVCDebugHook(); - cmSystemTools::InitializeLibUV(); - cmSystemTools::FindCMakeResources(av[0]); - if (ac > 1) { - if (strcmp(av[1], "--build") == 0) { - return do_build(ac, av); - } - if (strcmp(av[1], "--install") == 0) { - return do_install(ac, av); - } - if (strcmp(av[1], "--open") == 0) { - return do_open(ac, av); - } - if (strcmp(av[1], "-E") == 0) { - return do_command(ac, av); - } - } - int ret = do_cmake(ac, av); -#ifdef CMAKE_BUILD_WITH_CMAKE - cmDynamicLoader::FlushCache(); -#endif - uv_loop_close(uv_default_loop()); - return ret; -} - int do_cmake(int ac, char const* const* av) { if (cmSystemTools::GetCurrentWorkingDirectory().empty()) { @@ -351,7 +306,6 @@ int do_cmake(int ac, char const* const* av) return 0; } -namespace { int extract_job_number(int& index, char const* current, char const* next, int len_of_flag) { @@ -381,9 +335,8 @@ int extract_job_number(int& index, char const* current, char const* next, } return jobs; } -} -static int do_build(int ac, char const* const* av) +int do_build(int ac, char const* const* av) { #ifndef CMAKE_BUILD_WITH_CMAKE std::cerr << "This cmake does not support --build\n"; @@ -547,7 +500,7 @@ static int do_build(int ac, char const* const* av) #endif } -static int do_install(int ac, char const* const* av) +int do_install(int ac, char const* const* av) { #ifndef CMAKE_BUILD_WITH_CMAKE std::cerr << "This cmake does not support --install\n"; @@ -668,7 +621,7 @@ static int do_install(int ac, char const* const* av) #endif } -static int do_open(int ac, char const* const* av) +int do_open(int ac, char const* const* av) { #ifndef CMAKE_BUILD_WITH_CMAKE std::cerr << "This cmake does not support --open\n"; @@ -710,3 +663,44 @@ static int do_open(int ac, char const* const* av) return cm.Open(dir, false) ? 0 : 1; #endif } +} // namespace + +int main(int ac, char const* const* av) +{ + cmSystemTools::EnsureStdPipes(); +#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) + // Replace streambuf so we can output Unicode to console + cmsys::ConsoleBuf::Manager consoleOut(std::cout); + consoleOut.SetUTF8Pipes(); + cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); + consoleErr.SetUTF8Pipes(); +#endif + cmsys::Encoding::CommandLineArguments args = + cmsys::Encoding::CommandLineArguments::Main(ac, av); + ac = args.argc(); + av = args.argv(); + + cmSystemTools::EnableMSVCDebugHook(); + cmSystemTools::InitializeLibUV(); + cmSystemTools::FindCMakeResources(av[0]); + if (ac > 1) { + if (strcmp(av[1], "--build") == 0) { + return do_build(ac, av); + } + if (strcmp(av[1], "--install") == 0) { + return do_install(ac, av); + } + if (strcmp(av[1], "--open") == 0) { + return do_open(ac, av); + } + if (strcmp(av[1], "-E") == 0) { + return do_command(ac, av); + } + } + int ret = do_cmake(ac, av); +#ifdef CMAKE_BUILD_WITH_CMAKE + cmDynamicLoader::FlushCache(); +#endif + uv_loop_close(uv_default_loop()); + return ret; +} https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0328b64efdf102206e855d16cd9b765f268c6bc9 commit 0328b64efdf102206e855d16cd9b765f268c6bc9 Author: Alex Turbov AuthorDate: Thu Jul 4 22:44:44 2019 +0300 Commit: Alex Turbov CommitDate: Wed Jul 10 01:06:26 2019 +0300 Refactor: Remove one-time used macros Signed-off-by: Alex Turbov diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index f80829f..4f088a8 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -54,34 +54,6 @@ static const char* cmDocumentationUsageNote[][2] = { { nullptr, nullptr } }; -# define CMAKE_BUILD_OPTIONS \ - " = Project binary directory to be built.\n" \ - " --parallel [], -j []\n" \ - " = Build in parallel using the given number of jobs. \n" \ - " If is omitted the native build tool's \n" \ - " default number is used.\n" \ - " The CMAKE_BUILD_PARALLEL_LEVEL environment " \ - "variable\n" \ - " specifies a default parallel level when this " \ - "option\n" \ - " is not given.\n" \ - " --target ..., -t ... \n" \ - " = Build instead of default targets.\n" \ - " --config = For multi-configuration tools, choose .\n" \ - " --clean-first = Build target 'clean' first, then build.\n" \ - " (To clean only, use --target 'clean'.)\n" \ - " --verbose, -v = Enable verbose output - if supported - including\n" \ - " the build commands to be executed. \n" \ - " -- = Pass remaining options to the native tool.\n" - -# define CMAKE_INSTALL_OPTIONS \ - " = Project binary directory to install.\n" \ - " --config = For multi-configuration tools, choose .\n" \ - " --component = Component-based install. Only install .\n" \ - " --prefix = The installation prefix CMAKE_INSTALL_PREFIX.\n" \ - " --strip = Performing install/strip.\n" \ - " -v --verbose = Enable verbose output.\n" - static const char* cmDocumentationOptions[][2] = { CMAKE_STANDARD_OPTIONS_TABLE, { "-E", "CMake command mode." }, @@ -539,7 +511,24 @@ static int do_build(int ac, char const* const* av) std::cerr << "Usage: cmake --build [options] [-- [native-options]]\n" "Options:\n" - CMAKE_BUILD_OPTIONS + " = Project binary directory to be built.\n" + " --parallel [], -j []\n" + " = Build in parallel using the given number of jobs. \n" + " If is omitted the native build tool's \n" + " default number is used.\n" + " The CMAKE_BUILD_PARALLEL_LEVEL environment " + "variable\n" + " specifies a default parallel level when this " + "option\n" + " is not given.\n" + " --target ..., -t ... \n" + " = Build instead of default targets.\n" + " --config = For multi-configuration tools, choose .\n" + " --clean-first = Build target 'clean' first, then build.\n" + " (To clean only, use --target 'clean'.)\n" + " --verbose, -v = Enable verbose output - if supported - including\n" + " the build commands to be executed. \n" + " -- = Pass remaining options to the native tool.\n" ; /* clang-format on */ return 1; @@ -625,8 +614,18 @@ static int do_install(int ac, char const* const* av) } if (dir.empty()) { - std::cerr << "Usage: cmake --install " - "[options]\nOptions:\n" CMAKE_INSTALL_OPTIONS; + /* clang-format off */ + std::cerr << + "Usage: cmake --install [options]\n" + "Options:\n" + " = Project binary directory to install.\n" + " --config = For multi-configuration tools, choose .\n" + " --component = Component-based install. Only install .\n" + " --prefix = The installation prefix CMAKE_INSTALL_PREFIX.\n" + " --strip = Performing install/strip.\n" + " -v --verbose = Enable verbose output.\n" + ; + /* clang-format on */ return 1; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b821f9ad62d97b975255380674aaedfce296a8b8 commit b821f9ad62d97b975255380674aaedfce296a8b8 Author: Alex Turbov AuthorDate: Thu Jul 4 21:04:19 2019 +0300 Commit: Alex Turbov CommitDate: Wed Jul 10 01:06:14 2019 +0300 Refactor: Optimize some stream output operations - remove redundant `std::flush` right after `std::endl` - join some string literals Signed-off-by: Alex Turbov diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index d1226c3..63b8da4 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1098,9 +1098,10 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output, cmProcessOutput processOutput(encoding); std::string strdata; cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, - " Each . represents " << tick_len << " bytes of output" - << std::endl - << " " << std::flush); + " Each . represents " << tick_len + << " bytes of output\n" + " " + << std::flush); while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) { processOutput.DecodeText(data, length, strdata); for (char& cc : strdata) { @@ -1115,8 +1116,7 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output, if (tick % tick_line_len == 0 && tick > 0) { cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size: " << int((double(output.size()) / 1024.0) + 1) - << "K" << std::endl - << " " << std::flush); + << "K\n " << std::flush); } } cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, @@ -1324,18 +1324,14 @@ int cmCTest::RunTest(std::vector argv, std::string* output, if (output) { *output += outerr; } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, - outerr << std::endl - << std::flush); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl); } else if (result == cmsysProcess_State_Error) { std::string outerr = "\n*** ERROR executing: "; outerr += cmsysProcess_GetErrorString(cp); if (output) { *output += outerr; } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, - outerr << std::endl - << std::flush); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl); } cmsysProcess_Delete(cp); @@ -3077,11 +3073,11 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg, } else { *this->Impl->OutputLogFile << cmCTestStringLogType[logType]; } - *this->Impl->OutputLogFile << "] " << std::endl << std::flush; + *this->Impl->OutputLogFile << "] " << std::endl; } *this->Impl->OutputLogFile << msg << std::flush; if (logType != this->Impl->OutputLogFileLastTag) { - *this->Impl->OutputLogFile << std::endl << std::flush; + *this->Impl->OutputLogFile << std::endl; this->Impl->OutputLogFileLastTag = logType; } } @@ -3194,7 +3190,7 @@ void cmCTest::OutputTestErrors(std::vector const& process_output) if (!process_output.empty()) { test_outputs.append(process_output.data(), process_output.size()); } - cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl << std::flush); + cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl); } bool cmCTest::CompressString(std::string& str) diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx index 1d790e2..0d2b21f 100644 --- a/Source/cmMessenger.cxx +++ b/Source/cmMessenger.cxx @@ -100,8 +100,7 @@ void displayMessage(MessageType t, std::ostringstream& msg) "it."; } else if (t == MessageType::AUTHOR_ERROR) { msg << "This error is for project developers. Use -Wno-error=dev to " - "suppress " - "it."; + "suppress it."; } // Add a terminating blank line. diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index a6348b3..f80829f 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -159,7 +159,7 @@ static std::string cmakemainGetStack(cmake* cm) static void cmakemainMessageCallback(const std::string& m, const char* /*unused*/, cmake* cm) { - std::cerr << m << cmakemainGetStack(cm) << std::endl << std::flush; + std::cerr << m << cmakemainGetStack(cm) << std::endl; } static void cmakemainProgressCallback(const std::string& m, float prog, @@ -178,8 +178,6 @@ static void cmakemainProgressCallback(const std::string& m, float prog, if ((prog < 0) || (!dir.empty())) { std::cout << "-- " << m << dir << cmakemainGetStack(cm) << std::endl; } - - std::cout.flush(); } int main(int ac, char const* const* av) ----------------------------------------------------------------------- Summary of changes: Source/CPack/cpack.cxx | 10 +-- Source/cmCTest.cxx | 24 +++---- Source/cmMessenger.cxx | 3 +- Source/cmakemain.cxx | 181 +++++++++++++++++++++++-------------------------- 4 files changed, 103 insertions(+), 115 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jul 13 00:03:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 13 Jul 2019 00:03:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-289-g82a4e07 Message-ID: <20190713040309.2E5A810B200@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 82a4e07f8fa3cfd745218ef56a1c9a46087a0be8 (commit) from a2319c04f6c6b881b2cd37ec33378c4781f415e1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82a4e07f8fa3cfd745218ef56a1c9a46087a0be8 commit 82a4e07f8fa3cfd745218ef56a1c9a46087a0be8 Author: Kitware Robot AuthorDate: Sat Jul 13 00:01:10 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jul 13 00:01:10 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7143749..19f2392 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 15) -set(CMake_VERSION_PATCH 20190712) +set(CMake_VERSION_PATCH 20190713) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jul 14 00:03:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 14 Jul 2019 00:03:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-290-g81389a5 Message-ID: <20190714040304.5B87CFABF5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 81389a5e8f14a09d26a8efb22fd12063168caba6 (commit) from 82a4e07f8fa3cfd745218ef56a1c9a46087a0be8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81389a5e8f14a09d26a8efb22fd12063168caba6 commit 81389a5e8f14a09d26a8efb22fd12063168caba6 Author: Kitware Robot AuthorDate: Sun Jul 14 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jul 14 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 19f2392..5fccf67 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 15) -set(CMake_VERSION_PATCH 20190713) +set(CMake_VERSION_PATCH 20190714) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 15 00:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 15 Jul 2019 00:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-291-g0db8b7e Message-ID: <20190715040305.B96291034CF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0db8b7eb451467f461579b0cf75691187dce7e1b (commit) from 81389a5e8f14a09d26a8efb22fd12063168caba6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0db8b7eb451467f461579b0cf75691187dce7e1b commit 0db8b7eb451467f461579b0cf75691187dce7e1b Author: Kitware Robot AuthorDate: Mon Jul 15 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jul 15 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 5fccf67..3108ebc 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 15) -set(CMake_VERSION_PATCH 20190714) +set(CMake_VERSION_PATCH 20190715) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 15 07:33:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 15 Jul 2019 07:33:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-293-g1b8fdad Message-ID: <20190715113309.18B30113A82@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1b8fdad269711da81a4f93526247e14057d7c0c7 (commit) via 6af97178efda2b6979200be55c2532929bafa815 (commit) from 0db8b7eb451467f461579b0cf75691187dce7e1b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b8fdad269711da81a4f93526247e14057d7c0c7 commit 1b8fdad269711da81a4f93526247e14057d7c0c7 Merge: 0db8b7e 6af9717 Author: Brad King AuthorDate: Mon Jul 15 11:27:35 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 15 07:27:46 2019 -0400 Merge topic 'soname' 6af97178ef Swift: support SONAME on ELFish targets Acked-by: Kitware Robot Merge-request: !3543 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6af97178efda2b6979200be55c2532929bafa815 commit 6af97178efda2b6979200be55c2532929bafa815 Author: Saleem Abdulrasool AuthorDate: Thu Jul 11 11:12:26 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Thu Jul 11 11:12:26 2019 -0700 Swift: support SONAME on ELFish targets We should enable the soname to be setup for ELF shared libraries. Failure to do so generates binaries with incorrect names which prevents loading. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 0f84cce..f6510b9 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -18,6 +18,9 @@ if(CMAKE_Swift_COMPILER_ID) endif() set(CMAKE_INCLUDE_FLAG_Swift "-I ") +if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ") +endif() set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") set(CMAKE_Swift_COMPILER_ARG1 -frontend) @@ -55,9 +58,9 @@ endif() if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") endif() endif() ----------------------------------------------------------------------- Summary of changes: Modules/CMakeSwiftInformation.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 15 07:43:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 15 Jul 2019 07:43:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc4-7-g7242d81 Message-ID: <20190715114307.D6EDD11CC78@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 7242d812691e95cae578a597161693940447b38c (commit) via f84d2045e916a3656e3c72f8be268c4a0c9f4dcc (commit) from 1810a61b394eee2fe9465d5460bb578f833078da (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/release/3.14.rst | 8 ++++++++ Modules/FindBISON.cmake | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 15 07:43:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 15 Jul 2019 07:43:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-306-gd7e53b4 Message-ID: <20190715114307.930A811CD6A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d7e53b427428bc23778d1b094e8893df4573e22e (commit) via a92b7fd46bcf1ecd255290d84c691a244c8ecb26 (commit) via 3376067bae3972b0fc7232b524ee80e2fc39950f (commit) via 5133cab1922ec68446b47eee8e1baa8c3eaa446f (commit) via 0964a969728e416b2abbedf41517c46e5cf2cb1c (commit) via 1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb (commit) via d9b2c7dae242868f13fc366773fb09448da26e8d (commit) via 7ff9ab3b101b131bd4a91a459f66ce27f97f4757 (commit) via 79f5ef19fe418efe2d9bfc55fcd16dfd75f18d49 (commit) via 22d3eb5d5e4ce9c6371ab709655928552453fbda (commit) via 7242d812691e95cae578a597161693940447b38c (commit) via 3af48083a24676025590e1e3a8db2cfef0317901 (commit) via f84d2045e916a3656e3c72f8be268c4a0c9f4dcc (commit) from 1b8fdad269711da81a4f93526247e14057d7c0c7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7e53b427428bc23778d1b094e8893df4573e22e commit d7e53b427428bc23778d1b094e8893df4573e22e Merge: a92b7fd 7ff9ab3 Author: Brad King AuthorDate: Mon Jul 15 11:41:43 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 15 07:41:52 2019 -0400 Merge topic 'cleanup-gen-lookups' 7ff9ab3b10 Makefile: De-duplicate executable link rule lookup 79f5ef19fe De-duplicate checks for whether a platform uses Windows DLLs 22d3eb5d5e Refactor checks for whether a target has an import library Acked-by: Kitware Robot Merge-request: !3550 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a92b7fd46bcf1ecd255290d84c691a244c8ecb26 commit a92b7fd46bcf1ecd255290d84c691a244c8ecb26 Merge: 3376067 1591f13 Author: Brad King AuthorDate: Mon Jul 15 11:39:47 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 15 07:40:00 2019 -0400 Merge topic 'modernize-cmCommand-memory-management' 1591f138f1 modernize: manage cmCommand instances using unique_ptr. d9b2c7dae2 Introduce memory management helper: cm_memory.hxx Acked-by: Kitware Robot Acked-by: Sebastian Holtermann Merge-request: !3513 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3376067bae3972b0fc7232b524ee80e2fc39950f commit 3376067bae3972b0fc7232b524ee80e2fc39950f Merge: 5133cab 7242d81 Author: Brad King AuthorDate: Mon Jul 15 07:35:17 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 07:35:17 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5133cab1922ec68446b47eee8e1baa8c3eaa446f commit 5133cab1922ec68446b47eee8e1baa8c3eaa446f Merge: 0964a96 3af4808 Author: Brad King AuthorDate: Mon Jul 15 07:34:54 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 07:34:54 2019 -0400 Merge branch 'release-3.14' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0964a969728e416b2abbedf41517c46e5cf2cb1c commit 0964a969728e416b2abbedf41517c46e5cf2cb1c Merge: 1b8fdad f84d204 Author: Brad King AuthorDate: Mon Jul 15 11:33:52 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 15 07:34:01 2019 -0400 Merge topic 'FindBISON-CMP0088-SourcePath' f84d2045e9 FindBISON: Fix CMP0088 NEW behavior for non-absolute input paths Acked-by: Kitware Robot Merge-request: !3549 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb commit 1591f138f1a40fccdde7fb2796ee2d2d8f3f97bb Author: Marc Chevrier AuthorDate: Thu Jul 4 18:14:22 2019 +0200 Commit: Marc Chevrier CommitDate: Sun Jul 14 15:37:30 2019 +0200 modernize: manage cmCommand instances using unique_ptr. diff --git a/Source/CTest/cmCTestBuildCommand.h b/Source/CTest/cmCTestBuildCommand.h index 77b0549..a62c301 100644 --- a/Source/CTest/cmCTestBuildCommand.h +++ b/Source/CTest/cmCTestBuildCommand.h @@ -6,13 +6,16 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestHandlerCommand.h" +#include "cmCommand.h" #include +#include #include +#include "cm_memory.hxx" + class cmCTestBuildHandler; class cmCTestGenericHandler; -class cmCommand; class cmExecutionStatus; class cmGlobalGenerator; @@ -30,12 +33,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestBuildCommand* ni = new cmCTestBuildCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestConfigureCommand.h b/Source/CTest/cmCTestConfigureCommand.h index 0cbcbfa..4677c83 100644 --- a/Source/CTest/cmCTestConfigureCommand.h +++ b/Source/CTest/cmCTestConfigureCommand.h @@ -6,11 +6,14 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestHandlerCommand.h" +#include "cmCommand.h" #include +#include + +#include "cm_memory.hxx" class cmCTestGenericHandler; -class cmCommand; /** \class cmCTestConfigure * \brief Run a ctest script @@ -25,12 +28,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestConfigureCommand* ni = new cmCTestConfigureCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h index 1ae2d86..08f31f7 100644 --- a/Source/CTest/cmCTestCoverageCommand.h +++ b/Source/CTest/cmCTestCoverageCommand.h @@ -6,12 +6,15 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestHandlerCommand.h" +#include "cmCommand.h" #include #include +#include + +#include "cm_memory.hxx" class cmCTestGenericHandler; -class cmCommand; /** \class cmCTestCoverage * \brief Run a ctest script @@ -26,12 +29,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestCoverageCommand* ni = new cmCTestCoverageCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h index 9425ece..84250cb 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h @@ -6,11 +6,14 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestCommand.h" +#include "cmCommand.h" #include +#include #include -class cmCommand; +#include "cm_memory.hxx" + class cmExecutionStatus; /** \class cmCTestEmptyBinaryDirectory @@ -27,13 +30,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestEmptyBinaryDirectoryCommand* ni = - new cmCTestEmptyBinaryDirectoryCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h index b6b3c40..837a687 100644 --- a/Source/CTest/cmCTestMemCheckCommand.h +++ b/Source/CTest/cmCTestMemCheckCommand.h @@ -5,10 +5,14 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include + +#include "cm_memory.hxx" + #include "cmCTestTestCommand.h" +#include "cmCommand.h" class cmCTestGenericHandler; -class cmCommand; /** \class cmCTestMemCheck * \brief Run a ctest script @@ -23,12 +27,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestMemCheckCommand* ni = new cmCTestMemCheckCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } protected: diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h index ba25c51..db2ac5e 100644 --- a/Source/CTest/cmCTestReadCustomFilesCommand.h +++ b/Source/CTest/cmCTestReadCustomFilesCommand.h @@ -6,11 +6,14 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestCommand.h" +#include "cmCommand.h" #include +#include #include -class cmCommand; +#include "cm_memory.hxx" + class cmExecutionStatus; /** \class cmCTestReadCustomFiles @@ -27,11 +30,11 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestReadCustomFilesCommand* ni = new cmCTestReadCustomFilesCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h index 9d8b4b5..6961f6e 100644 --- a/Source/CTest/cmCTestRunScriptCommand.h +++ b/Source/CTest/cmCTestRunScriptCommand.h @@ -6,11 +6,14 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestCommand.h" +#include "cmCommand.h" #include +#include #include -class cmCommand; +#include "cm_memory.hxx" + class cmExecutionStatus; /** \class cmCTestRunScript @@ -27,12 +30,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestRunScriptCommand* ni = new cmCTestRunScriptCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index a739f44..861bd06 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -12,6 +12,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCTest.h" #include "cmCTestBuildCommand.h" #include "cmCTestCommand.h" @@ -27,6 +29,7 @@ #include "cmCTestTestCommand.h" #include "cmCTestUpdateCommand.h" #include "cmCTestUploadCommand.h" +#include "cmCommand.h" #include "cmDuration.h" #include "cmFunctionBlocker.h" #include "cmGeneratedFileStream.h" @@ -167,12 +170,12 @@ void cmCTestScriptHandler::UpdateElapsedTime() } } -void cmCTestScriptHandler::AddCTestCommand(std::string const& name, - cmCTestCommand* command) +void cmCTestScriptHandler::AddCTestCommand( + std::string const& name, std::unique_ptr command) { command->CTest = this->CTest; command->CTestScriptHandler = this; - this->CMake->GetState()->AddBuiltinCommand(name, command); + this->CMake->GetState()->AddBuiltinCommand(name, std::move(command)); } int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) @@ -295,21 +298,28 @@ void cmCTestScriptHandler::CreateCMake() } }); - this->AddCTestCommand("ctest_build", new cmCTestBuildCommand); - this->AddCTestCommand("ctest_configure", new cmCTestConfigureCommand); - this->AddCTestCommand("ctest_coverage", new cmCTestCoverageCommand); + this->AddCTestCommand("ctest_build", cm::make_unique()); + this->AddCTestCommand("ctest_configure", + cm::make_unique()); + this->AddCTestCommand("ctest_coverage", + cm::make_unique()); this->AddCTestCommand("ctest_empty_binary_directory", - new cmCTestEmptyBinaryDirectoryCommand); - this->AddCTestCommand("ctest_memcheck", new cmCTestMemCheckCommand); + cm::make_unique()); + this->AddCTestCommand("ctest_memcheck", + cm::make_unique()); this->AddCTestCommand("ctest_read_custom_files", - new cmCTestReadCustomFilesCommand); - this->AddCTestCommand("ctest_run_script", new cmCTestRunScriptCommand); - this->AddCTestCommand("ctest_sleep", new cmCTestSleepCommand); - this->AddCTestCommand("ctest_start", new cmCTestStartCommand); - this->AddCTestCommand("ctest_submit", new cmCTestSubmitCommand); - this->AddCTestCommand("ctest_test", new cmCTestTestCommand); - this->AddCTestCommand("ctest_update", new cmCTestUpdateCommand); - this->AddCTestCommand("ctest_upload", new cmCTestUploadCommand); + cm::make_unique()); + this->AddCTestCommand("ctest_run_script", + cm::make_unique()); + this->AddCTestCommand("ctest_sleep", cm::make_unique()); + this->AddCTestCommand("ctest_start", cm::make_unique()); + this->AddCTestCommand("ctest_submit", + cm::make_unique()); + this->AddCTestCommand("ctest_test", cm::make_unique()); + this->AddCTestCommand("ctest_update", + cm::make_unique()); + this->AddCTestCommand("ctest_upload", + cm::make_unique()); } // this sets up some variables for the script to use, creates the required diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index d93b5f8..b2e8cbf 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -9,6 +9,7 @@ #include "cmDuration.h" #include +#include #include #include @@ -131,7 +132,8 @@ private: int RunConfigurationDashboard(); // Add ctest command - void AddCTestCommand(std::string const& name, cmCTestCommand* command); + void AddCTestCommand(std::string const& name, + std::unique_ptr command); // Try to remove the binary directory once static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath); diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h index 5cd185a..7b17081 100644 --- a/Source/CTest/cmCTestSleepCommand.h +++ b/Source/CTest/cmCTestSleepCommand.h @@ -6,11 +6,14 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestCommand.h" +#include "cmCommand.h" #include +#include #include -class cmCommand; +#include "cm_memory.hxx" + class cmExecutionStatus; /** \class cmCTestSleep @@ -27,12 +30,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestSleepCommand* ni = new cmCTestSleepCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h index 542f27c..7c71f36 100644 --- a/Source/CTest/cmCTestStartCommand.h +++ b/Source/CTest/cmCTestStartCommand.h @@ -6,12 +6,15 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestCommand.h" +#include "cmCommand.h" #include #include +#include #include -class cmCommand; +#include "cm_memory.hxx" + class cmExecutionStatus; /** \class cmCTestStart @@ -27,14 +30,14 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestStartCommand* ni = new cmCTestStartCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; ni->CreateNewTag = this->CreateNewTag; ni->Quiet = this->Quiet; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index afc3e67..bf43d88 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -4,11 +4,15 @@ #include "cmCTest.h" #include "cmCTestSubmitHandler.h" +#include "cmCommand.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmSystemTools.h" #include +#include + +#include "cm_memory.hxx" class cmExecutionStatus; @@ -27,12 +31,12 @@ cmCTestSubmitCommand::cmCTestSubmitCommand() /** * This is a virtual constructor for the command. */ -cmCommand* cmCTestSubmitCommand::Clone() +std::unique_ptr cmCTestSubmitCommand::Clone() { - cmCTestSubmitCommand* ni = new cmCTestSubmitCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 1e27046..5bbcd39 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -8,12 +8,13 @@ #include "cmCTest.h" #include "cmCTestHandlerCommand.h" +#include #include #include #include -class cmCTestGenericHandler; class cmCommand; +class cmCTestGenericHandler; class cmExecutionStatus; /** \class cmCTestSubmit @@ -26,7 +27,7 @@ class cmCTestSubmitCommand : public cmCTestHandlerCommand { public: cmCTestSubmitCommand(); - cmCommand* Clone() override; + std::unique_ptr Clone() override; bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h index 11c0db9..d74136c 100644 --- a/Source/CTest/cmCTestTestCommand.h +++ b/Source/CTest/cmCTestTestCommand.h @@ -6,11 +6,14 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestHandlerCommand.h" +#include "cmCommand.h" #include +#include + +#include "cm_memory.hxx" class cmCTestGenericHandler; -class cmCommand; /** \class cmCTestTest * \brief Run a ctest script @@ -25,12 +28,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestTestCommand* ni = new cmCTestTestCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 46ef809..9916ca3 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -11,12 +11,14 @@ #include #include #include -#include #include #include #include #include #include +#include + +#include "cm_memory.hxx" #include "cmAlgorithms.h" #include "cmCTest.h" @@ -43,11 +45,11 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestSubdirCommand* c = new cmCTestSubdirCommand; + auto c = cm::make_unique(); c->TestHandler = this->TestHandler; - return c; + return std::unique_ptr(std::move(c)); } /** @@ -122,11 +124,11 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestAddSubdirectoryCommand* c = new cmCTestAddSubdirectoryCommand; + auto c = cm::make_unique(); c->TestHandler = this->TestHandler; - return c; + return std::unique_ptr(std::move(c)); } /** @@ -187,11 +189,11 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestAddTestCommand* c = new cmCTestAddTestCommand; + auto c = cm::make_unique(); c->TestHandler = this->TestHandler; - return c; + return std::unique_ptr(std::move(c)); } /** @@ -220,11 +222,11 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestSetTestsPropertiesCommand* c = new cmCTestSetTestsPropertiesCommand; + auto c = cm::make_unique(); c->TestHandler = this->TestHandler; - return c; + return std::unique_ptr(std::move(c)); } /** @@ -249,12 +251,11 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestSetDirectoryPropertiesCommand* c = - new cmCTestSetDirectoryPropertiesCommand; + auto c = cm::make_unique(); c->TestHandler = this->TestHandler; - return c; + return std::unique_ptr(std::move(c)); } /** @@ -1686,32 +1687,31 @@ void cmCTestTestHandler::GetListOfTests() this->CTest->GetConfigType().c_str()); // Add handler for ADD_TEST - cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand; + auto newCom1 = cm::make_unique(); newCom1->TestHandler = this; - cm.GetState()->AddBuiltinCommand("add_test", newCom1); + cm.GetState()->AddBuiltinCommand("add_test", std::move(newCom1)); // Add handler for SUBDIRS - cmCTestSubdirCommand* newCom2 = new cmCTestSubdirCommand; + auto newCom2 = cm::make_unique(); newCom2->TestHandler = this; - cm.GetState()->AddBuiltinCommand("subdirs", newCom2); + cm.GetState()->AddBuiltinCommand("subdirs", std::move(newCom2)); // Add handler for ADD_SUBDIRECTORY - cmCTestAddSubdirectoryCommand* newCom3 = new cmCTestAddSubdirectoryCommand; + auto newCom3 = cm::make_unique(); newCom3->TestHandler = this; - cm.GetState()->AddBuiltinCommand("add_subdirectory", newCom3); + cm.GetState()->AddBuiltinCommand("add_subdirectory", std::move(newCom3)); // Add handler for SET_TESTS_PROPERTIES - cmCTestSetTestsPropertiesCommand* newCom4 = - new cmCTestSetTestsPropertiesCommand; + auto newCom4 = cm::make_unique(); newCom4->TestHandler = this; - cm.GetState()->AddBuiltinCommand("set_tests_properties", newCom4); + cm.GetState()->AddBuiltinCommand("set_tests_properties", std::move(newCom4)); // Add handler for SET_DIRECTORY_PROPERTIES cm.GetState()->RemoveBuiltinCommand("set_directory_properties"); - cmCTestSetDirectoryPropertiesCommand* newCom5 = - new cmCTestSetDirectoryPropertiesCommand; + auto newCom5 = cm::make_unique(); newCom5->TestHandler = this; - cm.GetState()->AddBuiltinCommand("set_directory_properties", newCom5); + cm.GetState()->AddBuiltinCommand("set_directory_properties", + std::move(newCom5)); const char* testFilename; if (cmSystemTools::FileExists("CTestTestfile.cmake")) { diff --git a/Source/CTest/cmCTestUpdateCommand.h b/Source/CTest/cmCTestUpdateCommand.h index 3b2f3e1..55c4b80 100644 --- a/Source/CTest/cmCTestUpdateCommand.h +++ b/Source/CTest/cmCTestUpdateCommand.h @@ -6,11 +6,14 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestHandlerCommand.h" +#include "cmCommand.h" #include +#include + +#include "cm_memory.hxx" class cmCTestGenericHandler; -class cmCommand; /** \class cmCTestUpdate * \brief Run a ctest script @@ -25,12 +28,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestUpdateCommand* ni = new cmCTestUpdateCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h index 0d3b06e..2bb072f 100644 --- a/Source/CTest/cmCTestUploadCommand.h +++ b/Source/CTest/cmCTestUploadCommand.h @@ -6,12 +6,15 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmCTestHandlerCommand.h" +#include "cmCommand.h" #include #include +#include + +#include "cm_memory.hxx" class cmCTestGenericHandler; -class cmCommand; /** \class cmCTestUpload * \brief Run a ctest script @@ -25,12 +28,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmCTestUploadCommand* ni = new cmCTestUploadCommand; + auto ni = cm::make_unique(); ni->CTest = this->CTest; ni->CTestScriptHandler = this->CTestScriptHandler; - return ni; + return std::unique_ptr(std::move(ni)); } /** diff --git a/Source/cmAddCompileDefinitionsCommand.h b/Source/cmAddCompileDefinitionsCommand.h index e985dca..5f90ed9 100644 --- a/Source/cmAddCompileDefinitionsCommand.h +++ b/Source/cmAddCompileDefinitionsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -18,7 +20,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddCompileDefinitionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h index 3d53d09..b34b7fc 100644 --- a/Source/cmAddCompileOptionsCommand.h +++ b/Source/cmAddCompileOptionsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -18,7 +20,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddCompileOptionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h index 6af4f10..931aeab 100644 --- a/Source/cmAddCustomCommandCommand.h +++ b/Source/cmAddCustomCommandCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddCustomCommandCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index 1a55116..db577bc 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddCustomTargetCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h index 7b75638..0e32c83 100644 --- a/Source/cmAddDefinitionsCommand.h +++ b/Source/cmAddDefinitionsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddDefinitionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h index e10df71..ce912d3 100644 --- a/Source/cmAddDependenciesCommand.h +++ b/Source/cmAddDependenciesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddDependenciesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h index bdf607d..ec57c3f 100644 --- a/Source/cmAddExecutableCommand.h +++ b/Source/cmAddExecutableCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddExecutableCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h index aa21261..56dab41 100644 --- a/Source/cmAddLibraryCommand.h +++ b/Source/cmAddLibraryCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddLibraryCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddLinkOptionsCommand.h b/Source/cmAddLinkOptionsCommand.h index 30fff00..8e46be6 100644 --- a/Source/cmAddLinkOptionsCommand.h +++ b/Source/cmAddLinkOptionsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -18,7 +20,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddLinkOptionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h index 0ea4423..664334e 100644 --- a/Source/cmAddSubDirectoryCommand.h +++ b/Source/cmAddSubDirectoryCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddSubDirectoryCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h index bea3f3d..3d37d2b 100644 --- a/Source/cmAddTestCommand.h +++ b/Source/cmAddTestCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAddTestCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h index 3742e3e..973a464 100644 --- a/Source/cmAuxSourceDirectoryCommand.h +++ b/Source/cmAuxSourceDirectoryCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -27,7 +29,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmAuxSourceDirectoryCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h index 3b18567..e6f218e 100644 --- a/Source/cmBreakCommand.h +++ b/Source/cmBreakCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmBreakCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h index e0529a4..d373103 100644 --- a/Source/cmBuildCommand.h +++ b/Source/cmBuildCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmBuildCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index 4bb72d1..bd2d146 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmBuildNameCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmBuildNameCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; }; diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h index b871641..8ea2d55 100644 --- a/Source/cmCMakeHostSystemInformationCommand.h +++ b/Source/cmCMakeHostSystemInformationCommand.h @@ -9,6 +9,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -28,9 +30,9 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - return new cmCMakeHostSystemInformationCommand; + return cm::make_unique(); } /** diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index f9b61e1..3881133 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmCMakeMinimumRequired; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h index cca1406..919402c 100644 --- a/Source/cmCMakePolicyCommand.h +++ b/Source/cmCMakePolicyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmCMakePolicyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 9ccd773..cdd2aba 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include #include #include @@ -75,7 +76,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() = 0; + virtual std::unique_ptr Clone() = 0; /** * Return the last error string. diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 63c5397..96c7105 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -1,5 +1,8 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ + +#include "cm_memory.hxx" + #include "cmCommands.h" #include "cmPolicies.h" #include "cmState.h" @@ -17,6 +20,7 @@ #include "cmBuildCommand.h" #include "cmCMakeMinimumRequired.h" #include "cmCMakePolicyCommand.h" +#include "cmCommand.h" #include "cmConfigureFileCommand.h" #include "cmContinueCommand.h" #include "cmCreateTestSourceList.h" @@ -112,52 +116,64 @@ void GetScriptingCommands(cmState* state) { - state->AddBuiltinCommand("break", new cmBreakCommand); + state->AddBuiltinCommand("break", cm::make_unique()); state->AddBuiltinCommand("cmake_minimum_required", - new cmCMakeMinimumRequired); - state->AddBuiltinCommand("cmake_policy", new cmCMakePolicyCommand); - state->AddBuiltinCommand("configure_file", new cmConfigureFileCommand); - state->AddBuiltinCommand("continue", new cmContinueCommand); - state->AddBuiltinCommand("exec_program", new cmExecProgramCommand); - state->AddBuiltinCommand("execute_process", new cmExecuteProcessCommand); - state->AddBuiltinCommand("file", new cmFileCommand); - state->AddBuiltinCommand("find_file", new cmFindFileCommand); - state->AddBuiltinCommand("find_library", new cmFindLibraryCommand); - state->AddBuiltinCommand("find_package", new cmFindPackageCommand); - state->AddBuiltinCommand("find_path", new cmFindPathCommand); - state->AddBuiltinCommand("find_program", new cmFindProgramCommand); - state->AddBuiltinCommand("foreach", new cmForEachCommand); - state->AddBuiltinCommand("function", new cmFunctionCommand); + cm::make_unique()); + state->AddBuiltinCommand("cmake_policy", + cm::make_unique()); + state->AddBuiltinCommand("configure_file", + cm::make_unique()); + state->AddBuiltinCommand("continue", cm::make_unique()); + state->AddBuiltinCommand("exec_program", + cm::make_unique()); + state->AddBuiltinCommand("execute_process", + cm::make_unique()); + state->AddBuiltinCommand("file", cm::make_unique()); + state->AddBuiltinCommand("find_file", cm::make_unique()); + state->AddBuiltinCommand("find_library", + cm::make_unique()); + state->AddBuiltinCommand("find_package", + cm::make_unique()); + state->AddBuiltinCommand("find_path", cm::make_unique()); + state->AddBuiltinCommand("find_program", + cm::make_unique()); + state->AddBuiltinCommand("foreach", cm::make_unique()); + state->AddBuiltinCommand("function", cm::make_unique()); state->AddBuiltinCommand("get_cmake_property", - new cmGetCMakePropertyCommand); + cm::make_unique()); state->AddBuiltinCommand("get_directory_property", - new cmGetDirectoryPropertyCommand); + cm::make_unique()); state->AddBuiltinCommand("get_filename_component", - new cmGetFilenameComponentCommand); - state->AddBuiltinCommand("get_property", new cmGetPropertyCommand); - state->AddBuiltinCommand("if", new cmIfCommand); - state->AddBuiltinCommand("include", new cmIncludeCommand); - state->AddBuiltinCommand("include_guard", new cmIncludeGuardCommand); - state->AddBuiltinCommand("list", new cmListCommand); - state->AddBuiltinCommand("macro", new cmMacroCommand); - state->AddBuiltinCommand("make_directory", new cmMakeDirectoryCommand); - state->AddBuiltinCommand("mark_as_advanced", new cmMarkAsAdvancedCommand); - state->AddBuiltinCommand("math", new cmMathCommand); - state->AddBuiltinCommand("message", new cmMessageCommand); - state->AddBuiltinCommand("option", new cmOptionCommand); + cm::make_unique()); + state->AddBuiltinCommand("get_property", + cm::make_unique()); + state->AddBuiltinCommand("if", cm::make_unique()); + state->AddBuiltinCommand("include", cm::make_unique()); + state->AddBuiltinCommand("include_guard", + cm::make_unique()); + state->AddBuiltinCommand("list", cm::make_unique()); + state->AddBuiltinCommand("macro", cm::make_unique()); + state->AddBuiltinCommand("make_directory", + cm::make_unique()); + state->AddBuiltinCommand("mark_as_advanced", + cm::make_unique()); + state->AddBuiltinCommand("math", cm::make_unique()); + state->AddBuiltinCommand("message", cm::make_unique()); + state->AddBuiltinCommand("option", cm::make_unique()); state->AddBuiltinCommand("cmake_parse_arguments", - new cmParseArgumentsCommand); - state->AddBuiltinCommand("return", new cmReturnCommand); + cm::make_unique()); + state->AddBuiltinCommand("return", cm::make_unique()); state->AddBuiltinCommand("separate_arguments", - new cmSeparateArgumentsCommand); - state->AddBuiltinCommand("set", new cmSetCommand); + cm::make_unique()); + state->AddBuiltinCommand("set", cm::make_unique()); state->AddBuiltinCommand("set_directory_properties", - new cmSetDirectoryPropertiesCommand); - state->AddBuiltinCommand("set_property", new cmSetPropertyCommand); - state->AddBuiltinCommand("site_name", new cmSiteNameCommand); - state->AddBuiltinCommand("string", new cmStringCommand); - state->AddBuiltinCommand("unset", new cmUnsetCommand); - state->AddBuiltinCommand("while", new cmWhileCommand); + cm::make_unique()); + state->AddBuiltinCommand("set_property", + cm::make_unique()); + state->AddBuiltinCommand("site_name", cm::make_unique()); + state->AddBuiltinCommand("string", cm::make_unique()); + state->AddBuiltinCommand("unset", cm::make_unique()); + state->AddBuiltinCommand("while", cm::make_unique()); state->AddUnexpectedCommand( "else", @@ -195,17 +211,21 @@ void GetScriptingCommands(cmState* state) "match the opening WHILE command."); #if defined(CMAKE_BUILD_WITH_CMAKE) - state->AddBuiltinCommand("cmake_host_system_information", - new cmCMakeHostSystemInformationCommand); - state->AddBuiltinCommand("remove", new cmRemoveCommand); - state->AddBuiltinCommand("variable_watch", new cmVariableWatchCommand); - state->AddBuiltinCommand("write_file", new cmWriteFileCommand); + state->AddBuiltinCommand( + "cmake_host_system_information", + cm::make_unique()); + state->AddBuiltinCommand("remove", cm::make_unique()); + state->AddBuiltinCommand("variable_watch", + cm::make_unique()); + state->AddBuiltinCommand("write_file", + cm::make_unique()); state->AddDisallowedCommand( - "build_name", new cmBuildNameCommand, cmPolicies::CMP0036, + "build_name", cm::make_unique(), cmPolicies::CMP0036, "The build_name command should not be called; see CMP0036."); state->AddDisallowedCommand( - "use_mangled_mesa", new cmUseMangledMesaCommand, cmPolicies::CMP0030, + "use_mangled_mesa", cm::make_unique(), + cmPolicies::CMP0030, "The use_mangled_mesa command should not be called; see CMP0030."); #endif @@ -214,100 +234,131 @@ void GetScriptingCommands(cmState* state) void GetProjectCommands(cmState* state) { state->AddBuiltinCommand("add_custom_command", - new cmAddCustomCommandCommand); - state->AddBuiltinCommand("add_custom_target", new cmAddCustomTargetCommand); - state->AddBuiltinCommand("add_definitions", new cmAddDefinitionsCommand); - state->AddBuiltinCommand("add_dependencies", new cmAddDependenciesCommand); - state->AddBuiltinCommand("add_executable", new cmAddExecutableCommand); - state->AddBuiltinCommand("add_library", new cmAddLibraryCommand); - state->AddBuiltinCommand("add_subdirectory", new cmAddSubDirectoryCommand); - state->AddBuiltinCommand("add_test", new cmAddTestCommand); - state->AddBuiltinCommand("build_command", new cmBuildCommand); + cm::make_unique()); + state->AddBuiltinCommand("add_custom_target", + cm::make_unique()); + state->AddBuiltinCommand("add_definitions", + cm::make_unique()); + state->AddBuiltinCommand("add_dependencies", + cm::make_unique()); + state->AddBuiltinCommand("add_executable", + cm::make_unique()); + state->AddBuiltinCommand("add_library", + cm::make_unique()); + state->AddBuiltinCommand("add_subdirectory", + cm::make_unique()); + state->AddBuiltinCommand("add_test", cm::make_unique()); + state->AddBuiltinCommand("build_command", cm::make_unique()); state->AddBuiltinCommand("create_test_sourcelist", - new cmCreateTestSourceList); - state->AddBuiltinCommand("define_property", new cmDefinePropertyCommand); - state->AddBuiltinCommand("enable_language", new cmEnableLanguageCommand); - state->AddBuiltinCommand("enable_testing", new cmEnableTestingCommand); + cm::make_unique()); + state->AddBuiltinCommand("define_property", + cm::make_unique()); + state->AddBuiltinCommand("enable_language", + cm::make_unique()); + state->AddBuiltinCommand("enable_testing", + cm::make_unique()); state->AddBuiltinCommand("get_source_file_property", - new cmGetSourceFilePropertyCommand); + cm::make_unique()); state->AddBuiltinCommand("get_target_property", - new cmGetTargetPropertyCommand); - state->AddBuiltinCommand("get_test_property", new cmGetTestPropertyCommand); + cm::make_unique()); + state->AddBuiltinCommand("get_test_property", + cm::make_unique()); state->AddBuiltinCommand("include_directories", - new cmIncludeDirectoryCommand); - state->AddBuiltinCommand("include_regular_expression", - new cmIncludeRegularExpressionCommand); - state->AddBuiltinCommand("install", new cmInstallCommand); - state->AddBuiltinCommand("install_files", new cmInstallFilesCommand); - state->AddBuiltinCommand("install_targets", new cmInstallTargetsCommand); - state->AddBuiltinCommand("link_directories", new cmLinkDirectoriesCommand); - state->AddBuiltinCommand("project", new cmProjectCommand); - state->AddBuiltinCommand("set_source_files_properties", - new cmSetSourceFilesPropertiesCommand); + cm::make_unique()); + state->AddBuiltinCommand( + "include_regular_expression", + cm::make_unique()); + state->AddBuiltinCommand("install", cm::make_unique()); + state->AddBuiltinCommand("install_files", + cm::make_unique()); + state->AddBuiltinCommand("install_targets", + cm::make_unique()); + state->AddBuiltinCommand("link_directories", + cm::make_unique()); + state->AddBuiltinCommand("project", cm::make_unique()); + state->AddBuiltinCommand( + "set_source_files_properties", + cm::make_unique()); state->AddBuiltinCommand("set_target_properties", - new cmSetTargetPropertiesCommand); + cm::make_unique()); state->AddBuiltinCommand("set_tests_properties", - new cmSetTestsPropertiesCommand); - state->AddBuiltinCommand("subdirs", new cmSubdirCommand); - state->AddBuiltinCommand("target_compile_definitions", - new cmTargetCompileDefinitionsCommand); + cm::make_unique()); + state->AddBuiltinCommand("subdirs", cm::make_unique()); + state->AddBuiltinCommand( + "target_compile_definitions", + cm::make_unique()); state->AddBuiltinCommand("target_compile_features", - new cmTargetCompileFeaturesCommand); + cm::make_unique()); state->AddBuiltinCommand("target_compile_options", - new cmTargetCompileOptionsCommand); - state->AddBuiltinCommand("target_include_directories", - new cmTargetIncludeDirectoriesCommand); + cm::make_unique()); + state->AddBuiltinCommand( + "target_include_directories", + cm::make_unique()); state->AddBuiltinCommand("target_link_libraries", - new cmTargetLinkLibrariesCommand); - state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand); - state->AddBuiltinCommand("try_compile", new cmTryCompileCommand); - state->AddBuiltinCommand("try_run", new cmTryRunCommand); + cm::make_unique()); + state->AddBuiltinCommand("target_sources", + cm::make_unique()); + state->AddBuiltinCommand("try_compile", + cm::make_unique()); + state->AddBuiltinCommand("try_run", cm::make_unique()); #if defined(CMAKE_BUILD_WITH_CMAKE) state->AddBuiltinCommand("add_compile_definitions", - new cmAddCompileDefinitionsCommand); + cm::make_unique()); state->AddBuiltinCommand("add_compile_options", - new cmAddCompileOptionsCommand); + cm::make_unique()); state->AddBuiltinCommand("aux_source_directory", - new cmAuxSourceDirectoryCommand); - state->AddBuiltinCommand("export", new cmExportCommand); - state->AddBuiltinCommand("fltk_wrap_ui", new cmFLTKWrapUICommand); - state->AddBuiltinCommand("include_external_msproject", - new cmIncludeExternalMSProjectCommand); - state->AddBuiltinCommand("install_programs", new cmInstallProgramsCommand); - state->AddBuiltinCommand("add_link_options", new cmAddLinkOptionsCommand); - state->AddBuiltinCommand("link_libraries", new cmLinkLibrariesCommand); + cm::make_unique()); + state->AddBuiltinCommand("export", cm::make_unique()); + state->AddBuiltinCommand("fltk_wrap_ui", + cm::make_unique()); + state->AddBuiltinCommand( + "include_external_msproject", + cm::make_unique()); + state->AddBuiltinCommand("install_programs", + cm::make_unique()); + state->AddBuiltinCommand("add_link_options", + cm::make_unique()); + state->AddBuiltinCommand("link_libraries", + cm::make_unique()); state->AddBuiltinCommand("target_link_options", - new cmTargetLinkOptionsCommand); + cm::make_unique()); state->AddBuiltinCommand("target_link_directories", - new cmTargetLinkDirectoriesCommand); - state->AddBuiltinCommand("load_cache", new cmLoadCacheCommand); - state->AddBuiltinCommand("qt_wrap_cpp", new cmQTWrapCPPCommand); - state->AddBuiltinCommand("qt_wrap_ui", new cmQTWrapUICommand); + cm::make_unique()); + state->AddBuiltinCommand("load_cache", + cm::make_unique()); + state->AddBuiltinCommand("qt_wrap_cpp", + cm::make_unique()); + state->AddBuiltinCommand("qt_wrap_ui", cm::make_unique()); state->AddBuiltinCommand("remove_definitions", - new cmRemoveDefinitionsCommand); - state->AddBuiltinCommand("source_group", new cmSourceGroupCommand); + cm::make_unique()); + state->AddBuiltinCommand("source_group", + cm::make_unique()); state->AddDisallowedCommand( - "export_library_dependencies", new cmExportLibraryDependenciesCommand, - cmPolicies::CMP0033, + "export_library_dependencies", + cm::make_unique(), cmPolicies::CMP0033, "The export_library_dependencies command should not be called; " "see CMP0033."); state->AddDisallowedCommand( - "load_command", new cmLoadCommandCommand, cmPolicies::CMP0031, + "load_command", cm::make_unique(), + cmPolicies::CMP0031, "The load_command command should not be called; see CMP0031."); state->AddDisallowedCommand( - "output_required_files", new cmOutputRequiredFilesCommand, + "output_required_files", cm::make_unique(), cmPolicies::CMP0032, "The output_required_files command should not be called; see CMP0032."); state->AddDisallowedCommand( - "subdir_depends", new cmSubdirDependsCommand, cmPolicies::CMP0029, + "subdir_depends", cm::make_unique(), + cmPolicies::CMP0029, "The subdir_depends command should not be called; see CMP0029."); state->AddDisallowedCommand( - "utility_source", new cmUtilitySourceCommand, cmPolicies::CMP0034, + "utility_source", cm::make_unique(), + cmPolicies::CMP0034, "The utility_source command should not be called; see CMP0034."); state->AddDisallowedCommand( - "variable_requires", new cmVariableRequiresCommand, cmPolicies::CMP0035, + "variable_requires", cm::make_unique(), + cmPolicies::CMP0035, "The variable_requires command should not be called; see CMP0035."); #endif } diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index 5603c50..b3a99d7 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmNewLineStyle.h" @@ -16,7 +18,10 @@ class cmExecutionStatus; class cmConfigureFileCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmConfigureFileCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmContinueCommand.h b/Source/cmContinueCommand.h index d383d1d..a85010a 100644 --- a/Source/cmContinueCommand.h +++ b/Source/cmContinueCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmContinueCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index 005b32c..5aa6af4 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmCreateTestSourceList; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h index a9c1856..36f97df 100644 --- a/Source/cmDefinePropertyCommand.h +++ b/Source/cmDefinePropertyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmDefinePropertyCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmDefinePropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmDisallowedCommand.h b/Source/cmDisallowedCommand.h index d85c00f..eed59ca 100644 --- a/Source/cmDisallowedCommand.h +++ b/Source/cmDisallowedCommand.h @@ -6,8 +6,11 @@ #include "cmConfigure.h" // IWYU pragma: keep #include +#include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmPolicies.h" @@ -16,20 +19,20 @@ class cmExecutionStatus; class cmDisallowedCommand : public cmCommand { public: - cmDisallowedCommand(cmCommand* command, cmPolicies::PolicyID policy, - const char* message) - : Command(command) + cmDisallowedCommand(std::unique_ptr command, + cmPolicies::PolicyID policy, const char* message) + : Command(std::move(command)) , Policy(policy) , Message(message) { } - ~cmDisallowedCommand() override { delete this->Command; } + ~cmDisallowedCommand() override = default; - cmCommand* Clone() override + std::unique_ptr Clone() override { - return new cmDisallowedCommand(this->Command->Clone(), this->Policy, - this->Message); + return cm::make_unique(this->Command->Clone(), + this->Policy, this->Message); } bool InitialPass(std::vector const& args, @@ -40,7 +43,7 @@ public: bool HasFinalPass() const override { return this->Command->HasFinalPass(); } private: - cmCommand* Command; + std::unique_ptr Command; cmPolicies::PolicyID Policy; const char* Message; }; diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h index 97645a9..dc43e34 100644 --- a/Source/cmEnableLanguageCommand.h +++ b/Source/cmEnableLanguageCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -26,7 +28,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmEnableLanguageCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h index 88a17b9..fd50ebc 100644 --- a/Source/cmEnableTestingCommand.h +++ b/Source/cmEnableTestingCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -31,7 +33,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmEnableTestingCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index ae0fa9b..70f833a 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmProcessOutput.h" @@ -27,7 +29,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmExecProgramCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 121f33f..689fc20 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -8,7 +8,6 @@ #include #include /* isspace */ #include -#include #include #include diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h index b415deb..1d5445f 100644 --- a/Source/cmExecuteProcessCommand.h +++ b/Source/cmExecuteProcessCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmExecuteProcessCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h index 99f9932..50463af 100644 --- a/Source/cmExportCommand.h +++ b/Source/cmExportCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -18,7 +20,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmExportCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h index 8414866..5255d63 100644 --- a/Source/cmExportLibraryDependenciesCommand.h +++ b/Source/cmExportLibraryDependenciesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,9 +17,9 @@ class cmExecutionStatus; class cmExportLibraryDependenciesCommand : public cmCommand { public: - cmCommand* Clone() override + std::unique_ptr Clone() override { - return new cmExportLibraryDependenciesCommand; + return cm::make_unique(); } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h index 044755e..bff4f01 100644 --- a/Source/cmFLTKWrapUICommand.h +++ b/Source/cmFLTKWrapUICommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFLTKWrapUICommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index cfff894..d4b980e 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -22,7 +24,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFileCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h index 4309449..152b505 100644 --- a/Source/cmFindFileCommand.h +++ b/Source/cmFindFileCommand.h @@ -5,9 +5,10 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include "cmFindPathCommand.h" +#include "cm_memory.hxx" -class cmCommand; +#include "cmCommand.h" +#include "cmFindPathCommand.h" /** \class cmFindFileCommand * \brief Define a command to search for an executable program. @@ -24,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFindFileCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } }; #endif diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h index fb8a700..af17d60 100644 --- a/Source/cmFindLibraryCommand.h +++ b/Source/cmFindLibraryCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmFindBase.h" -class cmCommand; class cmExecutionStatus; /** \class cmFindLibraryCommand @@ -27,7 +29,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFindLibraryCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 316ca0f..f6645ae 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -3,6 +3,7 @@ #ifndef cmFindPackageCommand_h #define cmFindPackageCommand_h +#include "cmCommand.h" #include "cmConfigure.h" // IWYU pragma: keep #include "cmPolicies.h" @@ -14,6 +15,8 @@ #include #include +#include "cm_memory.hxx" + // IWYU insists we should forward-declare instead of including , // but we cannot forward-declare reliably because some C++ standard libraries // put the template in an inline namespace. @@ -27,7 +30,6 @@ namespace std { #include "cmFindCommon.h" -class cmCommand; class cmExecutionStatus; class cmSearchPath; @@ -65,7 +67,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFindPackageCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h index cb0db4c..89e2cef 100644 --- a/Source/cmFindPathCommand.h +++ b/Source/cmFindPathCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmFindBase.h" -class cmCommand; class cmExecutionStatus; /** \class cmFindPathCommand @@ -27,7 +29,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFindPathCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index 147936c..40e455e 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmFindBase.h" -class cmCommand; class cmExecutionStatus; /** \class cmFindProgramCommand @@ -28,7 +30,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFindProgramCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h index 5131a4f..cd112b8 100644 --- a/Source/cmForEachCommand.h +++ b/Source/cmForEachCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -39,7 +41,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmForEachCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 9067a5f..8e003ad 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -3,6 +3,9 @@ #include "cmFunctionCommand.h" #include +#include + +#include "cm_memory.hxx" #include "cmAlgorithms.h" #include "cmExecutionStatus.h" @@ -18,15 +21,15 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmFunctionHelperCommand* newC = new cmFunctionHelperCommand; + auto newC = cm::make_unique(); // we must copy when we clone newC->Args = this->Args; newC->Functions = this->Functions; newC->Policies = this->Policies; newC->FilePath = this->FilePath; - return newC; + return std::unique_ptr(std::move(newC)); } /** @@ -129,12 +132,12 @@ bool cmFunctionFunctionBlocker::IsFunctionBlocked( // if this is the endfunction for this function then execute if (!this->Depth) { // create a new command and add it to cmake - cmFunctionHelperCommand* f = new cmFunctionHelperCommand(); + auto f = cm::make_unique(); f->Args = this->Args; f->Functions = this->Functions; f->FilePath = this->GetStartingContext().FilePath; mf.RecordPolicies(f->Policies); - mf.GetState()->AddScriptedCommand(this->Args[0], f); + mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f)); // remove the function blocker now that the function is defined mf.RemoveFunctionBlocker(this, lff); return true; diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h index 8b37df0..449a180 100644 --- a/Source/cmFunctionCommand.h +++ b/Source/cmFunctionCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -34,7 +36,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmFunctionCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h index 1f29c78..7790a6b 100644 --- a/Source/cmGetCMakePropertyCommand.h +++ b/Source/cmGetCMakePropertyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmGetCMakePropertyCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmGetCMakePropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h index 02ea056..63a198a 100644 --- a/Source/cmGetDirectoryPropertyCommand.h +++ b/Source/cmGetDirectoryPropertyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmGetDirectoryPropertyCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmGetDirectoryPropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index 8c26655..1780b96 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmGetFilenameComponentCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h index c3f653e..50e4014 100644 --- a/Source/cmGetPropertyCommand.h +++ b/Source/cmGetPropertyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -17,7 +19,10 @@ class cmGetPropertyCommand : public cmCommand public: cmGetPropertyCommand(); - cmCommand* Clone() override { return new cmGetPropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h index 43bc330..387a7f4 100644 --- a/Source/cmGetSourceFilePropertyCommand.h +++ b/Source/cmGetSourceFilePropertyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmGetSourceFilePropertyCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmGetSourceFilePropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h index 63ee5fd..1a53195 100644 --- a/Source/cmGetTargetPropertyCommand.h +++ b/Source/cmGetTargetPropertyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmGetTargetPropertyCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmGetTargetPropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h index 4a74f59..a53a7f7 100644 --- a/Source/cmGetTestPropertyCommand.h +++ b/Source/cmGetTestPropertyCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmGetTestPropertyCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmGetTestPropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 6f32861..c58ad06 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -11,8 +11,6 @@ #include "cmSystemTools.h" #include "cmake.h" -#include - static std::string cmIfCommandError( std::vector const& args) { diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index d34ed02..4a67760 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -38,7 +40,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmIfCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This overrides the default InvokeInitialPass implementation. diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h index 3b843b2..94d3fbd 100644 --- a/Source/cmIncludeCommand.h +++ b/Source/cmIncludeCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmIncludeCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index 01d98db..4df94eb 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmIncludeDirectoryCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h index 945acdc..9f76576 100644 --- a/Source/cmIncludeExternalMSProjectCommand.h +++ b/Source/cmIncludeExternalMSProjectCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmIncludeExternalMSProjectCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmIncludeGuardCommand.h b/Source/cmIncludeGuardCommand.h index eaad9b8..4306c4c 100644 --- a/Source/cmIncludeGuardCommand.h +++ b/Source/cmIncludeGuardCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmIncludeGuardCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h index 8da991d..1723c8b 100644 --- a/Source/cmIncludeRegularExpressionCommand.h +++ b/Source/cmIncludeRegularExpressionCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmIncludeRegularExpressionCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h index 202c438..28bf443 100644 --- a/Source/cmInstallCommand.h +++ b/Source/cmInstallCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmInstallCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index a52f45e..e068b0e 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmInstallFilesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index 5c705eb..3242365 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmInstallProgramsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index 9950fb7..55e69ba 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmInstallTargetsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index ae4fb7f..1a439de 100644 --- a/Source/cmLinkDirectoriesCommand.h +++ b/Source/cmLinkDirectoriesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -26,7 +28,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmLinkDirectoriesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index af25fba..484ab0a 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/Source/cmLinkLibrariesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmLinkLibrariesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h index ea3d643..70c7f4e 100644 --- a/Source/cmListCommand.h +++ b/Source/cmListCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -22,7 +24,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmListCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h index e0f6e4f..45e52f0 100644 --- a/Source/cmLoadCacheCommand.h +++ b/Source/cmLoadCacheCommand.h @@ -9,6 +9,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmLoadCacheCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 69751b6..235dcd4 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -3,10 +3,14 @@ #include "cmLoadCommandCommand.h" #include + #include #include #include #include +#include + +#include "cm_memory.hxx" #include "cmCPluginAPI.cxx" #include "cmCPluginAPI.h" @@ -39,12 +43,12 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmLoadedCommand* newC = new cmLoadedCommand; + auto newC = cm::make_unique(); // we must copy when we clone memcpy(&newC->info, &this->info, sizeof(info)); - return newC; + return std::unique_ptr(std::move(newC)); } /** @@ -237,9 +241,9 @@ bool cmLoadCommandCommand::InitialPass(std::vector const& args, // function blocker if (initFunction) { // create a function blocker and set it up - cmLoadedCommand* f = new cmLoadedCommand(); + auto f = cm::make_unique(); (*initFunction)(&f->info); - this->Makefile->GetState()->AddScriptedCommand(args[0], f); + this->Makefile->GetState()->AddScriptedCommand(args[0], std::move(f)); return true; } this->SetError("Attempt to load command failed. " diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h index 021e6c7..d81cefb 100644 --- a/Source/cmLoadCommandCommand.h +++ b/Source/cmLoadCommandCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmLoadCommandCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmLoadCommandCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; }; diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index e9c6aea..3d553b7 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -6,6 +6,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmExecutionStatus.h" #include "cmMakefile.h" @@ -21,15 +23,15 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override + std::unique_ptr Clone() override { - cmMacroHelperCommand* newC = new cmMacroHelperCommand; + auto newC = cm::make_unique(); // we must copy when we clone newC->Args = this->Args; newC->Functions = this->Functions; newC->FilePath = this->FilePath; newC->Policies = this->Policies; - return newC; + return std::unique_ptr(std::move(newC)); } /** @@ -164,12 +166,12 @@ bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, if (!this->Depth) { mf.AppendProperty("MACROS", this->Args[0].c_str()); // create a new command and add it to cmake - cmMacroHelperCommand* f = new cmMacroHelperCommand(); + auto f = cm::make_unique(); f->Args = this->Args; f->Functions = this->Functions; f->FilePath = this->GetStartingContext().FilePath; mf.RecordPolicies(f->Policies); - mf.GetState()->AddScriptedCommand(this->Args[0], f); + mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f)); // remove the function blocker now that the macro is defined mf.RemoveFunctionBlocker(this, lff); return true; diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h index b54ed66..3ebd959 100644 --- a/Source/cmMacroCommand.h +++ b/Source/cmMacroCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -34,7 +36,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmMacroCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index d2637f3..b1fb49b 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -27,7 +29,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmMakeDirectoryCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 5f22a07..501ea69 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -118,7 +118,6 @@ cmMakefile::~cmMakefile() cmDeleteAll(this->SourceFiles); cmDeleteAll(this->Tests); cmDeleteAll(this->ImportedTargetsOwned); - cmDeleteAll(this->FinalPassCommands); cmDeleteAll(this->FunctionBlockers); cmDeleteAll(this->EvaluationFiles); } @@ -418,7 +417,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, } } else if (pcmd->HasFinalPass()) { // use the command - this->FinalPassCommands.push_back(pcmd.release()); + this->FinalPassCommands.push_back(std::move(pcmd)); } } } else { @@ -776,8 +775,8 @@ void cmMakefile::FinalPass() // give all the commands a chance to do something // after the file has been parsed before generation - for (cmCommand* fpCommand : this->FinalPassCommands) { - fpCommand->FinalPass(); + for (auto& command : this->FinalPassCommands) { + command->FinalPass(); } // go through all configured files and see which ones still exist. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d0b70d9..1b4ead7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -937,7 +937,7 @@ protected: size_t ObjectLibrariesSourceGroupIndex; #endif - std::vector FinalPassCommands; + std::vector> FinalPassCommands; cmGlobalGenerator* GlobalGenerator; bool IsFunctionBlocked(const cmListFileFunction& lff, cmExecutionStatus& status); diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h index 5dd198f..e367c46 100644 --- a/Source/cmMarkAsAdvancedCommand.h +++ b/Source/cmMarkAsAdvancedCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmMarkAsAdvancedCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h index 0c6c76b..23633d3 100644 --- a/Source/cmMathCommand.h +++ b/Source/cmMathCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -19,7 +21,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmMathCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index 819ebda..ef89d59 100644 --- a/Source/cmMessageCommand.h +++ b/Source/cmMessageCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -22,7 +24,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmMessageCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h index 34e0e6f..eddab03 100644 --- a/Source/cmOptionCommand.h +++ b/Source/cmOptionCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmOptionCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index 09e622b..faffabd 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/Source/cmOutputRequiredFilesCommand.h @@ -10,6 +10,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmDependInformation; @@ -18,7 +20,10 @@ class cmExecutionStatus; class cmOutputRequiredFilesCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmOutputRequiredFilesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; diff --git a/Source/cmParseArgumentsCommand.h b/Source/cmParseArgumentsCommand.h index b8ba61d..692ea64 100644 --- a/Source/cmParseArgumentsCommand.h +++ b/Source/cmParseArgumentsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -21,7 +23,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmParseArgumentsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index f1d03e7..8b9bcc8 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -26,7 +28,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmProjectCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h index c1dcd54..88a2210 100644 --- a/Source/cmQTWrapCPPCommand.h +++ b/Source/cmQTWrapCPPCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmQTWrapCPPCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h index 15cab40..6a346d4 100644 --- a/Source/cmQTWrapUICommand.h +++ b/Source/cmQTWrapUICommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmQTWrapUICommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index 7b11849..088d8ad 100644 --- a/Source/cmRemoveCommand.h +++ b/Source/cmRemoveCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmRemoveCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h index a5cb204..85d01d4 100644 --- a/Source/cmRemoveDefinitionsCommand.h +++ b/Source/cmRemoveDefinitionsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmRemoveDefinitionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h index ef39614..e9264d2 100644 --- a/Source/cmReturnCommand.h +++ b/Source/cmReturnCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmReturnCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h index 988ad23..76e2002 100644 --- a/Source/cmSeparateArgumentsCommand.h +++ b/Source/cmSeparateArgumentsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmSeparateArgumentsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index 76e3eae..1c5a435 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmSetCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h index 473347c..5416127 100644 --- a/Source/cmSetDirectoryPropertiesCommand.h +++ b/Source/cmSetDirectoryPropertiesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -16,7 +18,10 @@ class cmMakefile; class cmSetDirectoryPropertiesCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmSetDirectoryPropertiesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index f1126bb..4051e48 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -9,6 +9,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -22,7 +24,10 @@ class cmSetPropertyCommand : public cmCommand public: cmSetPropertyCommand(); - cmCommand* Clone() override { return new cmSetPropertyCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h index afb19f6..6fd6c41 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.h +++ b/Source/cmSetSourceFilesPropertiesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -16,7 +18,10 @@ class cmMakefile; class cmSetSourceFilesPropertiesCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmSetSourceFilesPropertiesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index c9755da..7e4606e 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -16,7 +18,10 @@ class cmMakefile; class cmSetTargetPropertiesCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmSetTargetPropertiesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h index 84b2645..d73e95a 100644 --- a/Source/cmSetTestsPropertiesCommand.h +++ b/Source/cmSetTestsPropertiesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -16,7 +18,10 @@ class cmMakefile; class cmSetTestsPropertiesCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmSetTestsPropertiesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h index 2d8dc17..0190abb 100644 --- a/Source/cmSiteNameCommand.h +++ b/Source/cmSiteNameCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmSiteNameCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index ec5ad32..eec4ec0 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -9,6 +9,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmSourceGroupCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 878d5b6..9748cf5 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "cm_memory.hxx" @@ -29,11 +30,7 @@ cmState::cmState() this->GlobVerificationManager = cm::make_unique(); } -cmState::~cmState() -{ - cmDeleteAll(this->BuiltinCommands); - cmDeleteAll(this->ScriptedCommands); -} +cmState::~cmState() = default; const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType) { @@ -421,50 +418,55 @@ void cmState::SetIsGeneratorMultiConfig(bool b) this->IsGeneratorMultiConfig = b; } -void cmState::AddBuiltinCommand(std::string const& name, cmCommand* command) +void cmState::AddBuiltinCommand(std::string const& name, + std::unique_ptr command) { assert(name == cmSystemTools::LowerCase(name)); assert(this->BuiltinCommands.find(name) == this->BuiltinCommands.end()); - this->BuiltinCommands.insert(std::make_pair(name, command)); + this->BuiltinCommands.insert( + std::map>::value_type( + name, std::move(command))); } -void cmState::AddDisallowedCommand(std::string const& name, cmCommand* command, +void cmState::AddDisallowedCommand(std::string const& name, + std::unique_ptr command, cmPolicies::PolicyID policy, const char* message) { - this->AddBuiltinCommand(name, - new cmDisallowedCommand(command, policy, message)); + this->AddBuiltinCommand( + name, + cm::make_unique(std::move(command), policy, message)); } void cmState::AddUnexpectedCommand(std::string const& name, const char* error) { - this->AddBuiltinCommand(name, new cmUnexpectedCommand(name, error)); + this->AddBuiltinCommand(name, + cm::make_unique(name, error)); } -void cmState::AddScriptedCommand(std::string const& name, cmCommand* command) +void cmState::AddScriptedCommand(std::string const& name, + std::unique_ptr command) { std::string sName = cmSystemTools::LowerCase(name); // if the command already exists, give a new name to the old command. if (cmCommand* oldCmd = this->GetCommand(sName)) { std::string const newName = "_" + sName; - std::map::iterator pos = - this->ScriptedCommands.find(newName); + auto pos = this->ScriptedCommands.find(newName); if (pos != this->ScriptedCommands.end()) { - delete pos->second; this->ScriptedCommands.erase(pos); } this->ScriptedCommands.insert(std::make_pair(newName, oldCmd->Clone())); } // if the command already exists, free the old one - std::map::iterator pos = - this->ScriptedCommands.find(sName); + auto pos = this->ScriptedCommands.find(sName); if (pos != this->ScriptedCommands.end()) { - delete pos->second; this->ScriptedCommands.erase(pos); } - this->ScriptedCommands.insert(std::make_pair(sName, command)); + this->ScriptedCommands.insert( + std::map>::value_type( + sName, std::move(command))); } cmCommand* cmState::GetCommand(std::string const& name) const @@ -474,14 +476,13 @@ cmCommand* cmState::GetCommand(std::string const& name) const cmCommand* cmState::GetCommandByExactName(std::string const& name) const { - std::map::const_iterator pos; - pos = this->ScriptedCommands.find(name); + auto pos = this->ScriptedCommands.find(name); if (pos != this->ScriptedCommands.end()) { - return pos->second; + return pos->second.get(); } pos = this->BuiltinCommands.find(name); if (pos != this->BuiltinCommands.end()) { - return pos->second; + return pos->second.get(); } return nullptr; } @@ -506,16 +507,13 @@ std::vector cmState::GetCommandNames() const void cmState::RemoveBuiltinCommand(std::string const& name) { assert(name == cmSystemTools::LowerCase(name)); - std::map::iterator i = - this->BuiltinCommands.find(name); + auto i = this->BuiltinCommands.find(name); assert(i != this->BuiltinCommands.end()); - delete i->second; this->BuiltinCommands.erase(i); } void cmState::RemoveUserDefinedCommands() { - cmDeleteAll(this->ScriptedCommands); this->ScriptedCommands.clear(); } diff --git a/Source/cmState.h b/Source/cmState.h index 0649ace..7e88030 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -146,11 +146,14 @@ public: // Returns a command from its name, or nullptr cmCommand* GetCommandByExactName(std::string const& name) const; - void AddBuiltinCommand(std::string const& name, cmCommand* command); - void AddDisallowedCommand(std::string const& name, cmCommand* command, + void AddBuiltinCommand(std::string const& name, + std::unique_ptr command); + void AddDisallowedCommand(std::string const& name, + std::unique_ptr command, cmPolicies::PolicyID policy, const char* message); void AddUnexpectedCommand(std::string const& name, const char* error); - void AddScriptedCommand(std::string const& name, cmCommand* command); + void AddScriptedCommand(std::string const& name, + std::unique_ptr command); void RemoveBuiltinCommand(std::string const& name); void RemoveUserDefinedCommands(); std::vector GetCommandNames() const; @@ -209,8 +212,8 @@ private: std::map PropertyDefinitions; std::vector EnabledLanguages; - std::map BuiltinCommands; - std::map ScriptedCommands; + std::map> BuiltinCommands; + std::map> ScriptedCommands; cmPropertyMap GlobalProperties; std::unique_ptr CacheManager; std::unique_ptr GlobVerificationManager; diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 10ccac0..4ad0870 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index acde605..f48ea17 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -9,6 +9,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmStringCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index adab757..3499c46 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -25,7 +27,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmSubdirCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index 2db28c6..64c28b9 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/Source/cmSubdirDependsCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmSubdirDependsCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmSubdirDependsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; }; diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h index d41483a..25af21d 100644 --- a/Source/cmTargetCompileDefinitionsCommand.h +++ b/Source/cmTargetCompileDefinitionsCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmTargetPropCommandBase.h" -class cmCommand; class cmExecutionStatus; class cmTarget; @@ -20,7 +22,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTargetCompileDefinitionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTargetCompileFeaturesCommand.h b/Source/cmTargetCompileFeaturesCommand.h index 45240a5..07948fa 100644 --- a/Source/cmTargetCompileFeaturesCommand.h +++ b/Source/cmTargetCompileFeaturesCommand.h @@ -8,15 +8,20 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmTargetPropCommandBase.h" -class cmCommand; class cmExecutionStatus; class cmTarget; class cmTargetCompileFeaturesCommand : public cmTargetPropCommandBase { - cmCommand* Clone() override { return new cmTargetCompileFeaturesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h index 6fb151a..a571cfb 100644 --- a/Source/cmTargetCompileOptionsCommand.h +++ b/Source/cmTargetCompileOptionsCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmTargetPropCommandBase.h" -class cmCommand; class cmExecutionStatus; class cmTarget; @@ -20,7 +22,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTargetCompileOptionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h index 57bf8fc..6defab2 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.h +++ b/Source/cmTargetIncludeDirectoriesCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmTargetPropCommandBase.h" -class cmCommand; class cmExecutionStatus; class cmTarget; @@ -20,7 +22,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTargetIncludeDirectoriesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTargetLinkDirectoriesCommand.h b/Source/cmTargetLinkDirectoriesCommand.h index 52c75a0..a2fcfa9 100644 --- a/Source/cmTargetLinkDirectoriesCommand.h +++ b/Source/cmTargetLinkDirectoriesCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmTargetPropCommandBase.h" -class cmCommand; class cmExecutionStatus; class cmTarget; @@ -20,7 +22,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTargetLinkDirectoriesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index 54f8cf4..6698ce0 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmTargetLinkLibraryType.h" @@ -30,7 +32,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTargetLinkLibrariesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTargetLinkOptionsCommand.h b/Source/cmTargetLinkOptionsCommand.h index a1fc9fc..3710739 100644 --- a/Source/cmTargetLinkOptionsCommand.h +++ b/Source/cmTargetLinkOptionsCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmTargetPropCommandBase.h" -class cmCommand; class cmExecutionStatus; class cmTarget; @@ -20,7 +22,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTargetLinkOptionsCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTargetSourcesCommand.h b/Source/cmTargetSourcesCommand.h index b01e3ca..90fd45f 100644 --- a/Source/cmTargetSourcesCommand.h +++ b/Source/cmTargetSourcesCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmTargetPropCommandBase.h" -class cmCommand; class cmExecutionStatus; class cmTarget; @@ -20,7 +22,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTargetSourcesCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h index 8237878..ec9f8b8 100644 --- a/Source/cmTryCompileCommand.h +++ b/Source/cmTryCompileCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmCoreTryCompile.h" -class cmCommand; class cmExecutionStatus; /** \class cmTryCompileCommand @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTryCompileCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h index c54622c..bacfcdb 100644 --- a/Source/cmTryRunCommand.h +++ b/Source/cmTryRunCommand.h @@ -8,9 +8,11 @@ #include #include +#include "cm_memory.hxx" + +#include "cmCommand.h" #include "cmCoreTryCompile.h" -class cmCommand; class cmExecutionStatus; /** \class cmTryRunCommand @@ -24,7 +26,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmTryRunCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx index fbd5634..56d6c09 100644 --- a/Source/cmUVProcessChain.cxx +++ b/Source/cmUVProcessChain.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmUVProcessChain.h" -#include "cmAlgorithms.h" #include "cmGetPipes.h" #include "cmUVHandlePtr.h" #include "cmUVStreambuf.h" @@ -10,6 +9,7 @@ #include +#include // IWYU pragma: keep #include #include diff --git a/Source/cmUnexpectedCommand.h b/Source/cmUnexpectedCommand.h index 33d6bdc..6e4cee5 100644 --- a/Source/cmUnexpectedCommand.h +++ b/Source/cmUnexpectedCommand.h @@ -9,6 +9,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -22,9 +24,9 @@ public: { } - cmCommand* Clone() override + std::unique_ptr Clone() override { - return new cmUnexpectedCommand(this->Name, this->Error); + return cm::make_unique(this->Name, this->Error); } bool InitialPass(std::vector const& args, diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h index 4e1208a..9b78d44 100644 --- a/Source/cmUnsetCommand.h +++ b/Source/cmUnsetCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmUnsetCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h index e2f1d9b..1c01596 100644 --- a/Source/cmUseMangledMesaCommand.h +++ b/Source/cmUseMangledMesaCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmUseMangledMesaCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmUseMangledMesaCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index 165ecef..cef7fed 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmUtilitySourceCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmUtilitySourceCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; }; diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h index 94970c5..38e7490 100644 --- a/Source/cmVariableRequiresCommand.h +++ b/Source/cmVariableRequiresCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -15,7 +17,10 @@ class cmExecutionStatus; class cmVariableRequiresCommand : public cmCommand { public: - cmCommand* Clone() override { return new cmVariableRequiresCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; }; diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h index 6a8115d..0dbb0cb 100644 --- a/Source/cmVariableWatchCommand.h +++ b/Source/cmVariableWatchCommand.h @@ -9,6 +9,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -23,7 +25,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmVariableWatchCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } //! Default constructor cmVariableWatchCommand(); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 0d3bdf8..31a878d 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -9,8 +9,6 @@ #include "cmMessageType.h" #include "cmSystemTools.h" -#include - cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) , Depth(0) diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h index 6f6d405..857d1c8 100644 --- a/Source/cmWhileCommand.h +++ b/Source/cmWhileCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" @@ -39,7 +41,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmWhileCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This overrides the default InvokeInitialPass implementation. diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h index 9028f84..3961898 100644 --- a/Source/cmWriteFileCommand.h +++ b/Source/cmWriteFileCommand.h @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmCommand.h" class cmExecutionStatus; @@ -22,7 +24,10 @@ public: /** * This is a virtual constructor for the command. */ - cmCommand* Clone() override { return new cmWriteFileCommand; } + std::unique_ptr Clone() override + { + return cm::make_unique(); + } /** * This is called when the command is first encountered in diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index 2c1202e..63c9943 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9b2c7dae242868f13fc366773fb09448da26e8d commit d9b2c7dae242868f13fc366773fb09448da26e8d Author: Marc Chevrier AuthorDate: Tue Jul 2 11:08:04 2019 +0200 Commit: Marc Chevrier CommitDate: Sun Jul 14 15:37:30 2019 +0200 Introduce memory management helper: cm_memory.hxx diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index 9dc9853..b4c7a5a 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackExternalGenerator.h" -#include "cmAlgorithms.h" #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" #include "cmMakefile.h" @@ -17,6 +16,8 @@ #include #include +#include "cm_memory.hxx" + int cmCPackExternalGenerator::InitializeInternal() { this->SetOption("CPACK_EXTERNAL_KNOWN_VERSIONS", "1.0"); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index b865cab..f9ac1eb 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -11,7 +11,6 @@ #include "cmsys/RegularExpression.hxx" #include -#include #include #include #include @@ -20,6 +19,8 @@ #include #include +#include "cm_memory.hxx" + cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler) : MultiTestHandler(multiHandler) { diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index fb97e9b..d80b5a5 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestUpdateHandler.h" -#include "cmAlgorithms.h" #include "cmCLocaleEnvironmentScope.h" #include "cmCTest.h" #include "cmCTestBZR.h" @@ -18,9 +17,10 @@ #include "cmXMLWriter.h" #include -#include #include +#include "cm_memory.hxx" + static const char* cmCTestUpdateHandlerUpdateStrings[] = { "Unknown", "CVS", "SVN", "BZR", "GIT", "HG", "P4" }; diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index d1e32b0..d153076 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -340,20 +339,6 @@ inline void cmStripSuffixIfExists(std::string& str, const std::string& suffix) namespace cm { -#if defined(CMake_HAVE_CXX_MAKE_UNIQUE) - -using std::make_unique; - -#else - -template -std::unique_ptr make_unique(Args&&... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} - -#endif - #if __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L using std::size; diff --git a/Source/cmBinUtilsLinuxELFLinker.cxx b/Source/cmBinUtilsLinuxELFLinker.cxx index 4fb15f2..86846cb 100644 --- a/Source/cmBinUtilsLinuxELFLinker.cxx +++ b/Source/cmBinUtilsLinuxELFLinker.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmBinUtilsLinuxELFLinker.h" -#include "cmAlgorithms.h" + #include "cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h" #include "cmLDConfigLDConfigTool.h" #include "cmMakefile.h" @@ -12,9 +12,10 @@ #include -#include #include +#include "cm_memory.hxx" + static std::string ReplaceOrigin(const std::string& rpath, const std::string& origin) { diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx index e219847..ac93155 100644 --- a/Source/cmBinUtilsMacOSMachOLinker.cxx +++ b/Source/cmBinUtilsMacOSMachOLinker.cxx @@ -12,6 +12,8 @@ #include #include +#include "cm_memory.hxx" + cmBinUtilsMacOSMachOLinker::cmBinUtilsMacOSMachOLinker( cmRuntimeDependencyArchive* archive) : cmBinUtilsLinker(archive) diff --git a/Source/cmBinUtilsWindowsPELinker.cxx b/Source/cmBinUtilsWindowsPELinker.cxx index 796e9ed..31602c4 100644 --- a/Source/cmBinUtilsWindowsPELinker.cxx +++ b/Source/cmBinUtilsWindowsPELinker.cxx @@ -2,16 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmBinUtilsWindowsPELinker.h" -#include "cmAlgorithms.h" + #include "cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.h" #include "cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.h" #include "cmRuntimeDependencyArchive.h" #include "cmSystemTools.h" -#include #include #include +#include "cm_memory.hxx" + #ifdef _WIN32 # include #endif diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index afdc039..83e3eff 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -30,6 +29,8 @@ # include // IWYU pragma: keep #endif +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCTestBuildAndTestHandler.h" #include "cmCTestBuildHandler.h" diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index a7618c7..54fc54c 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -23,6 +23,8 @@ #include #include +#include "cm_memory.hxx" + /* This file computes an ordered list of link items to use when linking a diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 4310eed..5e919af 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -2,13 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCryptoHash.h" -#include "cmAlgorithms.h" #include "cm_kwiml.h" #include "cm_rhash.h" #include "cmsys/FStream.hxx" + #include -#include +#include "cm_memory.hxx" static unsigned int const cmCryptoHashAlgoToId[] = { /* clang-format needs this comment to break after the opening brace */ diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index e1c098d..29afc9f 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -20,11 +20,12 @@ #include "cmsys/FStream.hxx" #include -#include #include #include #include +#include "cm_memory.hxx" + static std::string cmExportFileGeneratorEscape(std::string const& str) { // Escape a property value for writing into a .cmake file. diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index 2e86533..87ef2a9 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -4,10 +4,10 @@ #include "cmsys/FStream.hxx" #include -#include #include -#include "cmAlgorithms.h" +#include "cm_memory.hxx" + #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index dfba910..9871f49 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -21,6 +20,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmArgumentParser.h" #include "cmCryptoHash.h" diff --git a/Source/cmFileTimes.cxx b/Source/cmFileTimes.cxx index fd4f679..3824e9b 100644 --- a/Source/cmFileTimes.cxx +++ b/Source/cmFileTimes.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileTimes.h" -#include "cmAlgorithms.h" #include "cm_sys_stat.h" #include +#include "cm_memory.hxx" + #if defined(_WIN32) # include "cmSystemTools.h" # include diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 783b5f6..85546bf 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -13,12 +13,13 @@ #include #include #include -#include #include #include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmMessageType.h" diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 7f189d6..94c1b1a 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -2,12 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmForEachCommand.h" -#include #include #include #include -#include "cmAlgorithms.h" +#include "cm_memory.hxx" + #include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmMessageType.h" diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 98e8339..69a7da9 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -9,10 +9,11 @@ #include #include #include -#include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmFortranParser.h" diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 93f5482..35af0e1 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -4,10 +4,11 @@ #include #include -#include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 78e8f30..d99a906 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -5,11 +5,12 @@ #include "cmsys/RegularExpression.hxx" #include #include -#include #include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index e9a4a6f..a2e665f 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -16,6 +15,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" #include "cmMakefile.h" diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 1b4f428..1ec1fd9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -5,11 +5,12 @@ #include "cmsys/FStream.hxx" #include "cmsys/Terminal.h" #include -#include #include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCustomCommand.h" // IWYU pragma: keep #include "cmCustomCommandGenerator.h" diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx index ac6dce9..bec3ad8 100644 --- a/Source/cmMachO.cxx +++ b/Source/cmMachO.cxx @@ -4,10 +4,13 @@ #include "cmAlgorithms.h" #include "cmsys/FStream.hxx" + #include #include #include +#include "cm_memory.hxx" + // Include the Mach-O format information system header. #include #include diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 2001c1f..dcee47e 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -2,13 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileExecutableTargetGenerator.h" -#include #include #include #include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index e5aed01..bdde4b8 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,13 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" -#include #include #include #include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 70d9fca..8ed6be5 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -2,13 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileUtilityTargetGenerator.h" -#include #include #include #include #include -#include "cmAlgorithms.h" +#include "cm_memory.hxx" + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index d1af9e6..88040f8 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -6,11 +6,12 @@ #include #include #include -#include #include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCustomCommand.h" // IWYU pragma: keep #include "cmCustomCommandGenerator.h" diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 57e500e..de79817 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -8,10 +8,11 @@ #include #include #include -#include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx index ef8a56b..f172b77 100644 --- a/Source/cmQtAutoGenGlobalInitializer.cxx +++ b/Source/cmQtAutoGenGlobalInitializer.cxx @@ -4,7 +4,6 @@ #include "cmQtAutoGen.h" #include "cmQtAutoGenInitializer.h" -#include "cmAlgorithms.h" #include "cmCustomCommandLines.h" #include "cmDuration.h" #include "cmGeneratorTarget.h" @@ -17,9 +16,10 @@ #include "cmSystemTools.h" #include "cmTarget.h" -#include #include +#include "cm_memory.hxx" + cmQtAutoGenGlobalInitializer::Keywords::Keywords() : AUTOMOC("AUTOMOC") , AUTOUIC("AUTOUIC") diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 83a1bc4..4b12419 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -38,6 +38,8 @@ #include #include +#include "cm_memory.hxx" + static std::size_t GetParallelCPUCount() { static std::size_t count = 0; diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index 3a3162d..2516d84 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -5,7 +5,8 @@ #include "cmsys/FStream.hxx" -#include "cmAlgorithms.h" +#include "cm_memory.hxx" + #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" @@ -14,8 +15,6 @@ #include "cmSystemTools.h" #include "cmake.h" -#include - cmQtAutoGenerator::Logger::Logger() { // Initialize logger diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx index 889f47d..44d2db0 100644 --- a/Source/cmQtAutoMocUic.cxx +++ b/Source/cmQtAutoMocUic.cxx @@ -5,11 +5,12 @@ #include #include #include -#include #include #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCryptoHash.h" #include "cmGeneratedFileStream.h" diff --git a/Source/cmRuntimeDependencyArchive.cxx b/Source/cmRuntimeDependencyArchive.cxx index a1d1f95..45aff69 100644 --- a/Source/cmRuntimeDependencyArchive.cxx +++ b/Source/cmRuntimeDependencyArchive.cxx @@ -3,7 +3,6 @@ #include "cmRuntimeDependencyArchive.h" -#include "cmAlgorithms.h" #include "cmBinUtilsLinuxELFLinker.h" #include "cmBinUtilsMacOSMachOLinker.h" #include "cmBinUtilsWindowsPELinker.h" @@ -27,6 +26,8 @@ #include #include +#include "cm_memory.hxx" + #if defined(_WIN32) static void AddVisualStudioPath(std::vector& paths, const std::string& prefix, diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index 1903fd9..9df1883 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmServer.h" -#include "cmAlgorithms.h" #include "cmConnection.h" #include "cmFileMonitor.h" #include "cmJsonObjectDictionary.h" @@ -18,10 +17,11 @@ #include #include #include -#include #include #include +#include "cm_memory.hxx" + void on_signal(uv_signal_t* signal, int signum) { auto conn = static_cast(signal->data); diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 558391f..c5de742 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmServerProtocol.h" -#include "cmAlgorithms.h" #include "cmExternalMakefileProjectGenerator.h" #include "cmFileMonitor.h" #include "cmGlobalGenerator.h" @@ -19,11 +18,12 @@ #include #include #include -#include #include #include #include +#include "cm_memory.hxx" + // Get rid of some windows macros: #undef max diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 587cda5..878d5b6 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -8,6 +8,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCacheManager.h" #include "cmCommand.h" diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b10b30f..28d8c64 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -12,6 +12,8 @@ #include #include +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmGeneratorExpression.h" diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx index 90ece0b..fbd5634 100644 --- a/Source/cmUVProcessChain.cxx +++ b/Source/cmUVProcessChain.cxx @@ -11,9 +11,10 @@ #include #include -#include #include +#include "cm_memory.hxx" + struct cmUVProcessChain::InternalData { struct BasicStreamData diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index e2a4816..ae347fe 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -19,9 +19,10 @@ #include "windows.h" #include -#include #include +#include "cm_memory.hxx" + static void ConvertToWindowsSlash(std::string& s); static std::string cmVS10EscapeXML(std::string arg) diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx index cbf070e..974100b 100644 --- a/Source/cmWorkerPool.cxx +++ b/Source/cmWorkerPool.cxx @@ -16,6 +16,8 @@ #include #include +#include "cm_memory.hxx" + /** * @brief libuv pipe buffer class */ diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h index 5cc308b..d708118 100644 --- a/Source/cmWorkerPool.h +++ b/Source/cmWorkerPool.h @@ -5,14 +5,13 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include "cmAlgorithms.h" // IWYU pragma: keep - -#include #include #include #include #include +#include "cm_memory.hxx" + // -- Types class cmWorkerPoolInternal; diff --git a/Source/cm_memory.hxx b/Source/cm_memory.hxx new file mode 100644 index 0000000..9f5e678 --- /dev/null +++ b/Source/cm_memory.hxx @@ -0,0 +1,31 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cm_memory_hxx +#define cm_memory_hxx + +#include "cmConfigure.h" // IWYU pragma: keep + +#include // IWYU pragma: export +#if !defined(CMake_HAVE_CXX_MAKE_UNIQUE) +# include +#endif + +namespace cm { + +#if defined(CMake_HAVE_CXX_MAKE_UNIQUE) + +using std::make_unique; + +#else + +template +std::unique_ptr make_unique(Args&&... args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +} + +#endif + +} // namespace cm + +#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b8238a2..7250e51 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmake.h" +#include "cm_memory.hxx" + #include "cmAlgorithms.h" #include "cmCommands.h" #include "cmDocumentation.h" @@ -104,7 +106,6 @@ #include #include #include -#include #include #include #include diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index e926350..2c1202e 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -1,6 +1,5 @@ #include "cmUVProcessChain.h" -#include "cmAlgorithms.h" #include "cmGetPipes.h" #include "cmUVHandlePtr.h" #include "cmUVStreambuf.h" @@ -17,6 +16,8 @@ #include +#include "cm_memory.hxx" + struct ExpectedStatus { bool Finished; diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 4e00214..9fff442 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -51,7 +51,9 @@ { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, { symbol: [ "std::allocator_traits > >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits, std::allocator > > >::value_type", private, "", public ] }, { symbol: [ "std::allocator_traits, std::allocator > > > >::value_type", private, "", public ] }, + { symbol: [ "std::allocator_traits, std::allocator >, std::allocator, std::allocator > > > > >::value_type", private, "", public ] }, { symbol: [ "std::allocator_traits >::value_type", private, "", public ] }, # TODO: enable this block and remove some includes? https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ff9ab3b101b131bd4a91a459f66ce27f97f4757 commit 7ff9ab3b101b131bd4a91a459f66ce27f97f4757 Author: Brad King AuthorDate: Fri Jul 12 12:37:28 2019 -0400 Commit: Brad King CommitDate: Fri Jul 12 17:37:02 2019 -0400 Makefile: De-duplicate executable link rule lookup Use `GetCreateRuleVariable` instead of duplicating the variable lookup. diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 2001c1f..2950bfb 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -482,9 +482,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) // Construct the main link rule. std::vector real_link_commands; - std::string linkRuleVar = "CMAKE_"; - linkRuleVar += linkLanguage; - linkRuleVar += "_LINK_EXECUTABLE"; + std::string linkRuleVar = this->GeneratorTarget->GetCreateRuleVariable( + linkLanguage, this->ConfigName); std::string linkRule = this->GetLinkRule(linkRuleVar); std::vector commands1; cmSystemTools::ExpandListArgument(linkRule, real_link_commands); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79f5ef19fe418efe2d9bfc55fcd16dfd75f18d49 commit 79f5ef19fe418efe2d9bfc55fcd16dfd75f18d49 Author: Brad King AuthorDate: Fri Jul 12 13:36:15 2019 -0400 Commit: Brad King CommitDate: Fri Jul 12 17:35:49 2019 -0400 De-duplicate checks for whether a platform uses Windows DLLs diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 54f6e80..c807f6d 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -259,9 +259,6 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) t->GetSourceBacktraces(), this->SourceEntries, true); - this->DLLPlatform = - !this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty(); - this->PolicyMap = t->GetPolicyMap(); } @@ -2357,7 +2354,7 @@ void cmGeneratorTarget::ComputeModuleDefinitionInfo( bool cmGeneratorTarget::IsDLLPlatform() const { - return this->DLLPlatform; + return this->Target->IsDLLPlatform(); } void cmGeneratorTarget::GetAutoUicOptions(std::vector& result, diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 852f8fd..e86535d 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -913,7 +913,6 @@ private: mutable bool DebugSourcesDone; mutable bool LinkImplementationLanguageIsContextDependent; mutable bool UtilityItemsDone; - bool DLLPlatform; bool ComputePDBOutputDir(const std::string& kind, const std::string& config, std::string& out) const; diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index dba4bbb..750ed8c 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -389,10 +389,6 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) return true; } - // Check whether this is a DLL platform. - bool dll_platform = - !this->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty(); - for (std::string const& tgt : targetList) { if (this->Makefile->IsAlias(tgt)) { @@ -472,7 +468,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // Shared libraries are handled differently on DLL and non-DLL // platforms. All windows platforms are DLL platforms including // cygwin. Currently no other platform is a DLL platform. - if (dll_platform) { + if (target.IsDLLPlatform()) { // When in namelink only mode skip all libraries on Windows. if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) { continue; @@ -641,7 +637,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // On DLL platforms an executable may also have an import // library. Install it to the archive destination if it // exists. - if (dll_platform && !archiveArgs.GetDestination().empty() && + if (target.IsDLLPlatform() && !archiveArgs.GetDestination().empty() && target.IsExecutableWithExports()) { // The import library uses the ARCHIVE properties. archiveGenerator = CreateInstallTargetGenerator( diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b10b30f..2237d9b 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -168,7 +168,7 @@ public: cmPropertyMap Properties; bool IsGeneratorProvided; bool HaveInstallRule; - bool DLLPlatform; + bool IsDLLPlatform; bool IsAndroid; bool IsImportedTarget; bool ImportedGloballyVisible; @@ -216,7 +216,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, impl->Name = name; impl->IsGeneratorProvided = false; impl->HaveInstallRule = false; - impl->DLLPlatform = false; + impl->IsDLLPlatform = false; impl->IsAndroid = false; impl->IsImportedTarget = (vis == VisibilityImported || vis == VisibilityImportedGlobally); @@ -224,7 +224,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, impl->BuildInterfaceIncludesAppended = false; // Check whether this is a DLL platform. - impl->DLLPlatform = + impl->IsDLLPlatform = !impl->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty(); // Check whether we are targeting an Android platform. @@ -1657,6 +1657,11 @@ cmPropertyMap const& cmTarget::GetProperties() const return impl->Properties; } +bool cmTarget::IsDLLPlatform() const +{ + return impl->IsDLLPlatform; +} + bool cmTarget::IsImported() const { return impl->IsImportedTarget; @@ -1872,7 +1877,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, // If we needed to find one of the mapped configurations but did not // On a DLL platform there may be only IMPORTED_IMPLIB for a shared // library or an executable with exports. - bool allowImp = (impl->DLLPlatform && + bool allowImp = (this->IsDLLPlatform() && (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->IsExecutableWithExports())); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index f47cc14..d9e87b8 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -177,6 +177,9 @@ public: //! Get all properties cmPropertyMap const& GetProperties() const; + //! Return whether or not the target is for a DLL platform. + bool IsDLLPlatform() const; + bool IsImported() const; bool IsImportedGloballyVisible() const; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=22d3eb5d5e4ce9c6371ab709655928552453fbda commit 22d3eb5d5e4ce9c6371ab709655928552453fbda Author: Brad King AuthorDate: Fri Jul 12 11:22:36 2019 -0400 Commit: Brad King CommitDate: Fri Jul 12 17:29:40 2019 -0400 Refactor checks for whether a target has an import library Use `HasImportLibrary` for such checks. diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index b366ebb..5a03670 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -268,10 +268,6 @@ cmComputeLinkInformation::cmComputeLinkInformation( return; } - // Check whether we should use an import library for linking a target. - this->UseImportLibrary = - this->Makefile->IsDefinitionSet("CMAKE_IMPORT_LIBRARY_SUFFIX"); - // Check whether we should skip dependencies on shared library files. this->LinkDependsNoShared = this->Target->GetPropertyAsBool("LINK_DEPENDS_NO_SHARED"); @@ -280,7 +276,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( // to use when creating a plugin (module) that obtains symbols from // the program that will load it. this->LoaderFlag = nullptr; - if (!this->UseImportLibrary && + if (!this->Target->IsDLLPlatform() && this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) { std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_"; loader_flag_var += this->LinkLanguage; @@ -493,9 +489,7 @@ bool cmComputeLinkInformation::Compute() std::set const& wrongItems = cld.GetOldWrongConfigItems(); for (cmGeneratorTarget const* tgt : wrongItems) { - bool implib = (this->UseImportLibrary && - (tgt->GetType() == cmStateEnums::SHARED_LIBRARY)); - cmStateEnums::ArtifactType artifact = implib + cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(this->Config) ? cmStateEnums::ImportLibraryArtifact : cmStateEnums::RuntimeBinaryArtifact; this->OldLinkDirItems.push_back( @@ -578,7 +572,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // Compute the proper name to use to link this library. const std::string& config = this->Config; bool impexe = (tgt && tgt->IsExecutableWithExports()); - if (impexe && !this->UseImportLibrary && !this->LoaderFlag) { + if (impexe && !tgt->HasImportLibrary(config) && !this->LoaderFlag) { // Skip linking to executables on platforms with no import // libraries or loader flags. return; @@ -592,7 +586,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // platform. Add it now. std::string linkItem; linkItem = this->LoaderFlag; - cmStateEnums::ArtifactType artifact = this->UseImportLibrary + cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(config) ? cmStateEnums::ImportLibraryArtifact : cmStateEnums::RuntimeBinaryArtifact; @@ -616,10 +610,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // Its object-files should already have been extracted for linking. } else { // Decide whether to use an import library. - bool implib = - (this->UseImportLibrary && - (impexe || tgt->GetType() == cmStateEnums::SHARED_LIBRARY)); - cmStateEnums::ArtifactType artifact = implib + cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(config) ? cmStateEnums::ImportLibraryArtifact : cmStateEnums::RuntimeBinaryArtifact; @@ -694,7 +685,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, // linked will be able to find it. std::string lib; if (tgt) { - cmStateEnums::ArtifactType artifact = this->UseImportLibrary + cmStateEnums::ArtifactType artifact = tgt->HasImportLibrary(this->Config) ? cmStateEnums::ImportLibraryArtifact : cmStateEnums::RuntimeBinaryArtifact; lib = tgt->GetFullPath(this->Config, artifact); diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 863639c..3be2c7f 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -179,7 +179,6 @@ private: bool OldLinkDirMode; bool OpenBSD; bool LinkDependsNoShared; - bool UseImportLibrary; bool RuntimeUseChrpath; bool NoSONameUsesPath; bool LinkWithRuntimePath; diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 5800629..de3e0e2 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -236,14 +236,15 @@ void cmExportBuildFileGenerator::SetImportLocationProperty( } // Add the import library for windows DLLs. - if (target->HasImportLibrary(config) && - mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { + if (target->HasImportLibrary(config)) { std::string prop = "IMPORTED_IMPLIB"; prop += suffix; std::string value = target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact); - target->GetImplibGNUtoMS(config, value, value, - "${CMAKE_IMPORT_LIBRARY_SUFFIX}"); + if (mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { + target->GetImplibGNUtoMS(config, value, value, + "${CMAKE_IMPORT_LIBRARY_SUFFIX}"); + } properties[prop] = value; } } diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 73b4123..7b916cd 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -1076,17 +1076,16 @@ Json::Value Target::DumpArtifacts() } // Add Windows-specific artifacts produced by the linker. + if (this->GT->HasImportLibrary(this->Config)) { + Json::Value artifact = Json::objectValue; + artifact["path"] = + RelativeIfUnder(this->TopBuild, + this->GT->GetFullPath( + this->Config, cmStateEnums::ImportLibraryArtifact)); + artifacts.append(std::move(artifact)); // NOLINT(*) + } if (this->GT->IsDLLPlatform() && this->GT->GetType() != cmStateEnums::STATIC_LIBRARY) { - if (this->GT->GetType() == cmStateEnums::SHARED_LIBRARY || - this->GT->IsExecutableWithExports()) { - Json::Value artifact = Json::objectValue; - artifact["path"] = - RelativeIfUnder(this->TopBuild, - this->GT->GetFullPath( - this->Config, cmStateEnums::ImportLibraryArtifact)); - artifacts.append(std::move(artifact)); // NOLINT(*) - } cmGeneratorTarget::OutputInfo const* output = this->GT->GetOutputInfo(this->Config); if (output && !output->PdbDir.empty()) { diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 845937a..54f6e80 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -468,7 +468,7 @@ std::string cmGeneratorTarget::GetFilePrefix( const std::string& config, cmStateEnums::ArtifactType artifact) const { if (this->IsImported()) { - const char* prefix = this->GetFilePrefixInternal(artifact); + const char* prefix = this->GetFilePrefixInternal(config, artifact); return prefix ? prefix : std::string(); } @@ -481,7 +481,7 @@ std::string cmGeneratorTarget::GetFileSuffix( const std::string& config, cmStateEnums::ArtifactType artifact) const { if (this->IsImported()) { - const char* suffix = this->GetFileSuffixInternal(artifact); + const char* suffix = this->GetFileSuffixInternal(config, artifact); return suffix ? suffix : std::string(); } @@ -508,7 +508,8 @@ std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const } const char* cmGeneratorTarget::GetFilePrefixInternal( - cmStateEnums::ArtifactType artifact, const std::string& language) const + std::string const& config, cmStateEnums::ArtifactType artifact, + const std::string& language) const { // no prefix for non-main target types. if (this->GetType() != cmStateEnums::STATIC_LIBRARY && @@ -523,8 +524,7 @@ const char* cmGeneratorTarget::GetFilePrefixInternal( // Return an empty prefix for the import library if this platform // does not support import libraries. - if (isImportedLibraryArtifact && - !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { + if (isImportedLibraryArtifact && !this->NeedImportLibraryName(config)) { return nullptr; } @@ -558,7 +558,8 @@ const char* cmGeneratorTarget::GetFilePrefixInternal( return targetPrefix; } const char* cmGeneratorTarget::GetFileSuffixInternal( - cmStateEnums::ArtifactType artifact, const std::string& language) const + std::string const& config, cmStateEnums::ArtifactType artifact, + const std::string& language) const { // no suffix for non-main target types. if (this->GetType() != cmStateEnums::STATIC_LIBRARY && @@ -573,8 +574,7 @@ const char* cmGeneratorTarget::GetFileSuffixInternal( // Return an empty suffix for the import library if this platform // does not support import libraries. - if (isImportedLibraryArtifact && - !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { + if (isImportedLibraryArtifact && !this->NeedImportLibraryName(config)) { return nullptr; } @@ -3924,8 +3924,7 @@ void cmGeneratorTarget::GetFullNameInternal( // Return an empty name for the import library if this platform // does not support import libraries. - if (isImportedLibraryArtifact && - !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { + if (isImportedLibraryArtifact && !this->NeedImportLibraryName(config)) { outPrefix.clear(); outBase.clear(); outSuffix.clear(); @@ -3934,8 +3933,8 @@ void cmGeneratorTarget::GetFullNameInternal( // retrieve prefix and suffix std::string ll = this->GetLinkerLanguage(config); - const char* targetPrefix = this->GetFilePrefixInternal(artifact, ll); - const char* targetSuffix = this->GetFileSuffixInternal(artifact, ll); + const char* targetPrefix = this->GetFilePrefixInternal(config, artifact, ll); + const char* targetSuffix = this->GetFileSuffixInternal(config, artifact, ll); // The implib option is only allowed for shared libraries, module // libraries, and executables. @@ -6363,6 +6362,16 @@ bool cmGeneratorTarget::HasImportLibrary(std::string const& config) const this->GetManagedType(config) != ManagedType::Managed); } +bool cmGeneratorTarget::NeedImportLibraryName(std::string const& config) const +{ + return this->HasImportLibrary(config) || + // On DLL platforms we always generate the import library name + // just in case the sources have export markup. + (this->IsDLLPlatform() && + (this->GetType() == cmStateEnums::EXECUTABLE || + this->GetType() == cmStateEnums::MODULE_LIBRARY)); +} + std::string cmGeneratorTarget::GetSupportDirectory() const { std::string dir = this->LocalGenerator->GetCurrentBinaryDirectory(); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 627a055..852f8fd 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -743,9 +743,13 @@ private: mutable std::map DebugCompatiblePropertiesDone; - const char* GetFilePrefixInternal(cmStateEnums::ArtifactType artifact, + bool NeedImportLibraryName(std::string const& config) const; + + const char* GetFilePrefixInternal(std::string const& config, + cmStateEnums::ArtifactType artifact, const std::string& language = "") const; - const char* GetFileSuffixInternal(cmStateEnums::ArtifactType artifact, + const char* GetFileSuffixInternal(std::string const& config, + cmStateEnums::ArtifactType artifact, const std::string& language = "") const; std::string GetFullNameInternal(const std::string& config, diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx index 505188f..2423faf 100644 --- a/Source/cmJsonObjects.cxx +++ b/Source/cmJsonObjects.cxx @@ -516,9 +516,11 @@ static Json::Value DumpTarget(cmGeneratorTarget* target, Json::Value artifacts = Json::arrayValue; artifacts.append( target->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact)); - if (target->IsDLLPlatform()) { + if (target->HasImportLibrary(config)) { artifacts.append( target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact)); + } + if (target->IsDLLPlatform()) { const cmGeneratorTarget::OutputInfo* output = target->GetOutputInfo(config); if (output && !output->PdbDir.empty()) { diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index 469faca..8746b35 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -110,8 +110,7 @@ std::string cmLinkLineComputer::ComputeLinkPath( if (target->GetType() == cmStateEnums::STATIC_LIBRARY || target->GetType() == cmStateEnums::SHARED_LIBRARY) { cmStateEnums::ArtifactType type = cmStateEnums::RuntimeBinaryArtifact; - if (target->GetType() == cmStateEnums::SHARED_LIBRARY && - target->IsDLLPlatform()) { + if (target->HasImportLibrary(cli.GetConfig())) { type = cmStateEnums::ImportLibraryArtifact; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3af48083a24676025590e1e3a8db2cfef0317901 commit 3af48083a24676025590e1e3a8db2cfef0317901 Merge: 366746b f84d204 Author: Brad King AuthorDate: Fri Jul 12 16:21:12 2019 -0400 Commit: Brad King CommitDate: Fri Jul 12 16:21:12 2019 -0400 Merge branch 'FindBISON-CMP0088-SourcePath' into release-3.14 Merge-request: !3549 ----------------------------------------------------------------------- Summary of changes: Help/release/3.14.rst | 8 + Modules/FindBISON.cmake | 12 +- Source/CPack/cmCPackExternalGenerator.cxx | 3 +- Source/CTest/cmCTestBuildCommand.h | 11 +- Source/CTest/cmCTestConfigureCommand.h | 11 +- Source/CTest/cmCTestCoverageCommand.h | 11 +- Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h | 12 +- Source/CTest/cmCTestMemCheckCommand.h | 12 +- Source/CTest/cmCTestReadCustomFilesCommand.h | 11 +- Source/CTest/cmCTestRunScriptCommand.h | 11 +- Source/CTest/cmCTestRunTest.cxx | 3 +- Source/CTest/cmCTestScriptHandler.cxx | 42 ++-- Source/CTest/cmCTestScriptHandler.h | 4 +- Source/CTest/cmCTestSleepCommand.h | 11 +- Source/CTest/cmCTestStartCommand.h | 11 +- Source/CTest/cmCTestSubmitCommand.cxx | 10 +- Source/CTest/cmCTestSubmitCommand.h | 5 +- Source/CTest/cmCTestTestCommand.h | 11 +- Source/CTest/cmCTestTestHandler.cxx | 58 ++--- Source/CTest/cmCTestUpdateCommand.h | 11 +- Source/CTest/cmCTestUpdateHandler.cxx | 4 +- Source/CTest/cmCTestUploadCommand.h | 11 +- Source/cmAddCompileDefinitionsCommand.h | 7 +- Source/cmAddCompileOptionsCommand.h | 7 +- Source/cmAddCustomCommandCommand.h | 7 +- Source/cmAddCustomTargetCommand.h | 7 +- Source/cmAddDefinitionsCommand.h | 7 +- Source/cmAddDependenciesCommand.h | 7 +- Source/cmAddExecutableCommand.h | 7 +- Source/cmAddLibraryCommand.h | 7 +- Source/cmAddLinkOptionsCommand.h | 7 +- Source/cmAddSubDirectoryCommand.h | 7 +- Source/cmAddTestCommand.h | 7 +- Source/cmAlgorithms.h | 15 -- Source/cmAuxSourceDirectoryCommand.h | 7 +- Source/cmBinUtilsLinuxELFLinker.cxx | 5 +- Source/cmBinUtilsMacOSMachOLinker.cxx | 2 + Source/cmBinUtilsWindowsPELinker.cxx | 5 +- Source/cmBreakCommand.h | 7 +- Source/cmBuildCommand.h | 7 +- Source/cmBuildNameCommand.h | 7 +- Source/cmCMakeHostSystemInformationCommand.h | 6 +- Source/cmCMakeMinimumRequired.h | 7 +- Source/cmCMakePolicyCommand.h | 7 +- Source/cmCTest.cxx | 3 +- Source/cmCommand.h | 3 +- Source/cmCommands.cxx | 269 +++++++++++++--------- Source/cmComputeLinkDepends.cxx | 2 + Source/cmComputeLinkInformation.cxx | 21 +- Source/cmComputeLinkInformation.h | 1 - Source/cmConfigureFileCommand.h | 7 +- Source/cmContinueCommand.h | 7 +- Source/cmCreateTestSourceList.h | 7 +- Source/cmCryptoHash.cxx | 4 +- Source/cmDefinePropertyCommand.h | 7 +- Source/cmDisallowedCommand.h | 19 +- Source/cmEnableLanguageCommand.h | 7 +- Source/cmEnableTestingCommand.h | 7 +- Source/cmExecProgramCommand.h | 7 +- Source/cmExecuteProcessCommand.cxx | 1 - Source/cmExecuteProcessCommand.h | 7 +- Source/cmExportBuildFileGenerator.cxx | 9 +- Source/cmExportCommand.h | 7 +- Source/cmExportFileGenerator.cxx | 3 +- Source/cmExportLibraryDependenciesCommand.cxx | 4 +- Source/cmExportLibraryDependenciesCommand.h | 6 +- Source/cmFLTKWrapUICommand.h | 7 +- Source/cmFileAPICodemodel.cxx | 17 +- Source/cmFileCommand.cxx | 3 +- Source/cmFileCommand.h | 7 +- Source/cmFileTimes.cxx | 3 +- Source/cmFindFileCommand.h | 10 +- Source/cmFindLibraryCommand.h | 9 +- Source/cmFindPackageCommand.cxx | 3 +- Source/cmFindPackageCommand.h | 9 +- Source/cmFindPathCommand.h | 9 +- Source/cmFindProgramCommand.h | 9 +- Source/cmForEachCommand.cxx | 4 +- Source/cmForEachCommand.h | 7 +- Source/cmFunctionCommand.cxx | 13 +- Source/cmFunctionCommand.h | 7 +- Source/cmGeneratorTarget.cxx | 38 +-- Source/cmGeneratorTarget.h | 9 +- Source/cmGetCMakePropertyCommand.h | 7 +- Source/cmGetDirectoryPropertyCommand.h | 7 +- Source/cmGetFilenameComponentCommand.h | 7 +- Source/cmGetPropertyCommand.h | 7 +- Source/cmGetSourceFilePropertyCommand.h | 7 +- Source/cmGetTargetPropertyCommand.h | 7 +- Source/cmGetTestPropertyCommand.h | 7 +- Source/cmGlobalNinjaGenerator.cxx | 3 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 3 +- Source/cmGlobalXCodeGenerator.cxx | 3 +- Source/cmIfCommand.cxx | 2 - Source/cmIfCommand.h | 7 +- Source/cmIncludeCommand.h | 7 +- Source/cmIncludeDirectoryCommand.h | 7 +- Source/cmIncludeExternalMSProjectCommand.h | 7 +- Source/cmIncludeGuardCommand.h | 7 +- Source/cmIncludeRegularExpressionCommand.h | 7 +- Source/cmInstallCommand.cxx | 8 +- Source/cmInstallCommand.h | 7 +- Source/cmInstallFilesCommand.h | 7 +- Source/cmInstallProgramsCommand.h | 7 +- Source/cmInstallTargetsCommand.h | 7 +- Source/cmJsonObjects.cxx | 4 +- Source/cmLinkDirectoriesCommand.h | 7 +- Source/cmLinkLibrariesCommand.h | 7 +- Source/cmLinkLineComputer.cxx | 3 +- Source/cmListCommand.cxx | 3 +- Source/cmListCommand.h | 7 +- Source/cmLoadCacheCommand.h | 7 +- Source/cmLoadCommandCommand.cxx | 14 +- Source/cmLoadCommandCommand.h | 7 +- Source/cmLocalUnixMakefileGenerator3.cxx | 3 +- Source/cmMachO.cxx | 3 + Source/cmMacroCommand.cxx | 12 +- Source/cmMacroCommand.h | 7 +- Source/cmMakeDirectoryCommand.h | 7 +- Source/cmMakefile.cxx | 7 +- Source/cmMakefile.h | 2 +- Source/cmMakefileExecutableTargetGenerator.cxx | 8 +- Source/cmMakefileLibraryTargetGenerator.cxx | 3 +- Source/cmMakefileUtilityTargetGenerator.cxx | 4 +- Source/cmMarkAsAdvancedCommand.h | 7 +- Source/cmMathCommand.h | 7 +- Source/cmMessageCommand.h | 7 +- Source/cmNinjaNormalTargetGenerator.cxx | 3 +- Source/cmNinjaTargetGenerator.cxx | 3 +- Source/cmOptionCommand.h | 7 +- Source/cmOutputRequiredFilesCommand.h | 7 +- Source/cmParseArgumentsCommand.h | 7 +- Source/cmProjectCommand.h | 7 +- Source/cmQTWrapCPPCommand.h | 7 +- Source/cmQTWrapUICommand.h | 7 +- Source/cmQtAutoGenGlobalInitializer.cxx | 4 +- Source/cmQtAutoGenInitializer.cxx | 2 + Source/cmQtAutoGenerator.cxx | 5 +- Source/cmQtAutoMocUic.cxx | 3 +- Source/cmRemoveCommand.h | 7 +- Source/cmRemoveDefinitionsCommand.h | 7 +- Source/cmReturnCommand.h | 7 +- Source/cmRuntimeDependencyArchive.cxx | 3 +- Source/cmSeparateArgumentsCommand.h | 7 +- Source/cmServer.cxx | 4 +- Source/cmServerProtocol.cxx | 4 +- Source/cmSetCommand.h | 7 +- Source/cmSetDirectoryPropertiesCommand.h | 7 +- Source/cmSetPropertyCommand.h | 7 +- Source/cmSetSourceFilesPropertiesCommand.h | 7 +- Source/cmSetTargetPropertiesCommand.h | 7 +- Source/cmSetTestsPropertiesCommand.h | 7 +- Source/cmSiteNameCommand.h | 7 +- Source/cmSourceGroupCommand.h | 7 +- Source/cmState.cxx | 54 ++--- Source/cmState.h | 13 +- Source/cmStringCommand.cxx | 1 - Source/cmStringCommand.h | 7 +- Source/cmSubdirCommand.h | 7 +- Source/cmSubdirDependsCommand.h | 7 +- Source/cmTarget.cxx | 15 +- Source/cmTarget.h | 3 + Source/cmTargetCompileDefinitionsCommand.h | 9 +- Source/cmTargetCompileFeaturesCommand.h | 9 +- Source/cmTargetCompileOptionsCommand.h | 9 +- Source/cmTargetIncludeDirectoriesCommand.h | 9 +- Source/cmTargetLinkDirectoriesCommand.h | 9 +- Source/cmTargetLinkLibrariesCommand.h | 7 +- Source/cmTargetLinkOptionsCommand.h | 9 +- Source/cmTargetSourcesCommand.h | 9 +- Source/cmTryCompileCommand.h | 9 +- Source/cmTryRunCommand.h | 9 +- Source/cmUVProcessChain.cxx | 5 +- Source/cmUnexpectedCommand.h | 6 +- Source/cmUnsetCommand.h | 7 +- Source/cmUseMangledMesaCommand.h | 7 +- Source/cmUtilitySourceCommand.h | 7 +- Source/cmVariableRequiresCommand.h | 7 +- Source/cmVariableWatchCommand.h | 7 +- Source/cmVisualStudio10TargetGenerator.cxx | 3 +- Source/cmWhileCommand.cxx | 2 - Source/cmWhileCommand.h | 7 +- Source/cmWorkerPool.cxx | 2 + Source/cmWorkerPool.h | 5 +- Source/cmWriteFileCommand.h | 7 +- Source/cm_memory.hxx | 31 +++ Source/cmake.cxx | 3 +- Tests/CMakeLib/testUVProcessChain.cxx | 4 +- Utilities/IWYU/mapping.imp | 2 + 189 files changed, 1216 insertions(+), 529 deletions(-) create mode 100644 Source/cm_memory.hxx hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 16 00:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 16 Jul 2019 00:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-307-ge653938 Message-ID: <20190716040305.A87C8110094@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e653938b391d331c1df21bcf83ce5a771bf7a81f (commit) from d7e53b427428bc23778d1b094e8893df4573e22e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e653938b391d331c1df21bcf83ce5a771bf7a81f commit e653938b391d331c1df21bcf83ce5a771bf7a81f Author: Kitware Robot AuthorDate: Tue Jul 16 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Tue Jul 16 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3108ebc..7e93537 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 15) -set(CMake_VERSION_PATCH 20190715) +set(CMake_VERSION_PATCH 20190716) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 16 07:33:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 16 Jul 2019 07:33:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-313-g79a21ba Message-ID: <20190716113309.4DA6B113C67@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 79a21ba6804ea501365386ee2616441c9660f3ed (commit) via e0d45ddab55ac73bad80a95bdd80df711c0255d8 (commit) via 95f8b0aec750031ddecccea46012257528feb518 (commit) via cd6bd8391a4198a1ac9dc3146603d095e8a01d0d (commit) via 9e6206c59bc00be53351cd87ad569896686aeb89 (commit) via a9b36ea69f36cbfe198bcd5d34a19955651dfa5a (commit) from e653938b391d331c1df21bcf83ce5a771bf7a81f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79a21ba6804ea501365386ee2616441c9660f3ed commit 79a21ba6804ea501365386ee2616441c9660f3ed Merge: e0d45dd 95f8b0a Author: Brad King AuthorDate: Tue Jul 16 11:23:44 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 16 07:24:14 2019 -0400 Merge topic 'FindPNG-msvc-static' 95f8b0aec7 FindPNG: Add static libpng names for MSVC Acked-by: Kitware Robot Merge-request: !3552 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0d45ddab55ac73bad80a95bdd80df711c0255d8 commit e0d45ddab55ac73bad80a95bdd80df711c0255d8 Merge: e653938 cd6bd83 Author: Brad King AuthorDate: Tue Jul 16 11:23:11 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 16 07:23:20 2019 -0400 Merge topic 'FindMatlab/pre-2018-fixes' cd6bd8391a FindMatlab: code comment and ordering of the finders 9e6206c59b FindMatlab: fixing extension bat file invocation error a9b36ea69f FindMatlab: Fixing compilation issues on Windows Acked-by: Kitware Robot Merge-request: !3554 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95f8b0aec750031ddecccea46012257528feb518 commit 95f8b0aec750031ddecccea46012257528feb518 Author: Steve Robinson AuthorDate: Fri Jul 12 19:17:50 2019 -0700 Commit: Brad King CommitDate: Mon Jul 15 08:08:27 2019 -0400 FindPNG: Add static libpng names for MSVC Add names produced by the png upstream buildsystem for static libraries with MSVC. diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index a7908c5..bd400c7 100644 --- a/Modules/FindPNG.cmake +++ b/Modules/FindPNG.cmake @@ -69,8 +69,8 @@ if(ZLIB_FOUND) unset(_PNG_VERSION_SUFFIX_MIN) endif () foreach(v IN LISTS _PNG_VERSION_SUFFIXES) - list(APPEND PNG_NAMES png${v} libpng${v}) - list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d) + list(APPEND PNG_NAMES png${v} libpng${v} libpng${v}_static) + list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d libpng${v}_staticd) endforeach() unset(_PNG_VERSION_SUFFIXES) # For compatibility with versions prior to this multi-config search, honor https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd6bd8391a4198a1ac9dc3146603d095e8a01d0d commit cd6bd8391a4198a1ac9dc3146603d095e8a01d0d Author: Raffi Enficiaud AuthorDate: Mon Jul 15 01:34:18 2019 +0200 Commit: Raffi Enficiaud CommitDate: Mon Jul 15 01:52:07 2019 +0200 FindMatlab: code comment and ordering of the finders diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 4325623..c8cae2e 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1537,7 +1537,9 @@ if(MATLAB_FIND_DEBUG) message(STATUS "[MATLAB] Current version is ${Matlab_VERSION_STRING} located ${Matlab_ROOT_DIR}") endif() -if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.4") # MATLAB 9.4 (R2018a) and newer have a new C++ API +# MATLAB 9.4 (R2018a) and newer have a new C++ API +# This API pulls additional required libraries. +if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.4") set(Matlab_HAS_CPP_API 1) endif() @@ -1623,6 +1625,10 @@ endfunction() set(_matlab_required_variables) +# Order is as follow: +# - unconditionally required libraries/headers first +# - then library components +# - then program components # the MEX library/header are required find_path( @@ -1648,34 +1654,6 @@ list(APPEND _matlab_required_variables Matlab_MEX_EXTENSION) # the matlab root is required list(APPEND _matlab_required_variables Matlab_ROOT_DIR) -# component Mex Compiler -if("MEX_COMPILER" IN_LIST Matlab_FIND_COMPONENTS) - find_program( - Matlab_MEX_COMPILER - "mex" - PATHS ${Matlab_BINARIES_DIR} - DOC "Matlab MEX compiler" - NO_DEFAULT_PATH - ) - if(Matlab_MEX_COMPILER) - set(Matlab_MEX_COMPILER_FOUND TRUE) - endif() -endif() - -# component Matlab program -if("MAIN_PROGRAM" IN_LIST Matlab_FIND_COMPONENTS) - find_program( - Matlab_MAIN_PROGRAM - matlab - PATHS ${Matlab_ROOT_DIR} ${Matlab_ROOT_DIR}/bin - DOC "Matlab main program" - NO_DEFAULT_PATH - ) - if(Matlab_MAIN_PROGRAM) - set(Matlab_MAIN_PROGRAM_FOUND TRUE) - endif() -endif() - # The MX library is required _Matlab_find_library( ${_matlab_lib_prefix_for_search} @@ -1689,9 +1667,40 @@ if(Matlab_MX_LIBRARY) set(Matlab_MX_LIBRARY_FOUND TRUE) endif() +if(Matlab_HAS_CPP_API) + + # The MatlabEngine library is required for R2018a+ + _Matlab_find_library( + ${_matlab_lib_prefix_for_search} + Matlab_ENGINE_LIBRARY + MatlabEngine + PATHS ${_matlab_lib_dir_for_search} + DOC "MatlabEngine Library" + NO_DEFAULT_PATH + ) + list(APPEND _matlab_required_variables Matlab_ENGINE_LIBRARY) + if(Matlab_ENGINE_LIBRARY) + set(Matlab_ENGINE_LIBRARY_FOUND TRUE) + endif() + + # The MatlabDataArray library is required for R2018a+ + _Matlab_find_library( + ${_matlab_lib_prefix_for_search} + Matlab_DATAARRAY_LIBRARY + MatlabDataArray + PATHS ${_matlab_lib_dir_for_search} + DOC "MatlabDataArray Library" + NO_DEFAULT_PATH + ) + list(APPEND _matlab_required_variables Matlab_DATAARRAY_LIBRARY) + if(Matlab_DATAARRAY_LIBRARY) + set(Matlab_DATAARRAY_LIBRARY_FOUND TRUE) + endif() + +endif() + # Component ENG library -list(FIND Matlab_FIND_COMPONENTS ENG_LIBRARY _matlab_find_eng) -if(_matlab_find_eng GREATER -1) +if("ENG_LIBRARY" IN_LIST Matlab_FIND_COMPONENTS) _Matlab_find_library( ${_matlab_lib_prefix_for_search} Matlab_ENG_LIBRARY @@ -1703,11 +1712,9 @@ if(_matlab_find_eng GREATER -1) set(Matlab_ENG_LIBRARY_FOUND TRUE) endif() endif() -unset(_matlab_find_eng) # Component MAT library -list(FIND Matlab_FIND_COMPONENTS MAT_LIBRARY _matlab_find_mat) -if(_matlab_find_mat GREATER -1) +if("MAT_LIBRARY" IN_LIST Matlab_FIND_COMPONENTS) _Matlab_find_library( ${_matlab_lib_prefix_for_search} Matlab_MAT_LIBRARY @@ -1719,11 +1726,9 @@ if(_matlab_find_mat GREATER -1) set(Matlab_MAT_LIBRARY_FOUND TRUE) endif() endif() -unset(_matlab_find_mat) # Component Simulink -list(FIND Matlab_FIND_COMPONENTS SIMULINK _matlab_find_simulink) -if(_matlab_find_simulink GREATER -1) +if("SIMULINK" IN_LIST Matlab_FIND_COMPONENTS) find_path( Matlab_SIMULINK_INCLUDE_DIR simstruc.h @@ -1735,58 +1740,49 @@ if(_matlab_find_simulink GREATER -1) list(APPEND Matlab_INCLUDE_DIRS "${Matlab_SIMULINK_INCLUDE_DIR}") endif() endif() -unset(_matlab_find_simulink) -# component MCC Compiler -list(FIND Matlab_FIND_COMPONENTS MCC_COMPILER _matlab_find_mcc_compiler) -if(_matlab_find_mcc_compiler GREATER -1) +# component Matlab program +if("MAIN_PROGRAM" IN_LIST Matlab_FIND_COMPONENTS) find_program( - Matlab_MCC_COMPILER - "mcc" - PATHS ${Matlab_BINARIES_DIR} - DOC "Matlab MCC compiler" + Matlab_MAIN_PROGRAM + matlab + PATHS ${Matlab_ROOT_DIR} ${Matlab_ROOT_DIR}/bin + DOC "Matlab main program" NO_DEFAULT_PATH ) - if(Matlab_MCC_COMPILER) - set(Matlab_MCC_COMPILER_FOUND TRUE) + if(Matlab_MAIN_PROGRAM) + set(Matlab_MAIN_PROGRAM_FOUND TRUE) endif() endif() -unset(_matlab_find_mcc_compiler) - -if(Matlab_HAS_CPP_API) - # The MatlabEngine library is required for R2018a+ - _Matlab_find_library( - ${_matlab_lib_prefix_for_search} - Matlab_ENGINE_LIBRARY - MatlabEngine - PATHS ${_matlab_lib_dir_for_search} - DOC "MatlabEngine Library" +# component Mex Compiler +if("MEX_COMPILER" IN_LIST Matlab_FIND_COMPONENTS) + find_program( + Matlab_MEX_COMPILER + "mex" + PATHS ${Matlab_BINARIES_DIR} + DOC "Matlab MEX compiler" NO_DEFAULT_PATH ) - list(APPEND _matlab_required_variables Matlab_ENGINE_LIBRARY) - if(Matlab_ENGINE_LIBRARY) - set(Matlab_ENGINE_LIBRARY_FOUND TRUE) + if(Matlab_MEX_COMPILER) + set(Matlab_MEX_COMPILER_FOUND TRUE) endif() +endif() - # The MatlabDataArray library is required for R2018a+ - _Matlab_find_library( - ${_matlab_lib_prefix_for_search} - Matlab_DATAARRAY_LIBRARY - MatlabDataArray - PATHS ${_matlab_lib_dir_for_search} - DOC "MatlabDataArray Library" +# component MCC Compiler +if("MCC_COMPILER" IN_LIST Matlab_FIND_COMPONENTS) + find_program( + Matlab_MCC_COMPILER + "mcc" + PATHS ${Matlab_BINARIES_DIR} + DOC "Matlab MCC compiler" NO_DEFAULT_PATH ) - list(APPEND _matlab_required_variables Matlab_DATAARRAY_LIBRARY) - if(Matlab_DATAARRAY_LIBRARY) - set(Matlab_DATAARRAY_LIBRARY_FOUND TRUE) + if(Matlab_MCC_COMPILER) + set(Matlab_MCC_COMPILER_FOUND TRUE) endif() - endif() -unset(_matlab_lib_dir_for_search) - set(Matlab_LIBRARIES ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} ${Matlab_ENG_LIBRARY} ${Matlab_MAT_LIBRARY} https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e6206c59bc00be53351cd87ad569896686aeb89 commit 9e6206c59bc00be53351cd87ad569896686aeb89 Author: Raffi Enficiaud AuthorDate: Mon Jul 15 01:52:02 2019 +0200 Commit: Raffi Enficiaud CommitDate: Mon Jul 15 01:52:02 2019 +0200 FindMatlab: fixing extension bat file invocation error If the environment variable MATLAB_ARCH is set prior to the call, the called scripts do not return an error message. diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 26b9419..4325623 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -609,14 +609,23 @@ function(matlab_get_mex_suffix matlab_root mex_suffix) set(devnull INPUT_FILE NUL) endif() + if(WIN32) + # this environment variable is used to determine the arch on Windows + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(ENV{MATLAB_ARCH} "win64") + else() + set(ENV{MATLAB_ARCH} "win32") + endif() + endif() + # this is the preferred way. If this does not work properly (eg. MCR on Windows), then we use our own knowledge execute_process( COMMAND ${Matlab_MEXEXTENSIONS_PROG} OUTPUT_VARIABLE _matlab_mex_extension - #RESULT_VARIABLE _matlab_mex_extension_call ERROR_VARIABLE _matlab_mex_extension_error OUTPUT_STRIP_TRAILING_WHITESPACE ${devnull}) + unset(ENV{MATLAB_ARCH}) if(_matlab_mex_extension_error) if(WIN32) @@ -631,7 +640,7 @@ function(matlab_get_mex_suffix matlab_root mex_suffix) string(STRIP "${_matlab_mex_extension}" _matlab_mex_extension) if(MATLAB_FIND_DEBUG) - message(STATUS "[MATLAB] '${Matlab_MEXEXTENSIONS_PROG}' : returned '${_matlab_mex_extension_call}', determined extension '${_matlab_mex_extension}' and error string is '${_matlab_mex_extension_error}'") + message(STATUS "[MATLAB] '${Matlab_MEXEXTENSIONS_PROG}' : determined extension '${_matlab_mex_extension}' and error string is '${_matlab_mex_extension_error}'") endif() unset(Matlab_MEXEXTENSIONS_PROG CACHE) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a9b36ea69f36cbfe198bcd5d34a19955651dfa5a commit a9b36ea69f36cbfe198bcd5d34a19955651dfa5a Author: Raffi Enficiaud AuthorDate: Mon Jul 15 01:31:40 2019 +0200 Commit: Raffi Enficiaud CommitDate: Mon Jul 15 01:46:12 2019 +0200 FindMatlab: Fixing compilation issues on Windows diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 03f1500..26b9419 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1043,14 +1043,9 @@ function(matlab_add_mex) set(_link_flags "${_link_flags} /EXPORT:mexfilerequiredapiversion") endif() - if(Matlab_HAS_CPP_API) - set(_link_flags "${_link_flags} /EXPORT:mexCreateMexFunction /EXPORT:mexDestroyMexFunction /EXPORT:mexFunctionAdapter") - #TODO: Is this necessary? - endif() - set_property(TARGET ${${prefix}_NAME} APPEND PROPERTY LINK_FLAGS ${_link_flags}) - endif() # TODO: what if there's a different compiler on Windows? + endif() # No other compiler currently supported on Windows. set_target_properties(${${prefix}_NAME} PROPERTIES ----------------------------------------------------------------------- Summary of changes: Modules/FindMatlab.cmake | 162 +++++++++++++++++++++++------------------------ Modules/FindPNG.cmake | 4 +- 2 files changed, 83 insertions(+), 83 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 16 08:43:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 16 Jul 2019 08:43:03 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-315-g09b4dfb Message-ID: <20190716124303.C273C1032FE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 09b4dfb92aab0b13d3df70ff974d4208386d55f0 (commit) via 96541918c88c9a1647b44fbe07ca7d50e821a98a (commit) from 79a21ba6804ea501365386ee2616441c9660f3ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09b4dfb92aab0b13d3df70ff974d4208386d55f0 commit 09b4dfb92aab0b13d3df70ff974d4208386d55f0 Merge: 79a21ba 9654191 Author: Brad King AuthorDate: Tue Jul 16 08:36:40 2019 -0400 Commit: Brad King CommitDate: Tue Jul 16 08:36:40 2019 -0400 Merge branch 'release-3.14' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96541918c88c9a1647b44fbe07ca7d50e821a98a commit 96541918c88c9a1647b44fbe07ca7d50e821a98a Author: Brad King AuthorDate: Tue Jul 16 07:08:05 2019 -0400 Commit: Brad King CommitDate: Tue Jul 16 07:08:05 2019 -0400 CMake 3.14.6 diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 46a1722..a1ff9fa 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 14) -set(CMake_VERSION_PATCH 5) +set(CMake_VERSION_PATCH 6) #set(CMake_VERSION_RC 0) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 16 09:03:03 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 16 Jul 2019 09:03:03 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.14.6, created. v3.14.6 Message-ID: <20190716130303.0FD921027F9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The annotated tag, v3.14.6 has been created at ddf219aefd4628ce3cae9026f73f029ed49ae69c (tag) tagging 96541918c88c9a1647b44fbe07ca7d50e821a98a (commit) replaces v3.14.5 tagged by Brad King on Tue Jul 16 08:36:20 2019 -0400 - Log ----------------------------------------------------------------- CMake 3.14.6 -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEExsJlMku+vcNQtRPQLSzvEDSSFoQFAl0txMQWHGJyYWQua2lu Z0BraXR3YXJlLmNvbQAKCRAtLO8QNJIWhO7iEACeUf5VDK5Zr/sVYEXlbQmvh0wT 2igFL4TCPlyM8WJBers6jiagXCmbo2xVssT1zyNz+j8UtJ/f8hMiCWpu/Jl8wmGG jowjfZTHybEJIeQJJVQNinGjEgHm6Nn0X5H9XmzTvdkGE2NdZv+i8MW5XW2CIPW0 NGS51Zf7Gl4oTeZ+9m1BXJPX7wEs9COUGZlASOMJKB3j7sr1nwj6akhvlL8Kyupo DvHxjbI41l2D81spp1ZeOU1NMTRFViScrYIiOZC9BwJX4TsKtB3KJTzwJ0f31QiV lo5ZKLRz7/5W3AkxKk2na0a6BUyMiOsyId8MESad72krjH5OOgtbDfmmGmrTrUFv CLwLoZxVb/F3b6ZX6IM87uLEmTHIz9i0SVdsAvjQFyvS2XakhCJtTnLLtX9MdU3j vgd+PZHoMPkYDuNfh4MZ0TIVPTogwDrZGz5TS3ynZmTmdPOp7iHsVzrGQxnp8qfl wtMd01BTBDhIL18psN/VvK/k4G5OVWP43rHSNuDTLAod90mwggpyTpOwN8fIofzV EEVd79KFWFY9eNc8Hvwrg18vPau7cHisbm65MNz4AcKT4N1QS+cF2w4Reg9e4Gg9 9jcV8nGMjDeIsluo/vd4XeI+gdzEKDikxVnJGpxLWQYbDvWrXamYEUG67CHV9Mfq dX0xHt5TAptSSTKdjQ== =4/eD -----END PGP SIGNATURE----- Brad King (4): Merge branch 'android-pie-cmp0083' into release-3.14 Merge branch 'backport-implicit-includes-cray-hlist' into release-3.14 Merge branch 'FindBISON-CMP0088-SourcePath' into release-3.14 CMake 3.14.6 Brian Carlson (1): FindBISON: Fix CMP0088 NEW behavior for non-absolute input paths Chuck Atkins (1): Cray: Fix include parsing when the -hlist= flag is present Marc Chevrier (1): Android: ensure PIE behavior is consistent regardless CMP0083 policy ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jul 16 10:33:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 16 Jul 2019 10:33:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-324-gc3d9d80 Message-ID: <20190716143308.2D73C10ECA6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c3d9d800157a8fe2c0478d7e054544b99694c240 (commit) via 76a540bab5f05e4d523ce1b0480b0ee6424c676b (commit) via 84ddeb8fa50cf16c53a48d1ccb92d067ed973d14 (commit) via e29ccfcafb8a57d73bd876e5f83f587396fca246 (commit) via c2c3d22504728e0763c3d0e88333a34d24457fb6 (commit) via 9f5c2040bfd41a2c87624cec3d9504cf477c9fc3 (commit) via 0f150b69d3a01c3c5b4a96d10334eb2703ba237f (commit) via a5bf4e7921e5ac1abbe8fd71a597a8b37e6f08d2 (commit) via 9cb5f040d7bd2a73d6510f2de38ddf03e4e7498a (commit) from 09b4dfb92aab0b13d3df70ff974d4208386d55f0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c3d9d800157a8fe2c0478d7e054544b99694c240 commit c3d9d800157a8fe2c0478d7e054544b99694c240 Merge: 76a540b c2c3d22 Author: Brad King AuthorDate: Tue Jul 16 14:30:30 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 16 10:30:38 2019 -0400 Merge topic 'aix-explicit-exports' c2c3d22504 Tests: Drop RunCMake workaround for AIX ld warnings about GNU atexit 9f5c2040bf AIX: Explicitly compute executable exports for both XL and GNU 0f150b69d3 AIX: Explicitly compute shared object exports for both XL and GNU a5bf4e7921 AIX: Drop redundant -brtl flags 9cb5f040d7 XL: De-duplicate shared object creation flags Acked-by: Kitware Robot Merge-request: !3556 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76a540bab5f05e4d523ce1b0480b0ee6424c676b commit 76a540bab5f05e4d523ce1b0480b0ee6424c676b Merge: 09b4dfb 84ddeb8 Author: Brad King AuthorDate: Tue Jul 16 14:28:44 2019 +0000 Commit: Kitware Robot CommitDate: Tue Jul 16 10:28:54 2019 -0400 Merge topic 'doc-ENABLE_EXPORTS' 84ddeb8fa5 Help: Clarify ENABLE_EXPORTS per-platform link behavior e29ccfcafb Help: Simplify CMAKE_ENABLE_EXPORTS documentation Acked-by: Kitware Robot Merge-request: !3560 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84ddeb8fa50cf16c53a48d1ccb92d067ed973d14 commit 84ddeb8fa50cf16c53a48d1ccb92d067ed973d14 Author: Brad King AuthorDate: Tue Jul 16 09:56:52 2019 -0400 Commit: Brad King CommitDate: Tue Jul 16 10:09:40 2019 -0400 Help: Clarify ENABLE_EXPORTS per-platform link behavior Spell out the behavior on each platform in a bullet list. diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/prop_tgt/ENABLE_EXPORTS.rst index 581c2b9..daef78b 100644 --- a/Help/prop_tgt/ENABLE_EXPORTS.rst +++ b/Help/prop_tgt/ENABLE_EXPORTS.rst @@ -7,16 +7,21 @@ Normally an executable does not export any symbols because it is the final program. It is possible for an executable to export symbols to be used by loadable modules. When this property is set to true CMake will allow other targets to "link" to the executable with the -:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level +:command:`target_link_libraries` command. On all platforms a target-level dependency on the executable is created for targets that link to it. -For DLL platforms an import library will be created for the exported -symbols and then used for linking. All Windows-based systems -including Cygwin are DLL platforms. For non-DLL platforms that -require all symbols to be resolved at link time, such as macOS, the -module will "link" to the executable using a flag like -``-bundle_loader``. For other non-DLL platforms the link rule is simply -ignored since the dynamic loader will automatically bind symbols when -the module is loaded. +Handling of the executable on the link lines of the loadable modules +varies by platform: + +* On Windows-based systems (including Cygwin) an "import library" is + created along with the executable to list the exported symbols. + Loadable modules link to the import library to get the symbols. + +* On macOS, loadable modules link to the executable itself using the + ``-bundle_loader`` flag. + +* On other platforms, loadable modules are simply linked without + referencing the executable since the dynamic loader will + automatically bind symbols when the module is loaded. This property is initialized by the value of the variable :variable:`CMAKE_ENABLE_EXPORTS` if it is set when a target is created. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e29ccfcafb8a57d73bd876e5f83f587396fca246 commit e29ccfcafb8a57d73bd876e5f83f587396fca246 Author: Brad King AuthorDate: Tue Jul 16 09:47:15 2019 -0400 Commit: Brad King CommitDate: Tue Jul 16 10:09:06 2019 -0400 Help: Simplify CMAKE_ENABLE_EXPORTS documentation In real projects the variable form should rarely be used because the decision to export symbols from an executable is very specific. Remove its main description, which duplicates the `ENABLE_EXPORTS` target property, and simply reference the property instead. diff --git a/Help/variable/CMAKE_ENABLE_EXPORTS.rst b/Help/variable/CMAKE_ENABLE_EXPORTS.rst index 7ec4d63..8848da1 100644 --- a/Help/variable/CMAKE_ENABLE_EXPORTS.rst +++ b/Help/variable/CMAKE_ENABLE_EXPORTS.rst @@ -1,22 +1,8 @@ CMAKE_ENABLE_EXPORTS -------------------- -Specify whether an executable exports symbols for loadable modules. +Specify whether executables export symbols for loadable modules. -Normally an executable does not export any symbols because it is the -final program. It is possible for an executable to export symbols to -be used by loadable modules. When this property is set to true CMake -will allow other targets to ``link`` to the executable with the -:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level -dependency on the executable is created for targets that link to it. -For DLL platforms an import library will be created for the exported -symbols and then used for linking. All Windows-based systems -including Cygwin are DLL platforms. For non-DLL platforms that -require all symbols to be resolved at link time, such as macOS, the -module will ``link`` to the executable using a flag like -``-bundle_loader``. For other non-DLL platforms the link rule is simply -ignored since the dynamic loader will automatically bind symbols when -the module is loaded. - -This variable is used to initialize the target property -:prop_tgt:`ENABLE_EXPORTS` for executable targets. +This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target +property for executable targets when they are created by calls to the +:command:`add_executable` command. See the property documentation for details. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2c3d22504728e0763c3d0e88333a34d24457fb6 commit c2c3d22504728e0763c3d0e88333a34d24457fb6 Author: Brad King AuthorDate: Fri Jul 12 16:24:20 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 13:27:16 2019 -0400 Tests: Drop RunCMake workaround for AIX ld warnings about GNU atexit Drop the filtering added by commit e22c45d4c9 (Tests: Teach RunCMake to ignore AIX ld warnings about GNU atexit, 2018-02-28, v3.12.0-rc1~419^2~6). It is no longer needed now that we compute our own exports on AIX and do not get these warnings when using shared libraries. diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index e730d6e..568bdf8 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -144,8 +144,6 @@ function(run_cmake test) "|Error kstat returned" "|Hit xcodebuild bug" "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type" - "|ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit" - "|ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information" "|[^\n]*is a member of multiple groups" "|[^\n]*from Time Machine by path" "|[^\n]*Bullseye Testing Technology" https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f5c2040bfd41a2c87624cec3d9504cf477c9fc3 commit 9f5c2040bfd41a2c87624cec3d9504cf477c9fc3 Author: Brad King AuthorDate: Fri Jul 12 12:55:55 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 13:27:16 2019 -0400 AIX: Explicitly compute executable exports for both XL and GNU On AIX, symbols in executables must be exported in order to be visible to modules (plugins) they load via `dlopen`. Prior to policy `CMP0065`, CMake linked all executables with flags to export symbols, but the NEW behavior for that policy is to do so only for executables that have the `ENABLE_EXPORTS` target property set. In both cases, CMake has always used the AIX linker option `-bexpall` option to export symbols from executables. This has worked fairly well with the XL compiler, but with the GNU compiler it works only for C ABI symbols. The reason is that `-bexpall` does not export symbols starting in `_` but the GNU C++ ABI mangles all symbols with a leading `_`. Therefore we have only supported C ABI plugins with the GNU compiler on AIX. Some projects have tried to work around this by replacing `-bexpall` with `-bexpfull`, but the latter often exports symbols that we do not want exported. Avoid using `-bexpall` for executables by instead using by our own internal `ExportImportList` script to compute symbol export lists from the object files to be linked into an executable. Pass the explicitly computed export list to the AIX linker's `-bE:...` option. We already do this for shared object exports. Issue: #19163 diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index beb928b..cec71a1 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -18,7 +18,7 @@ macro(__aix_compiler_gnu lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-G,-bnoipath") - set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1) set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath") @@ -32,4 +32,8 @@ macro(__aix_compiler_gnu lang) "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " " -Wl,-bE:/objects.exp -o " ) + + set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " + " -Wl,-bE:/objects.exp -o ") endmacro() diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 569edf7..52292bd 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -18,7 +18,7 @@ macro(__aix_compiler_xl lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-bnoipath") # -shared - set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ") set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ") @@ -30,4 +30,8 @@ macro(__aix_compiler_xl lang) "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " " -Wl,-bE:/objects.exp -o " ) + + set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " + " -Wl,-bE:/objects.exp -o ") endmacro() diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index c807f6d..a2c0503 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2754,6 +2754,13 @@ std::string cmGeneratorTarget::GetCreateRuleVariable( case cmStateEnums::MODULE_LIBRARY: return "CMAKE_" + lang + "_CREATE_SHARED_MODULE"; case cmStateEnums::EXECUTABLE: + if (this->IsExecutableWithExports()) { + std::string linkExeWithExports = + "CMAKE_" + lang + "_LINK_EXECUTABLE_WITH_EXPORTS"; + if (this->Makefile->IsDefinitionSet(linkExeWithExports)) { + return linkExeWithExports; + } + } return "CMAKE_" + lang + "_LINK_EXECUTABLE"; default: break; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0f730c9..4ffd6e0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1515,8 +1515,10 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065( } CM_FALLTHROUGH; case cmPolicies::OLD: - // OLD behavior is to always add the flags - add_shlib_flags = true; + // OLD behavior is to always add the flags, except on AIX where + // we compute symbol exports if ENABLE_EXPORTS is on. + add_shlib_flags = + !(tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS")); break; case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: @@ -1525,8 +1527,10 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065( cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065)); CM_FALLTHROUGH; case cmPolicies::NEW: - // NEW behavior is to only add the flags if ENABLE_EXPORTS is on - add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS"); + // NEW behavior is to only add the flags if ENABLE_EXPORTS is on, + // except on AIX where we compute symbol exports. + add_shlib_flags = + !tgt.Target->IsAIX() && tgt.GetPropertyAsBool("ENABLE_EXPORTS"); break; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 773487e..9290d27 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -171,6 +171,7 @@ public: bool IsGeneratorProvided; bool HaveInstallRule; bool IsDLLPlatform; + bool IsAIX; bool IsAndroid; bool IsImportedTarget; bool ImportedGloballyVisible; @@ -219,6 +220,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, impl->IsGeneratorProvided = false; impl->HaveInstallRule = false; impl->IsDLLPlatform = false; + impl->IsAIX = false; impl->IsAndroid = false; impl->IsImportedTarget = (vis == VisibilityImported || vis == VisibilityImportedGlobally); @@ -229,6 +231,10 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, impl->IsDLLPlatform = !impl->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX").empty(); + // Check whether we are targeting AIX. + impl->IsAIX = + (impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "AIX"); + // Check whether we are targeting an Android platform. impl->IsAndroid = (impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Android"); @@ -1664,6 +1670,11 @@ bool cmTarget::IsDLLPlatform() const return impl->IsDLLPlatform; } +bool cmTarget::IsAIX() const +{ + return impl->IsAIX; +} + bool cmTarget::IsImported() const { return impl->IsImportedTarget; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index d9e87b8..a808bb4 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -180,6 +180,9 @@ public: //! Return whether or not the target is for a DLL platform. bool IsDLLPlatform() const; + //! Return whether or not we are targeting AIX. + bool IsAIX() const; + bool IsImported() const; bool IsImportedGloballyVisible() const; diff --git a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake index 254a4ec..e86b50e 100644 --- a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake @@ -1,8 +1,11 @@ include(RunCMake) run_cmake(OLDBad1) -run_cmake(OLDBad2) -run_cmake(NEWBad) +if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX") + # Tests with ENABLE_EXPORTS ON. For AIX we do not use the flags at all. + run_cmake(OLDBad2) + run_cmake(NEWBad) +endif() run_cmake(NEWGood) run_cmake(WARN-OFF) run_cmake(WARN-ON) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 735ad5f..c952b1a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -120,7 +120,7 @@ add_RunCMake_test(CMP0081) # CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode # generators ignore. The policy will have no effect on those generators. if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") - add_RunCMake_test(CMP0065) + add_RunCMake_test(CMP0065 -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) endif() if(CMAKE_GENERATOR MATCHES "Make") add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU}) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f150b69d3a01c3c5b4a96d10334eb2703ba237f commit 0f150b69d3a01c3c5b4a96d10334eb2703ba237f Author: Brad King AuthorDate: Thu Jul 11 20:32:59 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 13:27:16 2019 -0400 AIX: Explicitly compute shared object exports for both XL and GNU On AIX, symbols in shared objects must be exported in order to be visible to dependents (similar to Windows). The AIX linker provides a `-bE:...` option to specify a file listing symbols to be exported. Compilers offer some features to help: * When the XL compiler is invoked with its `-qmkshrobj`/`-G` options for creating shared objects (without/with runtime linking), it recognizes when no explicit `-bE:...` linker option is specified and runs a `CreateExportList` tool provided with the compiler to compute one from the object files. Since commit d468a2c2cb (XL: Avoid copying archives into shared libraries that link them, 2011-04-07, v2.8.5~153^2) CMake runs `CreateExportList` explicitly to ensure it only looks at the object files and not any library files. * When the GNU compiler is invoked with its `-shared` option for creating shared objects, its internal `collect2` tool recognizes when no explicit `-bE:...` linker option is specified and computes one itself from the object files. However, it sometimes includes extra symbols such as `.__init_aix_libgcc_cxa_atexit`. Introduce our own internal `ExportImportList` script to compute symbol export lists from object files. Use a basic implementation for now: it can be extended as needed later. Update our shared library creation rules to run the script explicitly for both the XL and GNU compilers. Issue: #19163 diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index c3b7922..beb928b 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -25,4 +25,11 @@ macro(__aix_compiler_gnu lang) if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1) unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY) endif() + + # Construct the export list ourselves to pass only the object files so + # that we export only the symbols actually provided by the sources. + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " + " -Wl,-bE:/objects.exp -o " + ) endmacro() diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 0933a78..569edf7 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -24,25 +24,10 @@ macro(__aix_compiler_xl lang) set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath") - # Find the CreateExportList program that comes with this toolchain. - find_program(CMAKE_XL_CreateExportList - NAMES CreateExportList - DOC "IBM XL CreateExportList tool" + # Construct the export list ourselves to pass only the object files so + # that we export only the symbols actually provided by the sources. + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " + " -Wl,-bE:/objects.exp -o " ) - - # CMAKE_XL_CreateExportList is part of the AIX XL compilers but not the linux ones. - # If we found the tool, we'll use it to create exports, otherwise stick with the regular - # create shared library compile line. - if (CMAKE_XL_CreateExportList) - # The compiler front-end passes all object files, archive files, and shared - # library files named on the command line to CreateExportList to create a - # list of all symbols to be exported from the shared library. This causes - # all archive members to be copied into the shared library whether they are - # needed or not. Instead we run the tool ourselves to pass only the object - # files so that we export only the symbols actually provided by the sources. - set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "${CMAKE_XL_CreateExportList} /objects.exp " - " -Wl,-bE:/objects.exp -o " - ) - endif() endmacro() diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList new file mode 100755 index 0000000..c17378c --- /dev/null +++ b/Modules/Platform/AIX/ExportImportList @@ -0,0 +1,48 @@ +#!/bin/sh +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# This script is internal to CMake and meant only to be +# invoked by CMake-generated build systems on AIX. + +usage='usage: ExportImportList -o [--] ...' + +die() { + echo "$@" 1>&2; exit 1 +} + +# Process command-line arguments. +out='' +while test "$#" != 0; do + case "$1" in + -o) shift; out="$1" ;; + --) shift; break ;; + -*) die "$usage" ;; + *) break ;; + esac + shift +done +test -n "$out" || die "$usage" + +# Collect symbols exported from all object files. +out_tmp="$out.tmp$$" +trap 'rm -f "$out_tmp"' EXIT INT TERM +for f in "$@"; do + dump -tov -X 32_64 "$f" | + awk ' + BEGIN { + V["EXPORTED"]=" export" + V["PROTECTED"]=" protected" + } + /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / { + if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) { + print $NF V[$(NF-1)] + } + } + ' +done > "$out_tmp" + +# Generate the export/import file. +{ + sort -u "$out_tmp" +} > "$out" https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5bf4e7921e5ac1abbe8fd71a597a8b37e6f08d2 commit a5bf4e7921e5ac1abbe8fd71a597a8b37e6f08d2 Author: Brad King AuthorDate: Fri Jul 12 09:08:28 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 13:26:56 2019 -0400 AIX: Drop redundant -brtl flags We removed `-brtl` in commit bce7a2a3a5 (AIX: Do not use -brtl to create shared libraries, 2013-03-11, v2.8.11~103^2~1) but it was added again by commit f254276fc1 (AIX,HP-UX: Fix RPATH handling when CMP0065 is set to NEW, 2015-12-11, v3.4.2~4^2). Since the latter commit we initialize the `CMAKE_{SHARED,MODULE}_LINKER_FLAGS` to use the `-brtl` linker flag. This is unnecessary because we already use the `-G` linker flag which implies `-brtl`. The latter commit also moved `-brtl` to `CMAKE_EXE_LINKER_FLAGS` from flags that were always included in executable link lines with CMP0065 OLD behavior and are not part of the change intended by CMP0065. Leave this for now as we've always enabled runtime linking for executables (and implicitly done so via -G for shared libraries and modules). Issue: #13997 Issue: #19163 diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 0abbb61..c3b7922 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -11,8 +11,6 @@ set(__AIX_COMPILER_GNU 1) # # By default, runtime linking is enabled. All shared objects specified on the command line # will be listed, even if there are no symbols referenced, in the output file. -string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " -Wl,-brtl") -string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " -Wl,-brtl") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl") diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 06a806b..0933a78 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -11,8 +11,6 @@ set(__AIX_COMPILER_XL 1) # # By default, runtime linking is enabled. All shared objects specified on the command line # will be listed, even if there are no symbols referenced, in the output file. -string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " -Wl,-brtl") -string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " -Wl,-brtl") string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9cb5f040d7bd2a73d6510f2de38ddf03e4e7498a commit 9cb5f040d7bd2a73d6510f2de38ddf03e4e7498a Author: Brad King AuthorDate: Fri Jul 12 08:52:41 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 07:45:04 2019 -0400 XL: De-duplicate shared object creation flags The XL `-qmkshrobj` flag creates shared objects on all platforms. Move the flag out of the per-platform modules into the per-compiler module for XL. diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake index a9cec11..fc71ab4 100644 --- a/Modules/Compiler/XL.cmake +++ b/Modules/Compiler/XL.cmake @@ -18,6 +18,8 @@ macro(__compiler_xl lang) set(CMAKE_${lang}_RESPONSE_FILE_FLAG "-qoptfile=") set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-qoptfile=") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") diff --git a/Modules/Platform/Apple-XL-C.cmake b/Modules/Platform/Apple-XL-C.cmake index 2aeb132..e4fc3dd 100644 --- a/Modules/Platform/Apple-XL-C.cmake +++ b/Modules/Platform/Apple-XL-C.cmake @@ -1,4 +1,3 @@ -set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj") set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle") # Enable shared library versioning. diff --git a/Modules/Platform/Apple-XL-CXX.cmake b/Modules/Platform/Apple-XL-CXX.cmake index f8e1906..ea330c8 100644 --- a/Modules/Platform/Apple-XL-CXX.cmake +++ b/Modules/Platform/Apple-XL-CXX.cmake @@ -1,4 +1,3 @@ -set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj") set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-bundle") # Enable shared library versioning. diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake index d595e44..ef0c52b 100644 --- a/Modules/Platform/Linux-XL-C.cmake +++ b/Modules/Platform/Linux-XL-C.cmake @@ -1,2 +1 @@ -set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj") set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-CXX.cmake b/Modules/Platform/Linux-XL-CXX.cmake index 5ceb255..aa57d6e 100644 --- a/Modules/Platform/Linux-XL-CXX.cmake +++ b/Modules/Platform/Linux-XL-CXX.cmake @@ -1,2 +1 @@ -set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj") set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake index a878991..d9b4c2d 100644 --- a/Modules/Platform/Linux-XL-Fortran.cmake +++ b/Modules/Platform/Linux-XL-Fortran.cmake @@ -1,2 +1 @@ -set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj") set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-export-dynamic") ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/ENABLE_EXPORTS.rst | 23 +++++++++------ Help/variable/CMAKE_ENABLE_EXPORTS.rst | 22 +++----------- Modules/Compiler/XL.cmake | 2 ++ Modules/Platform/AIX-GNU.cmake | 15 ++++++++-- Modules/Platform/AIX-XL.cmake | 31 ++++++-------------- Modules/Platform/AIX/ExportImportList | 48 +++++++++++++++++++++++++++++++ Modules/Platform/Apple-XL-C.cmake | 1 - Modules/Platform/Apple-XL-CXX.cmake | 1 - Modules/Platform/Linux-XL-C.cmake | 1 - Modules/Platform/Linux-XL-CXX.cmake | 1 - Modules/Platform/Linux-XL-Fortran.cmake | 1 - Source/cmGeneratorTarget.cxx | 7 +++++ Source/cmLocalGenerator.cxx | 12 +++++--- Source/cmTarget.cxx | 11 +++++++ Source/cmTarget.h | 3 ++ Tests/RunCMake/CMP0065/RunCMakeTest.cmake | 7 +++-- Tests/RunCMake/CMakeLists.txt | 2 +- Tests/RunCMake/RunCMake.cmake | 2 -- 18 files changed, 124 insertions(+), 66 deletions(-) create mode 100755 Modules/Platform/AIX/ExportImportList hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 00:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 00:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-325-gb119968 Message-ID: <20190717040307.555AB102F2F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b1199680489b402e3b73229d79eb06e3bd440f81 (commit) from c3d9d800157a8fe2c0478d7e054544b99694c240 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1199680489b402e3b73229d79eb06e3bd440f81 commit b1199680489b402e3b73229d79eb06e3bd440f81 Author: Kitware Robot AuthorDate: Wed Jul 17 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Wed Jul 17 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7e93537..9c00c80 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 15) -set(CMake_VERSION_PATCH 20190716) +set(CMake_VERSION_PATCH 20190717) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 07:23:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 07:23:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-329-g119fb86 Message-ID: <20190717112308.F0CC7113C67@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 119fb8606a306e256fc6dd8c2297c9d69033384a (commit) via 3f84ff212c2e5ff9410dcd75f7806832472a756d (commit) via 185e6a12884433caa65e55a44431bd76f52a9f48 (commit) via f2edccea666662ce93af29e397c50702a675f3f4 (commit) from b1199680489b402e3b73229d79eb06e3bd440f81 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=119fb8606a306e256fc6dd8c2297c9d69033384a commit 119fb8606a306e256fc6dd8c2297c9d69033384a Merge: 3f84ff2 185e6a1 Author: Brad King AuthorDate: Wed Jul 17 07:20:47 2019 -0400 Commit: Brad King CommitDate: Wed Jul 17 07:20:47 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f84ff212c2e5ff9410dcd75f7806832472a756d commit 3f84ff212c2e5ff9410dcd75f7806832472a756d Merge: b119968 f2edcce Author: Brad King AuthorDate: Wed Jul 17 11:20:06 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 17 07:20:20 2019 -0400 Merge topic 'find_package-fix-NO_MODULE' f2edccea66 find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIG Acked-by: Kitware Robot Merge-request: !3557 ----------------------------------------------------------------------- Summary of changes: Source/cmFindPackageCommand.cxx | 5 ++-- Tests/FindPackageTest/CMakeLists.txt | 33 ++++++++++++++++++++++ .../ACMEConfig.cmake} | 0 .../PreferConfigRecurse/FindACME.cmake | 1 + 4 files changed, 37 insertions(+), 2 deletions(-) copy Tests/FindPackageTest/{PreferConfigOnlyModule/FindACME.cmake => PreferConfigRecurse/ACMEConfig.cmake} (100%) create mode 100644 Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 07:23:09 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 07:23:09 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc4-9-g185e6a1 Message-ID: <20190717112309.70F9A113A82@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 185e6a12884433caa65e55a44431bd76f52a9f48 (commit) via f2edccea666662ce93af29e397c50702a675f3f4 (commit) from 7242d812691e95cae578a597161693940447b38c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/cmFindPackageCommand.cxx | 5 ++-- Tests/FindPackageTest/CMakeLists.txt | 33 ++++++++++++++++++++++ .../ACMEConfig.cmake} | 0 .../PreferConfigRecurse/FindACME.cmake | 1 + 4 files changed, 37 insertions(+), 2 deletions(-) copy Tests/FindPackageTest/{PreferConfigOnlyModule/FindACME.cmake => PreferConfigRecurse/ACMEConfig.cmake} (100%) create mode 100644 Tests/FindPackageTest/PreferConfigRecurse/FindACME.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 07:33:12 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 07:33:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-338-g3143e9f Message-ID: <20190717113312.9F6B311DA29@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3143e9ffc5fcb15a9c0c1a7cfaa94587132947d1 (commit) via 0ba5891eadbfd533f0ab30c90966bce07e5fbef8 (commit) via 5f8466980696cc13653766d6c6255c40a896acb7 (commit) via b1f387a7ea2c5b42502970f5a6758d1880dee5ca (commit) via 41b85968d858d825891417c244879f4ebb6543c3 (commit) via 45e85dd2b2830601b28da26a0ed36db23c82204d (commit) via 90f91e4d217e64c5a68c8069500b83329eaee6b9 (commit) via 638383c38f58941692544401c44dfbce9c7ff2d9 (commit) via 9b6a53292f9183bd5ae59c24f8fc1d76c5e187c8 (commit) from 119fb8606a306e256fc6dd8c2297c9d69033384a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3143e9ffc5fcb15a9c0c1a7cfaa94587132947d1 commit 3143e9ffc5fcb15a9c0c1a7cfaa94587132947d1 Merge: 119fb86 0ba5891 Author: Brad King AuthorDate: Wed Jul 17 11:27:53 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 17 07:28:05 2019 -0400 Merge topic 'project-version-0' 0ba5891ead project: Keep leading `0` in PROJECT_VERSION components 5f84669806 Tests: Factor out RunCMake.project helper macro into module b1f387a7ea Refactor: Use raw string literals instead of escaping 41b85968d8 Refactor: Use initializer lists instead of `push_back` series 45e85dd2b2 Refactor: Add some `const` to vars 90f91e4d21 Refactor: Replace a "magic" number w/ a named constant 638383c38f Refactor: Eliminate one-time-used variables 9b6a53292f Refactor: Eliminate `sep` from the loop Acked-by: Kitware Robot Merge-request: !3517 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ba5891eadbfd533f0ab30c90966bce07e5fbef8 commit 0ba5891eadbfd533f0ab30c90966bce07e5fbef8 Author: Alex Turbov AuthorDate: Sat Jul 6 03:01:38 2019 +0300 Commit: Brad King CommitDate: Tue Jul 16 07:48:40 2019 -0400 project: Keep leading `0` in PROJECT_VERSION components Introduce CMake policy `CMP0096` to make `project()` keep leading zeros in version components. As a side effect, it now allows really long version numbers. Fixes: #19421 Co-Author: Brad King diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index d7207e1..6bdabaf 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,7 @@ Policies Introduced by CMake 3.16 .. toctree:: :maxdepth: 1 + CMP0096: project() preserves leading zeros in version components. CMP0095: RPATH entries are properly escaped in the intermediary CMake install script. Policies Introduced by CMake 3.15 diff --git a/Help/policy/CMP0096.rst b/Help/policy/CMP0096.rst new file mode 100644 index 0000000..8eaf0f9 --- /dev/null +++ b/Help/policy/CMP0096.rst @@ -0,0 +1,25 @@ +CMP0096 +------- + +The :command:`project` command preserves leading zeros in version components. + +When a ``VERSION [.[.[.]]]]`` argument is given +to the :command:`project` command, it stores the version string in the +``PROJECT_VERSION`` variable and stores individual integer version components +in ``PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}`` variables (see policy +:policy:`CMP0048`). CMake 3.15 and below dropped leading zeros from each +component. CMake 3.16 and higher prefer to preserve leading zeros. This +policy provides compatibility for projects that have not been updated to +expect the new behavior. + +The ``OLD`` behavior of this policy drops leading zeros in all components, +e.g. such that version ``1.07.06`` becomes ``1.7.6``. The ``NEW`` behavior +of this policy preserves the leading zeros in all components, such that +version ``1.07.06`` remains unchanged. + +This policy was introduced in CMake version 3.16. Unlike many policies, CMake +version |release| does *not* warn when this policy is not set and simply uses +the ``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/project-version-0.rst b/Help/release/dev/project-version-0.rst new file mode 100644 index 0000000..6525522 --- /dev/null +++ b/Help/release/dev/project-version-0.rst @@ -0,0 +1,5 @@ +project-version-0 +----------------- + +* The :command:`project` no longer strips leading zeros in version components. + See policy :policy:`CMP0096`. diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index c16a46f..e0f48de 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -283,7 +283,10 @@ class cmMakefile; SELECT(POLICY, CMP0095, \ "RPATH entries are properly escaped in the intermediary CMake " \ "install script.", \ - 3, 16, 0, cmPolicies::WARN) + 3, 16, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0096, \ + "project() preserves leading zeros in version components.", 3, 16, \ + 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/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 48a094f..e3d3bd8 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -3,9 +3,12 @@ #include "cmProjectCommand.h" #include "cmsys/RegularExpression.hxx" +#include +#include #include +#include #include -#include +#include #include "cmAlgorithms.h" #include "cmMakefile.h" @@ -220,44 +223,69 @@ bool cmProjectCommand::InitialPass(std::vector const& args, return true; } + cmPolicies::PolicyStatus const cmp0096 = + this->Makefile->GetPolicyStatus(cmPolicies::CMP0096); + constexpr std::size_t MAX_VERSION_COMPONENTS = 4u; - std::string vs; - char vb[MAX_VERSION_COMPONENTS][64]; - unsigned int v[MAX_VERSION_COMPONENTS] = { 0, 0, 0, 0 }; - int vc = - sscanf(version.c_str(), "%u.%u.%u.%u", &v[0], &v[1], &v[2], &v[3]); - for (auto i = 0u; i < MAX_VERSION_COMPONENTS; ++i) { - if (int(i) < vc) { - sprintf(vb[i], "%u", v[i]); - vs += &"."[size_t(i == 0)]; - vs += vb[i]; - } else { - vb[i][0] = 0; + std::string version_string; + std::array version_components; + + if (cmp0096 == cmPolicies::OLD || cmp0096 == cmPolicies::WARN) { + char vb[MAX_VERSION_COMPONENTS][std::numeric_limits::digits10]; + unsigned v[MAX_VERSION_COMPONENTS] = { 0, 0, 0, 0 }; + const int vc = std::sscanf(version.c_str(), "%u.%u.%u.%u", &v[0], &v[1], + &v[2], &v[3]); + for (auto i = 0u; i < MAX_VERSION_COMPONENTS; ++i) { + if (int(i) < vc) { + std::sprintf(vb[i], "%u", v[i]); + version_string += &"."[std::size_t(i == 0)]; + version_string += vb[i]; + version_components[i] = vb[i]; + } else { + vb[i][0] = '\x00'; + } + } + } else { + // The regex above verified that we have a .-separated string of + // non-negative integer components. Keep the original string. + version_string = std::move(version); + // Split the integer components. + auto components = cmSystemTools::SplitString(version_string, '.'); + for (auto i = 0u; i < components.size(); ++i) { + version_components[i] = std::move(components[i]); } } std::string vv; vv = projectName + "_VERSION"; - this->Makefile->AddDefinition("PROJECT_VERSION", vs.c_str()); - this->Makefile->AddDefinition(vv, vs.c_str()); + this->Makefile->AddDefinition("PROJECT_VERSION", version_string.c_str()); + this->Makefile->AddDefinition(vv, version_string.c_str()); vv = projectName + "_VERSION_MAJOR"; - this->Makefile->AddDefinition("PROJECT_VERSION_MAJOR", vb[0]); - this->Makefile->AddDefinition(vv, vb[0]); + this->Makefile->AddDefinition("PROJECT_VERSION_MAJOR", + version_components[0].c_str()); + this->Makefile->AddDefinition(vv, version_components[0].c_str()); vv = projectName + "_VERSION_MINOR"; - this->Makefile->AddDefinition("PROJECT_VERSION_MINOR", vb[1]); - this->Makefile->AddDefinition(vv, vb[1]); + this->Makefile->AddDefinition("PROJECT_VERSION_MINOR", + version_components[1].c_str()); + this->Makefile->AddDefinition(vv, version_components[1].c_str()); vv = projectName + "_VERSION_PATCH"; - this->Makefile->AddDefinition("PROJECT_VERSION_PATCH", vb[2]); - this->Makefile->AddDefinition(vv, vb[2]); + this->Makefile->AddDefinition("PROJECT_VERSION_PATCH", + version_components[2].c_str()); + this->Makefile->AddDefinition(vv, version_components[2].c_str()); vv = projectName + "_VERSION_TWEAK"; - this->Makefile->AddDefinition("PROJECT_VERSION_TWEAK", vb[3]); - this->Makefile->AddDefinition(vv, vb[3]); + this->Makefile->AddDefinition("PROJECT_VERSION_TWEAK", + version_components[3].c_str()); + this->Makefile->AddDefinition(vv, version_components[3].c_str()); // Also, try set top level variables - TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION", vs.c_str()); - TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_MAJOR", vb[0]); - TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_MINOR", vb[1]); - TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_PATCH", vb[2]); - TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_TWEAK", vb[3]); + TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION", version_string.c_str()); + TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_MAJOR", + version_components[0].c_str()); + TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_MINOR", + version_components[1].c_str()); + TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_PATCH", + version_components[2].c_str()); + TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_TWEAK", + version_components[3].c_str()); } else if (cmp0048 != cmPolicies::OLD) { // Set project VERSION variables to empty std::vector vv = { "PROJECT_VERSION", diff --git a/Tests/RunCMake/project/CMP0096-NEW-stdout.txt b/Tests/RunCMake/project/CMP0096-NEW-stdout.txt new file mode 100644 index 0000000..f6b999a --- /dev/null +++ b/Tests/RunCMake/project/CMP0096-NEW-stdout.txt @@ -0,0 +1,30 @@ +-- PROJECT_VERSION='2019.07.06' +-- DateVersion_VERSION='2019.07.06' +-- PROJECT_VERSION_MAJOR='2019' +-- DateVersion_VERSION_MAJOR='2019' +-- PROJECT_VERSION_MINOR='07' +-- DateVersion_VERSION_MINOR='07' +-- PROJECT_VERSION_PATCH='06' +-- DateVersion_VERSION_PATCH='06' +-- PROJECT_VERSION_TWEAK='' +-- DateVersion_VERSION_TWEAK='' +-- PROJECT_VERSION='4294967297' +-- LongVersion_VERSION='4294967297' +-- PROJECT_VERSION_MAJOR='4294967297' +-- LongVersion_VERSION_MAJOR='4294967297' +-- PROJECT_VERSION_MINOR='' +-- LongVersion_VERSION_MINOR='' +-- PROJECT_VERSION_PATCH='' +-- LongVersion_VERSION_PATCH='' +-- PROJECT_VERSION_TWEAK='' +-- LongVersion_VERSION_TWEAK='' +-- PROJECT_VERSION='0009999999999.0009999999999.0009999999999.0009999999999' +-- VeryLongVersion_VERSION='0009999999999.0009999999999.0009999999999.0009999999999' +-- PROJECT_VERSION_MAJOR='0009999999999' +-- VeryLongVersion_VERSION_MAJOR='0009999999999' +-- PROJECT_VERSION_MINOR='0009999999999' +-- VeryLongVersion_VERSION_MINOR='0009999999999' +-- PROJECT_VERSION_PATCH='0009999999999' +-- VeryLongVersion_VERSION_PATCH='0009999999999' +-- PROJECT_VERSION_TWEAK='0009999999999' +-- VeryLongVersion_VERSION_TWEAK='0009999999999' diff --git a/Tests/RunCMake/project/CMP0096-NEW.cmake b/Tests/RunCMake/project/CMP0096-NEW.cmake new file mode 100644 index 0000000..e2cdd20 --- /dev/null +++ b/Tests/RunCMake/project/CMP0096-NEW.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0048 NEW) +cmake_policy(SET CMP0096 NEW) +include(CMP0096-common.cmake) + +project(VeryLongVersion VERSION 0009999999999.0009999999999.0009999999999.0009999999999 LANGUAGES NONE) +print_versions(VeryLongVersion) diff --git a/Tests/RunCMake/project/CMP0096-OLD-stdout.txt b/Tests/RunCMake/project/CMP0096-OLD-stdout.txt new file mode 100644 index 0000000..6a945ce --- /dev/null +++ b/Tests/RunCMake/project/CMP0096-OLD-stdout.txt @@ -0,0 +1,20 @@ +-- PROJECT_VERSION='2019.7.6' +-- DateVersion_VERSION='2019.7.6' +-- PROJECT_VERSION_MAJOR='2019' +-- DateVersion_VERSION_MAJOR='2019' +-- PROJECT_VERSION_MINOR='7' +-- DateVersion_VERSION_MINOR='7' +-- PROJECT_VERSION_PATCH='6' +-- DateVersion_VERSION_PATCH='6' +-- PROJECT_VERSION_TWEAK='' +-- DateVersion_VERSION_TWEAK='' +-- PROJECT_VERSION='(1|4294967295)' +-- LongVersion_VERSION='(1|4294967295)' +-- PROJECT_VERSION_MAJOR='(1|4294967295)' +-- LongVersion_VERSION_MAJOR='(1|4294967295)' +-- PROJECT_VERSION_MINOR='' +-- LongVersion_VERSION_MINOR='' +-- PROJECT_VERSION_PATCH='' +-- LongVersion_VERSION_PATCH='' +-- PROJECT_VERSION_TWEAK='' +-- LongVersion_VERSION_TWEAK='' diff --git a/Tests/RunCMake/project/CMP0096-OLD.cmake b/Tests/RunCMake/project/CMP0096-OLD.cmake new file mode 100644 index 0000000..25a3b19 --- /dev/null +++ b/Tests/RunCMake/project/CMP0096-OLD.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0048 NEW) +cmake_policy(SET CMP0096 OLD) +include(CMP0096-common.cmake) diff --git a/Tests/RunCMake/project/CMP0096-WARN-stdout.txt b/Tests/RunCMake/project/CMP0096-WARN-stdout.txt new file mode 100644 index 0000000..6a945ce --- /dev/null +++ b/Tests/RunCMake/project/CMP0096-WARN-stdout.txt @@ -0,0 +1,20 @@ +-- PROJECT_VERSION='2019.7.6' +-- DateVersion_VERSION='2019.7.6' +-- PROJECT_VERSION_MAJOR='2019' +-- DateVersion_VERSION_MAJOR='2019' +-- PROJECT_VERSION_MINOR='7' +-- DateVersion_VERSION_MINOR='7' +-- PROJECT_VERSION_PATCH='6' +-- DateVersion_VERSION_PATCH='6' +-- PROJECT_VERSION_TWEAK='' +-- DateVersion_VERSION_TWEAK='' +-- PROJECT_VERSION='(1|4294967295)' +-- LongVersion_VERSION='(1|4294967295)' +-- PROJECT_VERSION_MAJOR='(1|4294967295)' +-- LongVersion_VERSION_MAJOR='(1|4294967295)' +-- PROJECT_VERSION_MINOR='' +-- LongVersion_VERSION_MINOR='' +-- PROJECT_VERSION_PATCH='' +-- LongVersion_VERSION_PATCH='' +-- PROJECT_VERSION_TWEAK='' +-- LongVersion_VERSION_TWEAK='' diff --git a/Tests/RunCMake/project/CMP0096-WARN.cmake b/Tests/RunCMake/project/CMP0096-WARN.cmake new file mode 100644 index 0000000..7fe0861 --- /dev/null +++ b/Tests/RunCMake/project/CMP0096-WARN.cmake @@ -0,0 +1,3 @@ +cmake_policy(SET CMP0048 NEW) + +include(CMP0096-common.cmake) diff --git a/Tests/RunCMake/project/CMP0096-common.cmake b/Tests/RunCMake/project/CMP0096-common.cmake new file mode 100644 index 0000000..8d26d30 --- /dev/null +++ b/Tests/RunCMake/project/CMP0096-common.cmake @@ -0,0 +1,9 @@ +include(PrintVersions.cmake) + +# Test leading zeros motivating this policy. +project(DateVersion VERSION 2019.07.06 LANGUAGES NONE) +print_versions(DateVersion) + +# Overflow version component in OLD behavior. +project(LongVersion VERSION 4294967297 #[[ uint32_max + 2 ]] LANGUAGES NONE) +print_versions(LongVersion) diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake index 3a8ad4b..8f43a51 100644 --- a/Tests/RunCMake/project/RunCMakeTest.cmake +++ b/Tests/RunCMake/project/RunCMakeTest.cmake @@ -27,3 +27,7 @@ run_cmake(CMP0048-OLD) run_cmake(CMP0048-OLD-VERSION) run_cmake(CMP0048-WARN) run_cmake(CMP0048-NEW) + +run_cmake(CMP0096-WARN) +run_cmake(CMP0096-OLD) +run_cmake(CMP0096-NEW) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f8466980696cc13653766d6c6255c40a896acb7 commit 5f8466980696cc13653766d6c6255c40a896acb7 Author: Brad King AuthorDate: Thu Jul 11 10:56:38 2019 -0400 Commit: Brad King CommitDate: Mon Jul 15 08:17:36 2019 -0400 Tests: Factor out RunCMake.project helper macro into module diff --git a/Tests/RunCMake/project/CMP0048-NEW.cmake b/Tests/RunCMake/project/CMP0048-NEW.cmake index 7e16b70..b6e80ac 100644 --- a/Tests/RunCMake/project/CMP0048-NEW.cmake +++ b/Tests/RunCMake/project/CMP0048-NEW.cmake @@ -1,9 +1,4 @@ -macro(print_versions name) - foreach(v "" _MAJOR _MINOR _PATCH _TWEAK) - message(STATUS "PROJECT_VERSION${v}='${PROJECT_VERSION${v}}'") - message(STATUS "${name}_VERSION${v}='${${name}_VERSION${v}}'") - endforeach() -endmacro() +include(PrintVersions.cmake) cmake_policy(SET CMP0048 NEW) diff --git a/Tests/RunCMake/project/PrintVersions.cmake b/Tests/RunCMake/project/PrintVersions.cmake new file mode 100644 index 0000000..ce1b25d --- /dev/null +++ b/Tests/RunCMake/project/PrintVersions.cmake @@ -0,0 +1,6 @@ +macro(print_versions name) + foreach(v "" _MAJOR _MINOR _PATCH _TWEAK) + message(STATUS "PROJECT_VERSION${v}='${PROJECT_VERSION${v}}'") + message(STATUS "${name}_VERSION${v}='${${name}_VERSION${v}}'") + endforeach() +endmacro() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1f387a7ea2c5b42502970f5a6758d1880dee5ca commit b1f387a7ea2c5b42502970f5a6758d1880dee5ca Author: Alex Turbov AuthorDate: Sat Jul 6 15:04:31 2019 +0300 Commit: Brad King CommitDate: Mon Jul 15 08:17:36 2019 -0400 Refactor: Use raw string literals instead of escaping diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index aae2ada..48a094f 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -214,7 +214,7 @@ bool cmProjectCommand::InitialPass(std::vector const& args, cmsys::RegularExpression vx( R"(^([0-9]+(\.[0-9]+(\.[0-9]+(\.[0-9]+)?)?)?)?$)"); if (!vx.find(version)) { - std::string e = "VERSION \"" + version + "\" format invalid."; + std::string e = R"(VERSION ")" + version + R"(" format invalid.)"; this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e); cmSystemTools::SetFatalErrorOccured(); return true; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41b85968d858d825891417c244879f4ebb6543c3 commit 41b85968d858d825891417c244879f4ebb6543c3 Author: Alex Turbov AuthorDate: Mon Jul 8 23:02:01 2019 +0300 Commit: Brad King CommitDate: Mon Jul 15 08:17:36 2019 -0400 Refactor: Use initializer lists instead of `push_back` series diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index b2bc0c4..aae2ada 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -260,17 +260,16 @@ bool cmProjectCommand::InitialPass(std::vector const& args, TopLevelCMakeVarCondSet("CMAKE_PROJECT_VERSION_TWEAK", vb[3]); } else if (cmp0048 != cmPolicies::OLD) { // Set project VERSION variables to empty - std::vector vv; - vv.emplace_back("PROJECT_VERSION"); - vv.emplace_back("PROJECT_VERSION_MAJOR"); - vv.emplace_back("PROJECT_VERSION_MINOR"); - vv.emplace_back("PROJECT_VERSION_PATCH"); - vv.emplace_back("PROJECT_VERSION_TWEAK"); - vv.push_back(projectName + "_VERSION"); - vv.push_back(projectName + "_VERSION_MAJOR"); - vv.push_back(projectName + "_VERSION_MINOR"); - vv.push_back(projectName + "_VERSION_PATCH"); - vv.push_back(projectName + "_VERSION_TWEAK"); + std::vector vv = { "PROJECT_VERSION", + "PROJECT_VERSION_MAJOR", + "PROJECT_VERSION_MINOR", + "PROJECT_VERSION_PATCH", + "PROJECT_VERSION_TWEAK", + projectName + "_VERSION", + projectName + "_VERSION_MAJOR", + projectName + "_VERSION_MINOR", + projectName + "_VERSION_PATCH", + projectName + "_VERSION_TWEAK" }; if (this->Makefile->IsRootMakefile()) { vv.emplace_back("CMAKE_PROJECT_VERSION"); vv.emplace_back("CMAKE_PROJECT_VERSION_MAJOR"); @@ -312,8 +311,7 @@ bool cmProjectCommand::InitialPass(std::vector const& args, if (languages.empty()) { // if no language is specified do c and c++ - languages.emplace_back("C"); - languages.emplace_back("CXX"); + languages = { "C", "CXX" }; } this->Makefile->EnableLanguage(languages, false); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45e85dd2b2830601b28da26a0ed36db23c82204d commit 45e85dd2b2830601b28da26a0ed36db23c82204d Author: Alex Turbov AuthorDate: Sat Jul 6 04:21:31 2019 +0300 Commit: Brad King CommitDate: Mon Jul 15 08:17:36 2019 -0400 Refactor: Add some `const` to vars diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index c08ad0f..b2bc0c4 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -199,7 +199,7 @@ bool cmProjectCommand::InitialPass(std::vector const& args, languages.emplace_back("NONE"); } - cmPolicies::PolicyStatus cmp0048 = + cmPolicies::PolicyStatus const cmp0048 = this->Makefile->GetPolicyStatus(cmPolicies::CMP0048); if (haveVersion) { // Set project VERSION variables to given values @@ -280,7 +280,7 @@ bool cmProjectCommand::InitialPass(std::vector const& args, } std::string vw; for (std::string const& i : vv) { - const char* v = this->Makefile->GetDefinition(i); + const char* const v = this->Makefile->GetDefinition(i); if (v && *v) { if (cmp0048 == cmPolicies::WARN) { if (!injectedProjectCommand) { @@ -330,7 +330,7 @@ bool cmProjectCommand::InitialPass(std::vector const& args, bool cmProjectCommand::IncludeByVariable(const std::string& variable) { - const char* include = this->Makefile->GetDefinition(variable); + const char* const include = this->Makefile->GetDefinition(variable); if (!include) { return true; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90f91e4d217e64c5a68c8069500b83329eaee6b9 commit 90f91e4d217e64c5a68c8069500b83329eaee6b9 Author: Alex Turbov AuthorDate: Sat Jul 6 02:53:32 2019 +0300 Commit: Brad King CommitDate: Mon Jul 15 08:17:36 2019 -0400 Refactor: Replace a "magic" number w/ a named constant diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index a4ed300..c08ad0f 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -220,13 +220,14 @@ bool cmProjectCommand::InitialPass(std::vector const& args, return true; } + constexpr std::size_t MAX_VERSION_COMPONENTS = 4u; std::string vs; - char vb[4][64]; - unsigned int v[4] = { 0, 0, 0, 0 }; + char vb[MAX_VERSION_COMPONENTS][64]; + unsigned int v[MAX_VERSION_COMPONENTS] = { 0, 0, 0, 0 }; int vc = sscanf(version.c_str(), "%u.%u.%u.%u", &v[0], &v[1], &v[2], &v[3]); - for (int i = 0; i < 4; ++i) { - if (i < vc) { + for (auto i = 0u; i < MAX_VERSION_COMPONENTS; ++i) { + if (int(i) < vc) { sprintf(vb[i], "%u", v[i]); vs += &"."[size_t(i == 0)]; vs += vb[i]; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=638383c38f58941692544401c44dfbce9c7ff2d9 commit 638383c38f58941692544401c44dfbce9c7ff2d9 Author: Alex Turbov AuthorDate: Mon Jul 8 23:01:22 2019 +0300 Commit: Brad King CommitDate: Mon Jul 15 08:17:36 2019 -0400 Refactor: Eliminate one-time-used variables diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index a703e40..a4ed300 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -33,25 +33,19 @@ bool cmProjectCommand::InitialPass(std::vector const& args, this->Makefile->SetProjectName(projectName); - std::string bindir = projectName; - bindir += "_BINARY_DIR"; - std::string srcdir = projectName; - srcdir += "_SOURCE_DIR"; - this->Makefile->AddCacheDefinition( - bindir, this->Makefile->GetCurrentBinaryDirectory().c_str(), + projectName + "_BINARY_DIR", + this->Makefile->GetCurrentBinaryDirectory().c_str(), "Value Computed by CMake", cmStateEnums::STATIC); this->Makefile->AddCacheDefinition( - srcdir, this->Makefile->GetCurrentSourceDirectory().c_str(), + projectName + "_SOURCE_DIR", + this->Makefile->GetCurrentSourceDirectory().c_str(), "Value Computed by CMake", cmStateEnums::STATIC); - bindir = "PROJECT_BINARY_DIR"; - srcdir = "PROJECT_SOURCE_DIR"; - this->Makefile->AddDefinition( - bindir, this->Makefile->GetCurrentBinaryDirectory().c_str()); + "PROJECT_BINARY_DIR", this->Makefile->GetCurrentBinaryDirectory().c_str()); this->Makefile->AddDefinition( - srcdir, this->Makefile->GetCurrentSourceDirectory().c_str()); + "PROJECT_SOURCE_DIR", this->Makefile->GetCurrentSourceDirectory().c_str()); this->Makefile->AddDefinition("PROJECT_NAME", projectName.c_str()); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b6a53292f9183bd5ae59c24f8fc1d76c5e187c8 commit 9b6a53292f9183bd5ae59c24f8fc1d76c5e187c8 Author: Alex Turbov AuthorDate: Sat Jul 6 02:51:06 2019 +0300 Commit: Brad King CommitDate: Mon Jul 15 08:17:34 2019 -0400 Refactor: Eliminate `sep` from the loop diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 8615ecc..a703e40 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -227,7 +227,6 @@ bool cmProjectCommand::InitialPass(std::vector const& args, } std::string vs; - const char* sep = ""; char vb[4][64]; unsigned int v[4] = { 0, 0, 0, 0 }; int vc = @@ -235,9 +234,8 @@ bool cmProjectCommand::InitialPass(std::vector const& args, for (int i = 0; i < 4; ++i) { if (i < vc) { sprintf(vb[i], "%u", v[i]); - vs += sep; + vs += &"."[size_t(i == 0)]; vs += vb[i]; - sep = "."; } else { vb[i][0] = 0; } ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0096.rst | 25 +++++ Help/release/dev/project-version-0.rst | 5 + Source/cmPolicies.h | 5 +- Source/cmProjectCommand.cxx | 137 ++++++++++++++----------- Tests/RunCMake/project/CMP0048-NEW.cmake | 7 +- Tests/RunCMake/project/CMP0096-NEW-stdout.txt | 30 ++++++ Tests/RunCMake/project/CMP0096-NEW.cmake | 6 ++ Tests/RunCMake/project/CMP0096-OLD-stdout.txt | 20 ++++ Tests/RunCMake/project/CMP0096-OLD.cmake | 3 + Tests/RunCMake/project/CMP0096-WARN-stdout.txt | 20 ++++ Tests/RunCMake/project/CMP0096-WARN.cmake | 3 + Tests/RunCMake/project/CMP0096-common.cmake | 9 ++ Tests/RunCMake/project/PrintVersions.cmake | 6 ++ Tests/RunCMake/project/RunCMakeTest.cmake | 4 + 15 files changed, 215 insertions(+), 66 deletions(-) create mode 100644 Help/policy/CMP0096.rst create mode 100644 Help/release/dev/project-version-0.rst create mode 100644 Tests/RunCMake/project/CMP0096-NEW-stdout.txt create mode 100644 Tests/RunCMake/project/CMP0096-NEW.cmake create mode 100644 Tests/RunCMake/project/CMP0096-OLD-stdout.txt create mode 100644 Tests/RunCMake/project/CMP0096-OLD.cmake create mode 100644 Tests/RunCMake/project/CMP0096-WARN-stdout.txt create mode 100644 Tests/RunCMake/project/CMP0096-WARN.cmake create mode 100644 Tests/RunCMake/project/CMP0096-common.cmake create mode 100644 Tests/RunCMake/project/PrintVersions.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 07:53:11 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 07:53:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-340-g74ad28f Message-ID: <20190717115314.A38DB1250A0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 74ad28fa6a05d033eb99db949eb095fc192c34ad (commit) via 0518e675eaa4fa7e539f4e1ec9cd7f3a40b3a0da (commit) from 3143e9ffc5fcb15a9c0c1a7cfaa94587132947d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74ad28fa6a05d033eb99db949eb095fc192c34ad commit 74ad28fa6a05d033eb99db949eb095fc192c34ad Merge: 3143e9f 0518e67 Author: Brad King AuthorDate: Wed Jul 17 11:49:04 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 17 07:49:12 2019 -0400 Merge topic 'cmake-qch-no-version-in-filename' 0518e675ea CMake.qch: Don't include the version in the file name Acked-by: Kitware Robot Merge-request: !3558 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0518e675eaa4fa7e539f4e1ec9cd7f3a40b3a0da commit 0518e675eaa4fa7e539f4e1ec9cd7f3a40b3a0da Author: Craig Scott AuthorDate: Tue Jul 16 23:25:46 2019 +1000 Commit: Craig Scott CommitDate: Wed Jul 17 21:35:12 2019 +1000 CMake.qch: Don't include the version in the file name Fixes: #19374 diff --git a/Help/release/dev/cmake-qch-no-version-in-filename.rst b/Help/release/dev/cmake-qch-no-version-in-filename.rst new file mode 100644 index 0000000..3c5cb04 --- /dev/null +++ b/Help/release/dev/cmake-qch-no-version-in-filename.rst @@ -0,0 +1,8 @@ +cmake-qch-no-version-in-filename +-------------------------------- + +* The Qt Compressed Help file is now named ``CMake.qch``, which no longer + contains the release version in the file name. When CMake is upgraded + in-place, the name and location of this file will remain constant. + Tools such as IDEs, help viewers, etc. should now be able to refer to this + file at a fixed location that remains valid across CMake upgrades. diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index c5b2bfe..e4e6e05 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -105,7 +105,6 @@ if(SPHINX_QTHELP) # Workaround sphinx configurability: # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable COMMAND ${CMAKE_COMMAND} "-DQTHELP_DIR=${CMAKE_CURRENT_BINARY_DIR}/qthelp/" - "-DCMake_VERSION=${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}${CMake_VERSION_PATCH}" -P "${CMAKE_CURRENT_SOURCE_DIR}/fixup_qthelp_names.cmake" # Create proper identifiers. Workaround for @@ -216,7 +215,7 @@ endif() if(SPHINX_QTHELP) CMake_OPTIONAL_COMPONENT(sphinx-qthelp) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake-${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}${CMake_VERSION_PATCH}.qch + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake.qch DESTINATION ${CMAKE_DOC_DIR} ${COMPONENT} ) endif() diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in index 70ba080..e50c4f9 100644 --- a/Utilities/Sphinx/conf.py.in +++ b/Utilities/Sphinx/conf.py.in @@ -82,4 +82,4 @@ html_favicon = '@conf_path@/static/cmake-favicon.ico' # Not supported yet by sphinx: # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable # qthelp_namespace = "org.cmake" -# qthelp_qch_name = "CMake-300.qch" +# qthelp_qch_name = "CMake.qch" diff --git a/Utilities/Sphinx/fixup_qthelp_names.cmake b/Utilities/Sphinx/fixup_qthelp_names.cmake index e35ef25..179e846 100644 --- a/Utilities/Sphinx/fixup_qthelp_names.cmake +++ b/Utilities/Sphinx/fixup_qthelp_names.cmake @@ -10,15 +10,6 @@ string(REPLACE QHCP_CONTENT "${QHCP_CONTENT}" ) -string(REPLACE - "CMake.qch" "CMake-${CMake_VERSION}.qch" - QHCP_CONTENT "${QHCP_CONTENT}" -) -string(REPLACE - "CMake.qch" "CMake-${CMake_VERSION}.qch" - QHCP_CONTENT "${QHCP_CONTENT}" -) - file(WRITE "${QTHELP_DIR}/CMake.qhcp" "${QHCP_CONTENT}") ----------------------------------------------------------------------- Summary of changes: Help/release/dev/cmake-qch-no-version-in-filename.rst | 8 ++++++++ Utilities/Sphinx/CMakeLists.txt | 3 +-- Utilities/Sphinx/conf.py.in | 2 +- Utilities/Sphinx/fixup_qthelp_names.cmake | 9 --------- 4 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 Help/release/dev/cmake-qch-no-version-in-filename.rst hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 09:23:11 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 09:23:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-342-g44a6468 Message-ID: <20190717132311.4C88F10335A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 44a6468304ad7b2e7d7b9e9b43bc04588f0ab918 (commit) via 2fa920c0cd5c186d0991c9636c9af6691ead8dce (commit) from 74ad28fa6a05d033eb99db949eb095fc192c34ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44a6468304ad7b2e7d7b9e9b43bc04588f0ab918 commit 44a6468304ad7b2e7d7b9e9b43bc04588f0ab918 Merge: 74ad28f 2fa920c Author: Brad King AuthorDate: Wed Jul 17 13:15:56 2019 +0000 Commit: Kitware Robot CommitDate: Wed Jul 17 09:16:07 2019 -0400 Merge topic 'aix-exe-implib' 2fa920c0cd AIX: Create import library for executables with exports Acked-by: Kitware Robot Merge-request: !3561 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2fa920c0cd5c186d0991c9636c9af6691ead8dce commit 2fa920c0cd5c186d0991c9636c9af6691ead8dce Author: Brad King AuthorDate: Tue Jul 16 10:32:25 2019 -0400 Commit: Brad King CommitDate: Tue Jul 16 14:15:13 2019 -0400 AIX: Create import library for executables with exports On AIX, plugins meant to be loaded into executables via `dlopen` must be linked with access to a list of symbols exported from the executable in order to use them (when not using runtime linking). The AIX linker supports specifying this list as an "import file" passed on the command line either via the `-bI:...` option or (with a leading `#! .` line) as a normal input file like any other library file. The linker import file plays the same role on AIX as import libraries do on Windows. Teach CMake to enable its import library abstraction on AIX for executables with the `ENABLE_EXPORTS` target property set. Teach our internal `ExportImportList` script to optionally generate a leading `#! .` line at the top of the generated export/import list. Update our rule for linking an executable with exports to generate a public-facing "import library" implemented as an AIX linker import file. With this approach, our existing infrastructure for handling import libraries on Windows will now work for AIX linker import files too: * Plugins that link to their executable's symbols will be automatically linked using the import file on the command line. * The executable's import file will be (optionally) installed and exported for use in linking externally-built plugins. This will allow executables and their plugins to build even if we later turn off runtime linking. Issue: #19163 diff --git a/Help/command/install.rst b/Help/command/install.rst index ab6fef6..5affc5b 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -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- diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 8cd6e68..d8142a2 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -811,6 +811,10 @@ An *archive* output artifact of a buildsystem target may be: executable target created by the :command:`add_executable` command when its :prop_tgt:`ENABLE_EXPORTS` target property is set. +* On AIX: the linker import file (e.g. ``.imp``) of an executable target + created by the :command:`add_executable` command when its + :prop_tgt:`ENABLE_EXPORTS` target property is set. + The :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY` and :prop_tgt:`ARCHIVE_OUTPUT_NAME` target properties may be used to control archive output artifact locations and names in the build tree. diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/prop_tgt/ENABLE_EXPORTS.rst index daef78b..0b1064a 100644 --- a/Help/prop_tgt/ENABLE_EXPORTS.rst +++ b/Help/prop_tgt/ENABLE_EXPORTS.rst @@ -19,6 +19,10 @@ varies by platform: * On macOS, loadable modules link to the executable itself using the ``-bundle_loader`` flag. +* On AIX, a linker "import file" is created along with the executable + to list the exported symbols for import when linking other targets. + Loadable modules link to the import file to get the symbols. + * On other platforms, loadable modules are simply linked without referencing the executable since the dynamic loader will automatically bind symbols when the module is loaded. diff --git a/Help/prop_tgt/IMPORTED_IMPLIB.rst b/Help/prop_tgt/IMPORTED_IMPLIB.rst index 77fb552..c8b6fde 100644 --- a/Help/prop_tgt/IMPORTED_IMPLIB.rst +++ b/Help/prop_tgt/IMPORTED_IMPLIB.rst @@ -3,5 +3,7 @@ IMPORTED_IMPLIB Full path to the import library for an ``IMPORTED`` target. -Set this to the location of the ``.lib`` part of a Windows DLL. Ignored -for non-imported targets. +Set this to the location of the ``.lib`` part of a Windows DLL, or on +AIX set it to an import file created for executables that export symbols +(see the :prop_tgt:`ENABLE_EXPORTS` target property). +Ignored for non-imported targets. diff --git a/Help/release/dev/aix.rst b/Help/release/dev/aix.rst new file mode 100644 index 0000000..c24872e --- /dev/null +++ b/Help/release/dev/aix.rst @@ -0,0 +1,10 @@ +aix +--- + +* On AIX, executables using the :prop_tgt:`ENABLE_EXPORTS` target property + now produce a linker import file with a ``.imp`` extension in addition + to the executable file. Plugins (created via :command:`add_library` with + the ``MODULE`` option) that use :command:`target_link_libraries` to link + to the executable for its symbols are now linked using the import file. + The :command:`install(TARGETS)` command now installs the import file as + an ``ARCHIVE`` artifact. diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index cec71a1..9e981c6 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -34,6 +34,6 @@ macro(__aix_compiler_gnu lang) ) set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " - " -Wl,-bE:/objects.exp -o ") + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o -l . " + " -Wl,-bE: -o ") endmacro() diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 52292bd..3424e2c 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -32,6 +32,6 @@ macro(__aix_compiler_xl lang) ) set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o /objects.exp " - " -Wl,-bE:/objects.exp -o ") + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o -l . " + " -Wl,-bE: -o ") endmacro() diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index 551a995..03cef51 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -1,5 +1,7 @@ set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so +set(CMAKE_AIX_IMPORT_FILE_PREFIX "") +set(CMAKE_AIX_IMPORT_FILE_SUFFIX ".imp") set(CMAKE_DL_LIBS "-lld") # RPATH support on AIX is called libpath. By default the runtime diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList index c17378c..4f67ef5 100755 --- a/Modules/Platform/AIX/ExportImportList +++ b/Modules/Platform/AIX/ExportImportList @@ -5,7 +5,7 @@ # This script is internal to CMake and meant only to be # invoked by CMake-generated build systems on AIX. -usage='usage: ExportImportList -o [--] ...' +usage='usage: ExportImportList -o [-l ] [--] ...' die() { echo "$@" 1>&2; exit 1 @@ -13,8 +13,10 @@ die() { # Process command-line arguments. out='' +lib='' while test "$#" != 0; do case "$1" in + -l) shift; lib="$1" ;; -o) shift; out="$1" ;; --) shift; break ;; -*) die "$usage" ;; @@ -44,5 +46,8 @@ done > "$out_tmp" # Generate the export/import file. { + if test -n "$lib"; then + echo "#! $lib" + fi sort -u "$out_tmp" } > "$out" diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 5a03670..f696f28 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -616,6 +616,15 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // Pass the full path to the target file. std::string lib = tgt->GetFullPath(config, artifact, true); + if (tgt->Target->IsAIX() && cmHasLiteralSuffix(lib, "-NOTFOUND") && + artifact == cmStateEnums::ImportLibraryArtifact) { + // This is an imported executable on AIX that has ENABLE_EXPORTS + // but not IMPORTED_IMPLIB. CMake used to produce and accept such + // imported executables on AIX before we taught it to use linker + // import files. For compatibility, simply skip linking to this + // executable as we did before. It works with runtime linking. + return; + } if (!this->LinkDependsNoShared || tgt->GetType() != cmStateEnums::SHARED_LIBRARY) { this->Depends.push_back(lib); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index a2c0503..d3e8248 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -6363,7 +6363,8 @@ bool cmGeneratorTarget::HasImportLibrary(std::string const& config) const this->IsExecutableWithExports()) && // Assemblies which have only managed code do not have // import libraries. - this->GetManagedType(config) != ManagedType::Managed); + this->GetManagedType(config) != ManagedType::Managed) || + (this->Target->IsAIX() && this->IsExecutableWithExports()); } bool cmGeneratorTarget::NeedImportLibraryName(std::string const& config) const diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 750ed8c..3b0659c 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -637,7 +637,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // On DLL platforms an executable may also have an import // library. Install it to the archive destination if it // exists. - if (target.IsDLLPlatform() && !archiveArgs.GetDestination().empty() && + if ((target.IsDLLPlatform() || target.IsAIX()) && + !archiveArgs.GetDestination().empty() && target.IsExecutableWithExports()) { // The import library uses the ARCHIVE properties. archiveGenerator = CreateInstallTargetGenerator( diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9290d27..b1a0127 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1716,7 +1716,8 @@ const char* cmTarget::GetSuffixVariableInternal( ? "CMAKE_SHARED_LIBRARY_SUFFIX" : "CMAKE_EXECUTABLE_SUFFIX"); case cmStateEnums::ImportLibraryArtifact: - return "CMAKE_IMPORT_LIBRARY_SUFFIX"; + return (impl->IsAIX ? "CMAKE_AIX_IMPORT_FILE_SUFFIX" + : "CMAKE_IMPORT_LIBRARY_SUFFIX"); } break; default: @@ -1756,7 +1757,8 @@ const char* cmTarget::GetPrefixVariableInternal( ? "CMAKE_SHARED_LIBRARY_PREFIX" : ""); case cmStateEnums::ImportLibraryArtifact: - return "CMAKE_IMPORT_LIBRARY_PREFIX"; + return (impl->IsAIX ? "CMAKE_AIX_IMPORT_FILE_PREFIX" + : "CMAKE_IMPORT_LIBRARY_PREFIX"); } break; default: @@ -1892,7 +1894,8 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, // library or an executable with exports. bool allowImp = (this->IsDLLPlatform() && (this->GetType() == cmStateEnums::SHARED_LIBRARY || - this->IsExecutableWithExports())); + this->IsExecutableWithExports())) || + (this->IsAIX() && this->IsExecutableWithExports()); // If a mapping was found, check its configurations. for (std::vector::const_iterator mci = mappedConfigs.begin(); diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index 18b9347..3b0ec6e 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -979,6 +979,11 @@ def gen_check_targets(c, g, inSource): "_dllExtra": False, }, { + "path": "^lib/my_interface_exe\\.imp$", + "_aixExtra": True, + "_dllExtra": False, + }, + { "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$", "_dllExtra": True, }, @@ -4895,6 +4900,10 @@ def gen_check_targets(c, g, inSource): for e in expected: e["artifacts"] = filter_list(lambda a: not a["_dllExtra"], e["artifacts"]) + if "aix" not in sys.platform: + for e in expected: + e["artifacts"] = filter_list(lambda a: not a.get("_aixExtra", False), e["artifacts"]) + return expected def check_targets(c, g, inSource): diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake index 34e500a..f52776e 100644 --- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake +++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake @@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_PREFIX static2_import_prefix) string (APPEND GENERATE_CONTENT "\ncheck_value (\"TARGET_FILE_PREFIX executable custom\" \"$\" \"exec2_prefix\") -check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$\" \"$,${win_platforms}>,exec2_import_prefix,exec2_prefix>\") +check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$\" \"$,${win_platforms};AIX>,exec2_import_prefix,exec2_prefix>\") check_value (\"TARGET_FILE_PREFIX shared custom\" \"$\" \"shared2_prefix\") check_value (\"TARGET_LINKER_FILE_PREFIX shared linker custom\" \"$\" \"$,${win_platforms}>,shared2_import_prefix,shared2_prefix>\") check_value (\"TARGET_FILE_PREFIX static custom\" \"$\" \"static2_prefix\") diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake index 6bb1e44..bef7bbf 100644 --- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake +++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake @@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_PREFIX static2_import_prefix) string (APPEND GENERATE_CONTENT "\ncheck_value (\"TARGET_FILE_PREFIX executable custom\" \"$\" \"exec2_prefix\") -check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$\" \"$,${win_platforms}>,exec2_import_prefix,exec2_prefix>\") +check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$\" \"$,${win_platforms};AIX>,exec2_import_prefix,exec2_prefix>\") check_value (\"TARGET_FILE_PREFIX shared custom\" \"$\" \"shared2_prefix\") check_value (\"TARGET_LINKER_FILE_PREFIX shared linker custom\" \"$\" \"$,${win_platforms}>,shared2_import_prefix,shared2_prefix>\") check_value (\"TARGET_FILE_PREFIX static custom\" \"$\" \"static2_prefix\") diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake index e1b7654..cefeb86 100644 --- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake +++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake @@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_SUFFIX static2_import_suffix) string (APPEND GENERATE_CONTENT "\ncheck_value (\"TARGET_FILE_SUFFIX executable custom\" \"$\" \"exec2_suffix\") -check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$\" \"$,${win_platforms}>,exec2_import_suffix,exec2_suffix>\") +check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$\" \"$,${win_platforms};AIX>,exec2_import_suffix,exec2_suffix>\") check_value (\"TARGET_FILE_SUFFIX shared custom\" \"$\" \"shared2_suffix\") check_value (\"TARGET_LINKER_FILE_SUFFIX shared linker custom\" \"$\" \"$,${win_platforms}>,shared2_import_suffix,shared2_suffix>\") check_value (\"TARGET_FILE_SUFFIX static custom\" \"$\" \"static2_suffix\") diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake index 78afecd..39e39fd 100644 --- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake +++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake @@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_SUFFIX static2_import_suffix) string (APPEND GENERATE_CONTENT "\ncheck_value (\"TARGET_FILE_SUFFIX executable custom\" \"$\" \"exec2_suffix\") -check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$\" \"$,${win_platforms}>,exec2_import_suffix,exec2_suffix>\") +check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$\" \"$,${win_platforms};AIX>,exec2_import_suffix,exec2_suffix>\") check_value (\"TARGET_FILE_SUFFIX shared custom\" \"$\" \"shared2_suffix\") check_value (\"TARGET_LINKER_FILE_SUFFIX shared linker custom\" \"$\" \"$,${win_platforms}>,shared2_import_suffix,shared2_suffix>\") check_value (\"TARGET_FILE_SUFFIX static custom\" \"$\" \"static2_suffix\") ----------------------------------------------------------------------- Summary of changes: Help/command/install.rst | 2 ++ Help/manual/cmake-buildsystem.7.rst | 4 ++++ Help/prop_tgt/ENABLE_EXPORTS.rst | 4 ++++ Help/prop_tgt/IMPORTED_IMPLIB.rst | 6 ++++-- Help/release/dev/aix.rst | 10 ++++++++++ Modules/Platform/AIX-GNU.cmake | 4 ++-- Modules/Platform/AIX-XL.cmake | 4 ++-- Modules/Platform/AIX.cmake | 2 ++ Modules/Platform/AIX/ExportImportList | 7 ++++++- Source/cmComputeLinkInformation.cxx | 9 +++++++++ Source/cmGeneratorTarget.cxx | 3 ++- Source/cmInstallCommand.cxx | 3 ++- Source/cmTarget.cxx | 9 ++++++--- Tests/RunCMake/FileAPI/codemodel-v2-check.py | 9 +++++++++ .../TARGET_FILE_PREFIX-imported-target.cmake | 2 +- Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake | 2 +- .../TARGET_FILE_SUFFIX-imported-target.cmake | 2 +- Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake | 2 +- 18 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 Help/release/dev/aix.rst hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 10:13:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 10:13:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-rc4-344-g744dd2c Message-ID: <20190717141308.DF22010929B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 744dd2cccb003628e6153d4bd9d9cf64bca56247 (commit) via 79bcf4e1655ffa38e8f4740b19ec3a14ac567eec (commit) from 44a6468304ad7b2e7d7b9e9b43bc04588f0ab918 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=744dd2cccb003628e6153d4bd9d9cf64bca56247 commit 744dd2cccb003628e6153d4bd9d9cf64bca56247 Merge: 44a6468 79bcf4e Author: Brad King AuthorDate: Wed Jul 17 10:06:59 2019 -0400 Commit: Brad King CommitDate: Wed Jul 17 10:06:59 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 10:13:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 10:13:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-rc4-10-g79bcf4e Message-ID: <20190717141309.0228310ECA6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 79bcf4e1655ffa38e8f4740b19ec3a14ac567eec (commit) from 185e6a12884433caa65e55a44431bd76f52a9f48 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jul 17 10:33:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 17 Jul 2019 10:33:04 -0400 (EDT) Subject: [Cmake-commits] CMake annotated tag, v3.15.0, created. v3.15.0 Message-ID: <20190717143304.79FE9107C9D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The annotated tag, v3.15.0 has been created at 9de1ffdb57477b22ccf0ee6e1b79617ba8198fc2 (tag) tagging 79bcf4e1655ffa38e8f4740b19ec3a14ac567eec (commit) replaces v3.15.0-rc4 tagged by Brad King on Wed Jul 17 10:06:49 2019 -0400 - Log ----------------------------------------------------------------- CMake 3.15.0 -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEExsJlMku+vcNQtRPQLSzvEDSSFoQFAl0vK3kWHGJyYWQua2lu Z0BraXR3YXJlLmNvbQAKCRAtLO8QNJIWhNeHEACI39ErQhDrCt1by8tXv/Zpl/tp E9ebBsqH8yxjfm5bG7Hxo8UPqIxCfnLRY4F5l9Ij+i8COK5AvtPeB3IbY11ymRPC KpBywe1XV2t1RSsg1mFj15rBorN/upd5AiEgjZJEi5khcXDKCBleL17+Z42eYwa8 qM3BUdxosSgW2I0FZEishJ55Jnr814HmwL9ZRLmMWAfwKdVzaL4WTIYzouYIyqev X61VRuKUR+ZiYosn9EGmFIHZfr4UwklpRU8FAlh5Ie1vKGasJCPkI6h8UOHwl+g3 mxucMuIm85GEV57m5w/+331KWbYnK3ycxu/pv3TyGSmc1Yf+nalgh6waOhXC7Np1 /UF26lsBjpJxycIkavBKOQEkq5o03qEnWfGINh8/Un5cJXQW+TTKDuszyCTGwXbN d1BE+w4VyWHXAJE+0yp8TlYiL7pTP8pqb2PZ3UEDVDjhQ+L8leZB6tiFAnX2TOgd dmHAf1SM1WmooBM1YXZ12XTWCOl172e/PrtPpBOQtI1Eo8cLzTYVTipERTsZFCMC wnbUvysTuGKzeKH5FWyD0S+9ICL0JLeNEYVtS29FWHBcB5hzUGrABcbzhUODVi98 iEQFLynKkN3O4fTDvkULnwRqlGSWYiw//NplLSGCqsaRLMrvdC4Hn0V5aJtuUD9J OSBE0XQNAwMFztIMGQ== =DIa6 -----END PGP SIGNATURE----- Brad King (6): Merge branch 'fortran-submodule-cray' into release-3.15 VS: Fix SBCS support for object libraries Merge branch 'object-library-sbcs' into release-3.15 Merge branch 'FindBISON-CMP0088-SourcePath' into release-3.15 Merge branch 'find_package-fix-NO_MODULE' into release-3.15 CMake 3.15.0 Brian Carlson (1): FindBISON: Fix CMP0088 NEW behavior for non-absolute input paths Cristian Adam (1): find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIG Willem Deconinck (2): Fortran: Support compilers using no module prefix on submodule files Fortran: Add support for submodules on Cray ----------------------------------------------------------------------- hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 18 00:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 18 Jul 2019 00:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-335-g94b883d Message-ID: <20190718040305.E6149112160@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 94b883d9d32cd42c70fa24a90c05116bfc814645 (commit) from 744dd2cccb003628e6153d4bd9d9cf64bca56247 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94b883d9d32cd42c70fa24a90c05116bfc814645 commit 94b883d9d32cd42c70fa24a90c05116bfc814645 Author: Kitware Robot AuthorDate: Thu Jul 18 00:01:08 2019 -0400 Commit: Kitware Robot CommitDate: Thu Jul 18 00:01:08 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9c00c80..a9ce61a 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 15) -set(CMake_VERSION_PATCH 20190717) +set(CMake_VERSION_PATCH 20190718) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 18 07:13:12 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 18 Jul 2019 07:13:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-337-g52fa25e Message-ID: <20190718111312.C6D6D11E1FB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 52fa25e28f66f043cc7c30717d9298b9a6b8cfa3 (commit) via 3fb3157dae5427b6c86949ec1603986c57602658 (commit) from 94b883d9d32cd42c70fa24a90c05116bfc814645 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52fa25e28f66f043cc7c30717d9298b9a6b8cfa3 commit 52fa25e28f66f043cc7c30717d9298b9a6b8cfa3 Merge: 94b883d 3fb3157 Author: Brad King AuthorDate: Thu Jul 18 11:07:59 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 18 07:08:08 2019 -0400 Merge topic 'aix-no-rtl' 3fb3157dae AIX: Do not enable runtime linking by default anymore Acked-by: Kitware Robot Merge-request: !3566 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3fb3157dae5427b6c86949ec1603986c57602658 commit 3fb3157dae5427b6c86949ec1603986c57602658 Author: Brad King AuthorDate: Wed Jul 17 09:20:31 2019 -0400 Commit: Brad King CommitDate: Wed Jul 17 14:21:37 2019 -0400 AIX: Do not enable runtime linking by default anymore We've long created shared objects on AIX using the linker's `-G` option (also offered by the XL front-end). The `-G` option implies `-brtl` and enables runtime linking. This has been largely unnecessary because we provide all dependencies on the link line and both XL and GNU compilers offer builtin behavior to export symbols. Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports for both XL and GNU, 2019-07-11) we compute exports explicitly and consistently. Therefore runtime linking is no longer necessary for shared objects. We've also long created executables on AIX using the linker's `-brtl` option to enable runtime linking in case they load plugins at runtime. Since commit 9f5c2040bf (AIX: Explicitly compute executable exports for both XL and GNU, 2019-07-12) and commit 2fa920c0cd (AIX: Create import library for executables with exports, 2019-07-16) we now provide the linker enough information to fully resolve symbols in plugins up front. Therefore runtime linking is no longer necessary for executables. Drop use of `-G` for creating shared objects and use the XL `-qmkshrobj` and GCC `-shared` options instead. Both invoke the linker with the `-bM:SRE -bnoentry` options to create a shared object without runtime linking enabled. Also drop use of `-brtl` for creating executables. Issue: #19163 diff --git a/Help/release/dev/aix.rst b/Help/release/dev/aix.rst index c24872e..6919358 100644 --- a/Help/release/dev/aix.rst +++ b/Help/release/dev/aix.rst @@ -8,3 +8,13 @@ aix to the executable for its symbols are now linked using the import file. The :command:`install(TARGETS)` command now installs the import file as an ``ARCHIVE`` artifact. + +* On AIX, runtime linking is no longer enabled by default. CMake provides + the linker enough information to resolve all symbols up front. + One may manually enable runtime linking for shared libraries and/or + loadable modules by adding ``-Wl,-G`` to their link flags + (e.g. in the :variable:`CMAKE_SHARED_LINKER_FLAGS` or + :variable:`CMAKE_MODULE_LINKER_FLAGS` variable). + One may manually enable runtime linking for executables by adding + ``-Wl,-brtl`` to their link flags (e.g. in the + :variable:`CMAKE_EXE_LINKER_FLAGS` variable). diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 9e981c6..61d213a 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -8,16 +8,10 @@ if(__AIX_COMPILER_GNU) endif() set(__AIX_COMPILER_GNU 1) -# -# By default, runtime linking is enabled. All shared objects specified on the command line -# will be listed, even if there are no symbols referenced, in the output file. -string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl") - - macro(__aix_compiler_gnu lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") - string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-G,-bnoipath") + string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-bnoipath") set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1) diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 3424e2c..64b0bc1 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -8,16 +8,10 @@ if(__AIX_COMPILER_XL) endif() set(__AIX_COMPILER_XL 1) -# -# By default, runtime linking is enabled. All shared objects specified on the command line -# will be listed, even if there are no symbols referenced, in the output file. -string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl") - - macro(__aix_compiler_xl lang) set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") - set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-bnoipath") # -shared + string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-bnoipath") set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ") set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ") ----------------------------------------------------------------------- Summary of changes: Help/release/dev/aix.rst | 10 ++++++++++ Modules/Platform/AIX-GNU.cmake | 8 +------- Modules/Platform/AIX-XL.cmake | 8 +------- 3 files changed, 12 insertions(+), 14 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 18 07:23:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 18 Jul 2019 07:23:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-339-gae84427 Message-ID: <20190718112304.7946E11EF75@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ae84427e3260342aa74aecaad28a27f11fafe569 (commit) via 696d0f9caf30f7c9f0295ee4bdd696a815eeccdd (commit) from 52fa25e28f66f043cc7c30717d9298b9a6b8cfa3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae84427e3260342aa74aecaad28a27f11fafe569 commit ae84427e3260342aa74aecaad28a27f11fafe569 Merge: 52fa25e 696d0f9 Author: Brad King AuthorDate: Thu Jul 18 11:15:39 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 18 07:15:48 2019 -0400 Merge topic 'FindPython-interpreter-crosscompiling' 696d0f9caf FindPython: ensure interpreter is founded when cross-compiling Acked-by: Kitware Robot Merge-request: !3564 diff --cc Modules/FindPython/Support.cmake index c0e843a,590c7af..8faec03 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@@ -793,9 -641,9 +793,9 @@@ if ("Interpreter" IN_LIST ${_PYTHON_PRE # For example, typical systems have 'python' for version 2.* and 'python3' # for version 3.*. So looking for names per dir will find, potentially, # systematically 'python' (i.e. version 2) even if version 3 is searched. - if (WIN32) + if (CMAKE_HOST_WIN32) find_program (${_PYTHON_PREFIX}_EXECUTABLE - NAMES python${_${_PYTHON_PREFIX}_VERSION} + NAMES ${_${_PYTHON_PREFIX}_NAMES} python ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}) else() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=696d0f9caf30f7c9f0295ee4bdd696a815eeccdd commit 696d0f9caf30f7c9f0295ee4bdd696a815eeccdd Author: Marc Chevrier AuthorDate: Wed Jul 17 18:25:21 2019 +0200 Commit: Brad King CommitDate: Thu Jul 18 07:13:20 2019 -0400 FindPython: ensure interpreter is founded when cross-compiling Fixes: #19473 diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake index 49d8e26..590c7af 100644 --- a/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake @@ -54,7 +54,7 @@ endmacro() macro (_PYTHON_FIND_FRAMEWORKS) set (${_PYTHON_PREFIX}_FRAMEWORKS) - if (APPLE) + if (CMAKE_HOST_APPLE OR APPLE) set (_pff_frameworks ${CMAKE_FRAMEWORK_PATH} $ENV{CMAKE_FRAMEWORK_PATH} ~/Library/Frameworks @@ -483,7 +483,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() # Apple frameworks handling - if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST") + if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} NAMES_PER_DIR @@ -500,7 +500,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() endif() # Windows registry - if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST") + if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} @@ -529,7 +529,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() # Apple frameworks handling - if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST") + if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} NAMES_PER_DIR @@ -542,7 +542,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() endif() # Windows registry - if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST") + if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} @@ -591,7 +591,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() # Apple frameworks handling - if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST") + if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} NAMES_PER_DIR @@ -605,7 +605,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() # Windows registry - if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST") + if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "FIRST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} @@ -641,7 +641,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) # For example, typical systems have 'python' for version 2.* and 'python3' # for version 3.*. So looking for names per dir will find, potentially, # systematically 'python' (i.e. version 2) even if version 3 is searched. - if (WIN32) + if (CMAKE_HOST_WIN32) find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES python${_${_PYTHON_PREFIX}_VERSION} python @@ -656,7 +656,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() # Apple frameworks handling - if (APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST") + if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "LAST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} NAMES_PER_DIR @@ -666,7 +666,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS) endif() # Windows registry - if (WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST") + if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST") find_program (${_PYTHON_PREFIX}_EXECUTABLE NAMES ${_${_PYTHON_PREFIX}_NAMES} ${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES} @@ -984,7 +984,6 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS else() list (REMOVE_ITEM CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) endif() - else() endif() # if python interpreter is found, use its location and version to ensure consistency ----------------------------------------------------------------------- Summary of changes: Modules/FindPython/Support.cmake | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 18 07:53:12 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 18 Jul 2019 07:53:12 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-2-gc790324 Message-ID: <20190718115312.95B70125AA1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via c79032438c5f90ca957b1a02886e60835d5d6e47 (commit) via 696d0f9caf30f7c9f0295ee4bdd696a815eeccdd (commit) from 79bcf4e1655ffa38e8f4740b19ec3a14ac567eec (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/FindPython/Support.cmake | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 18 07:53:11 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 18 Jul 2019 07:53:11 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-348-gd59716d Message-ID: <20190718115312.27B11125AF8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d59716d907dc6f5d28ee28829763cf1906505721 (commit) via f19c189e74a685c9f2fa5ffdca159e75f6f5be5c (commit) via 0a3dd07fb6b26694c46c5a23cf19d7f4641d91d3 (commit) via c79032438c5f90ca957b1a02886e60835d5d6e47 (commit) via 5803a8a2f7e0894810e9bd2e8c433dce7346cf76 (commit) via 47e28cbe1faf7b70bda0d7d88db1d146d69a0123 (commit) via 6814567e8c1c73c09e98ebcd1296e4fda717f0a4 (commit) via c8741e8ff5ed93467812378413f1b3338c0ee6b2 (commit) via be0d4042082db4dcd263dd181570b6f406202ed9 (commit) from ae84427e3260342aa74aecaad28a27f11fafe569 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d59716d907dc6f5d28ee28829763cf1906505721 commit d59716d907dc6f5d28ee28829763cf1906505721 Merge: 0a3dd07 f19c189 Author: Brad King AuthorDate: Thu Jul 18 11:50:33 2019 +0000 Commit: Kitware Robot CommitDate: Thu Jul 18 07:50:40 2019 -0400 Merge topic 'swift-improvements' f19c189e74 Merge branch 'backport-swift-improvements' into swift-improvements 5803a8a2f7 Swift: support SONAME on ELFish targets 47e28cbe1f Swift: support multithreaded compilation 6814567e8c Swift: add rules for static linking c8741e8ff5 Swift: Add library search paths for dependencies be0d404208 Support per-language library link flags Acked-by: Kitware Robot Merge-request: !3568 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f19c189e74a685c9f2fa5ffdca159e75f6f5be5c commit f19c189e74a685c9f2fa5ffdca159e75f6f5be5c Merge: 0a3dd07 5803a8a Author: Brad King AuthorDate: Thu Jul 18 07:46:42 2019 -0400 Commit: Brad King CommitDate: Thu Jul 18 07:46:42 2019 -0400 Merge branch 'backport-swift-improvements' into swift-improvements https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a3dd07fb6b26694c46c5a23cf19d7f4641d91d3 commit 0a3dd07fb6b26694c46c5a23cf19d7f4641d91d3 Merge: ae84427 c790324 Author: Brad King AuthorDate: Thu Jul 18 07:43:40 2019 -0400 Commit: Brad King CommitDate: Thu Jul 18 07:43:40 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5803a8a2f7e0894810e9bd2e8c433dce7346cf76 commit 5803a8a2f7e0894810e9bd2e8c433dce7346cf76 Author: Saleem Abdulrasool AuthorDate: Thu Jul 11 11:12:26 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Wed Jul 17 20:46:25 2019 -0700 Swift: support SONAME on ELFish targets We should enable the soname to be setup for ELF shared libraries. Failure to do so generates binaries with incorrect names which prevents loading. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 0f84cce..f6510b9 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -18,6 +18,9 @@ if(CMAKE_Swift_COMPILER_ID) endif() set(CMAKE_INCLUDE_FLAG_Swift "-I ") +if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ") +endif() set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") set(CMAKE_Swift_COMPILER_ARG1 -frontend) @@ -55,9 +58,9 @@ endif() if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") endif() endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47e28cbe1faf7b70bda0d7d88db1d146d69a0123 commit 47e28cbe1faf7b70bda0d7d88db1d146d69a0123 Author: Saleem Abdulrasool AuthorDate: Sun Jun 30 20:50:08 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Wed Jul 17 20:46:08 2019 -0700 Swift: support multithreaded compilation Query the number of logical CPUs available to enable parallel compilation for Swift. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 75ddd5d..e3c2f9f 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -98,6 +98,7 @@ Variables that Provide Information /variable/CMAKE_STATIC_LIBRARY_PREFIX /variable/CMAKE_STATIC_LIBRARY_SUFFIX /variable/CMAKE_Swift_MODULE_DIRECTORY + /variable/CMAKE_Swift_NUM_THREADS /variable/CMAKE_TOOLCHAIN_FILE /variable/CMAKE_TWEAK_VERSION /variable/CMAKE_VERBOSE_MAKEFILE diff --git a/Help/variable/CMAKE_Swift_NUM_THREADS.rst b/Help/variable/CMAKE_Swift_NUM_THREADS.rst new file mode 100644 index 0000000..cb33678 --- /dev/null +++ b/Help/variable/CMAKE_Swift_NUM_THREADS.rst @@ -0,0 +1,8 @@ +CMAKE_Swift_NUM_THREADS +----------------------- + +Number of threads for parallel compilation for Swift targets. + +This variable controls the number of parallel jobs that the swift driver creates +for building targets. If not specified, it will default to the number of +logical CPUs on the host. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index f62f61b..0f84cce 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -49,11 +49,15 @@ if(NOT CMAKE_Swift_COMPILE_OBJECT) set(CMAKE_Swift_COMPILE_OBJECT ":") endif() +if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$") + cmake_host_system_information(RESULT CMAKE_Swift_NUM_THREADS QUERY NUMBER_OF_LOGICAL_CORES) +endif() + if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") endif() endif() @@ -63,17 +67,17 @@ endif() if(NOT CMAKE_Swift_LINK_EXECUTABLE) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") endif() endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") else() - set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") endif() set(CMAKE_Swift_ARCHIVE_CREATE " crs ") https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6814567e8c1c73c09e98ebcd1296e4fda717f0a4 commit 6814567e8c1c73c09e98ebcd1296e4fda717f0a4 Author: Saleem Abdulrasool AuthorDate: Thu Jun 27 21:28:48 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Wed Jul 17 20:45:54 2019 -0700 Swift: add rules for static linking The Swift driver recently learnt how to generate static libraries using the `-static` flag. This enables us to generate proper static libraries with dependency tracking with Swift as well. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 6f99c1f..f62f61b 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -70,6 +70,12 @@ if(NOT CMAKE_Swift_LINK_EXECUTABLE) endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) + if(CMAKE_Swift_COMPILER_TARGET) + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + else() + set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") + endif() + set(CMAKE_Swift_ARCHIVE_CREATE " crs ") set(CMAKE_Swift_ARCHIVE_FINISH "") endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8741e8ff5ed93467812378413f1b3338c0ee6b2 commit c8741e8ff5ed93467812378413f1b3338c0ee6b2 Author: Saleem Abdulrasool AuthorDate: Sun Jun 9 12:51:00 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Wed Jul 17 20:45:19 2019 -0700 Swift: Add library search paths for dependencies When building Swift executables and libraries which import a module, an implicit link will be added by the driver. Because this links by name rather than path, the library search path needs to be provided to indicate where to find the library. For all local dependencies, add the library paths for the targets when linking. This ensures that you can link against local libraries without explicitly setting a library path. Fixes: #19304 diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index 2a8bee6..469faca 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -99,14 +99,34 @@ std::string cmLinkLineComputer::ComputeLinkPath( std::string const& libPathTerminator) { std::string linkPath; - std::vector const& libDirs = cli.GetDirectories(); - for (std::string const& libDir : libDirs) { - std::string libpath = this->ConvertToOutputForExisting(libDir); - linkPath += " " + libPathFlag; - linkPath += libpath; - linkPath += libPathTerminator; - linkPath += " "; + + if (cli.GetLinkLanguage() == "Swift") { + for (const cmComputeLinkInformation::Item& item : cli.GetItems()) { + const cmGeneratorTarget* target = item.Target; + if (!target) { + continue; + } + + if (target->GetType() == cmStateEnums::STATIC_LIBRARY || + target->GetType() == cmStateEnums::SHARED_LIBRARY) { + cmStateEnums::ArtifactType type = cmStateEnums::RuntimeBinaryArtifact; + if (target->GetType() == cmStateEnums::SHARED_LIBRARY && + target->IsDLLPlatform()) { + type = cmStateEnums::ImportLibraryArtifact; + } + + linkPath += " " + libPathFlag + + item.Target->GetDirectory(cli.GetConfig(), type) + + libPathTerminator + " "; + } + } } + + for (std::string const& libDir : cli.GetDirectories()) { + linkPath += " " + libPathFlag + this->ConvertToOutputForExisting(libDir) + + libPathTerminator + " "; + } + return linkPath; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be0d4042082db4dcd263dd181570b6f406202ed9 commit be0d4042082db4dcd263dd181570b6f406202ed9 Author: Saleem Abdulrasool AuthorDate: Wed Jun 5 22:01:16 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Wed Jul 17 20:44:58 2019 -0700 Support per-language library link flags This changes the behaviour of the generators to use a per-language library search path flag. This is needed for multi-language projects with different compilers (e.g. cl + gfortran). Since the adjusted variable has been part of the user settings, we control this based on a policy. Fixes: #19307 diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 21f18d4..6f99c1f 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -23,6 +23,8 @@ set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") set(CMAKE_Swift_COMPILER_ARG1 -frontend) set(CMAKE_Swift_DEFINE_FLAG -D) set(CMAKE_Swift_FRAMEWORK_SEARCH_FLAG "-F ") +set(CMAKE_Swift_LIBRARY_PATH_FLAG "-L ") +set(CMAKE_Swift_LIBRARY_PATH_TERMINATOR "") set(CMAKE_Swift_LINKER_WRAPPER_FLAG "-Xlinker" " ") set(CMAKE_Swift_RESPONSE_FILE_LINK_FLAG @) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index fe5c8af..3abf2dd 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1444,10 +1444,23 @@ void cmLocalGenerator::OutputLinkLibraries( std::string linkLanguage = cli.GetLinkLanguage(); - const std::string& libPathFlag = - this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG"); - const std::string& libPathTerminator = - this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); + std::string libPathFlag; + if (const char* value = this->Makefile->GetDefinition( + "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_FLAG")) { + libPathFlag = value; + } else { + libPathFlag = + this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG"); + } + + std::string libPathTerminator; + if (const char* value = this->Makefile->GetDefinition( + "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_TERMINATOR")) { + libPathTerminator = value; + } else { + libPathTerminator = + this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); + } // Add standard libraries for this language. std::string standardLibsVar = "CMAKE_"; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 18 08:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 18 Jul 2019 08:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-350-ge3bd5c5 Message-ID: <20190718120306.EB258517D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e3bd5c5b666e515319d81f8218e2f71c11169304 (commit) via 1a2d260634807682a94aee140e77d52168f10ba6 (commit) from d59716d907dc6f5d28ee28829763cf1906505721 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3bd5c5b666e515319d81f8218e2f71c11169304 commit e3bd5c5b666e515319d81f8218e2f71c11169304 Merge: d59716d 1a2d260 Author: Brad King AuthorDate: Thu Jul 18 07:53:06 2019 -0400 Commit: Brad King CommitDate: Thu Jul 18 07:53:06 2019 -0400 Merge branch 'release-3.15' ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jul 18 08:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 18 Jul 2019 08:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-8-g1a2d260 Message-ID: <20190718120307.E3DA48C61A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 1a2d260634807682a94aee140e77d52168f10ba6 (commit) via 5803a8a2f7e0894810e9bd2e8c433dce7346cf76 (commit) via 47e28cbe1faf7b70bda0d7d88db1d146d69a0123 (commit) via 6814567e8c1c73c09e98ebcd1296e4fda717f0a4 (commit) via c8741e8ff5ed93467812378413f1b3338c0ee6b2 (commit) via be0d4042082db4dcd263dd181570b6f406202ed9 (commit) from c79032438c5f90ca957b1a02886e60835d5d6e47 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-variables.7.rst | 1 + Help/variable/CMAKE_Swift_NUM_THREADS.rst | 8 ++++++++ Modules/CMakeSwiftInformation.cmake | 23 +++++++++++++++++---- Source/cmLinkLineComputer.cxx | 34 ++++++++++++++++++++++++------- Source/cmLocalGenerator.cxx | 21 +++++++++++++++---- 5 files changed, 72 insertions(+), 15 deletions(-) create mode 100644 Help/variable/CMAKE_Swift_NUM_THREADS.rst hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 19 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 19 Jul 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-351-gac000e2 Message-ID: <20190719040306.18BE010EFEB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ac000e29da89eec74fc106fc41c48a098f8ff971 (commit) from e3bd5c5b666e515319d81f8218e2f71c11169304 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac000e29da89eec74fc106fc41c48a098f8ff971 commit ac000e29da89eec74fc106fc41c48a098f8ff971 Author: Kitware Robot AuthorDate: Fri Jul 19 00:01:07 2019 -0400 Commit: Kitware Robot CommitDate: Fri Jul 19 00:01:07 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a9ce61a..cf21839 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 15) -set(CMake_VERSION_PATCH 20190718) +set(CMake_VERSION_PATCH 20190719) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 19 10:13:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 19 Jul 2019 10:13:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-353-g1bdb5a3 Message-ID: <20190719141306.268E514992@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1bdb5a3b5113a075393a0760888604684c43c64b (commit) via 6cc4ca31d5707d63c3cb4cb70ff4c6ea2058ec31 (commit) from ac000e29da89eec74fc106fc41c48a098f8ff971 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1bdb5a3b5113a075393a0760888604684c43c64b commit 1bdb5a3b5113a075393a0760888604684c43c64b Merge: ac000e2 6cc4ca3 Author: Kyle Edwards AuthorDate: Fri Jul 19 14:05:05 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 10:05:15 2019 -0400 Merge topic 'findvulcan-doc-fix' 6cc4ca31d5 Fix repeated word in FindVulkan.cmake Acked-by: Kitware Robot Merge-request: !3575 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6cc4ca31d5707d63c3cb4cb70ff4c6ea2058ec31 commit 6cc4ca31d5707d63c3cb4cb70ff4c6ea2058ec31 Author: NeroBurner AuthorDate: Thu Jul 18 17:25:04 2019 -0400 Commit: NeroBurner CommitDate: Thu Jul 18 17:25:04 2019 -0400 Fix repeated word in FindVulkan.cmake diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index ae8d72d..55da55f 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -5,7 +5,7 @@ FindVulkan ---------- -Find Vulkan, which isis a low-overhead, cross-platform 3D graphics +Find Vulkan, which is a low-overhead, cross-platform 3D graphics and computing API. IMPORTED Targets ----------------------------------------------------------------------- Summary of changes: Modules/FindVulkan.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 19 12:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 19 Jul 2019 12:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-367-gca7ec2e Message-ID: <20190719160306.8E73DFD032@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ca7ec2e188a6f66546a0f5dc9e76a6f24c22bfa6 (commit) via da79075c4de45095d8f9eca5d2cc76711b79341e (commit) via f79e684678fb481c91586bd015d03bfb9e1a019b (commit) via a2daa3ef2706bf3d0436d5d6ef91d263cd98bf6c (commit) via 37b998dd3e8f2b64baaa1cd714b6a7878d3d72c3 (commit) via dcdeade5ee2c1410563fc1bd422ea3a3acc2febc (commit) via 6618cbf38aa8298a5881669d8b095a4110f102f6 (commit) via 8d2299975393bb341d7afe8bdd200b8dbe3010e3 (commit) via 282d9f31685906cd45b27961ea013edab8bacd6b (commit) via d96bc3cf048756695a651a8561b763cfc5cead86 (commit) via c1fc6c80c777172139e67753530f610d642a4656 (commit) via 3bed969dace917e5bf551c6783da425f5e2217c7 (commit) via faacb90a13f87d32aaf3e5c45cfd48af7e84b733 (commit) via 8738e2584a111de065341296dcfa1f4ac9c68346 (commit) from 1bdb5a3b5113a075393a0760888604684c43c64b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca7ec2e188a6f66546a0f5dc9e76a6f24c22bfa6 commit ca7ec2e188a6f66546a0f5dc9e76a6f24c22bfa6 Merge: f79e684 da79075 Author: Brad King AuthorDate: Fri Jul 19 16:02:44 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 12:02:53 2019 -0400 Merge topic 'ctest-done-hash' da79075c4d CTest: Generate Done.xml before calculating its hash Acked-by: Kitware Robot Merge-request: !3563 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da79075c4de45095d8f9eca5d2cc76711b79341e commit da79075c4de45095d8f9eca5d2cc76711b79341e Author: Betsy McPhail AuthorDate: Wed Jul 17 10:02:02 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 12:00:30 2019 -0400 CTest: Generate Done.xml before calculating its hash Fixes: #19489 diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 1fa7988..54c4bae 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -266,15 +266,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( } } - upload_as += "&MD5="; - - if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) { - upload_as += "bad_md5sum"; - } else { - upload_as += - cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5); - } - // Generate Done.xml right before it is submitted. // The reason for this is two-fold: // 1) It must be generated after some other part has been submitted @@ -286,6 +277,15 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( this->CTest->GenerateDoneFile(); } + upload_as += "&MD5="; + + if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) { + upload_as += "bad_md5sum"; + } else { + upload_as += + cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5); + } + if (!cmSystemTools::FileExists(local_file)) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " << local_file << std::endl); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f79e684678fb481c91586bd015d03bfb9e1a019b commit f79e684678fb481c91586bd015d03bfb9e1a019b Merge: a2daa3e 8738e25 Author: Brad King AuthorDate: Fri Jul 19 15:59:05 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 12:00:12 2019 -0400 Merge topic 'QCC-ninja-support' 8738e2584a cmGlobalNinjaGenerator: Use gnu compatible paths with QCC Acked-by: Kitware Robot Merge-request: !3567 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2daa3ef2706bf3d0436d5d6ef91d263cd98bf6c commit a2daa3ef2706bf3d0436d5d6ef91d263cd98bf6c Merge: 37b998d 3bed969 Author: Brad King AuthorDate: Fri Jul 19 15:58:51 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 11:59:04 2019 -0400 Merge topic 'modernize_std_unique_ptr' 3bed969dac cmMakefile: Modernize AddFunctionBlocker method to accept a std::unique_ptr faacb90a13 cmELF: Modernize to use std::unique_ptr instead of new/delete Acked-by: Kitware Robot Merge-request: !3548 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37b998dd3e8f2b64baaa1cd714b6a7878d3d72c3 commit 37b998dd3e8f2b64baaa1cd714b6a7878d3d72c3 Merge: dcdeade 8d22999 Author: Brad King AuthorDate: Fri Jul 19 11:57:30 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 11:57:30 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dcdeade5ee2c1410563fc1bd422ea3a3acc2febc commit dcdeade5ee2c1410563fc1bd422ea3a3acc2febc Merge: 6618cbf 282d9f3 Author: Brad King AuthorDate: Fri Jul 19 15:55:51 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 11:57:10 2019 -0400 Merge topic 'msvc-runtime-library-doc' 282d9f3168 MSVC: Document behavior when MSVC_RUNTIME_LIBRARY is not set Acked-by: Kitware Robot Merge-request: !3573 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6618cbf38aa8298a5881669d8b095a4110f102f6 commit 6618cbf38aa8298a5881669d8b095a4110f102f6 Merge: 1bdb5a3 c1fc6c8 Author: Brad King AuthorDate: Fri Jul 19 15:55:37 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 11:55:48 2019 -0400 Merge topic 'vs-asmlist-dir' c1fc6c80c7 VS: Place intermediate files in the "ASM List Location" next to objects Acked-by: Kitware Robot Merge-request: !3569 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bed969dace917e5bf551c6783da425f5e2217c7 commit 3bed969dace917e5bf551c6783da425f5e2217c7 Author: Sebastian Holtermann AuthorDate: Fri Jul 12 12:15:21 2019 +0200 Commit: Sebastian Holtermann CommitDate: Wed Jul 17 14:58:27 2019 +0200 cmMakefile: Modernize AddFunctionBlocker method to accept a std::unique_ptr diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 861bd06..85040dd 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -4,13 +4,6 @@ #include "cmsys/Directory.hxx" #include "cmsys/Process.h" -#include -#include -#include -#include -#include -#include -#include #include "cm_memory.hxx" @@ -41,6 +34,15 @@ #include "cmSystemTools.h" #include "cmake.h" +#include +#include +#include +#include +#include +#include +#include +#include + #ifdef _WIN32 # include #else @@ -372,9 +374,11 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) #endif // always add a function blocker to update the elapsed time - cmCTestScriptFunctionBlocker* f = new cmCTestScriptFunctionBlocker(); - f->CTestScriptHandler = this; - this->Makefile->AddFunctionBlocker(f); + { + auto fb = cm::make_unique(); + fb->CTestScriptHandler = this; + this->Makefile->AddFunctionBlocker(std::move(fb)); + } /* Execute CTestScriptMode.cmake, which loads CMakeDetermineSystem and CMakeSystemSpecificInformation, so diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 94c1b1a..a30ebe1 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -5,6 +5,7 @@ #include #include #include +#include #include "cm_memory.hxx" @@ -121,7 +122,7 @@ bool cmForEachCommand::InitialPass(std::vector const& args, } // create a function blocker - auto f = cm::make_unique(this->Makefile); + auto fb = cm::make_unique(this->Makefile); if (args.size() > 1) { if (args[1] == "RANGE") { int start = 0; @@ -168,23 +169,22 @@ bool cmForEachCommand::InitialPass(std::vector const& args, break; } } - f->Args = range; + fb->Args = range; } else { - f->Args = args; + fb->Args = args; } } else { - f->Args = args; + fb->Args = args; } - this->Makefile->AddFunctionBlocker(f.release()); + this->Makefile->AddFunctionBlocker(std::move(fb)); return true; } bool cmForEachCommand::HandleInMode(std::vector const& args) { - std::unique_ptr f( - new cmForEachFunctionBlocker(this->Makefile)); - f->Args.push_back(args[0]); + auto fb = cm::make_unique(this->Makefile); + fb->Args.push_back(args[0]); enum Doing { @@ -195,7 +195,7 @@ bool cmForEachCommand::HandleInMode(std::vector const& args) Doing doing = DoingNone; for (unsigned int i = 2; i < args.size(); ++i) { if (doing == DoingItems) { - f->Args.push_back(args[i]); + fb->Args.push_back(args[i]); } else if (args[i] == "LISTS") { doing = DoingLists; } else if (args[i] == "ITEMS") { @@ -203,7 +203,7 @@ bool cmForEachCommand::HandleInMode(std::vector const& args) } else if (doing == DoingLists) { const char* value = this->Makefile->GetDefinition(args[i]); if (value && *value) { - cmSystemTools::ExpandListArgument(value, f->Args, true); + cmSystemTools::ExpandListArgument(value, fb->Args, true); } } else { std::ostringstream e; @@ -214,7 +214,7 @@ bool cmForEachCommand::HandleInMode(std::vector const& args) } } - this->Makefile->AddFunctionBlocker(f.release()); // TODO: pass unique_ptr + this->Makefile->AddFunctionBlocker(std::move(fb)); return true; } diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 8e003ad..6d06531 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -179,8 +179,10 @@ bool cmFunctionCommand::InitialPass(std::vector const& args, } // create a function blocker - cmFunctionFunctionBlocker* f = new cmFunctionFunctionBlocker(); - cmAppend(f->Args, args); - this->Makefile->AddFunctionBlocker(f); + { + auto fb = cm::make_unique(); + cmAppend(fb->Args, args); + this->Makefile->AddFunctionBlocker(std::move(fb)); + } return true; } diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index c58ad06..625dd45 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIfCommand.h" +#include "cm_memory.hxx" + #include "cmConditionEvaluator.h" #include "cmExecutionStatus.h" #include "cmExpandedCommandArgument.h" @@ -11,6 +13,8 @@ #include "cmSystemTools.h" #include "cmake.h" +#include + static std::string cmIfCommandError( std::vector const& args) { @@ -200,15 +204,17 @@ bool cmIfCommand::InvokeInitialPass( this->Makefile->IssueMessage(status, err); } - cmIfFunctionBlocker* f = new cmIfFunctionBlocker(); - // if is isn't true block the commands - f->ScopeDepth = 1; - f->IsBlocking = !isTrue; - if (isTrue) { - f->HasRun = true; + { + auto fb = cm::make_unique(); + // if is isn't true block the commands + fb->ScopeDepth = 1; + fb->IsBlocking = !isTrue; + if (isTrue) { + fb->HasRun = true; + } + fb->Args = args; + this->Makefile->AddFunctionBlocker(std::move(fb)); } - f->Args = args; - this->Makefile->AddFunctionBlocker(f); return true; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 3d553b7..6e65c6b 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -213,8 +213,10 @@ bool cmMacroCommand::InitialPass(std::vector const& args, } // create a function blocker - cmMacroFunctionBlocker* f = new cmMacroFunctionBlocker(); - cmAppend(f->Args, args); - this->Makefile->AddFunctionBlocker(f); + { + auto fb = cm::make_unique(); + cmAppend(fb->Args, args); + this->Makefile->AddFunctionBlocker(std::move(fb)); + } return true; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 501ea69..5ae3a29 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -118,7 +118,6 @@ cmMakefile::~cmMakefile() cmDeleteAll(this->SourceFiles); cmDeleteAll(this->Tests); cmDeleteAll(this->ImportedTargetsOwned); - cmDeleteAll(this->FunctionBlockers); cmDeleteAll(this->EvaluationFiles); } @@ -3076,13 +3075,13 @@ bool cmMakefile::IsFunctionBlocked(const cmListFileFunction& lff, cmExecutionStatus& status) { // if there are no blockers get out of here - if (this->FunctionBlockers.begin() == this->FunctionBlockers.end()) { + if (this->FunctionBlockers.empty()) { return false; } // loop over all function blockers to see if any block this command // evaluate in reverse, this is critical for balanced IF statements etc - for (cmFunctionBlocker* pos : cmReverseRange(this->FunctionBlockers)) { + for (auto const& pos : cmReverseRange(this->FunctionBlockers)) { if (pos->IsFunctionBlocked(lff, *this, status)) { return true; } @@ -3102,7 +3101,8 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError) FunctionBlockersType::size_type barrier = this->FunctionBlockerBarriers.back(); while (this->FunctionBlockers.size() > barrier) { - std::unique_ptr fb(this->FunctionBlockers.back()); + std::unique_ptr fb( + std::move(this->FunctionBlockers.back())); this->FunctionBlockers.pop_back(); if (reportError) { // Report the context in which the unclosed block was opened. @@ -3227,14 +3227,14 @@ bool cmMakefile::ExpandArguments( return !cmSystemTools::GetFatalErrorOccured(); } -void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb) +void cmMakefile::AddFunctionBlocker(std::unique_ptr fb) { if (!this->ExecutionStatusStack.empty()) { // Record the context in which the blocker is created. fb->SetStartingContext(this->GetExecutionContext()); } - this->FunctionBlockers.push_back(fb); + this->FunctionBlockers.push_back(std::move(fb)); } std::unique_ptr cmMakefile::RemoveFunctionBlocker( @@ -3250,9 +3250,8 @@ std::unique_ptr cmMakefile::RemoveFunctionBlocker( // Search for the function blocker whose scope this command ends. for (FunctionBlockersType::size_type i = this->FunctionBlockers.size(); i > barrier; --i) { - std::vector::iterator pos = - this->FunctionBlockers.begin() + (i - 1); - if (*pos == fb) { + auto pos = this->FunctionBlockers.begin() + (i - 1); + if (pos->get() == fb) { // Warn if the arguments do not match, but always remove. if (!(*pos)->ShouldRemove(lff, *this)) { cmListFileContext const& lfc = fb->GetStartingContext(); @@ -3268,9 +3267,9 @@ std::unique_ptr cmMakefile::RemoveFunctionBlocker( /* clang-format on */ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str()); } - cmFunctionBlocker* b = *pos; + std::unique_ptr b = std::move(*pos); this->FunctionBlockers.erase(pos); - return std::unique_ptr(b); + return b; } } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 1b4ead7..924cf24 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -17,6 +17,7 @@ #include #include "cmAlgorithms.h" +#include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmMessageType.h" #include "cmNewLineStyle.h" @@ -36,7 +37,6 @@ class cmCustomCommandLines; class cmExecutionStatus; class cmExpandedCommandArgument; class cmExportBuildFileGenerator; -class cmFunctionBlocker; class cmGeneratorExpressionEvaluationFile; class cmGlobalGenerator; class cmInstallGenerator; @@ -95,7 +95,7 @@ public: /** * Add a function blocker to this makefile */ - void AddFunctionBlocker(cmFunctionBlocker* fb); + void AddFunctionBlocker(std::unique_ptr fb); /// @return whether we are processing the top CMakeLists.txt file. bool IsRootMakefile() const; @@ -955,7 +955,7 @@ private: bool EnforceUniqueDir(const std::string& srcPath, const std::string& binPath) const; - typedef std::vector FunctionBlockersType; + typedef std::vector> FunctionBlockersType; FunctionBlockersType FunctionBlockers; std::vector FunctionBlockerBarriers; void PushFunctionBlockerBarrier(); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 31a878d..a902964 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWhileCommand.h" +#include "cm_memory.hxx" + #include "cmConditionEvaluator.h" #include "cmExecutionStatus.h" #include "cmExpandedCommandArgument.h" @@ -9,6 +11,8 @@ #include "cmMessageType.h" #include "cmSystemTools.h" +#include + cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf) : Makefile(mf) , Depth(0) @@ -134,9 +138,10 @@ bool cmWhileCommand::InvokeInitialPass( } // create a function blocker - cmWhileFunctionBlocker* f = new cmWhileFunctionBlocker(this->Makefile); - f->Args = args; - this->Makefile->AddFunctionBlocker(f); - + { + auto fb = cm::make_unique(this->Makefile); + fb->Args = args; + this->Makefile->AddFunctionBlocker(std::move(fb)); + } return true; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=faacb90a13f87d32aaf3e5c45cfd48af7e84b733 commit faacb90a13f87d32aaf3e5c45cfd48af7e84b733 Author: Sebastian Holtermann AuthorDate: Sun Jul 14 18:20:53 2019 +0200 Commit: Sebastian Holtermann CommitDate: Wed Jul 17 14:58:27 2019 +0200 cmELF: Modernize to use std::unique_ptr instead of new/delete diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 51eb814..096016d 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -4,6 +4,7 @@ #include "cmAlgorithms.h" #include "cm_kwiml.h" +#include "cm_memory.hxx" #include "cmsys/FStream.hxx" #include #include @@ -109,10 +110,10 @@ public: }; // Construct and take ownership of the file stream object. - cmELFInternal(cmELF* external, std::unique_ptr& fin, + cmELFInternal(cmELF* external, std::unique_ptr fin, ByteOrderType order) : External(external) - , Stream(*fin.release()) + , Stream(std::move(fin)) , ByteOrder(order) , ELFType(cmELF::FileTypeInvalid) { @@ -132,7 +133,7 @@ public: } // Destruct and delete the file stream object. - virtual ~cmELFInternal() { delete &this->Stream; } + virtual ~cmELFInternal() = default; // Forward to the per-class implementation. virtual unsigned int GetNumberOfSections() const = 0; @@ -171,7 +172,7 @@ protected: cmELF* External; // The stream from which to read. - std::istream& Stream; + std::unique_ptr Stream; // The byte order of the ELF file. ByteOrderType ByteOrder; @@ -233,7 +234,7 @@ public: typedef typename Types::tagtype tagtype; // Construct with a stream and byte swap indicator. - cmELFInternalImpl(cmELF* external, std::unique_ptr& fin, + cmELFInternalImpl(cmELF* external, std::unique_ptr fin, ByteOrderType order); // Return the number of sections as specified by the ELF header. @@ -352,7 +353,7 @@ private: bool Read(ELF_Ehdr& x) { // Read the header from the file. - if (!this->Stream.read(reinterpret_cast(&x), sizeof(x))) { + if (!this->Stream->read(reinterpret_cast(&x), sizeof(x))) { return false; } @@ -382,26 +383,26 @@ private: } bool Read(ELF_Shdr& x) { - if (this->Stream.read(reinterpret_cast(&x), sizeof(x)) && + if (this->Stream->read(reinterpret_cast(&x), sizeof(x)) && this->NeedSwap) { ByteSwap(x); } - return !this->Stream.fail(); + return !this->Stream->fail(); } bool Read(ELF_Dyn& x) { - if (this->Stream.read(reinterpret_cast(&x), sizeof(x)) && + if (this->Stream->read(reinterpret_cast(&x), sizeof(x)) && this->NeedSwap) { ByteSwap(x); } - return !this->Stream.fail(); + return !this->Stream->fail(); } bool LoadSectionHeader(ELF_Half i) { // Read the section header from the file. - this->Stream.seekg(this->ELFHeader.e_shoff + - this->ELFHeader.e_shentsize * i); + this->Stream->seekg(this->ELFHeader.e_shoff + + this->ELFHeader.e_shentsize * i); if (!this->Read(this->SectionHeaders[i])) { return false; } @@ -426,9 +427,10 @@ private: }; template -cmELFInternalImpl::cmELFInternalImpl( - cmELF* external, std::unique_ptr& fin, ByteOrderType order) - : cmELFInternal(external, fin, order) +cmELFInternalImpl::cmELFInternalImpl(cmELF* external, + std::unique_ptr fin, + ByteOrderType order) + : cmELFInternal(external, std::move(fin), order) { // Read the main header. if (!this->Read(this->ELFHeader)) { @@ -510,7 +512,7 @@ bool cmELFInternalImpl::LoadDynamicSection() // Read each entry. for (int j = 0; j < n; ++j) { // Seek to the beginning of the section entry. - this->Stream.seekg(sec.sh_offset + sec.sh_entsize * j); + this->Stream->seekg(sec.sh_offset + sec.sh_entsize * j); ELF_Dyn& dyn = this->DynamicSectionEntries[j]; // Try reading the entry. @@ -630,7 +632,7 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( unsigned long first = static_cast(dyn.d_un.d_val); unsigned long last = first; unsigned long end = static_cast(strtab.sh_size); - this->Stream.seekg(strtab.sh_offset + first); + this->Stream->seekg(strtab.sh_offset + first); // Read the string. It may be followed by more than one NULL // terminator. Count the total size of the region allocated to @@ -639,7 +641,7 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( // assumption. bool terminated = false; char c; - while (last != end && this->Stream.get(c) && !(terminated && c)) { + while (last != end && this->Stream->get(c) && !(terminated && c)) { ++last; if (c) { se.Value += c; @@ -649,7 +651,7 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( } // Make sure the whole value was read. - if (!this->Stream) { + if (!(*this->Stream)) { this->SetErrorMessage("Dynamic section specifies unreadable RPATH."); se.Value = ""; return nullptr; @@ -679,10 +681,9 @@ const long cmELF::TagMipsRldMapRel = 0; #endif cmELF::cmELF(const char* fname) - : Internal(nullptr) { // Try to open the file. - std::unique_ptr fin(new cmsys::ifstream(fname)); + auto fin = cm::make_unique(fname); // Quit now if the file could not be opened. if (!fin || !*fin) { @@ -725,12 +726,14 @@ cmELF::cmELF(const char* fname) // parser implementation. if (ident[EI_CLASS] == ELFCLASS32) { // 32-bit ELF - this->Internal = new cmELFInternalImpl(this, fin, order); + this->Internal = cm::make_unique>( + this, std::move(fin), order); } #ifndef _SCO_DS else if (ident[EI_CLASS] == ELFCLASS64) { // 64-bit ELF - this->Internal = new cmELFInternalImpl(this, fin, order); + this->Internal = cm::make_unique>( + this, std::move(fin), order); } #endif else { @@ -739,10 +742,7 @@ cmELF::cmELF(const char* fname) } } -cmELF::~cmELF() -{ - delete this->Internal; -} +cmELF::~cmELF() = default; bool cmELF::Valid() const { diff --git a/Source/cmELF.h b/Source/cmELF.h index 987f0c3..afef654 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include +#include #include #include #include @@ -108,7 +109,7 @@ public: private: friend class cmELFInternal; bool Valid() const; - cmELFInternal* Internal; + std::unique_ptr Internal; std::string ErrorMessage; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8738e2584a111de065341296dcfa1f4ac9c68346 commit 8738e2584a111de065341296dcfa1f4ac9c68346 Author: Samuel Ostlund AuthorDate: Tue Jul 16 14:06:34 2019 -0700 Commit: Samuel Ostlund CommitDate: Tue Jul 16 14:06:34 2019 -0700 cmGlobalNinjaGenerator: Use gnu compatible paths with QCC diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 69a7da9..7e81a54 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -639,7 +639,9 @@ void cmGlobalNinjaGenerator::EnableLanguage( (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "GNU") || (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "GNU") || (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "Clang") || - (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang")))) { + (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "Clang") || + (mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") == "QCC") || + (mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID") == "QCC")))) { this->UsingGCCOnWindows = true; } #endif ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0091.rst | 4 ++- Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst | 3 ++ Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst | 5 +++ Source/CTest/cmCTestScriptHandler.cxx | 24 +++++++------ Source/CTest/cmCTestSubmitHandler.cxx | 18 +++++----- Source/cmELF.cxx | 54 ++++++++++++++-------------- Source/cmELF.h | 3 +- Source/cmForEachCommand.cxx | 22 ++++++------ Source/cmFunctionCommand.cxx | 8 +++-- Source/cmGlobalNinjaGenerator.cxx | 4 ++- Source/cmIfCommand.cxx | 22 +++++++----- Source/cmLocalVisualStudio7Generator.cxx | 3 +- Source/cmMacroCommand.cxx | 8 +++-- Source/cmMakefile.cxx | 21 ++++++----- Source/cmMakefile.h | 6 ++-- Source/cmVisualStudio10TargetGenerator.cxx | 3 +- Source/cmWhileCommand.cxx | 13 ++++--- 17 files changed, 125 insertions(+), 96 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 19 12:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 19 Jul 2019 12:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-12-g8d22999 Message-ID: <20190719160306.B0011103069@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 8d2299975393bb341d7afe8bdd200b8dbe3010e3 (commit) via 282d9f31685906cd45b27961ea013edab8bacd6b (commit) via d96bc3cf048756695a651a8561b763cfc5cead86 (commit) via c1fc6c80c777172139e67753530f610d642a4656 (commit) from 1a2d260634807682a94aee140e77d52168f10ba6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/policy/CMP0091.rst | 4 +++- Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst | 3 +++ Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst | 5 +++++ Source/cmLocalVisualStudio7Generator.cxx | 3 +-- Source/cmVisualStudio10TargetGenerator.cxx | 3 +-- 5 files changed, 13 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 19 12:13:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 19 Jul 2019 12:13:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-383-g573f1fc Message-ID: <20190719161304.36410C14B9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 573f1fc19b39f0aaea6c17c1c11c1f5bbde227d3 (commit) via 123384da2e20cc840a5c207ca467f78fc1acb7a1 (commit) via a6cc72595f01b517bc54b8b745c2eacf2a38c160 (commit) via aa5ec6f42cc3a3ab8b36eb9cb87ea86709cec7f4 (commit) via fc2a7c8b3fc95b90ff69b7bb4a16b216b8ac3671 (commit) via 732dd344b974d880402b0cb047de328eca1df666 (commit) via fbee46e262044ac71170552adc4eb656ef0b030b (commit) via 360d4155920b851f114843e91234bb0ae33afef3 (commit) via 3bbd85d5fffe66181cf16c81b23b2ba50f5387ba (commit) via 316e40baec978980c9023532f4dade1e5ea0ad48 (commit) via 7bc88b91655b3397054d26f519548f34068ad830 (commit) via 6a1a3763eea8f1bd2a6ca444c02af30d300cacc0 (commit) via 20169f0b8de5d0e5efea2d67a735332786173c23 (commit) via a74dad3bd3e5e4bbf09764a0b6bdedfe842442a7 (commit) via d26e6cb1c2f352da12200727a887e940aac463a7 (commit) via 151ef7cef43d5aadcd0993e3edaac366189749e4 (commit) from ca7ec2e188a6f66546a0f5dc9e76a6f24c22bfa6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=573f1fc19b39f0aaea6c17c1c11c1f5bbde227d3 commit 573f1fc19b39f0aaea6c17c1c11c1f5bbde227d3 Merge: 123384d 732dd34 Author: Brad King AuthorDate: Fri Jul 19 16:08:53 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 12:09:03 2019 -0400 Merge topic 'command-final-action' 732dd344b9 cmCommand: remove FinalPass from interface fbee46e262 cmVariableWatchCommand: Port away from FinalPass 360d415592 cmLoadCommandCommand: Port away from FinalPass 316e40baec cmInstallProgramsCommand: Port away from FinalPass 7bc88b9165 cmInstallFilesCommand: Port away from FinalPass 6a1a3763ee cmFLTKWrapUICommand: Port away from FinalPass 20169f0b8d cmExportLibraryDependenciesCommand: Port away from FinalPass a74dad3bd3 cmMakefile: decouple FinalAction from cmCommand ... Acked-by: Kitware Robot Merge-request: !3562 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=123384da2e20cc840a5c207ca467f78fc1acb7a1 commit 123384da2e20cc840a5c207ca467f78fc1acb7a1 Merge: a6cc725 151ef7c Author: Brad King AuthorDate: Fri Jul 19 16:07:59 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 12:08:08 2019 -0400 Merge topic 'swift-deduplicate' 151ef7cef4 Swift: refactor rule construction to reduce duplication Acked-by: Kitware Robot Merge-request: !3551 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6cc72595f01b517bc54b8b745c2eacf2a38c160 commit a6cc72595f01b517bc54b8b745c2eacf2a38c160 Merge: aa5ec6f 3bbd85d Author: Brad King AuthorDate: Fri Jul 19 16:05:21 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 12:05:31 2019 -0400 Merge topic 'FindProtobuf-DLLs' 3bbd85d5ff FindProtobuf: Fix usage of protobuf dynamic libraries on Windows Acked-by: Kitware Robot Merge-request: !3555 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa5ec6f42cc3a3ab8b36eb9cb87ea86709cec7f4 commit aa5ec6f42cc3a3ab8b36eb9cb87ea86709cec7f4 Merge: ca7ec2e fc2a7c8 Author: Brad King AuthorDate: Fri Jul 19 12:04:07 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 12:04:07 2019 -0400 Merge branch 'release-3.15' https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=732dd344b974d880402b0cb047de328eca1df666 commit 732dd344b974d880402b0cb047de328eca1df666 Author: Daniel Pfeifer AuthorDate: Fri Jan 6 23:16:18 2017 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 17:35:43 2019 +0200 cmCommand: remove FinalPass from interface diff --git a/Source/cmCommand.h b/Source/cmCommand.h index cdd2aba..b210f27 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -61,19 +61,6 @@ public: cmExecutionStatus&) = 0; /** - * This is called at the end after all the information - * specified by the command is accumulated. Most commands do - * not implement this method. At this point, reading and - * writing to the cache can be done. - */ - virtual void FinalPass() {} - - /** - * Does this command have a final pass? Query after InitialPass. - */ - virtual bool HasFinalPass() const { return false; } - - /** * This is a virtual constructor for the command. */ virtual std::unique_ptr Clone() = 0; diff --git a/Source/cmDisallowedCommand.h b/Source/cmDisallowedCommand.h index eed59ca..e07f255 100644 --- a/Source/cmDisallowedCommand.h +++ b/Source/cmDisallowedCommand.h @@ -38,10 +38,6 @@ public: bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; - void FinalPass() override { this->Command->FinalPass(); } - - bool HasFinalPass() const override { return this->Command->HasFinalPass(); } - private: std::unique_ptr Command; cmPolicies::PolicyID Policy; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a350789..d2b0ae6 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -355,20 +355,6 @@ private: cmMakefile* Makefile; }; -class cmFinalPassAction -{ -public: - cmFinalPassAction(std::unique_ptr command) - : Command(std::move(command)) - { - } - - void operator()(cmMakefile&) { this->Command->FinalPass(); } - -private: - std::shared_ptr Command; -}; - bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, cmExecutionStatus& status) { @@ -429,9 +415,6 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, if (this->GetCMakeInstance()->GetWorkingMode() != cmake::NORMAL_MODE) { cmSystemTools::SetFatalErrorOccured(); } - } else if (pcmd->HasFinalPass()) { - // use the command - this->AddFinalAction(cmFinalPassAction(std::move(pcmd))); } } } else { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fbee46e262044ac71170552adc4eb656ef0b030b commit fbee46e262044ac71170552adc4eb656ef0b030b Author: Daniel Pfeifer AuthorDate: Fri Jan 6 23:13:44 2017 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 17:35:43 2019 +0200 cmVariableWatchCommand: Port away from FinalPass diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index 5fe55bd..afc0b76 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -3,6 +3,7 @@ #include "cmVariableWatchCommand.h" #include +#include #include "cmExecutionStatus.h" #include "cmListFileCache.h" @@ -84,15 +85,39 @@ static void deleteVariableWatchCallbackData(void* client_data) delete data; } -cmVariableWatchCommand::cmVariableWatchCommand() = default; - -cmVariableWatchCommand::~cmVariableWatchCommand() +/** This command does not really have a final pass but it needs to + stay alive since it owns variable watch callback information. */ +class FinalAction { - for (std::string const& wv : this->WatchedVariables) { - this->Makefile->GetCMakeInstance()->GetVariableWatch()->RemoveWatch( - wv, cmVariableWatchCommandVariableAccessed); +public: + FinalAction(cmMakefile* makefile, std::string variable) + : Action(std::make_shared(makefile, std::move(variable))) + { } -} + + void operator()(cmMakefile&) const {} + +private: + struct Impl + { + Impl(cmMakefile* makefile, std::string variable) + : Makefile(makefile) + , Variable(std::move(variable)) + { + } + + ~Impl() + { + this->Makefile->GetCMakeInstance()->GetVariableWatch()->RemoveWatch( + this->Variable, cmVariableWatchCommandVariableAccessed); + } + + cmMakefile* Makefile; + std::string Variable; + }; + + std::shared_ptr Action; +}; bool cmVariableWatchCommand::InitialPass(std::vector const& args, cmExecutionStatus&) @@ -118,7 +143,6 @@ bool cmVariableWatchCommand::InitialPass(std::vector const& args, data->InCallback = false; data->Command = command; - this->WatchedVariables.insert(variable); if (!this->Makefile->GetCMakeInstance()->GetVariableWatch()->AddWatch( variable, cmVariableWatchCommandVariableAccessed, data, deleteVariableWatchCallbackData)) { @@ -126,5 +150,6 @@ bool cmVariableWatchCommand::InitialPass(std::vector const& args, return false; } + this->Makefile->AddFinalAction(FinalAction(this->Makefile, variable)); return true; } diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h index 0dbb0cb..221269f 100644 --- a/Source/cmVariableWatchCommand.h +++ b/Source/cmVariableWatchCommand.h @@ -5,7 +5,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include #include #include @@ -30,25 +29,12 @@ public: return cm::make_unique(); } - //! Default constructor - cmVariableWatchCommand(); - - //! Destructor. - ~cmVariableWatchCommand() override; - /** * This is called when the command is first encountered in * the CMakeLists.txt file. */ bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; - - /** This command does not really have a final pass but it needs to - stay alive since it owns variable watch callback information. */ - bool HasFinalPass() const override { return true; } - -protected: - std::set WatchedVariables; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=360d4155920b851f114843e91234bb0ae33afef3 commit 360d4155920b851f114843e91234bb0ae33afef3 Author: Daniel Pfeifer AuthorDate: Thu Jan 5 23:41:01 2017 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 17:35:43 2019 +0200 cmLoadCommandCommand: Port away from FinalPass diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 2697f44..f5da2ee 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -126,18 +126,6 @@ public: bool InitialPass(std::vector const& args, cmExecutionStatus&) override; - /** - * This is called at the end after all the information - * specified by the command is accumulated. Most commands do - * not implement this method. At this point, reading and - * writing to the cache can be done. - */ - void FinalPass() override; - bool HasFinalPass() const override - { - return this->Impl->FinalPass != nullptr; - } - private: std::shared_ptr Impl; }; @@ -168,6 +156,11 @@ bool cmLoadedCommand::InitialPass(std::vector const& args, cmFreeArguments(argc, argv); if (result) { + if (this->Impl->FinalPass) { + auto impl = this->Impl; + this->Makefile->AddFinalAction( + [impl](cmMakefile& makefile) { impl->DoFinalPass(&makefile); }); + } return true; } @@ -178,13 +171,6 @@ bool cmLoadedCommand::InitialPass(std::vector const& args, return false; } -void cmLoadedCommand::FinalPass() -{ - if (this->Impl->FinalPass) { - this->Impl->DoFinalPass(this->Makefile); - } -} - } // namespace // cmLoadCommandCommand https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bbd85d5fffe66181cf16c81b23b2ba50f5387ba commit 3bbd85d5fffe66181cf16c81b23b2ba50f5387ba Author: gnaggnoyil AuthorDate: Wed Jul 17 21:08:33 2019 +0800 Commit: Brad King CommitDate: Thu Jul 18 07:40:40 2019 -0400 FindProtobuf: Fix usage of protobuf dynamic libraries on Windows Define `PROTOBUF_USE_DLLS` on Windows when linking against dynamic protobuf libraries so that we import symbols from them. We use the condition `MSVC` to enable this because that is what the upstream buildsystem uses. diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 670352c..2d45965 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -526,6 +526,11 @@ if(Protobuf_INCLUDE_DIR) INTERFACE_COMPILE_FEATURES cxx_std_11 ) endif() + if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) + set_property(TARGET protobuf::libprotobuf APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotobuf APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) @@ -554,6 +559,11 @@ if(Protobuf_INCLUDE_DIR) set_target_properties(protobuf::libprotobuf-lite PROPERTIES IMPORTED_LOCATION_DEBUG "${Protobuf_LITE_LIBRARY_DEBUG}") endif() + if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) + set_property(TARGET protobuf::libprotobuf-lite APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotobuf-lite APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) @@ -587,6 +597,11 @@ if(Protobuf_INCLUDE_DIR) INTERFACE_COMPILE_FEATURES cxx_std_11 ) endif() + if (MSVC AND NOT Protobuf_USE_STATIC_LIBS) + set_property(TARGET protobuf::libprotoc APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS" + ) + endif() if(UNIX AND TARGET Threads::Threads) set_property(TARGET protobuf::libprotoc APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=316e40baec978980c9023532f4dade1e5ea0ad48 commit 316e40baec978980c9023532f4dade1e5ea0ad48 Author: Daniel Pfeifer AuthorDate: Thu Jan 5 23:27:14 2017 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 11:53:46 2019 +0200 cmInstallProgramsCommand: Port away from FinalPass diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index a58f875..6ec02e7 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallProgramsCommand.h" -#include "cmAlgorithms.h" #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmInstallFilesGenerator.h" @@ -12,6 +11,10 @@ class cmExecutionStatus; +static void FinalAction(cmMakefile& makefile, std::string const& dest, + std::vector const& args); +static std::string FindInstallSource(cmMakefile& makefile, const char* name); + // cmExecutableCommand bool cmInstallProgramsCommand::InitialPass( std::vector const& args, cmExecutionStatus&) @@ -24,51 +27,55 @@ bool cmInstallProgramsCommand::InitialPass( // Enable the install target. this->Makefile->GetGlobalGenerator()->EnableInstallTarget(); - this->Destination = args[0]; - - cmAppend(this->FinalArgs, args.begin() + 1, args.end()); - this->Makefile->GetGlobalGenerator()->AddInstallComponent( this->Makefile->GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")); + std::string const& dest = args[0]; + std::vector const finalArgs(args.begin() + 1, args.end()); + this->Makefile->AddFinalAction([dest, finalArgs](cmMakefile& makefile) { + FinalAction(makefile, dest, finalArgs); + }); return true; } -void cmInstallProgramsCommand::FinalPass() +static void FinalAction(cmMakefile& makefile, std::string const& dest, + std::vector const& args) { bool files_mode = false; - if (!this->FinalArgs.empty() && this->FinalArgs[0] == "FILES") { + if (!args.empty() && args[0] == "FILES") { files_mode = true; } + std::vector files; + // two different options - if (this->FinalArgs.size() > 1 || files_mode) { + if (args.size() > 1 || files_mode) { // for each argument, get the programs - std::vector::iterator s = this->FinalArgs.begin(); + std::vector::const_iterator s = args.begin(); if (files_mode) { // Skip the FILES argument in files mode. ++s; } - for (; s != this->FinalArgs.end(); ++s) { + for (; s != args.end(); ++s) { // add to the result - this->Files.push_back(this->FindInstallSource(s->c_str())); + files.push_back(FindInstallSource(makefile, s->c_str())); } } else // reg exp list { std::vector programs; - cmSystemTools::Glob(this->Makefile->GetCurrentSourceDirectory(), - this->FinalArgs[0], programs); + cmSystemTools::Glob(makefile.GetCurrentSourceDirectory(), args[0], + programs); std::vector::iterator s = programs.begin(); // for each argument, get the programs for (; s != programs.end(); ++s) { - this->Files.push_back(this->FindInstallSource(s->c_str())); + files.push_back(FindInstallSource(makefile, s->c_str())); } } // Construct the destination. This command always installs under // the prefix. We skip the leading slash given by the user. - std::string destination = this->Destination.substr(1); + std::string destination = dest.substr(1); cmSystemTools::ConvertToUnixSlashes(destination); if (destination.empty()) { destination = "."; @@ -79,12 +86,12 @@ void cmInstallProgramsCommand::FinalPass() const char* no_rename = ""; bool no_exclude_from_all = false; std::string no_component = - this->Makefile->GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); + makefile.GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector no_configurations; cmInstallGenerator::MessageLevel message = - cmInstallGenerator::SelectMessageLevel(this->Makefile); - this->Makefile->AddInstallGenerator(new cmInstallFilesGenerator( - this->Files, destination.c_str(), true, no_permissions, no_configurations, + cmInstallGenerator::SelectMessageLevel(&makefile); + makefile.AddInstallGenerator(new cmInstallFilesGenerator( + files, destination.c_str(), true, no_permissions, no_configurations, no_component.c_str(), message, no_exclude_from_all, no_rename)); } @@ -94,7 +101,7 @@ void cmInstallProgramsCommand::FinalPass() * present in the build tree. If a full path is given, it is just * returned. */ -std::string cmInstallProgramsCommand::FindInstallSource(const char* name) const +static std::string FindInstallSource(cmMakefile& makefile, const char* name) { if (cmSystemTools::FileIsFullPath(name) || cmGeneratorExpression::Find(name) == 0) { @@ -103,10 +110,10 @@ std::string cmInstallProgramsCommand::FindInstallSource(const char* name) const } // This is a relative path. - std::string tb = this->Makefile->GetCurrentBinaryDirectory(); + std::string tb = makefile.GetCurrentBinaryDirectory(); tb += "/"; tb += name; - std::string ts = this->Makefile->GetCurrentSourceDirectory(); + std::string ts = makefile.GetCurrentSourceDirectory(); ts += "/"; ts += name; diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index 3242365..ccd621d 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -37,24 +37,6 @@ public: */ bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; - - /** - * This is called at the end after all the information - * specified by the command is accumulated. Most commands do - * not implement this method. At this point, reading and - * writing to the cache can be done. - */ - void FinalPass() override; - - bool HasFinalPass() const override { return true; } - -protected: - std::string FindInstallSource(const char* name) const; - -private: - std::vector FinalArgs; - std::string Destination; - std::vector Files; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bc88b91655b3397054d26f519548f34068ad830 commit 7bc88b91655b3397054d26f519548f34068ad830 Author: Daniel Pfeifer AuthorDate: Thu Dec 29 00:44:44 2016 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 11:53:46 2019 +0200 cmInstallFilesCommand: Port away from FinalPass diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index efbcb67..4522669 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallFilesCommand.h" -#include "cmAlgorithms.h" #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmInstallFilesGenerator.h" @@ -13,7 +12,13 @@ class cmExecutionStatus; -// cmExecutableCommand +static std::string FindInstallSource(cmMakefile& makefile, const char* name); +static void CreateInstallGenerator(cmMakefile& makefile, + std::string const& dest, + std::vector const& files); +static void FinalAction(cmMakefile& makefile, std::string const& dest, + std::vector const& args); + bool cmInstallFilesCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { @@ -25,18 +30,20 @@ bool cmInstallFilesCommand::InitialPass(std::vector const& args, // Enable the install target. this->Makefile->GetGlobalGenerator()->EnableInstallTarget(); - this->Destination = args[0]; + std::string const& dest = args[0]; if ((args.size() > 1) && (args[1] == "FILES")) { - this->IsFilesForm = true; + std::vector files; for (std::string const& arg : cmMakeRange(args).advance(2)) { // Find the source location for each file listed. - this->Files.push_back(this->FindInstallSource(arg.c_str())); + files.push_back(FindInstallSource(*this->Makefile, arg.c_str())); } - this->CreateInstallGenerator(); + CreateInstallGenerator(*this->Makefile, dest, files); } else { - this->IsFilesForm = false; - cmAppend(this->FinalArgs, args.begin() + 1, args.end()); + std::vector finalArgs(args.begin() + 1, args.end()); + this->Makefile->AddFinalAction([dest, finalArgs](cmMakefile& makefile) { + FinalAction(makefile, dest, finalArgs); + }); } this->Makefile->GetGlobalGenerator()->AddInstallComponent( @@ -45,23 +52,20 @@ bool cmInstallFilesCommand::InitialPass(std::vector const& args, return true; } -void cmInstallFilesCommand::FinalPass() +static void FinalAction(cmMakefile& makefile, std::string const& dest, + std::vector const& args) { - // No final pass for "FILES" form of arguments. - if (this->IsFilesForm) { - return; - } - std::string testf; - std::string const& ext = this->FinalArgs[0]; + std::string const& ext = args[0]; + std::vector installFiles; // two different options - if (this->FinalArgs.size() > 1) { + if (args.size() > 1) { // now put the files into the list - std::vector::iterator s = this->FinalArgs.begin(); + std::vector::const_iterator s = args.begin(); ++s; // for each argument, get the files - for (; s != this->FinalArgs.end(); ++s) { + for (; s != args.end(); ++s) { // replace any variables std::string const& temps = *s; if (!cmSystemTools::GetFilenamePath(temps).empty()) { @@ -72,30 +76,31 @@ void cmInstallFilesCommand::FinalPass() } // add to the result - this->Files.push_back(this->FindInstallSource(testf.c_str())); + installFiles.push_back(FindInstallSource(makefile, testf.c_str())); } } else // reg exp list { std::vector files; - std::string const& regex = this->FinalArgs[0]; - cmSystemTools::Glob(this->Makefile->GetCurrentSourceDirectory(), regex, - files); + std::string const& regex = args[0]; + cmSystemTools::Glob(makefile.GetCurrentSourceDirectory(), regex, files); std::vector::iterator s = files.begin(); // for each argument, get the files for (; s != files.end(); ++s) { - this->Files.push_back(this->FindInstallSource(s->c_str())); + installFiles.push_back(FindInstallSource(makefile, s->c_str())); } } - this->CreateInstallGenerator(); + CreateInstallGenerator(makefile, dest, installFiles); } -void cmInstallFilesCommand::CreateInstallGenerator() const +static void CreateInstallGenerator(cmMakefile& makefile, + std::string const& dest, + std::vector const& files) { // Construct the destination. This command always installs under // the prefix. We skip the leading slash given by the user. - std::string destination = this->Destination.substr(1); + std::string destination = dest.substr(1); cmSystemTools::ConvertToUnixSlashes(destination); if (destination.empty()) { destination = "."; @@ -106,12 +111,12 @@ void cmInstallFilesCommand::CreateInstallGenerator() const const char* no_rename = ""; bool no_exclude_from_all = false; std::string no_component = - this->Makefile->GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); + makefile.GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector no_configurations; cmInstallGenerator::MessageLevel message = - cmInstallGenerator::SelectMessageLevel(this->Makefile); - this->Makefile->AddInstallGenerator(new cmInstallFilesGenerator( - this->Files, destination.c_str(), false, no_permissions, no_configurations, + cmInstallGenerator::SelectMessageLevel(&makefile); + makefile.AddInstallGenerator(new cmInstallFilesGenerator( + files, destination.c_str(), false, no_permissions, no_configurations, no_component.c_str(), message, no_exclude_from_all, no_rename)); } @@ -121,7 +126,7 @@ void cmInstallFilesCommand::CreateInstallGenerator() const * present in the build tree. If a full path is given, it is just * returned. */ -std::string cmInstallFilesCommand::FindInstallSource(const char* name) const +static std::string FindInstallSource(cmMakefile& makefile, const char* name) { if (cmSystemTools::FileIsFullPath(name) || cmGeneratorExpression::Find(name) == 0) { @@ -130,10 +135,10 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const } // This is a relative path. - std::string tb = this->Makefile->GetCurrentBinaryDirectory(); + std::string tb = makefile.GetCurrentBinaryDirectory(); tb += "/"; tb += name; - std::string ts = this->Makefile->GetCurrentSourceDirectory(); + std::string ts = makefile.GetCurrentSourceDirectory(); ts += "/"; ts += name; diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index e068b0e..f9b84fd 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -37,25 +37,6 @@ public: */ bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; - - /** - * This is called at the end after all the information - * specified by the command is accumulated. Most commands do - * not implement this method. At this point, reading and - * writing to the cache can be done. - */ - void FinalPass() override; - bool HasFinalPass() const override { return !this->IsFilesForm; } - -protected: - void CreateInstallGenerator() const; - std::string FindInstallSource(const char* name) const; - -private: - std::vector FinalArgs; - bool IsFilesForm = false; - std::string Destination; - std::vector Files; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a1a3763eea8f1bd2a6ca444c02af30d300cacc0 commit 6a1a3763eea8f1bd2a6ca444c02af30d300cacc0 Author: Daniel Pfeifer AuthorDate: Wed Dec 28 23:58:29 2016 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 11:53:46 2019 +0200 cmFLTKWrapUICommand: Port away from FinalPass diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 89629c7..70800b4 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -13,6 +13,23 @@ class cmExecutionStatus; class cmTarget; +static void FinalAction(cmMakefile& makefile, std::string const& name) +{ + // people should add the srcs to the target themselves, but the old command + // didn't support that, so check and see if they added the files in and if + // they didn;t then print a warning and add then anyhow + cmTarget* target = makefile.FindLocalNonAliasTarget(name); + if (!target) { + std::string msg = + "FLTK_WRAP_UI was called with a target that was never created: "; + msg += name; + msg += ". The problem was found while processing the source directory: "; + msg += makefile.GetCurrentSourceDirectory(); + msg += ". This FLTK_WRAP_UI call will be ignored."; + cmSystemTools::Message(msg, "Warning"); + } +} + // cmFLTKWrapUICommand bool cmFLTKWrapUICommand::InitialPass(std::vector const& args, cmExecutionStatus&) @@ -27,8 +44,8 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector const& args, std::string const& fluid_exe = this->Makefile->GetRequiredDefinition("FLTK_FLUID_EXECUTABLE"); - // get parameter for the command - this->Target = args[0]; // Target that will use the generated files + // Target that will use the generated files + std::string const& target = args[0]; // get the list of GUI files from which .cxx and .h will be generated std::string outputDirectory = this->Makefile->GetCurrentBinaryDirectory(); @@ -41,6 +58,9 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector const& args, this->Makefile->AddIncludeDirectories(outputDirectories); } + // List of produced files. + std::vector generatedSourcesClasses; + for (std::string const& arg : cmMakeRange(args).advance(1)) { cmSourceFile* curr = this->Makefile->GetSource(arg); // if we should use the source GUI @@ -84,40 +104,23 @@ bool cmFLTKWrapUICommand::InitialPass(std::vector const& args, cmSourceFile* sf = this->Makefile->GetSource(cxxres); sf->AddDepend(hname); sf->AddDepend(origname); - this->GeneratedSourcesClasses.push_back(sf); + generatedSourcesClasses.push_back(sf); } } // create the variable with the list of sources in it - size_t lastHeadersClass = this->GeneratedSourcesClasses.size(); + size_t lastHeadersClass = generatedSourcesClasses.size(); std::string sourceListValue; for (size_t classNum = 0; classNum < lastHeadersClass; classNum++) { if (classNum) { sourceListValue += ";"; } - sourceListValue += this->GeneratedSourcesClasses[classNum]->GetFullPath(); + sourceListValue += generatedSourcesClasses[classNum]->GetFullPath(); } - std::string varName = this->Target; - varName += "_FLTK_UI_SRCS"; + std::string const varName = target + "_FLTK_UI_SRCS"; this->Makefile->AddDefinition(varName, sourceListValue.c_str()); + this->Makefile->AddFinalAction( + [target](cmMakefile& makefile) { FinalAction(makefile, target); }); return true; } - -void cmFLTKWrapUICommand::FinalPass() -{ - // people should add the srcs to the target themselves, but the old command - // didn't support that, so check and see if they added the files in and if - // they didn;t then print a warning and add then anyhow - cmTarget* target = this->Makefile->FindLocalNonAliasTarget(this->Target); - if (!target) { - std::string msg = - "FLTK_WRAP_UI was called with a target that was never created: "; - msg += this->Target; - msg += ". The problem was found while processing the source directory: "; - msg += this->Makefile->GetCurrentSourceDirectory(); - msg += ". This FLTK_WRAP_UI call will be ignored."; - cmSystemTools::Message(msg, "Warning"); - return; - } -} diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h index bff4f01..ea8d401 100644 --- a/Source/cmFLTKWrapUICommand.h +++ b/Source/cmFLTKWrapUICommand.h @@ -13,7 +13,6 @@ #include "cmCommand.h" class cmExecutionStatus; -class cmSourceFile; /** \class cmFLTKWrapUICommand * \brief Create .h and .cxx files rules for FLTK user interfaces files @@ -38,27 +37,6 @@ public: */ bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; - - /** - * This is called at the end after all the information - * specified by the command is accumulated. Most commands do - * not implement this method. At this point, reading and - * writing to the cache can be done. - */ - void FinalPass() override; - bool HasFinalPass() const override { return true; } - -private: - /** - * List of produced files. - */ - std::vector GeneratedSourcesClasses; - - /** - * List of Fluid files that provide the source - * generating .cxx and .h files - */ - std::string Target; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20169f0b8de5d0e5efea2d67a735332786173c23 commit 20169f0b8de5d0e5efea2d67a735332786173c23 Author: Daniel Pfeifer AuthorDate: Wed Dec 28 23:43:11 2016 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 11:53:46 2019 +0200 cmExportLibraryDependenciesCommand: Port away from FinalPass diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index 87ef2a9..8f2fff5 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -19,57 +19,31 @@ class cmExecutionStatus; -bool cmExportLibraryDependenciesCommand::InitialPass( - std::vector const& args, cmExecutionStatus&) -{ - if (args.empty()) { - this->SetError("called with incorrect number of arguments"); - return false; - } - - // store the arguments for the final pass - this->Filename = args[0]; - this->Append = false; - if (args.size() > 1) { - if (args[1] == "APPEND") { - this->Append = true; - } - } - return true; -} - -void cmExportLibraryDependenciesCommand::FinalPass() -{ - // export_library_dependencies() shouldn't modify anything - // ensure this by calling a const method - this->ConstFinalPass(); -} - -void cmExportLibraryDependenciesCommand::ConstFinalPass() const +static void FinalAction(cmMakefile& makefile, std::string const& filename, + bool append) { // Use copy-if-different if not appending. std::unique_ptr foutPtr; - if (this->Append) { + if (append) { const auto openmodeApp = std::ios::app; - foutPtr = - cm::make_unique(this->Filename.c_str(), openmodeApp); + foutPtr = cm::make_unique(filename.c_str(), openmodeApp); } else { std::unique_ptr ap( - new cmGeneratedFileStream(this->Filename, true)); + new cmGeneratedFileStream(filename, true)); ap->SetCopyIfDifferent(true); foutPtr = std::move(ap); } std::ostream& fout = *foutPtr; if (!fout) { - cmSystemTools::Error("Error Writing " + this->Filename); + cmSystemTools::Error("Error Writing " + filename); cmSystemTools::ReportLastSystemError(""); return; } // Collect dependency information about all library targets built in // the project. - cmake* cm = this->Makefile->GetCMakeInstance(); + cmake* cm = makefile.GetCMakeInstance(); cmGlobalGenerator* global = cm->GetGlobalGenerator(); const std::vector& locals = global->GetMakefiles(); std::map libDepsOld; @@ -166,3 +140,20 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const } fout << "endif()\n"; } + +bool cmExportLibraryDependenciesCommand::InitialPass( + std::vector const& args, cmExecutionStatus&) +{ + if (args.empty()) { + this->SetError("called with incorrect number of arguments"); + return false; + } + + std::string const& filename = args[0]; + bool const append = args.size() > 1 && args[1] == "APPEND"; + this->Makefile->AddFinalAction([filename, append](cmMakefile& makefile) { + FinalAction(makefile, filename, append); + }); + + return true; +} diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h index 5255d63..4817162 100644 --- a/Source/cmExportLibraryDependenciesCommand.h +++ b/Source/cmExportLibraryDependenciesCommand.h @@ -23,14 +23,6 @@ public: } bool InitialPass(std::vector const& args, cmExecutionStatus& status) override; - - void FinalPass() override; - bool HasFinalPass() const override { return true; } - -private: - std::string Filename; - bool Append = false; - void ConstFinalPass() const; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a74dad3bd3e5e4bbf09764a0b6bdedfe842442a7 commit a74dad3bd3e5e4bbf09764a0b6bdedfe842442a7 Author: Daniel Pfeifer AuthorDate: Wed Dec 28 23:15:41 2016 +0100 Commit: Regina Pfeifer CommitDate: Thu Jul 18 11:53:46 2019 +0200 cmMakefile: decouple FinalAction from cmCommand diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 501ea69..a350789 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -355,6 +355,20 @@ private: cmMakefile* Makefile; }; +class cmFinalPassAction +{ +public: + cmFinalPassAction(std::unique_ptr command) + : Command(std::move(command)) + { + } + + void operator()(cmMakefile&) { this->Command->FinalPass(); } + +private: + std::shared_ptr Command; +}; + bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, cmExecutionStatus& status) { @@ -417,7 +431,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, } } else if (pcmd->HasFinalPass()) { // use the command - this->FinalPassCommands.push_back(std::move(pcmd)); + this->AddFinalAction(cmFinalPassAction(std::move(pcmd))); } } } else { @@ -768,6 +782,11 @@ struct file_not_persistent }; } +void cmMakefile::AddFinalAction(FinalAction action) +{ + this->FinalActions.push_back(std::move(action)); +} + void cmMakefile::FinalPass() { // do all the variable expansions here @@ -775,8 +794,8 @@ void cmMakefile::FinalPass() // give all the commands a chance to do something // after the file has been parsed before generation - for (auto& command : this->FinalPassCommands) { - command->FinalPass(); + for (FinalAction& action : this->FinalActions) { + action(*this); } // go through all configured files and see which ones still exist. diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 1b4ead7..166a697 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -7,6 +7,7 @@ #include "cmsys/RegularExpression.hxx" #include +#include #include #include #include @@ -30,7 +31,6 @@ # include "cmSourceGroup.h" #endif -class cmCommand; class cmCompiledGeneratorExpression; class cmCustomCommandLines; class cmExecutionStatus; @@ -125,6 +125,13 @@ public: bool EnforceUniqueName(std::string const& name, std::string& msg, bool isCustom = false) const; + using FinalAction = std::function; + + /** + * Register an action that is executed during FinalPass + */ + void AddFinalAction(FinalAction action); + /** * Perform FinalPass, Library dependency analysis etc before output of the * makefile. @@ -132,7 +139,7 @@ public: void ConfigureFinalPass(); /** - * run the final pass on all commands. + * run all FinalActions. */ void FinalPass(); @@ -937,7 +944,7 @@ protected: size_t ObjectLibrariesSourceGroupIndex; #endif - std::vector> FinalPassCommands; + std::vector FinalActions; cmGlobalGenerator* GlobalGenerator; bool IsFunctionBlocked(const cmListFileFunction& lff, cmExecutionStatus& status); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d26e6cb1c2f352da12200727a887e940aac463a7 commit d26e6cb1c2f352da12200727a887e940aac463a7 Author: Regina Pfeifer AuthorDate: Thu Jul 18 11:30:44 2019 +0200 Commit: Regina Pfeifer CommitDate: Thu Jul 18 11:49:28 2019 +0200 cmLoadCommandCommand: Code cleanup diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 235dcd4..2697f44 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -25,21 +25,89 @@ class cmExecutionStatus; # include /* for malloc/free on QNX */ #endif -extern "C" void TrapsForSignalsCFunction(int sig); +namespace { + +const char* LastName = nullptr; + +extern "C" void TrapsForSignals(int sig) +{ + fprintf(stderr, "CMake loaded command %s crashed with signal: %d.\n", + LastName, sig); +} + +struct SignalHandlerGuard +{ + explicit SignalHandlerGuard(const char* name) + { + LastName = name != nullptr ? name : "????"; + + signal(SIGSEGV, TrapsForSignals); +#ifdef SIGBUS + signal(SIGBUS, TrapsForSignals); +#endif + signal(SIGILL, TrapsForSignals); + } + + ~SignalHandlerGuard() + { + signal(SIGSEGV, nullptr); +#ifdef SIGBUS + signal(SIGBUS, nullptr); +#endif + signal(SIGILL, nullptr); + } + + SignalHandlerGuard(SignalHandlerGuard const&) = delete; + SignalHandlerGuard& operator=(SignalHandlerGuard const&) = delete; +}; + +struct LoadedCommandImpl : cmLoadedCommandInfo +{ + explicit LoadedCommandImpl(CM_INIT_FUNCTION init) + : cmLoadedCommandInfo{ 0, 0, &cmStaticCAPI, 0, + nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr } + { + init(this); + } + + ~LoadedCommandImpl() + { + if (this->Destructor) { + SignalHandlerGuard guard(this->Name); + this->Destructor(this); + } + if (this->Error != nullptr) { + free(this->Error); + } + } + + LoadedCommandImpl(LoadedCommandImpl const&) = delete; + LoadedCommandImpl& operator=(LoadedCommandImpl const&) = delete; + + int DoInitialPass(cmMakefile* mf, int argc, char* argv[]) + { + SignalHandlerGuard guard(this->Name); + return this->InitialPass(this, mf, argc, argv); + } + + void DoFinalPass(cmMakefile* mf) + { + SignalHandlerGuard guard(this->Name); + this->FinalPass(this, mf); + } +}; // a class for loadabple commands class cmLoadedCommand : public cmCommand { public: - cmLoadedCommand() + cmLoadedCommand() = default; + explicit cmLoadedCommand(CM_INIT_FUNCTION init) + : Impl(std::make_shared(init)) { - memset(&this->info, 0, sizeof(this->info)); - this->info.CAPI = &cmStaticCAPI; } - //! clean up any memory allocated by the plugin - ~cmLoadedCommand() override; - /** * This is a virtual constructor for the command. */ @@ -47,8 +115,8 @@ public: { auto newC = cm::make_unique(); // we must copy when we clone - memcpy(&newC->info, &this->info, sizeof(info)); - return std::unique_ptr(std::move(newC)); + newC->Impl = this->Impl; + return std::unique_ptr(std::move(newC)); } /** @@ -67,57 +135,23 @@ public: void FinalPass() override; bool HasFinalPass() const override { - return this->info.FinalPass != nullptr; - } - - static const char* LastName; - static void TrapsForSignals(int sig) - { - fprintf(stderr, "CMake loaded command %s crashed with signal: %d.\n", - cmLoadedCommand::LastName, sig); - } - static void InstallSignalHandlers(const char* name, int remove = 0) - { - cmLoadedCommand::LastName = name; - if (!name) { - cmLoadedCommand::LastName = "????"; - } - - if (!remove) { - signal(SIGSEGV, TrapsForSignalsCFunction); -#ifdef SIGBUS - signal(SIGBUS, TrapsForSignalsCFunction); -#endif - signal(SIGILL, TrapsForSignalsCFunction); - } else { - signal(SIGSEGV, nullptr); -#ifdef SIGBUS - signal(SIGBUS, nullptr); -#endif - signal(SIGILL, nullptr); - } + return this->Impl->FinalPass != nullptr; } - cmLoadedCommandInfo info; +private: + std::shared_ptr Impl; }; -extern "C" void TrapsForSignalsCFunction(int sig) -{ - cmLoadedCommand::TrapsForSignals(sig); -} - -const char* cmLoadedCommand::LastName = nullptr; - bool cmLoadedCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (!info.InitialPass) { + if (!this->Impl->InitialPass) { return true; } // clear the error string - if (this->info.Error) { - free(this->info.Error); + if (this->Impl->Error) { + free(this->Impl->Error); } // create argc and argv and then invoke the command @@ -130,9 +164,7 @@ bool cmLoadedCommand::InitialPass(std::vector const& args, for (i = 0; i < argc; ++i) { argv[i] = strdup(args[i].c_str()); } - cmLoadedCommand::InstallSignalHandlers(info.Name); - int result = info.InitialPass(&info, this->Makefile, argc, argv); - cmLoadedCommand::InstallSignalHandlers(info.Name, 1); + int result = this->Impl->DoInitialPass(this->Makefile, argc, argv); cmFreeArguments(argc, argv); if (result) { @@ -140,32 +172,20 @@ bool cmLoadedCommand::InitialPass(std::vector const& args, } /* Initial Pass must have failed so set the error string */ - if (this->info.Error) { - this->SetError(this->info.Error); + if (this->Impl->Error) { + this->SetError(this->Impl->Error); } return false; } void cmLoadedCommand::FinalPass() { - if (this->info.FinalPass) { - cmLoadedCommand::InstallSignalHandlers(info.Name); - this->info.FinalPass(&this->info, this->Makefile); - cmLoadedCommand::InstallSignalHandlers(info.Name, 1); + if (this->Impl->FinalPass) { + this->Impl->DoFinalPass(this->Makefile); } } -cmLoadedCommand::~cmLoadedCommand() -{ - if (this->info.Destructor) { - cmLoadedCommand::InstallSignalHandlers(info.Name); - this->info.Destructor(&this->info); - cmLoadedCommand::InstallSignalHandlers(info.Name, 1); - } - if (this->info.Error) { - free(this->info.Error); - } -} +} // namespace // cmLoadCommandCommand bool cmLoadCommandCommand::InitialPass(std::vector const& args, @@ -240,10 +260,8 @@ bool cmLoadCommandCommand::InitialPass(std::vector const& args, // if the symbol is found call it to set the name on the // function blocker if (initFunction) { - // create a function blocker and set it up - auto f = cm::make_unique(); - (*initFunction)(&f->info); - this->Makefile->GetState()->AddScriptedCommand(args[0], std::move(f)); + this->Makefile->GetState()->AddScriptedCommand( + args[0], cm::make_unique(initFunction)); return true; } this->SetError("Attempt to load command failed. " https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=151ef7cef43d5aadcd0993e3edaac366189749e4 commit 151ef7cef43d5aadcd0993e3edaac366189749e4 Author: Saleem Abdulrasool AuthorDate: Wed Jul 17 10:26:46 2019 -0700 Commit: Saleem Abdulrasool CommitDate: Wed Jul 17 10:26:46 2019 -0700 Swift: refactor rule construction to reduce duplication Use the placeholder expansion to avoid constructing the `-target` option by hand if specified. This reduces duplication and simplifies the rules. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index f6510b9..58b0813 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -23,7 +23,13 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL Dar endif() set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ") -set(CMAKE_Swift_COMPILER_ARG1 -frontend) +set(CMAKE_Swift_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN "-tools-directory ") +# NOTE(compnerd) the `-sdk` support is not yet ready in the compiler; when that +# is fully working, we should be able to enable this. +# set(CMAKE_Swift_COMPILE_OPTIONS_SYSROOT "-sdk ") +# NOTE(compnerd) do not setup `-frontend` as we use the compiler as the driver +# during the link phase and use that to drive the compilation +set(CMAKE_Swift_COMPILER_ARG1 "") set(CMAKE_Swift_DEFINE_FLAG -D) set(CMAKE_Swift_FRAMEWORK_SEARCH_FLAG "-F ") set(CMAKE_Swift_LIBRARY_PATH_FLAG "-L ") @@ -57,11 +63,7 @@ if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$") endif() if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY) - if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") - else() - set(CMAKE_Swift_CREATE_SHARED_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") - endif() + set(CMAKE_Swift_CREATE_SHARED_LIBRARY " -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") endif() if(NOT CMAKE_Swift_CREATE_SHARED_MODULE) @@ -69,19 +71,11 @@ if(NOT CMAKE_Swift_CREATE_SHARED_MODULE) endif() if(NOT CMAKE_Swift_LINK_EXECUTABLE) - if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") - else() - set(CMAKE_Swift_LINK_EXECUTABLE "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") - endif() + set(CMAKE_Swift_LINK_EXECUTABLE " -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o -emit-module -emit-module-path -emit-dependencies ") endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) - if(CMAKE_Swift_COMPILER_TARGET) - set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -target -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") - else() - set(CMAKE_Swift_CREATE_STATIC_LIBRARY "${CMAKE_Swift_COMPILER} -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") - endif() + set(CMAKE_Swift_CREATE_STATIC_LIBRARY " -output-file-map -incremental -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o -module-name -module-link-name -emit-module -emit-module-path -emit-dependencies ") set(CMAKE_Swift_ARCHIVE_CREATE " crs ") set(CMAKE_Swift_ARCHIVE_FINISH "") ----------------------------------------------------------------------- Summary of changes: Modules/CMakeSwiftInformation.cmake | 26 ++-- Modules/FindProtobuf.cmake | 15 +++ Source/cmCommand.h | 13 -- Source/cmDisallowedCommand.h | 4 - Source/cmExportLibraryDependenciesCommand.cxx | 57 ++++---- Source/cmExportLibraryDependenciesCommand.h | 8 -- Source/cmFLTKWrapUICommand.cxx | 53 ++++---- Source/cmFLTKWrapUICommand.h | 22 ---- Source/cmInstallFilesCommand.cxx | 71 +++++----- Source/cmInstallFilesCommand.h | 19 --- Source/cmInstallProgramsCommand.cxx | 51 ++++---- Source/cmInstallProgramsCommand.h | 18 --- Source/cmLoadCommandCommand.cxx | 182 +++++++++++++------------- Source/cmMakefile.cxx | 12 +- Source/cmMakefile.h | 13 +- Source/cmVariableWatchCommand.cxx | 41 ++++-- Source/cmVariableWatchCommand.h | 14 -- 17 files changed, 287 insertions(+), 332 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 19 12:13:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 19 Jul 2019 12:13:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, release, updated. v3.15.0-14-gfc2a7c8 Message-ID: <20190719161304.4A97A100F05@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via fc2a7c8b3fc95b90ff69b7bb4a16b216b8ac3671 (commit) via da79075c4de45095d8f9eca5d2cc76711b79341e (commit) from 8d2299975393bb341d7afe8bdd200b8dbe3010e3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestSubmitHandler.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jul 19 12:23:04 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 19 Jul 2019 12:23:04 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-388-g16bb46e Message-ID: <20190719162304.105B4C14B9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 16bb46eaf3261a2991e35e22116fd8a51d031b15 (commit) via 5dbd9c8583f44d0d9abe2ec95b2ddfd4ac65dc0d (commit) via 407dd1a910b1232cf915db9afb9c09022c6e22a9 (commit) via d7955d4e5d3038930f333bf12e15a09c7ae6088c (commit) via 4f1dec86a53b789d164827eb6e89696f9e59f1c0 (commit) from 573f1fc19b39f0aaea6c17c1c11c1f5bbde227d3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16bb46eaf3261a2991e35e22116fd8a51d031b15 commit 16bb46eaf3261a2991e35e22116fd8a51d031b15 Merge: 573f1fc 5dbd9c8 Author: Kyle Edwards AuthorDate: Fri Jul 19 16:14:14 2019 +0000 Commit: Kitware Robot CommitDate: Fri Jul 19 12:14:27 2019 -0400 Merge topic 'skip_regular_expression' 5dbd9c8583 Vim: Add SKIP_REGULAR_EXPRESSION test property to vim syntax file 407dd1a910 Help: Add documentation for SKIP_REGULAR_EXPRESSION test property d7955d4e5d Tests: Create test for SKIP_REGULAR_EXPRESSION test property 4f1dec86a5 CTest: Add SKIP_REGULAR_EXPRESSION test property Acked-by: Kitware Robot Merge-request: !3570 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5dbd9c8583f44d0d9abe2ec95b2ddfd4ac65dc0d commit 5dbd9c8583f44d0d9abe2ec95b2ddfd4ac65dc0d Author: Gabor Bencze AuthorDate: Thu Jul 18 17:00:08 2019 +0200 Commit: Kyle Edwards CommitDate: Thu Jul 18 15:45:09 2019 -0400 Vim: Add SKIP_REGULAR_EXPRESSION test property to vim syntax file diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 8712fb9..5de117b 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -288,6 +288,7 @@ syn keyword cmakeProperty contained \ SKIP_AUTORCC \ SKIP_AUTOUIC \ SKIP_BUILD_RPATH + \ SKIP_REGULAR_EXPRESSION \ SKIP_RETURN_CODE \ SOURCES \ SOURCE_DIR @@ -1772,6 +1773,7 @@ syn keyword cmakeKWadd_test contained \ NAME \ OFF \ PASS_REGULAR_EXPRESSION + \ SKIP_REGULAR_EXPRESSION \ TARGET_FILE \ WILL_FAIL \ WORKING_DIRECTORY https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=407dd1a910b1232cf915db9afb9c09022c6e22a9 commit 407dd1a910b1232cf915db9afb9c09022c6e22a9 Author: Gabor Bencze AuthorDate: Thu Jul 18 16:59:15 2019 +0200 Commit: Kyle Edwards CommitDate: Thu Jul 18 15:45:09 2019 -0400 Help: Add documentation for SKIP_REGULAR_EXPRESSION test property diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst index 884b2ee..a77ba37 100644 --- a/Help/command/add_test.rst +++ b/Help/command/add_test.rst @@ -38,8 +38,9 @@ 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 diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 0beca82..ae4be3e 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -407,6 +407,7 @@ Properties on Tests /prop_test/REQUIRED_FILES /prop_test/RESOURCE_LOCK /prop_test/RUN_SERIAL + /prop_test/SKIP_REGULAR_EXPRESSION /prop_test/SKIP_RETURN_CODE /prop_test/TIMEOUT /prop_test/TIMEOUT_AFTER_MATCH diff --git a/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst new file mode 100644 index 0000000..2c6d980 --- /dev/null +++ b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst @@ -0,0 +1,17 @@ +SKIP_REGULAR_EXPRESSION +----------------------- + +If the output matches this regular expression the test will be marked as skipped. + +If set, if the output matches one of specified regular expressions, +the test will be marked as skipped. Example: + +.. code-block:: cmake + + set_property(TEST mytest PROPERTY + SKIP_REGULAR_EXPRESSION "[^a-z]Skip" "SKIP" "Skipped" + ) + +``SKIP_REGULAR_EXPRESSION`` expects a list of regular expressions. + +See also the :prop_test:`SKIP_RETURN_CODE` property. diff --git a/Help/prop_test/SKIP_RETURN_CODE.rst b/Help/prop_test/SKIP_RETURN_CODE.rst index 3d48c2f..23c4c62 100644 --- a/Help/prop_test/SKIP_RETURN_CODE.rst +++ b/Help/prop_test/SKIP_RETURN_CODE.rst @@ -8,3 +8,5 @@ test are met. If such a situation should not be considered a hard failure a return code of the process can be specified that will mark the test as ``Not Run`` if it is encountered. Valid values are in the range of 0 to 255, inclusive. + +See also the :prop_test:`SKIP_REGULAR_EXPRESSION` property. diff --git a/Help/release/dev/add_skip_regular_expression_test_property.rst b/Help/release/dev/add_skip_regular_expression_test_property.rst new file mode 100644 index 0000000..20ef214 --- /dev/null +++ b/Help/release/dev/add_skip_regular_expression_test_property.rst @@ -0,0 +1,10 @@ +add_skip_regular_expression_test_property +----------------------------------------- + +* A new test property, :prop_test:`SKIP_REGULAR_EXPRESSION`, has been added. + This property is similar to :prop_test:`FAIL_REGULAR_EXPRESSION` and + :prop_test:`PASS_REGULAR_EXPRESSION`, but with the same meaning as + :prop_test:`SKIP_RETURN_CODE`. This is useful, for example, in cases where + the user has no control over the return code of the test. For example, in + Catch2, the return value is the number of assertion failed, therefore it is + impossible to use it for :prop_test:`SKIP_RETURN_CODE`. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7955d4e5d3038930f333bf12e15a09c7ae6088c commit d7955d4e5d3038930f333bf12e15a09c7ae6088c Author: Gabor Bencze AuthorDate: Thu Jul 18 16:58:14 2019 +0200 Commit: Kyle Edwards CommitDate: Thu Jul 18 11:52:10 2019 -0400 Tests: Create test for SKIP_REGULAR_EXPRESSION test property diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index f417db0..3fee79c 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -120,6 +120,20 @@ set_tests_properties(test1 PROPERTIES FAIL_REGULAR_EXPRESSION \"foo;test1;bar\" endfunction() run_FailRegexFoundTest() +function(run_SkipRegexFoundTest) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SkipRegexFound) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " +add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\") +set_tests_properties(test1 PROPERTIES SKIP_REGULAR_EXPRESSION \"test1\") +") + + run_cmake_command(SkipRegexFound ${CMAKE_CTEST_COMMAND} -V) +endfunction() +run_SkipRegexFoundTest() + function(run_SerialFailed) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SerialFailed) set(RunCMake_TEST_NO_CLEAN 1) diff --git a/Tests/RunCMake/CTestCommandLine/SkipRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/SkipRegexFound-check.cmake new file mode 100644 index 0000000..1a2dfa3 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/SkipRegexFound-check.cmake @@ -0,0 +1,13 @@ +set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log") +if(EXISTS "${last_test_log}") + file(READ "${last_test_log}" last_test_log_content) + string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}") + if(NOT last_test_log_content MATCHES " +Test Pass Reason: +Skip regular expression found in output. Regex=[[]test1]") + string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}") + set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}") + endif() +else() + set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}") +endif() https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f1dec86a53b789d164827eb6e89696f9e59f1c0 commit 4f1dec86a53b789d164827eb6e89696f9e59f1c0 Author: Gabor Bencze AuthorDate: Thu Jul 18 16:56:16 2019 +0200 Commit: Kyle Edwards CommitDate: Thu Jul 18 11:52:05 2019 -0400 CTest: Add SKIP_REGULAR_EXPRESSION test property diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 37a8abf..42534f7 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -823,6 +823,11 @@ static Json::Value DumpCTestProperties( "FAIL_REGULAR_EXPRESSION", DumpRegExToJsonArray(testProperties.ErrorRegularExpressions))); } + if (!testProperties.SkipRegularExpressions.empty()) { + properties.append(DumpCTestProperty( + "SKIP_REGULAR_EXPRESSION", + DumpRegExToJsonArray(testProperties.SkipRegularExpressions))); + } if (!testProperties.FixturesCleanup.empty()) { properties.append(DumpCTestProperty( "FIXTURES_CLEANUP", DumpToJsonArray(testProperties.FixturesCleanup))); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index f9ac1eb..65cf646 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -77,6 +77,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) } std::int64_t retVal = this->TestProcess->GetExitValue(); bool forceFail = false; + bool forceSkip = false; bool skipped = false; bool outputTestErrorsToConsole = false; if (!this->TestProperties->RequiredRegularExpressions.empty() && @@ -116,16 +117,34 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) } } } + if (!this->TestProperties->SkipRegularExpressions.empty() && + this->FailedDependencies.empty()) { + for (auto& skip : this->TestProperties->SkipRegularExpressions) { + if (skip.first.find(this->ProcessOutput)) { + reason = "Skip regular expression found in output."; + reason += " Regex=["; + reason += skip.second; + reason += "]"; + forceSkip = true; + break; + } + } + } std::ostringstream outputStream; if (res == cmProcess::State::Exited) { bool success = !forceFail && (retVal == 0 || !this->TestProperties->RequiredRegularExpressions.empty()); - if (this->TestProperties->SkipReturnCode >= 0 && - this->TestProperties->SkipReturnCode == retVal) { + if ((this->TestProperties->SkipReturnCode >= 0 && + this->TestProperties->SkipReturnCode == retVal) || + forceSkip) { this->TestResult.Status = cmCTestTestHandler::NOT_RUN; std::ostringstream s; - s << "SKIP_RETURN_CODE=" << this->TestProperties->SkipReturnCode; + if (forceSkip) { + s << "SKIP_REGULAR_EXPRESSION_MATCHED"; + } else { + s << "SKIP_RETURN_CODE=" << this->TestProperties->SkipReturnCode; + } this->TestResult.CompletionStatus = s.str(); cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Skipped "); skipped = true; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 9916ca3..c2748e1 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -526,7 +526,7 @@ int cmCTestTestHandler::ProcessHandler() std::vector disabledTests; for (cmCTestTestResult const& ft : resultsSet) { - if (cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_RETURN_CODE=") || + if (cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_") || ft.CompletionStatus == "Disabled") { disabledTests.push_back(ft); } @@ -599,7 +599,7 @@ int cmCTestTestHandler::ProcessHandler() for (cmCTestTestResult const& ft : resultsSet) { if (ft.Status != cmCTestTestHandler::COMPLETED && - !cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_RETURN_CODE=") && + !cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_") && ft.CompletionStatus != "Disabled") { ofs << ft.TestCount << ":" << ft.Name << std::endl; auto testColor = cmCTest::Color::RED; @@ -2229,6 +2229,13 @@ bool cmCTestTestHandler::SetTestsProperties( rt.ErrorRegularExpressions.emplace_back(cr, cr); } } + if (key == "SKIP_REGULAR_EXPRESSION") { + std::vector lval; + cmSystemTools::ExpandListArgument(val, lval); + for (std::string const& cr : lval) { + rt.SkipRegularExpressions.emplace_back(cr, cr); + } + } if (key == "PROCESSORS") { rt.Processors = atoi(val.c_str()); if (rt.Processors < 1) { diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 7f3f5e4..5bbc68e 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -118,6 +118,8 @@ public: std::vector> RequiredRegularExpressions; std::vector> + SkipRegularExpressions; + std::vector> TimeoutRegularExpressions; std::map Measurements; bool IsInBasedOnREOptions; ----------------------------------------------------------------------- Summary of changes: Auxiliary/vim/syntax/cmake.vim | 2 ++ Help/command/add_test.rst | 5 +++-- Help/manual/cmake-properties.7.rst | 1 + Help/prop_test/SKIP_REGULAR_EXPRESSION.rst | 17 +++++++++++++++ Help/prop_test/SKIP_RETURN_CODE.rst | 2 ++ .../add_skip_regular_expression_test_property.rst | 10 +++++++++ Source/CTest/cmCTestMultiProcessHandler.cxx | 5 +++++ Source/CTest/cmCTestRunTest.cxx | 25 +++++++++++++++++++--- Source/CTest/cmCTestTestHandler.cxx | 11 ++++++++-- Source/CTest/cmCTestTestHandler.h | 2 ++ Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 14 ++++++++++++ ...ound-check.cmake => SkipRegexFound-check.cmake} | 2 +- 12 files changed, 88 insertions(+), 8 deletions(-) create mode 100644 Help/prop_test/SKIP_REGULAR_EXPRESSION.rst create mode 100644 Help/release/dev/add_skip_regular_expression_test_property.rst copy Tests/RunCMake/CTestCommandLine/{RequiredRegexFound-check.cmake => SkipRegexFound-check.cmake} (90%) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jul 20 00:03:08 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 20 Jul 2019 00:03:08 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-389-g0c6e27b Message-ID: <20190720040308.71B8D112B76@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0c6e27bff1dc362993c2e1f5271424b4c881140a (commit) from 16bb46eaf3261a2991e35e22116fd8a51d031b15 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c6e27bff1dc362993c2e1f5271424b4c881140a commit 0c6e27bff1dc362993c2e1f5271424b4c881140a Author: Kitware Robot AuthorDate: Sat Jul 20 00:01:11 2019 -0400 Commit: Kitware Robot CommitDate: Sat Jul 20 00:01:11 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index cf21839..1a0e0d3 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 15) -set(CMake_VERSION_PATCH 20190719) +set(CMake_VERSION_PATCH 20190720) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jul 21 00:03:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 21 Jul 2019 00:03:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-390-g82aa694 Message-ID: <20190721040305.1E4D0107C9D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 82aa6941e9b292d95820b5723b4dcc8b70fbb417 (commit) from 0c6e27bff1dc362993c2e1f5271424b4c881140a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82aa6941e9b292d95820b5723b4dcc8b70fbb417 commit 82aa6941e9b292d95820b5723b4dcc8b70fbb417 Author: Kitware Robot AuthorDate: Sun Jul 21 00:01:05 2019 -0400 Commit: Kitware Robot CommitDate: Sun Jul 21 00:01:05 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1a0e0d3..218e24f 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 15) -set(CMake_VERSION_PATCH 20190720) +set(CMake_VERSION_PATCH 20190721) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 22 00:03:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 22 Jul 2019 00:03:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-391-gf3bbbb4 Message-ID: <20190722040306.65ABE112D7B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f3bbbb42f17c24737acf54d7626901f185ce6b6b (commit) from 82aa6941e9b292d95820b5723b4dcc8b70fbb417 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3bbbb42f17c24737acf54d7626901f185ce6b6b commit f3bbbb42f17c24737acf54d7626901f185ce6b6b Author: Kitware Robot AuthorDate: Mon Jul 22 00:01:06 2019 -0400 Commit: Kitware Robot CommitDate: Mon Jul 22 00:01:06 2019 -0400 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 218e24f..f0084cd 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 15) -set(CMake_VERSION_PATCH 20190721) +set(CMake_VERSION_PATCH 20190722) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 22 07:03:07 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 22 Jul 2019 07:03:07 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-393-gf4131e4 Message-ID: <20190722110307.4DB6C10D7EE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f4131e4e1b5ac9ea8940a04b81e7b2ef2fba5d3f (commit) via 5f6fd917a3c27f151e0dd05d12a75ab189f546e0 (commit) from f3bbbb42f17c24737acf54d7626901f185ce6b6b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4131e4e1b5ac9ea8940a04b81e7b2ef2fba5d3f commit f4131e4e1b5ac9ea8940a04b81e7b2ef2fba5d3f Merge: f3bbbb4 5f6fd91 Author: Craig Scott AuthorDate: Mon Jul 22 11:02:24 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 22 07:02:50 2019 -0400 Merge topic 'feature/message-indent' 5f6fd917a3 message(): Control indentation via CMAKE_MESSAGE_INDENT Acked-by: Kitware Robot Merge-request: !3464 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f6fd917a3c27f151e0dd05d12a75ab189f546e0 commit 5f6fd917a3c27f151e0dd05d12a75ab189f546e0 Author: Alex Turbov AuthorDate: Fri Jun 21 00:46:53 2019 +0300 Commit: Craig Scott CommitDate: Sun Jul 21 10:19:30 2019 +1000 message(): Control indentation via CMAKE_MESSAGE_INDENT diff --git a/Help/command/message.rst b/Help/command/message.rst index 5dca6b4..3002842 100644 --- a/Help/command/message.rst +++ b/Help/command/message.rst @@ -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. diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index e0ce6f7..a7079bc 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -69,6 +69,7 @@ Variables that Provide Information /variable/CMAKE_MAKE_PROGRAM /variable/CMAKE_MATCH_COUNT /variable/CMAKE_MATCH_n + /variable/CMAKE_MESSAGE_INDENT /variable/CMAKE_MINIMUM_REQUIRED_VERSION /variable/CMAKE_MINOR_VERSION /variable/CMAKE_NETRC diff --git a/Help/release/dev/message-indent.rst b/Help/release/dev/message-indent.rst new file mode 100644 index 0000000..b170708 --- /dev/null +++ b/Help/release/dev/message-indent.rst @@ -0,0 +1,5 @@ +message-indent +-------------- + +* The :command:`message` command learned indentation control with the new + :variable:`CMAKE_MESSAGE_INDENT` variable. diff --git a/Help/variable/CMAKE_MESSAGE_INDENT.rst b/Help/variable/CMAKE_MESSAGE_INDENT.rst new file mode 100644 index 0000000..f7975ab --- /dev/null +++ b/Help/variable/CMAKE_MESSAGE_INDENT.rst @@ -0,0 +1,30 @@ +CMAKE_MESSAGE_INDENT +-------------------- + +The :command:`message` command joins the strings from this list and for +log levels of ``NOTICE`` and below, it prepends the resultant string to +each line of the message. + +Example: + +.. code-block:: cmake + + list(APPEND listVar one two three) + + message(VERBOSE [[Collected items in the "listVar":]]) + list(APPEND CMAKE_MESSAGE_INDENT " ") + + foreach(item IN LISTS listVar) + message(VERBOSE ${item}) + endforeach() + + list(POP_BACK CMAKE_MESSAGE_INDENT) + message(VERBOSE "No more indent") + +Which results in the following output: + + -- Collected items in the "listVar": + -- one + -- two + -- tree + -- No more indent diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 5320ec5..58f3b2f 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -25,7 +25,6 @@ bool cmMessageCommand::InitialPass(std::vector const& args, auto i = args.cbegin(); auto type = MessageType::MESSAGE; - auto status = false; auto fatal = false; auto level = cmake::LogLevel::LOG_UNDEFINED; if (*i == "SEND_ERROR") { @@ -55,19 +54,15 @@ bool cmMessageCommand::InitialPass(std::vector const& args, } ++i; } else if (*i == "STATUS") { - status = true; level = cmake::LogLevel::LOG_STATUS; ++i; } else if (*i == "VERBOSE") { - status = true; level = cmake::LogLevel::LOG_VERBOSE; ++i; } else if (*i == "DEBUG") { - status = true; level = cmake::LogLevel::LOG_DEBUG; ++i; } else if (*i == "TRACE") { - status = true; level = cmake::LogLevel::LOG_TRACE; ++i; } else if (*i == "DEPRECATION") { @@ -105,17 +100,46 @@ bool cmMessageCommand::InitialPass(std::vector const& args, auto message = cmJoin(cmMakeRange(i, args.cend()), ""); - if (type != MessageType::MESSAGE) { - // we've overridden the message type, above, so display it directly - cmMessenger* m = this->Makefile->GetMessenger(); - m->DisplayMessage(type, message, this->Makefile->GetBacktrace()); - } else { - if (status) { - this->Makefile->DisplayStatus(message, -1); - } else { + if (cmake::LogLevel::LOG_NOTICE <= level) { + // Check if any indentation has requested: + // `CMAKE_MESSAGE_INDENT` is a list of "padding" pieces + // to be joined and prepended to the message lines. + auto indent = + cmJoin(cmSystemTools::ExpandedListArgument( + this->Makefile->GetSafeDefinition("CMAKE_MESSAGE_INDENT")), + ""); + // Make every line of the `message` indented + // NOTE Can't reuse `cmDocumentationFormatter::PrintPreformatted` + // here cuz it appends `\n` to the EOM ;-( + cmSystemTools::ReplaceString(message, "\n", "\n" + indent); + message = indent + message; + } + + switch (level) { + case cmake::LogLevel::LOG_ERROR: + case cmake::LogLevel::LOG_WARNING: + // we've overridden the message type, above, so display it directly + this->Makefile->GetMessenger()->DisplayMessage( + type, message, this->Makefile->GetBacktrace()); + break; + + case cmake::LogLevel::LOG_NOTICE: cmSystemTools::Message(message); - } + break; + + case cmake::LogLevel::LOG_STATUS: + case cmake::LogLevel::LOG_VERBOSE: + case cmake::LogLevel::LOG_DEBUG: + case cmake::LogLevel::LOG_TRACE: + this->Makefile->DisplayStatus(message, -1); + break; + + default: + assert("Unexpected log level! Review the `cmMessageCommand.cxx`." && + false); + break; } + if (fatal) { cmSystemTools::SetFatalErrorOccured(); } diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index cecfc7f..3c7e51c 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -52,3 +52,12 @@ run_cmake_command( message-loglevel-trace ${CMAKE_COMMAND} --loglevel=trace -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake ) + +run_cmake_command( + message-indent + ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent.cmake + ) +run_cmake_command( + message-indent-multiline + ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent-multiline.cmake + ) diff --git a/Tests/RunCMake/message/message-indent-multiline-stderr.txt b/Tests/RunCMake/message/message-indent-multiline-stderr.txt new file mode 100644 index 0000000..5853a31 --- /dev/null +++ b/Tests/RunCMake/message/message-indent-multiline-stderr.txt @@ -0,0 +1,3 @@ + >This is + >the multiline + >message diff --git a/Tests/RunCMake/message/message-indent-multiline-stdout.txt b/Tests/RunCMake/message/message-indent-multiline-stdout.txt new file mode 100644 index 0000000..ae0c72e --- /dev/null +++ b/Tests/RunCMake/message/message-indent-multiline-stdout.txt @@ -0,0 +1,8 @@ +-- >This is + >the multiline + >message + > + > +-- >This is + >the multiline + >message diff --git a/Tests/RunCMake/message/message-indent-multiline.cmake b/Tests/RunCMake/message/message-indent-multiline.cmake new file mode 100644 index 0000000..0f789bf --- /dev/null +++ b/Tests/RunCMake/message/message-indent-multiline.cmake @@ -0,0 +1,13 @@ +# NOTE Use non-space indent string, to check indentation +# of line endings and "empty" lines. +# ALERT Do not put any space characters after the non-space! +list(APPEND CMAKE_MESSAGE_INDENT " >") +set(msg [[This is +the multiline +message]]) # No `\n` at the end! +# NOTE Two empty lines after the text +message(STATUS "${msg}\n\n") +message(STATUS "${msg}") +# This is just to make sure NOTICE messages are also get indented: +# https://gitlab.kitware.com/cmake/cmake/issues/19418#note_588011 +message(NOTICE "${msg}") diff --git a/Tests/RunCMake/message/message-indent-stdout.txt b/Tests/RunCMake/message/message-indent-stdout.txt new file mode 100644 index 0000000..b2c3c60 --- /dev/null +++ b/Tests/RunCMake/message/message-indent-stdout.txt @@ -0,0 +1,13 @@ +-- COUNTING: +-- COUNTING_ENGLISH: +-- one +-- two +-- three +-- four +-- five +-- COUNTING_BAHASA: +-- satu +-- dua +-- tiga +-- empat +-- lima diff --git a/Tests/RunCMake/message/message-indent.cmake b/Tests/RunCMake/message/message-indent.cmake new file mode 100644 index 0000000..c07ff45 --- /dev/null +++ b/Tests/RunCMake/message/message-indent.cmake @@ -0,0 +1,19 @@ +function(debug_list LIST_VAR) + message(STATUS "${LIST_VAR}:") + list(APPEND CMAKE_MESSAGE_INDENT " ") + foreach(_item IN LISTS ${LIST_VAR}) + list(LENGTH ${_item} _item_len) + if(_item_len GREATER 1) + debug_list(${_item}) + else() + message(STATUS "${_item}") + endif() + endforeach() +endfunction() + +list(APPEND COUNTING_ENGLISH one two three four five) +list(APPEND COUNTING_BAHASA satu dua tiga empat lima) + +list(APPEND COUNTING COUNTING_ENGLISH COUNTING_BAHASA) + +debug_list(COUNTING) ----------------------------------------------------------------------- Summary of changes: Help/command/message.rst | 5 +++ Help/manual/cmake-variables.7.rst | 1 + Help/release/dev/message-indent.rst | 5 +++ Help/variable/CMAKE_MESSAGE_INDENT.rst | 30 +++++++++++++ Source/cmMessageCommand.cxx | 52 ++++++++++++++++------ Tests/RunCMake/message/RunCMakeTest.cmake | 9 ++++ .../message/message-indent-multiline-stderr.txt | 3 ++ .../message/message-indent-multiline-stdout.txt | 8 ++++ .../message/message-indent-multiline.cmake | 13 ++++++ Tests/RunCMake/message/message-indent-stdout.txt | 13 ++++++ Tests/RunCMake/message/message-indent.cmake | 19 ++++++++ 11 files changed, 144 insertions(+), 14 deletions(-) create mode 100644 Help/release/dev/message-indent.rst create mode 100644 Help/variable/CMAKE_MESSAGE_INDENT.rst create mode 100644 Tests/RunCMake/message/message-indent-multiline-stderr.txt create mode 100644 Tests/RunCMake/message/message-indent-multiline-stdout.txt create mode 100644 Tests/RunCMake/message/message-indent-multiline.cmake create mode 100644 Tests/RunCMake/message/message-indent-stdout.txt create mode 100644 Tests/RunCMake/message/message-indent.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 22 07:13:06 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 22 Jul 2019 07:13:06 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-395-g9e42075 Message-ID: <20190722111306.A26FB113B01@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9e420754988caa86ebe8835b8fe2d24ff380a59e (commit) via 5f96601675b7b4c1b8d609f31ce39ce35a96a1a5 (commit) from f4131e4e1b5ac9ea8940a04b81e7b2ef2fba5d3f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e420754988caa86ebe8835b8fe2d24ff380a59e commit 9e420754988caa86ebe8835b8fe2d24ff380a59e Merge: f4131e4 5f96601 Author: Craig Scott AuthorDate: Mon Jul 22 11:03:13 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 22 07:04:00 2019 -0400 Merge topic 'cpack-install-scripts' 5f96601675 CPack: Introduce CPACK_INSTALL_SCRIPTS variable Acked-by: Kitware Robot Merge-request: !3531 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f96601675b7b4c1b8d609f31ce39ce35a96a1a5 commit 5f96601675b7b4c1b8d609f31ce39ce35a96a1a5 Author: Alex Turbov AuthorDate: Tue Jul 16 19:19:10 2019 +0300 Commit: Alex Turbov CommitDate: Mon Jul 22 02:01:44 2019 +0300 CPack: Introduce CPACK_INSTALL_SCRIPTS variable The singular name `CPACK_INSTALL_SCRIPT` has existed but was not linked from the CPack documentation. Also, it supported multiple values and should have had a plural name. Add a plural-named alternative now. If both `CPACK_INSTALL_SCRIPTS` and `CPACK_INSTALL_SCRIPT` are set then ignore the latter with a warning. Signed-off-by: Alex Turbov diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index d4dbcca..e632e87 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -607,7 +607,6 @@ Variables for CPack /variable/CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION /variable/CPACK_INCLUDE_TOPLEVEL_DIRECTORY /variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS - /variable/CPACK_INSTALL_SCRIPT /variable/CPACK_PACKAGING_INSTALL_PREFIX /variable/CPACK_SET_DESTDIR /variable/CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION diff --git a/Help/release/dev/cpack-install-scripts.rst b/Help/release/dev/cpack-install-scripts.rst new file mode 100644 index 0000000..7b80d33 --- /dev/null +++ b/Help/release/dev/cpack-install-scripts.rst @@ -0,0 +1,5 @@ +cpack-install-scripts +--------------------- + +* The ``CPACK_INSTALL_SCRIPT`` variable has been deprecated in favor of the + new, more accurately named :variable:`CPACK_INSTALL_SCRIPTS` variable. diff --git a/Help/variable/CPACK_INSTALL_SCRIPT.rst b/Help/variable/CPACK_INSTALL_SCRIPT.rst deleted file mode 100644 index 12a48a4..0000000 --- a/Help/variable/CPACK_INSTALL_SCRIPT.rst +++ /dev/null @@ -1,8 +0,0 @@ -CPACK_INSTALL_SCRIPT --------------------- - -Extra CMake script provided by the user. - -If set this CMake script will be executed by CPack during its local -[CPack-private] installation which is done right before packaging the -files. The script is not called by e.g.: ``make install``. diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index c9008db..8a6a712 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -325,7 +325,21 @@ The following variables are for advanced uses of CPack: .. variable:: CPACK_INSTALL_COMMANDS - Extra commands to install components. + Extra commands to install components. The environment variable + ``CMAKE_INSTALL_PREFIX`` is set to the temporary install directory + during execution. + +.. variable:: CPACK_INSTALL_SCRIPTS + + Extra CMake scripts executed by CPack during its local staging + installation, which is done right before packaging the files. + The scripts are not called by a standalone install (e.g.: ``make install``). + For every script, the following variables will be set: + :variable:`CMAKE_CURRENT_SOURCE_DIR`, :variable:`CMAKE_CURRENT_BINARY_DIR` + and :variable:`CMAKE_INSTALL_PREFIX` (which is set to the staging install + directory). The singular form ``CMAKE_INSTALL_SCRIPT`` is supported as + an alternative variable for historical reasons, but its value is ignored if + ``CMAKE_INSTALL_SCRIPTS`` is set and a warning will be issued. .. variable:: CPACK_INSTALLED_DIRECTORIES diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 7e07ff4..540ce46 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -235,7 +235,7 @@ int cmCPackGenerator::InstallProject() return 0; } - // If the CPackConfig file sets CPACK_INSTALL_SCRIPT then run them + // If the CPackConfig file sets CPACK_INSTALL_SCRIPT(S) then run them // as listed if (!this->InstallProjectViaInstallScript(setDestDir, tempInstallDirectory)) { @@ -448,7 +448,19 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( int cmCPackGenerator::InstallProjectViaInstallScript( bool setDestDir, const std::string& tempInstallDirectory) { - const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPT"); + const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS"); + { + const char* const cmakeScript = this->GetOption("CPACK_INSTALL_SCRIPT"); + if (cmakeScript && cmakeScripts) { + cmCPackLogger( + cmCPackLog::LOG_WARNING, + "Both CPACK_INSTALL_SCRIPTS and CPACK_INSTALL_SCRIPT are set, " + "the latter will be ignored." + << std::endl); + } else if (cmakeScript && !cmakeScripts) { + cmakeScripts = cmakeScript; + } + } if (cmakeScripts && *cmakeScripts) { cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install scripts: " << cmakeScripts << std::endl); diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 37df57c..d93f280 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -33,6 +33,6 @@ run_cpack_test(TIMESTAMPS "DEB.TIMESTAMPS;TGZ" false "COMPONENT") unset(ENVIRONMENT) run_cpack_test(USER_FILELIST "RPM.USER_FILELIST" false "MONOLITHIC") run_cpack_test(MD5SUMS "DEB.MD5SUMS" false "MONOLITHIC;COMPONENT") -run_cpack_test(CPACK_INSTALL_SCRIPT "ZIP" false "MONOLITHIC") +run_cpack_test_subtests(CPACK_INSTALL_SCRIPTS "singular;plural;both" "ZIP" false "MONOLITHIC") run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY" false "MONOLITHIC;COMPONENT") run_cpack_test_subtests(EXTERNAL "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "External" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake deleted file mode 100644 index e3fe0ca..0000000 --- a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake +++ /dev/null @@ -1,11 +0,0 @@ -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/abc.txt" "test content") -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/user-script.cmake" - "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/foo\" - TYPE FILE FILES \"${CMAKE_CURRENT_BINARY_DIR}/abc.txt\")") -set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/user-script.cmake") - -function(run_after_include_cpack) - file(READ "${CPACK_OUTPUT_CONFIG_FILE}" conf_file_) - string(REGEX REPLACE "SET\\(CPACK_INSTALL_CMAKE_PROJECTS [^)]*\\)" "" conf_file_ "${conf_file_}") - file(WRITE "${CPACK_OUTPUT_CONFIG_FILE}" "${conf_file_}") -endfunction() diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/ExpectedFiles.cmake similarity index 100% rename from Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/ExpectedFiles.cmake rename to Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/ExpectedFiles.cmake diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt new file mode 100644 index 0000000..666030e --- /dev/null +++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt @@ -0,0 +1 @@ +CPack Warning: Both CPACK_INSTALL_SCRIPTS and CPACK_INSTALL_SCRIPT are set, the latter will be ignored. diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake new file mode 100644 index 0000000..249d2e6 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake @@ -0,0 +1,26 @@ +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/abc.txt" "test content") +set(user_script_ "${CMAKE_CURRENT_BINARY_DIR}/user-script.cmake") +file(WRITE "${user_script_}" + "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/foo\" + TYPE FILE FILES \"${CMAKE_CURRENT_BINARY_DIR}/abc.txt\")") + +if(RunCMake_SUBTEST_SUFFIX STREQUAL "both") + set(CPACK_INSTALL_SCRIPT "${user_script_}") + set(CPACK_INSTALL_SCRIPTS "${CPACK_INSTALL_SCRIPT}") + +elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "singular") + set(CPACK_INSTALL_SCRIPT "${user_script_}") + +elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "plural") + set(CPACK_INSTALL_SCRIPTS "${user_script_}") + +else() + message(FATAL_ERROR "Unexpected subtest name: ${RunCMake_SUBTEST_SUFFIX}") + +endif() + +function(run_after_include_cpack) + file(READ "${CPACK_OUTPUT_CONFIG_FILE}" conf_file_) + string(REGEX REPLACE "SET\\(CPACK_INSTALL_CMAKE_PROJECTS [^)]*\\)" "" conf_file_ "${conf_file_}") + file(WRITE "${CPACK_OUTPUT_CONFIG_FILE}" "${conf_file_}") +endfunction() ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-variables.7.rst | 1 - Help/release/dev/cpack-install-scripts.rst | 5 +++++ Help/variable/CPACK_INSTALL_SCRIPT.rst | 8 ------- Modules/CPack.cmake | 16 ++++++++++++- Source/CPack/cmCPackGenerator.cxx | 16 +++++++++++-- Tests/RunCMake/CPack/RunCMakeTest.cmake | 2 +- .../CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake | 11 --------- .../ExpectedFiles.cmake | 0 .../tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt | 1 + .../CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake | 26 ++++++++++++++++++++++ 10 files changed, 62 insertions(+), 24 deletions(-) create mode 100644 Help/release/dev/cpack-install-scripts.rst delete mode 100644 Help/variable/CPACK_INSTALL_SCRIPT.rst delete mode 100644 Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake rename Tests/RunCMake/CPack/tests/{CPACK_INSTALL_SCRIPT => CPACK_INSTALL_SCRIPTS}/ExpectedFiles.cmake (100%) create mode 100644 Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt create mode 100644 Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jul 22 08:23:05 2019 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 22 Jul 2019 08:23:05 -0400 (EDT) Subject: [Cmake-commits] CMake branch, master, updated. v3.15.0-411-gdbffd2f Message-ID: <20190722122305.144B514C8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dbffd2f4d5742374a96468d217490769d1fad288 (commit) via c1cb4945f3ffbabe84bcf7e55aa9f6341bdae097 (commit) via 303cf2791a1edb6f216e5306ea01ee0aa0bd9024 (commit) via 827b498a02453b0c098ca3aac1bdc0519a90ac0b (commit) via aaf3859e0ae8cff877862e2975319354ebb4d127 (commit) via c94e62c07eab14d6f36c18e11712d9d788fafd87 (commit) via ae2cfc4bd8c673804b8455fcb5c10d6a59c862c6 (commit) via 2682714a3fd9bd65c07246264a792c151d7fe2a3 (commit) via 3cbc15773fc12c96597d56f1f27106fa228328c8 (commit) via 33494a507d45871e1a04a071ed8d3bee453986b3 (commit) via c131e62f7bad6638178074cde45f74008067d9de (commit) via fab72918c9ffc862375823daa5a67cceb41cbc1f (commit) via 95d3598e0441bd9f276be1d6b4054442aad16608 (commit) via b97673f54ba0fad406f73c4790d5dd94beced6f9 (commit) via 26cd64d9776aa418d0083374084ff7738422b4c4 (commit) via 59f2aa63e4aeb99b3c51a0325cc5f622b126444c (commit) from 9e420754988caa86ebe8835b8fe2d24ff380a59e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dbffd2f4d5742374a96468d217490769d1fad288 commit dbffd2f4d5742374a96468d217490769d1fad288 Merge: c1cb494 ae2cfc4 Author: Brad King AuthorDate: Mon Jul 22 12:21:03 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 22 08:21:26 2019 -0400 Merge topic 'refactor-processhandler' ae2cfc4bd8 Refactor: Break cmCTestTestHandler::ProcessHandler() into smaller functions Acked-by: Kitware Robot Merge-request: !3580 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1cb4945f3ffbabe84bcf7e55aa9f6341bdae097 commit c1cb4945f3ffbabe84bcf7e55aa9f6341bdae097 Merge: 303cf27 c94e62c Author: Brad King AuthorDate: Mon Jul 22 12:20:09 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 22 08:20:34 2019 -0400 Merge topic 'tutorial_reference_cmake_install_command' c94e62c07e Tutorial: Updated to reference using cmake --install Acked-by: Kitware Robot Merge-request: !3572 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=303cf2791a1edb6f216e5306ea01ee0aa0bd9024 commit 303cf2791a1edb6f216e5306ea01ee0aa0bd9024 Merge: 827b498 b97673f Author: Brad King AuthorDate: Mon Jul 22 12:19:15 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 22 08:19:39 2019 -0400 Merge topic 'doc-string-multibyte' b97673f54b Help: Add note to each string() subcommand that assumes ASCII input 26cd64d977 Help: Fix language and formatting inconsistencies for string() command Acked-by: Kitware Robot Merge-request: !3559 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=827b498a02453b0c098ca3aac1bdc0519a90ac0b commit 827b498a02453b0c098ca3aac1bdc0519a90ac0b Merge: aaf3859 59f2aa6 Author: Brad King AuthorDate: Mon Jul 22 12:18:34 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 22 08:18:43 2019 -0400 Merge topic 'static-library-flags' 59f2aa63e4 Swift: fix static library handling Acked-by: Kitware Robot Merge-request: !3576 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aaf3859e0ae8cff877862e2975319354ebb4d127 commit aaf3859e0ae8cff877862e2975319354ebb4d127 Merge: 9e42075 2682714 Author: Brad King AuthorDate: Mon Jul 22 12:17:33 2019 +0000 Commit: Kitware Robot CommitDate: Mon Jul 22 08:17:41 2019 -0400 Merge topic 'refactor-usage-requirements' 2682714a3f cmGeneratorTarget: Refactor usage requirement genex evaluation 3cbc15773f cmGeneratorTarget: Move static functions to anonymous namespace 33494a507d cmGeneratorTarget: Order usage requirement processing logic consistently c131e62f7b cmGeneratorTarget: Remove unnecessary copy to local variable fab72918c9 cmGeneratorTarget: Remove unused member of internal class 95d3598e04 cmGeneratorExpressionDAGChecker: Avoid const_cast Acked-by: Kitware Robot Acked-by: Marc Chevrier Merge-request: !3578 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c94e62c07eab14d6f36c18e11712d9d788fafd87 commit c94e62c07eab14d6f36c18e11712d9d788fafd87 Author: Robert Maynard AuthorDate: Thu Jul 18 14:19:12 2019 -0400 Commit: Robert Maynard CommitDate: Fri Jul 19 14:38:05 2019 -0400 Tutorial: Updated to reference using cmake --install This is preferred over using `make install` as it allows for control over the install location, configuration, and component. diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst index db8e7a0..41ed0c4 100644 --- a/Help/guide/tutorial/index.rst +++ b/Help/guide/tutorial/index.rst @@ -228,7 +228,8 @@ remove our uses of the ``EXTRA_INCLUDES`` variable from the top-level CMakeLists. Once this is done, run **cmake** or **cmake-gui** to configure the project -and then build it with your chosen build tool. +and then build it with your chosen build tool or by using ``cmake --build .`` +from the build directory. Installing and Testing (Step 4) =============================== @@ -258,14 +259,15 @@ And the to top-level ``CMakeLists.txt`` we add: That is all that is needed to create a basic local install of the tutorial. Run **cmake** or **cmake-gui** to configure the project and then build it -with your chosen build tool. Build the ``install`` target by typing -``make install`` from the command line or build the ``INSTALL`` target from -an IDE. This will install the appropriate header files, libraries, and -executables. +with your chosen build tool. Run the install step by typing +``cmake --install .`` or from the command line, or build the ``INSTALL`` +target from an IDE. This will install the appropriate header files, libraries, +and executables. Verify that the installed Tutorial runs. Note: The CMake variable ``CMAKE_INSTALL_PREFIX`` is used to determine the root of where the files will -be installed. +be installed. If using ``cmake --install`` a custom installation directory can +be given via ``--prefix`` argument. Testing Support --------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae2cfc4bd8c673804b8455fcb5c10d6a59c862c6 commit ae2cfc4bd8c673804b8455fcb5c10d6a59c862c6 Author: Kyle Edwards AuthorDate: Tue Jul 9 11:57:33 2019 -0400 Commit: Kyle Edwards CommitDate: Fri Jul 19 14:13:56 2019 -0400 Refactor: Break cmCTestTestHandler::ProcessHandler() into smaller functions diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index c2748e1..cfbdad0 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -423,54 +423,11 @@ int cmCTestTestHandler::PostProcessHandler() return 1; } -// clearly it would be nice if this were broken up into a few smaller -// functions and commented... int cmCTestTestHandler::ProcessHandler() { - // Update internal data structure from generic one - this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation")); - this->SetUseUnion(cmSystemTools::IsOn(this->GetOption("UseUnion"))); - if (cmSystemTools::IsOn(this->GetOption("ScheduleRandom"))) { - this->CTest->SetScheduleType("Random"); - } - if (this->GetOption("ParallelLevel")) { - this->CTest->SetParallelLevel(atoi(this->GetOption("ParallelLevel"))); - } - - const char* val; - val = this->GetOption("LabelRegularExpression"); - if (val) { - this->UseIncludeLabelRegExpFlag = true; - this->IncludeLabelRegExp = val; - } - val = this->GetOption("ExcludeLabelRegularExpression"); - if (val) { - this->UseExcludeLabelRegExpFlag = true; - this->ExcludeLabelRegExp = val; - } - val = this->GetOption("IncludeRegularExpression"); - if (val) { - this->UseIncludeRegExp(); - this->SetIncludeRegExp(val); - } - val = this->GetOption("ExcludeRegularExpression"); - if (val) { - this->UseExcludeRegExp(); - this->SetExcludeRegExp(val); - } - val = this->GetOption("ExcludeFixtureRegularExpression"); - if (val) { - this->ExcludeFixtureRegExp = val; - } - val = this->GetOption("ExcludeFixtureSetupRegularExpression"); - if (val) { - this->ExcludeFixtureSetupRegExp = val; - } - val = this->GetOption("ExcludeFixtureCleanupRegularExpression"); - if (val) { - this->ExcludeFixtureCleanupRegExp = val; + if (!this->ProcessOptions()) { + return -1; } - this->SetRerunFailed(cmSystemTools::IsOn(this->GetOption("RerunFailed"))); this->TestResults.clear(); @@ -490,7 +447,6 @@ int cmCTestTestHandler::ProcessHandler() std::vector passed; std::vector failed; - int total; // start the real time clock auto clock_start = std::chrono::steady_clock::now(); @@ -499,9 +455,7 @@ int cmCTestTestHandler::ProcessHandler() auto clock_finish = std::chrono::steady_clock::now(); - total = int(passed.size()) + int(failed.size()); - - if (total == 0) { + if (passed.size() + failed.size() == 0) { if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { cmCTestLog(this->CTest, ERROR_MESSAGE, "No tests were found!!!" << std::endl); @@ -519,9 +473,6 @@ int cmCTestTestHandler::ProcessHandler() } } - typedef std::set - SetOfTests; SetOfTests resultsSet(this->TestResults.begin(), this->TestResults.end()); std::vector disabledTests; @@ -532,92 +483,182 @@ int cmCTestTestHandler::ProcessHandler() } } - float percent = float(passed.size()) * 100.0f / float(total); - if (!failed.empty() && percent > 99) { - percent = 99; - } + cmDuration durationInSecs = clock_finish - clock_start; + this->LogTestSummary(passed, failed, durationInSecs); - std::string passColorCode; - std::string failedColorCode; - if (failed.empty()) { - passColorCode = this->CTest->GetColorCode(cmCTest::Color::GREEN); - } else { - failedColorCode = this->CTest->GetColorCode(cmCTest::Color::RED); - } + this->LogDisabledTests(disabledTests); + + this->LogFailedTests(failed, resultsSet); + } + + if (!this->GenerateXML()) { + return 1; + } + + if (!this->PostProcessHandler()) { + this->LogFile = nullptr; + return -1; + } + + if (!failed.empty()) { + this->LogFile = nullptr; + return -1; + } + this->LogFile = nullptr; + return 0; +} + +bool cmCTestTestHandler::ProcessOptions() +{ + // Update internal data structure from generic one + this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation")); + this->SetUseUnion(cmSystemTools::IsOn(this->GetOption("UseUnion"))); + if (cmSystemTools::IsOn(this->GetOption("ScheduleRandom"))) { + this->CTest->SetScheduleType("Random"); + } + if (this->GetOption("ParallelLevel")) { + this->CTest->SetParallelLevel(atoi(this->GetOption("ParallelLevel"))); + } + + const char* val; + val = this->GetOption("LabelRegularExpression"); + if (val) { + this->UseIncludeLabelRegExpFlag = true; + this->IncludeLabelRegExp = val; + } + val = this->GetOption("ExcludeLabelRegularExpression"); + if (val) { + this->UseExcludeLabelRegExpFlag = true; + this->ExcludeLabelRegExp = val; + } + val = this->GetOption("IncludeRegularExpression"); + if (val) { + this->UseIncludeRegExp(); + this->SetIncludeRegExp(val); + } + val = this->GetOption("ExcludeRegularExpression"); + if (val) { + this->UseExcludeRegExp(); + this->SetExcludeRegExp(val); + } + val = this->GetOption("ExcludeFixtureRegularExpression"); + if (val) { + this->ExcludeFixtureRegExp = val; + } + val = this->GetOption("ExcludeFixtureSetupRegularExpression"); + if (val) { + this->ExcludeFixtureSetupRegExp = val; + } + val = this->GetOption("ExcludeFixtureCleanupRegularExpression"); + if (val) { + this->ExcludeFixtureCleanupRegExp = val; + } + this->SetRerunFailed(cmSystemTools::IsOn(this->GetOption("RerunFailed"))); + + return true; +} + +void cmCTestTestHandler::LogTestSummary(const std::vector& passed, + const std::vector& failed, + const cmDuration& durationInSecs) +{ + std::size_t total = passed.size() + failed.size(); + + float percent = float(passed.size()) * 100.0f / float(total); + if (!failed.empty() && percent > 99) { + percent = 99; + } + + std::string passColorCode; + std::string failedColorCode; + if (failed.empty()) { + passColorCode = this->CTest->GetColorCode(cmCTest::Color::GREEN); + } else { + failedColorCode = this->CTest->GetColorCode(cmCTest::Color::RED); + } + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl + << passColorCode << std::lround(percent) << "% tests passed" + << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) + << ", " << failedColorCode << failed.size() << " tests failed" + << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) + << " out of " << total << std::endl); + if ((!this->CTest->GetLabelsForSubprojects().empty() && + this->CTest->GetSubprojectSummary())) { + this->PrintLabelOrSubprojectSummary(true); + } + if (this->CTest->GetLabelSummary()) { + this->PrintLabelOrSubprojectSummary(false); + } + char realBuf[1024]; + sprintf(realBuf, "%6.2f sec", durationInSecs.count()); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, + "\nTotal Test time (real) = " << realBuf << "\n", + this->Quiet); +} + +void cmCTestTestHandler::LogDisabledTests( + const std::vector& disabledTests) +{ + if (!disabledTests.empty()) { + cmGeneratedFileStream ofs; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl - << passColorCode << std::lround(percent) << "% tests passed" - << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) - << ", " << failedColorCode << failed.size() << " tests failed" - << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) - << " out of " << total << std::endl); - if ((!this->CTest->GetLabelsForSubprojects().empty() && - this->CTest->GetSubprojectSummary())) { - this->PrintLabelOrSubprojectSummary(true); - } - if (this->CTest->GetLabelSummary()) { - this->PrintLabelOrSubprojectSummary(false); - } - char realBuf[1024]; - cmDuration durationInSecs = clock_finish - clock_start; - sprintf(realBuf, "%6.2f sec", durationInSecs.count()); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - "\nTotal Test time (real) = " << realBuf << "\n", - this->Quiet); + << "The following tests did not run:" << std::endl); + this->StartLogFile("TestsDisabled", ofs); - if (!disabledTests.empty()) { - cmGeneratedFileStream ofs; - cmCTestLog(this->CTest, HANDLER_OUTPUT, - std::endl - << "The following tests did not run:" << std::endl); - this->StartLogFile("TestsDisabled", ofs); - - const char* disabled_reason; - cmCTestLog(this->CTest, HANDLER_OUTPUT, - this->CTest->GetColorCode(cmCTest::Color::BLUE)); - for (cmCTestTestResult const& dt : disabledTests) { - ofs << dt.TestCount << ":" << dt.Name << std::endl; - if (dt.CompletionStatus == "Disabled") { - disabled_reason = "Disabled"; - } else { - disabled_reason = "Skipped"; - } - cmCTestLog(this->CTest, HANDLER_OUTPUT, - "\t" << std::setw(3) << dt.TestCount << " - " << dt.Name - << " (" << disabled_reason << ")" << std::endl); + const char* disabled_reason; + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetColorCode(cmCTest::Color::BLUE)); + for (cmCTestTestResult const& dt : disabledTests) { + ofs << dt.TestCount << ":" << dt.Name << std::endl; + if (dt.CompletionStatus == "Disabled") { + disabled_reason = "Disabled"; + } else { + disabled_reason = "Skipped"; } cmCTestLog(this->CTest, HANDLER_OUTPUT, - this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)); + "\t" << std::setw(3) << dt.TestCount << " - " << dt.Name + << " (" << disabled_reason << ")" << std::endl); } + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)); + } +} - if (!failed.empty()) { - cmGeneratedFileStream ofs; - cmCTestLog(this->CTest, HANDLER_OUTPUT, - std::endl - << "The following tests FAILED:" << std::endl); - this->StartLogFile("TestsFailed", ofs); - - for (cmCTestTestResult const& ft : resultsSet) { - if (ft.Status != cmCTestTestHandler::COMPLETED && - !cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_") && - ft.CompletionStatus != "Disabled") { - ofs << ft.TestCount << ":" << ft.Name << std::endl; - auto testColor = cmCTest::Color::RED; - if (this->GetTestStatus(ft) == "Not Run") { - testColor = cmCTest::Color::YELLOW; - } - cmCTestLog( - this->CTest, HANDLER_OUTPUT, - "\t" << this->CTest->GetColorCode(testColor) << std::setw(3) - << ft.TestCount << " - " << ft.Name << " (" - << this->GetTestStatus(ft) << ")" - << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) - << std::endl); +void cmCTestTestHandler::LogFailedTests(const std::vector& failed, + const SetOfTests& resultsSet) +{ + if (!failed.empty()) { + cmGeneratedFileStream ofs; + cmCTestLog(this->CTest, HANDLER_OUTPUT, + std::endl + << "The following tests FAILED:" << std::endl); + this->StartLogFile("TestsFailed", ofs); + + for (cmCTestTestResult const& ft : resultsSet) { + if (ft.Status != cmCTestTestHandler::COMPLETED && + !cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_") && + ft.CompletionStatus != "Disabled") { + ofs << ft.TestCount << ":" << ft.Name << std::endl; + auto testColor = cmCTest::Color::RED; + if (this->GetTestStatus(ft) == "Not Run") { + testColor = cmCTest::Color::YELLOW; } + cmCTestLog( + this->CTest, HANDLER_OUTPUT, + "\t" << this->CTest->GetColorCode(testColor) << std::setw(3) + << ft.TestCount << " - " << ft.Name << " (" + << this->GetTestStatus(ft) << ")" + << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR) + << std::endl); } } } +} +bool cmCTestTestHandler::GenerateXML() +{ if (this->CTest->GetProduceXML()) { cmGeneratedFileStream xmlfile; if (!this->StartResultingXML( @@ -628,23 +669,13 @@ int cmCTestTestHandler::ProcessHandler() << (this->MemCheck ? "memory check" : "testing") << " XML file" << std::endl); this->LogFile = nullptr; - return 1; + return false; } cmXMLWriter xml(xmlfile); this->GenerateDartOutput(xml); } - if (!this->PostProcessHandler()) { - this->LogFile = nullptr; - return -1; - } - - if (!failed.empty()) { - this->LogFile = nullptr; - return -1; - } - this->LogFile = nullptr; - return 0; + return true; } void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject) diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 5bbc68e..9345185 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -191,12 +191,25 @@ public: typedef std::vector ListOfTests; protected: + typedef std::set + SetOfTests; + // compute a final test list virtual int PreProcessHandler(); virtual int PostProcessHandler(); virtual void GenerateTestCommand(std::vector& args, int test); int ExecuteCommands(std::vector& vec); + bool ProcessOptions(); + void LogTestSummary(const std::vector& passed, + const std::vector& failed, + const cmDuration& durationInSecs); + void LogDisabledTests(const std::vector& disabledTests); + void LogFailedTests(const std::vector& failed, + const SetOfTests& resultsSet); + bool GenerateXML(); + void WriteTestResultHeader(cmXMLWriter& xml, cmCTestTestResult const& result); void WriteTestResultFooter(cmXMLWriter& xml, https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2682714a3fd9bd65c07246264a792c151d7fe2a3 commit 2682714a3fd9bd65c07246264a792c151d7fe2a3 Author: Brad King AuthorDate: Fri Jul 19 08:31:28 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 13:38:30 2019 -0400 cmGeneratorTarget: Refactor usage requirement genex evaluation Evaluate usage requirement generator expressions fully before entering the processing loops. This allows us to evaluate and collect all entries up front and then have only one call to the loop over them. This also allows `AddInterfaceEntries` to immediately evaluate the generator expressions it synthesizes, which will enable later optimization. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index da16788..6e6c917 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -206,6 +206,63 @@ void CreatePropertyGeneratorExpressions( } } +namespace { +// Represent a target property entry after evaluating generator expressions +// and splitting up lists. +struct EvaluatedTargetPropertyEntry +{ + EvaluatedTargetPropertyEntry(cmLinkImplItem const& item, + cmListFileBacktrace bt) + : LinkImplItem(item) + , Backtrace(std::move(bt)) + { + } + + // Move-only. + EvaluatedTargetPropertyEntry(EvaluatedTargetPropertyEntry&&) = default; + EvaluatedTargetPropertyEntry(EvaluatedTargetPropertyEntry const&) = delete; + EvaluatedTargetPropertyEntry& operator=(EvaluatedTargetPropertyEntry&&) = + delete; + EvaluatedTargetPropertyEntry& operator=( + EvaluatedTargetPropertyEntry const&) = delete; + + cmLinkImplItem const& LinkImplItem; + cmListFileBacktrace Backtrace; + std::vector Values; + bool ContextDependent = false; +}; + +EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry( + cmGeneratorTarget const* thisTarget, std::string const& config, + std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker, + cmGeneratorTarget::TargetPropertyEntry* entry) +{ + EvaluatedTargetPropertyEntry ee(entry->LinkImplItem, entry->GetBacktrace()); + cmSystemTools::ExpandListArgument( + entry->Evaluate(thisTarget->GetLocalGenerator(), config, false, thisTarget, + dagChecker, lang), + ee.Values); + if (entry->GetHadContextSensitiveCondition()) { + ee.ContextDependent = true; + } + return ee; +} + +std::vector EvaluateTargetPropertyEntries( + cmGeneratorTarget const* thisTarget, std::string const& config, + std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker, + std::vector const& in) +{ + std::vector out; + out.reserve(in.size()); + for (cmGeneratorTarget::TargetPropertyEntry* entry : in) { + out.emplace_back(EvaluateTargetPropertyEntry(thisTarget, config, lang, + dagChecker, entry)); + } + return out; +} +} + cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) : Target(t) , FortranModuleDirectoryCreated(false) @@ -1085,78 +1142,90 @@ bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const } namespace { -void AddInterfaceEntries( - cmGeneratorTarget const* thisTarget, std::string const& config, - std::string const& prop, - std::vector& entries) +void AddInterfaceEntries(cmGeneratorTarget const* headTarget, + std::string const& config, std::string const& prop, + std::string const& lang, + cmGeneratorExpressionDAGChecker* dagChecker, + std::vector& entries) { if (cmLinkImplementationLibraries const* impl = - thisTarget->GetLinkImplementationLibraries(config)) { + headTarget->GetLinkImplementationLibraries(config)) { for (cmLinkImplItem const& lib : impl->Libraries) { if (lib.Target) { std::string uniqueName = - thisTarget->GetGlobalGenerator()->IndexGeneratorTargetUniquely( + headTarget->GetGlobalGenerator()->IndexGeneratorTargetUniquely( lib.Target); std::string genex = "$"; cmGeneratorExpression ge(lib.Backtrace); std::unique_ptr cge = ge.Parse(genex); cge->SetEvaluateForBuildsystem(true); - entries.push_back(new TargetPropertyEntryGenex(std::move(cge), lib)); + + EvaluatedTargetPropertyEntry ee(lib, lib.Backtrace); + cmSystemTools::ExpandListArgument( + cge->Evaluate(headTarget->GetLocalGenerator(), config, false, + headTarget, dagChecker, lang), + ee.Values); + if (cge->GetHadContextSensitiveCondition()) { + ee.ContextDependent = true; + } + entries.emplace_back(std::move(ee)); } } } } -void AddObjectEntries( - cmGeneratorTarget const* thisTarget, std::string const& config, - std::vector& entries) +void AddObjectEntries(cmGeneratorTarget const* headTarget, + std::string const& config, + cmGeneratorExpressionDAGChecker* dagChecker, + std::vector& entries) { if (cmLinkImplementationLibraries const* impl = - thisTarget->GetLinkImplementationLibraries(config)) { + headTarget->GetLinkImplementationLibraries(config)) { for (cmLinkImplItem const& lib : impl->Libraries) { if (lib.Target && lib.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) { std::string uniqueName = - thisTarget->GetGlobalGenerator()->IndexGeneratorTargetUniquely( + headTarget->GetGlobalGenerator()->IndexGeneratorTargetUniquely( lib.Target); std::string genex = "$"; cmGeneratorExpression ge(lib.Backtrace); std::unique_ptr cge = ge.Parse(genex); cge->SetEvaluateForBuildsystem(true); - entries.push_back(new TargetPropertyEntryGenex(std::move(cge), lib)); + + EvaluatedTargetPropertyEntry ee(lib, lib.Backtrace); + cmSystemTools::ExpandListArgument( + cge->Evaluate(headTarget->GetLocalGenerator(), config, false, + headTarget, dagChecker), + ee.Values); + if (cge->GetHadContextSensitiveCondition()) { + ee.ContextDependent = true; + } + entries.emplace_back(std::move(ee)); } } } } -bool processSources( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& srcs, - std::unordered_set& uniqueSrcs, - cmGeneratorExpressionDAGChecker* dagChecker, std::string const& config, - bool debugSources) +bool processSources(cmGeneratorTarget const* tgt, + std::vector& entries, + std::vector>& srcs, + std::unordered_set& uniqueSrcs, + bool debugSources) { cmMakefile* mf = tgt->Target->GetMakefile(); bool contextDependent = false; - for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { - std::vector entrySources; - cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), - config, false, tgt, - dagChecker), - entrySources); - - if (entry->GetHadContextSensitiveCondition()) { + for (EvaluatedTargetPropertyEntry& entry : entries) { + if (entry.ContextDependent) { contextDependent = true; } - cmLinkImplItem const& item = entry->LinkImplItem; + cmLinkImplItem const& item = entry.LinkImplItem; std::string const& targetName = item.AsStr(); - for (std::string& src : entrySources) { + for (std::string& src : entry.Values) { cmSourceFile* sf = mf->GetOrCreateSource(src); std::string e; std::string fullPath = sf->GetFullPath(&e); @@ -1185,9 +1254,9 @@ bool processSources( src = fullPath; } std::string usedSources; - for (std::string const& src : entrySources) { + for (std::string const& src : entry.Values) { if (uniqueSrcs.insert(src).second) { - srcs.emplace_back(src, entry->GetBacktrace()); + srcs.emplace_back(src, entry.Backtrace); if (debugSources) { usedSources += " * " + src + "\n"; } @@ -1198,7 +1267,7 @@ bool processSources( MessageType::LOG, std::string("Used sources for target ") + tgt->GetName() + ":\n" + usedSources, - entry->GetBacktrace()); + entry.Backtrace); } } return contextDependent; @@ -1251,28 +1320,28 @@ std::vector> cmGeneratorTarget::GetSourceFilePaths( cmGeneratorExpressionDAGChecker dagChecker(this, "SOURCES", nullptr, nullptr); + std::vector entries = + EvaluateTargetPropertyEntries(this, config, std::string(), &dagChecker, + this->SourceEntries); + std::unordered_set uniqueSrcs; bool contextDependentDirectSources = - processSources(this, this->SourceEntries, files, uniqueSrcs, &dagChecker, - config, debugSources); + processSources(this, entries, files, uniqueSrcs, debugSources); // Collect INTERFACE_SOURCES of all direct link-dependencies. - std::vector - linkInterfaceSourcesEntries; - AddInterfaceEntries(this, config, "INTERFACE_SOURCES", - linkInterfaceSourcesEntries); + std::vector linkInterfaceSourcesEntries; + AddInterfaceEntries(this, config, "INTERFACE_SOURCES", std::string(), + &dagChecker, linkInterfaceSourcesEntries); std::vector::size_type numFilesBefore = files.size(); - bool contextDependentInterfaceSources = - processSources(this, linkInterfaceSourcesEntries, files, uniqueSrcs, - &dagChecker, config, debugSources); + bool contextDependentInterfaceSources = processSources( + this, linkInterfaceSourcesEntries, files, uniqueSrcs, debugSources); // Collect TARGET_OBJECTS of direct object link-dependencies. - std::vector linkObjectsEntries; - AddObjectEntries(this, config, linkObjectsEntries); + std::vector linkObjectsEntries; + AddObjectEntries(this, config, &dagChecker, linkObjectsEntries); std::vector::size_type numFilesBefore2 = files.size(); bool contextDependentObjects = - processSources(this, linkObjectsEntries, files, uniqueSrcs, &dagChecker, - config, debugSources); + processSources(this, linkObjectsEntries, files, uniqueSrcs, debugSources); if (!contextDependentDirectSources && !(contextDependentInterfaceSources && numFilesBefore < files.size()) && @@ -1280,8 +1349,6 @@ std::vector> cmGeneratorTarget::GetSourceFilePaths( this->LinkImplementationLanguageIsContextDependent = false; } - cmDeleteAll(linkInterfaceSourcesEntries); - cmDeleteAll(linkObjectsEntries); return files; } @@ -2775,25 +2842,18 @@ std::string cmGeneratorTarget::GetCreateRuleVariable( namespace { void processIncludeDirectories( cmGeneratorTarget const* tgt, - const std::vector& entries, + std::vector& entries, std::vector>& includes, - std::unordered_set& uniqueIncludes, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - bool debugIncludes, const std::string& language) -{ - for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { - std::vector entryIncludes; - cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), - config, false, tgt, - dagChecker, language), - entryIncludes); - cmLinkImplItem const& item = entry->LinkImplItem; + std::unordered_set& uniqueIncludes, bool debugIncludes) +{ + for (EvaluatedTargetPropertyEntry& entry : entries) { + cmLinkImplItem const& item = entry.LinkImplItem; std::string const& targetName = item.AsStr(); bool const fromImported = item.Target && item.Target->IsImported(); bool const checkCMP0027 = item.FromGenex; std::string usedIncludes; - for (std::string& entryInclude : entryIncludes) { + for (std::string& entryInclude : entry.Values) { if (fromImported && !cmSystemTools::FileExists(entryInclude)) { std::ostringstream e; MessageType messageType = MessageType::FATAL_ERROR; @@ -2867,7 +2927,7 @@ void processIncludeDirectories( } if (uniqueIncludes.insert(entryInclude).second) { - includes.emplace_back(entryInclude, entry->GetBacktrace()); + includes.emplace_back(entryInclude, entry.Backtrace); if (debugIncludes) { usedIncludes += " * " + entryInclude + "\n"; } @@ -2878,7 +2938,7 @@ void processIncludeDirectories( MessageType::LOG, std::string("Used includes for target ") + tgt->GetName() + ":\n" + usedIncludes, - entry->GetBacktrace()); + entry.Backtrace); } } } @@ -2908,14 +2968,12 @@ std::vector> cmGeneratorTarget::GetIncludeDirectories( this->DebugIncludesDone = true; } - processIncludeDirectories(this, this->IncludeDirectoriesEntries, includes, - uniqueIncludes, &dagChecker, config, debugIncludes, - lang); + std::vector entries = + EvaluateTargetPropertyEntries(this, config, lang, &dagChecker, + this->IncludeDirectoriesEntries); - std::vector - linkInterfaceIncludeDirectoriesEntries; - AddInterfaceEntries(this, config, "INTERFACE_INCLUDE_DIRECTORIES", - linkInterfaceIncludeDirectoriesEntries); + AddInterfaceEntries(this, config, "INTERFACE_INCLUDE_DIRECTORIES", lang, + &dagChecker, entries); if (this->Makefile->IsOn("APPLE")) { cmLinkImplementationLibraries const* impl = @@ -2931,16 +2989,14 @@ std::vector> cmGeneratorTarget::GetIncludeDirectories( libDir = frameworkCheck.match(1); - linkInterfaceIncludeDirectoriesEntries.push_back( - CreateTargetPropertyEntry(libDir)); + EvaluatedTargetPropertyEntry ee(lib, cmListFileBacktrace()); + ee.Values.emplace_back(std::move(libDir)); + entries.emplace_back(std::move(ee)); } } - processIncludeDirectories(this, linkInterfaceIncludeDirectoriesEntries, - includes, uniqueIncludes, &dagChecker, config, - debugIncludes, lang); - - cmDeleteAll(linkInterfaceIncludeDirectoriesEntries); + processIncludeDirectories(this, entries, includes, uniqueIncludes, + debugIncludes); return includes; } @@ -2952,33 +3008,25 @@ enum class OptionsParse }; namespace { -void processOptionsInternal( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& options, - std::unordered_set& uniqueOptions, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - bool debugOptions, const char* logName, std::string const& language, - OptionsParse parse) -{ - for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { - std::vector entryOptions; - cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), - config, false, tgt, - dagChecker, language), - entryOptions); +void processOptions(cmGeneratorTarget const* tgt, + std::vector const& entries, + std::vector>& options, + std::unordered_set& uniqueOptions, + bool debugOptions, const char* logName, OptionsParse parse) +{ + for (EvaluatedTargetPropertyEntry const& entry : entries) { std::string usedOptions; - for (std::string const& opt : entryOptions) { + for (std::string const& opt : entry.Values) { if (uniqueOptions.insert(opt).second) { if (parse == OptionsParse::Shell && cmHasLiteralPrefix(opt, "SHELL:")) { std::vector tmp; cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, tmp); for (std::string& o : tmp) { - options.emplace_back(std::move(o), entry->GetBacktrace()); + options.emplace_back(std::move(o), entry.Backtrace); } } else { - options.emplace_back(opt, entry->GetBacktrace()); + options.emplace_back(opt, entry.Backtrace); } if (debugOptions) { usedOptions += " * " + opt + "\n"; @@ -2990,23 +3038,10 @@ void processOptionsInternal( MessageType::LOG, std::string("Used ") + logName + std::string(" for target ") + tgt->GetName() + ":\n" + usedOptions, - entry->GetBacktrace()); + entry.Backtrace); } } } - -void processCompileOptions( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& options, - std::unordered_set& uniqueOptions, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - bool debugOptions, std::string const& language) -{ - processOptionsInternal(tgt, entries, options, uniqueOptions, dagChecker, - config, debugOptions, "compile options", language, - OptionsParse::Shell); -} } void cmGeneratorTarget::GetCompileOptions(std::vector& result, @@ -3044,39 +3079,19 @@ std::vector> cmGeneratorTarget::GetCompileOptions( this->DebugCompileOptionsDone = true; } - processCompileOptions(this, this->CompileOptionsEntries, result, - uniqueOptions, &dagChecker, config, debugOptions, - language); - - std::vector - linkInterfaceCompileOptionsEntries; + std::vector entries = + EvaluateTargetPropertyEntries(this, config, language, &dagChecker, + this->CompileOptionsEntries); - AddInterfaceEntries(this, config, "INTERFACE_COMPILE_OPTIONS", - linkInterfaceCompileOptionsEntries); + AddInterfaceEntries(this, config, "INTERFACE_COMPILE_OPTIONS", language, + &dagChecker, entries); - processCompileOptions(this, linkInterfaceCompileOptionsEntries, result, - uniqueOptions, &dagChecker, config, debugOptions, - language); + processOptions(this, entries, result, uniqueOptions, debugOptions, + "compile options", OptionsParse::Shell); - cmDeleteAll(linkInterfaceCompileOptionsEntries); return result; } -namespace { -void processCompileFeatures( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& options, - std::unordered_set& uniqueOptions, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - bool debugOptions) -{ - processOptionsInternal(tgt, entries, options, uniqueOptions, dagChecker, - config, debugOptions, "compile features", - std::string(), OptionsParse::None); -} -} - void cmGeneratorTarget::GetCompileFeatures(std::vector& result, const std::string& config) const { @@ -3111,36 +3126,19 @@ std::vector> cmGeneratorTarget::GetCompileFeatures( this->DebugCompileFeaturesDone = true; } - processCompileFeatures(this, this->CompileFeaturesEntries, result, - uniqueFeatures, &dagChecker, config, debugFeatures); + std::vector entries = + EvaluateTargetPropertyEntries(this, config, std::string(), &dagChecker, + this->CompileFeaturesEntries); - std::vector - linkInterfaceCompileFeaturesEntries; AddInterfaceEntries(this, config, "INTERFACE_COMPILE_FEATURES", - linkInterfaceCompileFeaturesEntries); + std::string(), &dagChecker, entries); - processCompileFeatures(this, linkInterfaceCompileFeaturesEntries, result, - uniqueFeatures, &dagChecker, config, debugFeatures); + processOptions(this, entries, result, uniqueFeatures, debugFeatures, + "compile features", OptionsParse::None); - cmDeleteAll(linkInterfaceCompileFeaturesEntries); return result; } -namespace { -void processCompileDefinitions( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& options, - std::unordered_set& uniqueOptions, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - bool debugOptions, std::string const& language) -{ - processOptionsInternal(tgt, entries, options, uniqueOptions, dagChecker, - config, debugOptions, "compile definitions", language, - OptionsParse::None); -} -} - void cmGeneratorTarget::GetCompileDefinitions( std::vector& result, const std::string& config, const std::string& language) const @@ -3177,14 +3175,13 @@ std::vector> cmGeneratorTarget::GetCompileDefinitions( this->DebugCompileDefinitionsDone = true; } - processCompileDefinitions(this, this->CompileDefinitionsEntries, list, - uniqueOptions, &dagChecker, config, debugDefines, - language); + std::vector entries = + EvaluateTargetPropertyEntries(this, config, language, &dagChecker, + this->CompileDefinitionsEntries); + + AddInterfaceEntries(this, config, "INTERFACE_COMPILE_DEFINITIONS", language, + &dagChecker, entries); - std::vector - linkInterfaceCompileDefinitionsEntries; - AddInterfaceEntries(this, config, "INTERFACE_COMPILE_DEFINITIONS", - linkInterfaceCompileDefinitionsEntries); if (!config.empty()) { std::string configPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config); @@ -3199,8 +3196,10 @@ std::vector> cmGeneratorTarget::GetCompileDefinitions( CM_FALLTHROUGH; } case cmPolicies::OLD: { - linkInterfaceCompileDefinitionsEntries.push_back( + std::unique_ptr entry( CreateTargetPropertyEntry(configProp)); + entries.emplace_back(EvaluateTargetPropertyEntry( + this, config, language, &dagChecker, entry.get())); } break; case cmPolicies::NEW: case cmPolicies::REQUIRED_ALWAYS: @@ -3210,29 +3209,12 @@ std::vector> cmGeneratorTarget::GetCompileDefinitions( } } - processCompileDefinitions(this, linkInterfaceCompileDefinitionsEntries, list, - uniqueOptions, &dagChecker, config, debugDefines, - language); + processOptions(this, entries, list, uniqueOptions, debugDefines, + "compile definitions", OptionsParse::None); - cmDeleteAll(linkInterfaceCompileDefinitionsEntries); return list; } -namespace { -void processLinkOptions( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& options, - std::unordered_set& uniqueOptions, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - bool debugOptions, std::string const& language) -{ - processOptionsInternal(tgt, entries, options, uniqueOptions, dagChecker, - config, debugOptions, "link options", language, - OptionsParse::Shell); -} -} - void cmGeneratorTarget::GetLinkOptions(std::vector& result, const std::string& config, const std::string& language) const @@ -3268,20 +3250,15 @@ std::vector> cmGeneratorTarget::GetLinkOptions( this->DebugLinkOptionsDone = true; } - processLinkOptions(this, this->LinkOptionsEntries, result, uniqueOptions, - &dagChecker, config, debugOptions, language); - - std::vector - linkInterfaceLinkOptionsEntries; + std::vector entries = + EvaluateTargetPropertyEntries(this, config, language, &dagChecker, + this->LinkOptionsEntries); - AddInterfaceEntries(this, config, "INTERFACE_LINK_OPTIONS", - linkInterfaceLinkOptionsEntries); + AddInterfaceEntries(this, config, "INTERFACE_LINK_OPTIONS", language, + &dagChecker, entries); - processLinkOptions(this, linkInterfaceLinkOptionsEntries, result, - uniqueOptions, &dagChecker, config, debugOptions, - language); - - cmDeleteAll(linkInterfaceLinkOptionsEntries); + processOptions(this, entries, result, uniqueOptions, debugOptions, + "link options", OptionsParse::Shell); // Last step: replace "LINKER:" prefixed elements by // actual linker wrapper @@ -3387,21 +3364,6 @@ std::vector> cmGeneratorTarget::GetLinkOptions( return result; } -namespace { -void processStaticLibraryLinkOptions( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& options, - std::unordered_set& uniqueOptions, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - std::string const& language) -{ - processOptionsInternal(tgt, entries, options, uniqueOptions, dagChecker, - config, false, "static library link options", - language, OptionsParse::Shell); -} -} - void cmGeneratorTarget::GetStaticLibraryLinkOptions( std::vector& result, const std::string& config, const std::string& language) const @@ -3418,47 +3380,41 @@ std::vector> cmGeneratorTarget::GetStaticLibraryLinkOptions( std::string const& config, std::string const& language) const { std::vector> result; - std::vector entries; std::unordered_set uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker(this, "STATIC_LIBRARY_OPTIONS", nullptr, nullptr); + std::vector entries; if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { std::vector options; cmSystemTools::ExpandListArgument(linkOptions, options); for (const auto& option : options) { - entries.push_back(CreateTargetPropertyEntry(option)); + std::unique_ptr entry( + CreateTargetPropertyEntry(option)); + entries.emplace_back(EvaluateTargetPropertyEntry( + this, config, language, &dagChecker, entry.get())); } } - processStaticLibraryLinkOptions(this, entries, result, uniqueOptions, - &dagChecker, config, language); + processOptions(this, entries, result, uniqueOptions, false, + "static library link options", OptionsParse::Shell); - cmDeleteAll(entries); return result; } namespace { -void processLinkDirectories( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& directories, - std::unordered_set& uniqueDirectories, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - bool debugDirectories, std::string const& language) -{ - for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { - std::vector entryDirectories; - cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), - config, false, tgt, - dagChecker, language), - entryDirectories); - - cmLinkImplItem const& item = entry->LinkImplItem; +void processLinkDirectories(cmGeneratorTarget const* tgt, + std::vector& entries, + std::vector>& directories, + std::unordered_set& uniqueDirectories, + bool debugDirectories) +{ + for (EvaluatedTargetPropertyEntry& entry : entries) { + cmLinkImplItem const& item = entry.LinkImplItem; std::string const& targetName = item.AsStr(); std::string usedDirectories; - for (std::string& entryDirectory : entryDirectories) { + for (std::string& entryDirectory : entry.Values) { if (!cmSystemTools::FileIsFullPath(entryDirectory)) { std::ostringstream e; bool noMessage = false; @@ -3511,7 +3467,7 @@ void processLinkDirectories( MessageType::LOG, std::string("Used link directories for target ") + tgt->GetName() + ":\n" + usedDirectories, - entry->GetBacktrace()); + entry.Backtrace); } } } @@ -3553,39 +3509,19 @@ std::vector> cmGeneratorTarget::GetLinkDirectories( this->DebugLinkDirectoriesDone = true; } - processLinkDirectories(this, this->LinkDirectoriesEntries, result, - uniqueDirectories, &dagChecker, config, - debugDirectories, language); - - std::vector - linkInterfaceLinkDirectoriesEntries; + std::vector entries = + EvaluateTargetPropertyEntries(this, config, language, &dagChecker, + this->LinkDirectoriesEntries); - AddInterfaceEntries(this, config, "INTERFACE_LINK_DIRECTORIES", - linkInterfaceLinkDirectoriesEntries); + AddInterfaceEntries(this, config, "INTERFACE_LINK_DIRECTORIES", language, + &dagChecker, entries); - processLinkDirectories(this, linkInterfaceLinkDirectoriesEntries, result, - uniqueDirectories, &dagChecker, config, - debugDirectories, language); + processLinkDirectories(this, entries, result, uniqueDirectories, + debugDirectories); - cmDeleteAll(linkInterfaceLinkDirectoriesEntries); return result; } -namespace { -void processLinkDepends( - cmGeneratorTarget const* tgt, - const std::vector& entries, - std::vector>& options, - std::unordered_set& uniqueOptions, - cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, - std::string const& language) -{ - processOptionsInternal(tgt, entries, options, uniqueOptions, dagChecker, - config, false, "link depends", language, - OptionsParse::None); -} -} - void cmGeneratorTarget::GetLinkDepends(std::vector& result, const std::string& config, const std::string& language) const @@ -3601,24 +3537,27 @@ std::vector> cmGeneratorTarget::GetLinkDepends( std::string const& config, std::string const& language) const { std::vector> result; - std::vector linkDependsEntries; std::unordered_set uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DEPENDS", nullptr, nullptr); + std::vector entries; if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) { std::vector depends; cmSystemTools::ExpandListArgument(linkDepends, depends); for (const auto& depend : depends) { - linkDependsEntries.push_back(CreateTargetPropertyEntry(depend)); + std::unique_ptr entry( + CreateTargetPropertyEntry(depend)); + entries.emplace_back(EvaluateTargetPropertyEntry( + this, config, language, &dagChecker, entry.get())); } } - AddInterfaceEntries(this, config, "INTERFACE_LINK_DEPENDS", - linkDependsEntries); - processLinkDepends(this, linkDependsEntries, result, uniqueOptions, - &dagChecker, config, language); + AddInterfaceEntries(this, config, "INTERFACE_LINK_DEPENDS", language, + &dagChecker, entries); + + processOptions(this, entries, result, uniqueOptions, false, "link depends", + OptionsParse::None); - cmDeleteAll(linkDependsEntries); return result; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3cbc15773fc12c96597d56f1f27106fa228328c8 commit 3cbc15773fc12c96597d56f1f27106fa228328c8 Author: Brad King AuthorDate: Fri Jul 19 10:29:02 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 13:05:21 2019 -0400 cmGeneratorTarget: Move static functions to anonymous namespace diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index aa1f8d1..da16788 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -651,12 +651,14 @@ std::vector const* cmGeneratorTarget::GetSourceDepends( return nullptr; } -static void handleSystemIncludesDep( - cmLocalGenerator* lg, cmGeneratorTarget const* depTgt, - const std::string& config, cmGeneratorTarget const* headTarget, - cmGeneratorExpressionDAGChecker* dagChecker, - std::vector& result, bool excludeImported, - std::string const& language) +namespace { +void handleSystemIncludesDep(cmLocalGenerator* lg, + cmGeneratorTarget const* depTgt, + const std::string& config, + cmGeneratorTarget const* headTarget, + cmGeneratorExpressionDAGChecker* dagChecker, + std::vector& result, + bool excludeImported, std::string const& language) { if (const char* dirs = depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")) { @@ -679,6 +681,7 @@ static void handleSystemIncludesDep( result); } } +} /* clang-format off */ #define IMPLEMENT_VISIT(KIND) \ @@ -1081,7 +1084,8 @@ bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const return this->Target->GetPropertyAsBool(prop); } -static void AddInterfaceEntries( +namespace { +void AddInterfaceEntries( cmGeneratorTarget const* thisTarget, std::string const& config, std::string const& prop, std::vector& entries) @@ -1104,7 +1108,7 @@ static void AddInterfaceEntries( } } -static void AddObjectEntries( +void AddObjectEntries( cmGeneratorTarget const* thisTarget, std::string const& config, std::vector& entries) { @@ -1126,7 +1130,7 @@ static void AddObjectEntries( } } -static bool processSources( +bool processSources( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& srcs, @@ -1199,6 +1203,7 @@ static bool processSources( } return contextDependent; } +} std::vector> cmGeneratorTarget::GetSourceFilePaths( std::string const& config) const @@ -1853,16 +1858,17 @@ std::string cmGeneratorTarget::GetSOName(const std::string& config) const return this->GetLibraryNames(config).SharedObject; } -static bool shouldAddFullLevel(cmGeneratorTarget::BundleDirectoryLevel level) +namespace { +bool shouldAddFullLevel(cmGeneratorTarget::BundleDirectoryLevel level) { return level == cmGeneratorTarget::FullLevel; } -static bool shouldAddContentLevel( - cmGeneratorTarget::BundleDirectoryLevel level) +bool shouldAddContentLevel(cmGeneratorTarget::BundleDirectoryLevel level) { return level == cmGeneratorTarget::ContentLevel || shouldAddFullLevel(level); } +} std::string cmGeneratorTarget::GetAppBundleDirectory( const std::string& config, BundleDirectoryLevel level) const @@ -2765,7 +2771,9 @@ std::string cmGeneratorTarget::GetCreateRuleVariable( } return ""; } -static void processIncludeDirectories( + +namespace { +void processIncludeDirectories( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& includes, @@ -2874,6 +2882,7 @@ static void processIncludeDirectories( } } } +} std::vector> cmGeneratorTarget::GetIncludeDirectories( const std::string& config, const std::string& lang) const @@ -2942,7 +2951,8 @@ enum class OptionsParse Shell }; -static void processOptionsInternal( +namespace { +void processOptionsInternal( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -2985,7 +2995,7 @@ static void processOptionsInternal( } } -static void processCompileOptions( +void processCompileOptions( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -2997,6 +3007,7 @@ static void processCompileOptions( config, debugOptions, "compile options", language, OptionsParse::Shell); } +} void cmGeneratorTarget::GetCompileOptions(std::vector& result, const std::string& config, @@ -3051,7 +3062,8 @@ std::vector> cmGeneratorTarget::GetCompileOptions( return result; } -static void processCompileFeatures( +namespace { +void processCompileFeatures( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -3063,6 +3075,7 @@ static void processCompileFeatures( config, debugOptions, "compile features", std::string(), OptionsParse::None); } +} void cmGeneratorTarget::GetCompileFeatures(std::vector& result, const std::string& config) const @@ -3113,7 +3126,8 @@ std::vector> cmGeneratorTarget::GetCompileFeatures( return result; } -static void processCompileDefinitions( +namespace { +void processCompileDefinitions( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -3125,6 +3139,7 @@ static void processCompileDefinitions( config, debugOptions, "compile definitions", language, OptionsParse::None); } +} void cmGeneratorTarget::GetCompileDefinitions( std::vector& result, const std::string& config, @@ -4343,8 +4358,9 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender, } } -static std::string intersect(const std::set& s1, - const std::set& s2) +namespace { +std::string intersect(const std::set& s1, + const std::set& s2) { std::set intersect; std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), @@ -4355,9 +4371,9 @@ static std::string intersect(const std::set& s1, return ""; } -static std::string intersect(const std::set& s1, - const std::set& s2, - const std::set& s3) +std::string intersect(const std::set& s1, + const std::set& s2, + const std::set& s3) { std::string result; result = intersect(s1, s2); @@ -4371,10 +4387,10 @@ static std::string intersect(const std::set& s1, return intersect(s2, s3); } -static std::string intersect(const std::set& s1, - const std::set& s2, - const std::set& s3, - const std::set& s4) +std::string intersect(const std::set& s1, + const std::set& s2, + const std::set& s3, + const std::set& s4) { std::string result; result = intersect(s1, s2); @@ -4391,6 +4407,7 @@ static std::string intersect(const std::set& s1, } return intersect(s2, s3, s4); } +} void cmGeneratorTarget::CheckPropertyCompatibility( cmComputeLinkInformation* info, const std::string& config) const https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33494a507d45871e1a04a071ed8d3bee453986b3 commit 33494a507d45871e1a04a071ed8d3bee453986b3 Author: Brad King AuthorDate: Thu Jul 18 20:29:16 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 09:58:12 2019 -0400 cmGeneratorTarget: Order usage requirement processing logic consistently Re-order logic in all `process*` methods so that they all evaluate generator expressions at the beginning of their loops. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index d2671cd..aa1f8d1 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1139,11 +1139,9 @@ static bool processSources( bool contextDependent = false; for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { - cmLinkImplItem const& item = entry->LinkImplItem; - std::string const& targetName = item.AsStr(); std::vector entrySources; cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), - config, false, tgt, tgt, + config, false, tgt, dagChecker), entrySources); @@ -1151,6 +1149,9 @@ static bool processSources( contextDependent = true; } + cmLinkImplItem const& item = entry->LinkImplItem; + std::string const& targetName = item.AsStr(); + for (std::string& src : entrySources) { cmSourceFile* sf = mf->GetOrCreateSource(src); std::string e; @@ -2773,15 +2774,15 @@ static void processIncludeDirectories( bool debugIncludes, const std::string& language) { for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { - cmLinkImplItem const& item = entry->LinkImplItem; - std::string const& targetName = item.AsStr(); - bool const fromImported = item.Target && item.Target->IsImported(); - bool const checkCMP0027 = item.FromGenex; std::vector entryIncludes; cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, dagChecker, language), entryIncludes); + cmLinkImplItem const& item = entry->LinkImplItem; + std::string const& targetName = item.AsStr(); + bool const fromImported = item.Target && item.Target->IsImported(); + bool const checkCMP0027 = item.FromGenex; std::string usedIncludes; for (std::string& entryInclude : entryIncludes) { @@ -3432,15 +3433,15 @@ void processLinkDirectories( bool debugDirectories, std::string const& language) { for (cmGeneratorTarget::TargetPropertyEntry* entry : entries) { - cmLinkImplItem const& item = entry->LinkImplItem; - std::string const& targetName = item.AsStr(); - std::vector entryDirectories; cmSystemTools::ExpandListArgument(entry->Evaluate(tgt->GetLocalGenerator(), config, false, tgt, dagChecker, language), entryDirectories); + cmLinkImplItem const& item = entry->LinkImplItem; + std::string const& targetName = item.AsStr(); + std::string usedDirectories; for (std::string& entryDirectory : entryDirectories) { if (!cmSystemTools::FileIsFullPath(entryDirectory)) { https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c131e62f7bad6638178074cde45f74008067d9de commit c131e62f7bad6638178074cde45f74008067d9de Author: Brad King AuthorDate: Thu Jul 18 21:05:29 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 09:58:12 2019 -0400 cmGeneratorTarget: Remove unnecessary copy to local variable diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index fe771c6..d2671cd 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2856,12 +2856,11 @@ static void processIncludeDirectories( if (!cmSystemTools::IsOff(entryInclude)) { cmSystemTools::ConvertToUnixSlashes(entryInclude); } - std::string inc = entryInclude; - if (uniqueIncludes.insert(inc).second) { - includes.emplace_back(inc, entry->GetBacktrace()); + if (uniqueIncludes.insert(entryInclude).second) { + includes.emplace_back(entryInclude, entry->GetBacktrace()); if (debugIncludes) { - usedIncludes += " * " + inc + "\n"; + usedIncludes += " * " + entryInclude + "\n"; } } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fab72918c9ffc862375823daa5a67cceb41cbc1f commit fab72918c9ffc862375823daa5a67cceb41cbc1f Author: Brad King AuthorDate: Thu Jul 18 20:23:13 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 09:58:12 2019 -0400 cmGeneratorTarget: Remove unused member of internal class diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index d3e8248..fe771c6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -92,9 +92,6 @@ public: virtual bool GetHadContextSensitiveCondition() const { return false; } cmLinkImplItem const& LinkImplItem; - -private: - cmListFileBacktrace Backtrace; }; cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95d3598e0441bd9f276be1d6b4054442aad16608 commit 95d3598e0441bd9f276be1d6b4054442aad16608 Author: Brad King AuthorDate: Fri Jul 19 06:15:03 2019 -0400 Commit: Brad King CommitDate: Fri Jul 19 09:58:12 2019 -0400 cmGeneratorExpressionDAGChecker: Avoid const_cast Make a member mutable to avoid casting away const of a whole object. diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 728f2a4..817f41e 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -68,9 +68,7 @@ void cmGeneratorExpressionDAGChecker::Initialize() return; } } - const_cast(top) - ->Seen[this->Target] - .insert(this->Property); + top->Seen[this->Target].insert(this->Property); } } diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index e1fba5e..6d7d6ef 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -88,7 +88,7 @@ private: const cmGeneratorExpressionDAGChecker* const Parent; cmGeneratorTarget const* Target; const std::string Property; - std::map> Seen; + mutable std::map> Seen; const GeneratorExpressionContent* const Content; const cmListFileBacktrace Backtrace; Result CheckResult; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b97673f54ba0fad406f73c4790d5dd94beced6f9 commit b97673f54ba0fad406f73c4790d5dd94beced6f9 Author: Craig Scott AuthorDate: Fri Jul 19 20:35:40 2019 +1000 Commit: Craig Scott CommitDate: Fri Jul 19 20:47:21 2019 +1000 Help: Add note to each string() subcommand that assumes ASCII input Fixes: #19465 diff --git a/Help/command/string.rst b/Help/command/string.rst index c0d83f8..81a2061 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -59,6 +59,10 @@ search for the position of the last occurrence of the specified ````. If the ```` is not found, a position of -1 is returned. +The ``string(FIND)`` subcommand treats all strings as ASCII-only characters. +The index stored in ```` will also be counted in bytes, +so strings containing multi-byte characters may lead to unexpected results. + .. _REPLACE: .. code-block:: cmake @@ -239,7 +243,9 @@ Convert ```` to upper characters. string(LENGTH ) -Store in an ```` a given string's length. +Store in an ```` a given string's length in bytes. +Note that this means if ```` contains multi-byte characters, the +result stored in ```` will *not* be the number of characters. .. _SUBSTRING: @@ -252,6 +258,9 @@ Store in an ```` a substring of a given ````. If will be returned. If ```` is shorter than ```` then the end of the string is used instead. +Both ```` and ```` are counted in bytes, so care must +be exercised if ```` could contain multi-byte characters. + .. note:: CMake 3.1 and below reported an error if ```` pointed past the end of ````. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26cd64d9776aa418d0083374084ff7738422b4c4 commit 26cd64d9776aa418d0083374084ff7738422b4c4 Author: Craig Scott AuthorDate: Tue Jul 16 22:03:15 2019 +1000 Commit: Craig Scott CommitDate: Fri Jul 19 20:47:21 2019 +1000 Help: Fix language and formatting inconsistencies for string() command diff --git a/Help/command/string.rst b/Help/command/string.rst index 2e89d7b..c0d83f8 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -22,8 +22,8 @@ Synopsis string(`PREPEND`_ [...]) string(`CONCAT`_ [...]) string(`JOIN`_ [...]) - string(`TOLOWER`_ ) - string(`TOUPPER`_ ) + string(`TOLOWER`_ ) + string(`TOUPPER`_ ) string(`LENGTH`_ ) string(`SUBSTRING`_ ) string(`STRIP`_ ) @@ -38,7 +38,7 @@ Synopsis `Generation`_ string(`ASCII`_ ... ) - string(`CONFIGURE`_ [...]) + string(`CONFIGURE`_ [...]) string(`MAKE_C_IDENTIFIER`_ ) string(`RANDOM`_ [