[Cmake-commits] CMake branch, master, updated. v3.12.0-rc1-105-gae153c6
Kitware Robot
kwrobot at kitware.com
Mon Jun 25 09:55:09 EDT 2018
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 ae153c691454ec24dbae5caa5d0e4bb2351d0886 (commit)
via 383f29fd63e98e574606150c5f717d3298f4d5c9 (commit)
via 3c4698da3a3c8470c8b6b1d025b10af0d5371625 (commit)
via b759f7068f4e263917ab029f9e9a518dfd386ddb (commit)
via d548994afcfccbff17fcba5698ed10f083142059 (commit)
via 142a6257294afbfdf86ec13fdb4ecf303b131f99 (commit)
from 8e50de4dc5c06a7a2279bc162a59e6e8ba9ca4fa (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=ae153c691454ec24dbae5caa5d0e4bb2351d0886
commit ae153c691454ec24dbae5caa5d0e4bb2351d0886
Merge: 383f29f 3c4698d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 25 13:53:25 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Jun 25 09:54:11 2018 -0400
Merge topic 'vs-filter-default-toolset'
3c4698da3a VS: Allow toolset version selection to specify default toolset
b759f7068f cmVSSetupHelper: Expose default toolset version
d548994afc cmVSSetupHelper: Use in-class member initialization
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2162
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=383f29fd63e98e574606150c5f717d3298f4d5c9
commit 383f29fd63e98e574606150c5f717d3298f4d5c9
Merge: 8e50de4 142a625
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 25 13:53:17 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Jun 25 09:53:24 2018 -0400
Merge topic 'file-GLOB-remove-new-errors'
142a625729 file: Drop error cases added by CMake 3.12.0-rc1 to avoid regressions
Acked-by: Kitware Robot <kwrobot at kitware.com>
Acked-by: Shane Parris <shane.lee.parris at gmail.com>
Merge-request: !2164
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c4698da3a3c8470c8b6b1d025b10af0d5371625
commit 3c4698da3a3c8470c8b6b1d025b10af0d5371625
Author: Basil Fierz <basil.fierz at hotmail.com>
AuthorDate: Wed Jun 20 22:34:54 2018 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sun Jun 24 10:36:03 2018 -0400
VS: Allow toolset version selection to specify default toolset
Teach the feature added by commit v3.12.0-rc1~38^2 (VS: Add option to
select the version of the toolset used by VS 2017, 2018-05-19) to accept
the default toolset version in addition to older versions. If the
default toolset version is supplied, simply clear it so the default will
be used.
Fixes: #18107
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 8c20313..a5709d5 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -263,25 +263,32 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
this->GeneratorToolsetVersion.clear();
}
- std::string const toolsetPath = this->GetAuxiliaryToolset();
- if (!toolsetPath.empty() && !cmSystemTools::FileExists(toolsetPath)) {
-
- std::ostringstream e;
- /* clang-format off */
- e <<
- "Generator\n"
- " " << this->GetName() << "\n"
- "given toolset and version specification\n"
- " " << this->GetPlatformToolsetString() << ",version=" <<
- this->GeneratorToolsetVersion << "\n"
- "does not seem to be installed at\n" <<
- " " << toolsetPath;
- ;
- /* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
-
- // Clear the configured tool-set
+ bool const isDefaultToolset =
+ this->IsDefaultToolset(this->GeneratorToolsetVersion);
+ if (isDefaultToolset) {
+ // If the given version is the default toolset, remove the setting
this->GeneratorToolsetVersion.clear();
+ } else {
+ std::string const toolsetPath = this->GetAuxiliaryToolset();
+ if (!toolsetPath.empty() && !cmSystemTools::FileExists(toolsetPath)) {
+
+ std::ostringstream e;
+ /* clang-format off */
+ e <<
+ "Generator\n"
+ " " << this->GetName() << "\n"
+ "given toolset and version specification\n"
+ " " << this->GetPlatformToolsetString() << ",version=" <<
+ this->GeneratorToolsetVersion << "\n"
+ "does not seem to be installed at\n" <<
+ " " << toolsetPath;
+ ;
+ /* clang-format on */
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+
+ // Clear the configured tool-set
+ this->GeneratorToolsetVersion.clear();
+ }
}
}
@@ -615,6 +622,12 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetCudaString() const
return this->GeneratorToolsetCuda;
}
+bool cmGlobalVisualStudio10Generator::IsDefaultToolset(
+ const std::string&) const
+{
+ return true;
+}
+
std::string cmGlobalVisualStudio10Generator::GetAuxiliaryToolset() const
{
return {};
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index f85b773..6eb597c 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -106,6 +106,7 @@ public:
std::string Encoding() override;
virtual const char* GetToolsVersion() { return "4.0"; }
+ virtual bool IsDefaultToolset(const std::string& version) const;
virtual std::string GetAuxiliaryToolset() const;
bool FindMakeProgram(cmMakefile* mf) override;
diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx
index 6af5793..9983a43 100644
--- a/Source/cmGlobalVisualStudio15Generator.cxx
+++ b/Source/cmGlobalVisualStudio15Generator.cxx
@@ -158,6 +158,27 @@ bool cmGlobalVisualStudio15Generator::GetVSInstance(std::string& dir) const
return vsSetupAPIHelper.GetVSInstanceInfo(dir);
}
+bool cmGlobalVisualStudio15Generator::IsDefaultToolset(
+ const std::string& version) const
+{
+ if (version.empty()) {
+ return true;
+ }
+
+ std::string vcToolsetVersion;
+ if (this->vsSetupAPIHelper.GetVCToolsetVersion(vcToolsetVersion)) {
+
+ cmsys::RegularExpression regex("[0-9][0-9]\\.[0-9]+");
+ if (regex.find(version) && regex.find(vcToolsetVersion)) {
+ const auto majorMinorEnd = vcToolsetVersion.find('.', 3);
+ const auto majorMinor = vcToolsetVersion.substr(0, majorMinorEnd);
+ return version == majorMinor;
+ }
+ }
+
+ return false;
+}
+
std::string cmGlobalVisualStudio15Generator::GetAuxiliaryToolset() const
{
const char* version = this->GetPlatformToolsetVersion();
diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h
index 3b9cfc7..cdc97ad 100644
--- a/Source/cmGlobalVisualStudio15Generator.h
+++ b/Source/cmGlobalVisualStudio15Generator.h
@@ -32,6 +32,7 @@ public:
bool GetVSInstance(std::string& dir) const;
+ bool IsDefaultToolset(const std::string& version) const override;
std::string GetAuxiliaryToolset() const override;
protected:
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b759f7068f4e263917ab029f9e9a518dfd386ddb
commit b759f7068f4e263917ab029f9e9a518dfd386ddb
Author: Basil Fierz <basil.fierz at hotmail.com>
AuthorDate: Wed Jun 20 22:34:54 2018 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 22 10:07:09 2018 -0400
cmVSSetupHelper: Expose default toolset version
We already detect the VS toolset version. Expose it to clients.
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index 4ca847e..22fe007 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -199,6 +199,7 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(
if (!cmSystemTools::FileIsDirectory(vcToolsDir)) {
return false;
}
+ vsInstanceInfo.VCToolsetVersion = vcToolsVersion;
}
// Reboot may have been required before the product package was registered
@@ -254,6 +255,18 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation)
return isInstalled;
}
+bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion)
+{
+ vsToolsetVersion.clear();
+ bool isInstalled = this->EnumerateAndChooseVSInstance();
+
+ if (isInstalled) {
+ vsToolsetVersion = chosenInstanceInfo.VCToolsetVersion;
+ }
+
+ return isInstalled && !vsToolsetVersion.empty();
+}
+
bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
{
bool isVSInstanceExists = false;
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index 8ce36de..4144c15 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -107,6 +107,7 @@ struct VSInstanceInfo
std::wstring InstanceId;
std::wstring VSInstallLocation;
std::wstring Version;
+ std::string VCToolsetVersion;
ULONGLONG ullVersion = 0;
bool IsWin10SDKInstalled = false;
bool IsWin81SDKInstalled = false;
@@ -126,6 +127,7 @@ public:
bool IsVS2017Installed();
bool GetVSInstanceInfo(std::string& vsInstallLocation);
+ bool GetVCToolsetVersion(std::string& vsToolsetVersion);
bool IsWin10SDKInstalled();
bool IsWin81SDKInstalled();
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d548994afcfccbff17fcba5698ed10f083142059
commit d548994afcfccbff17fcba5698ed10f083142059
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 22 10:03:00 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 22 10:07:09 2018 -0400
cmVSSetupHelper: Use in-class member initialization
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index 368341c..8ce36de 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -107,16 +107,11 @@ struct VSInstanceInfo
std::wstring InstanceId;
std::wstring VSInstallLocation;
std::wstring Version;
- ULONGLONG ullVersion;
- bool IsWin10SDKInstalled;
- bool IsWin81SDKInstalled;
+ ULONGLONG ullVersion = 0;
+ bool IsWin10SDKInstalled = false;
+ bool IsWin81SDKInstalled = false;
- VSInstanceInfo()
- {
- InstanceId = VSInstallLocation = Version = L"";
- ullVersion = 0;
- IsWin10SDKInstalled = IsWin81SDKInstalled = false;
- }
+ VSInstanceInfo() = default;
std::string GetInstallLocation() const;
};
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=142a6257294afbfdf86ec13fdb4ecf303b131f99
commit 142a6257294afbfdf86ec13fdb4ecf303b131f99
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 22 09:31:45 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 22 09:39:05 2018 -0400
file: Drop error cases added by CMake 3.12.0-rc1 to avoid regressions
Refactoring in commit v3.12.0-rc1~418^2~3 (Refactor HandleGlobCommand,
2018-02-13) introduced error diagnostics for argument combinations that
were previously accepted. Restore acceptance to avoid regressing
projects that used those combinations even if they do not make sense.
Fixes: #18097
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index aae70b1..dcb79f7 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -777,7 +777,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
this->Makefile->GetCMakeInstance()->GetWorkingMode();
while (i != args.end()) {
if (*i == "LIST_DIRECTORIES") {
- ++i;
+ ++i; // skip LIST_DIRECTORIES
if (i != args.end()) {
if (cmSystemTools::IsOn(i->c_str())) {
g.SetListDirs(true);
@@ -789,27 +789,21 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
this->SetError("LIST_DIRECTORIES missing bool value.");
return false;
}
+ ++i;
} else {
this->SetError("LIST_DIRECTORIES missing bool value.");
return false;
}
- ++i;
- if (i == args.end()) {
- this->SetError("GLOB requires a glob expression after the bool.");
- return false;
- }
} else if (*i == "FOLLOW_SYMLINKS") {
- if (!recurse) {
- this->SetError("FOLLOW_SYMLINKS is not a valid parameter for GLOB.");
- return false;
- }
- explicitFollowSymlinks = true;
- g.RecurseThroughSymlinksOn();
- ++i;
- if (i == args.end()) {
- this->SetError(
- "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS.");
- return false;
+ ++i; // skip FOLLOW_SYMLINKS
+ if (recurse) {
+ explicitFollowSymlinks = true;
+ g.RecurseThroughSymlinksOn();
+ if (i == args.end()) {
+ this->SetError(
+ "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS.");
+ return false;
+ }
}
} else if (*i == "RELATIVE") {
++i; // skip RELATIVE
diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt b/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt b/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt
deleted file mode 100644
index af3cb2e..0000000
--- a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at GLOB-error-FOLLOW_SYMLINKS\.cmake:[0-9]+ \(file\):
- file FOLLOW_SYMLINKS is not a valid parameter for GLOB\.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS.cmake b/Tests/RunCMake/file/GLOB-noexp-FOLLOW_SYMLINKS.cmake
similarity index 100%
rename from Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS.cmake
rename to Tests/RunCMake/file/GLOB-noexp-FOLLOW_SYMLINKS.cmake
diff --git a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt b/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt b/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt
deleted file mode 100644
index ee6cb0b..0000000
--- a/Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at GLOB-noexp-LIST_DIRECTORIES\.cmake:[0-9]+ \(file\):
- file GLOB requires a glob expression after the bool\.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 342606b..b383230 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -39,12 +39,12 @@ run_cmake(GLOB_RECURSE-noexp-FOLLOW_SYMLINKS)
# tests are valid both for GLOB and GLOB_RECURSE
run_cmake(GLOB-sort-dedup)
-run_cmake(GLOB-error-FOLLOW_SYMLINKS)
run_cmake(GLOB-error-LIST_DIRECTORIES-not-boolean)
run_cmake(GLOB-error-LIST_DIRECTORIES-no-arg)
run_cmake(GLOB-error-RELATIVE-no-arg)
run_cmake(GLOB-error-CONFIGURE_DEPENDS-modified)
run_cmake(GLOB-noexp-CONFIGURE_DEPENDS)
+run_cmake(GLOB-noexp-FOLLOW_SYMLINKS)
run_cmake(GLOB-noexp-LIST_DIRECTORIES)
run_cmake(GLOB-noexp-RELATIVE)
run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P
-----------------------------------------------------------------------
Summary of changes:
Source/cmFileCommand.cxx | 28 +++++--------
Source/cmGlobalVisualStudio10Generator.cxx | 49 ++++++++++++++--------
Source/cmGlobalVisualStudio10Generator.h | 1 +
Source/cmGlobalVisualStudio15Generator.cxx | 21 ++++++++++
Source/cmGlobalVisualStudio15Generator.h | 1 +
Source/cmVSSetupHelper.cxx | 13 ++++++
Source/cmVSSetupHelper.h | 15 +++----
.../file/GLOB-error-FOLLOW_SYMLINKS-result.txt | 1 -
.../file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt | 4 --
...INKS.cmake => GLOB-noexp-FOLLOW_SYMLINKS.cmake} | 0
.../file/GLOB-noexp-LIST_DIRECTORIES-result.txt | 1 -
.../file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt | 4 --
Tests/RunCMake/file/RunCMakeTest.cmake | 2 +-
13 files changed, 85 insertions(+), 55 deletions(-)
delete mode 100644 Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-result.txt
delete mode 100644 Tests/RunCMake/file/GLOB-error-FOLLOW_SYMLINKS-stderr.txt
rename Tests/RunCMake/file/{GLOB-error-FOLLOW_SYMLINKS.cmake => GLOB-noexp-FOLLOW_SYMLINKS.cmake} (100%)
delete mode 100644 Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-result.txt
delete mode 100644 Tests/RunCMake/file/GLOB-noexp-LIST_DIRECTORIES-stderr.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list