[Cmake-commits] CMake branch, master, updated. v3.12.0-311-g0ff961f
Kitware Robot
kwrobot at kitware.com
Thu Jul 26 10:15:05 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 0ff961f1885e55b5f47c0d0d52c7dd5f88b082a3 (commit)
via 2235244263618d264f8741278da3f97dab1c264a (commit)
via c985c9743340b7f8be19981b241d13b72c1e716d (commit)
via 8442d9fc3fe71c12dd613ba585b196da93d6d9f1 (commit)
via 7ddc2a110c0e52ce6e2e360a69aadf9291edbb11 (commit)
via b0b820ea39fe4edaf0672ba899a7042ef93a20d2 (commit)
via 1f36652ef4062d784620caa59e3ddd5de06cd976 (commit)
via db866d05deb1d345793aff4152211f7651451213 (commit)
via 3713dc9b8e0662279e7f84133d5953998dcfe254 (commit)
via d1077c1ce6310f02c93962cbb89e82dc57a6dd31 (commit)
from 4687de32a485ad682f426bf337cc1eb780a06fbc (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=0ff961f1885e55b5f47c0d0d52c7dd5f88b082a3
commit 0ff961f1885e55b5f47c0d0d52c7dd5f88b082a3
Merge: 2235244 b0b820e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 26 14:10:02 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jul 26 10:10:08 2018 -0400
Merge topic 'get_include_directories'
b0b820ea39 cmLocalGenerator: Extend the functionality of ``GetIncludeDirectories()``
1f36652ef4 cmLocalGenerator: Style changes: Private local variable renames
db866d05de cmLocalGenerator: Style change: Wrap temporary strings and code in braces
3713dc9b8e cmLocalGenerator: Style change: Wrap temporary strings and code in braces
d1077c1ce6 cmLocalGenerator: Style change: Use return value of std::set::insert
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2234
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2235244263618d264f8741278da3f97dab1c264a
commit 2235244263618d264f8741278da3f97dab1c264a
Merge: c985c97 8442d9f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 26 10:08:57 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 26 10:08:57 2018 -0400
Merge branch 'release-3.12'
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c985c9743340b7f8be19981b241d13b72c1e716d
commit c985c9743340b7f8be19981b241d13b72c1e716d
Merge: 4687de3 7ddc2a1
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 26 14:08:04 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jul 26 10:08:11 2018 -0400
Merge topic 'googletest_policy_settings'
7ddc2a110c GoogleTest: Ensure policy settings allow use of IN_LIST
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2237
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0b820ea39fe4edaf0672ba899a7042ef93a20d2
commit b0b820ea39fe4edaf0672ba899a7042ef93a20d2
Author: Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed Jul 25 12:45:10 2018 +0200
Commit: Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed Jul 25 12:45:10 2018 +0200
cmLocalGenerator: Extend the functionality of ``GetIncludeDirectories()``
What ``cmLocalGenerator::GetIncludeDirectories`` does
-----------------------------------------------------
In general it concatenates the
1. ``target->GetIncludeDirectories(LANG)`` and the
2. ``CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES``.
Additionally it performs some sorting and special treatment of the
- ``CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES``.
By default all ``CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`` are stripped from
the result list.
When explicitly requested (by setting ``stripImplicitInclDirs=false``) *some*
implicit directories are appended to the result list. The implicit directories
that *are* appended are those that were requested to be included by
1. ``target->GetIncludeDirectories(LANG)`` or
2. ``CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES``.
All other implicit directories are still stripped from the result list.
The reason to not simply append all implicit directories is that Qt4's moc has
problems to parse some headers that might be found in the implicit system
include directories (See commit d2536579d51e77827b8e55f39123316324314781
and
[QTBUG-28045](https://bugreports.qt.io/browse/QTBUG-28045)
).
That has been solved in Qt5's moc though.
Extension request to ``cmLocalGenerator::GetIncludeDirectories``
----------------------------------------------------------------
For Qt5's moc we like to have an option that allows to append *all* implict
include directories to the result list, not just those that were user requested.
Changes to ``cmLocalGenerator::GetIncludeDirectories``
------------------------------------------------------
- Shorten the function parameter name ``stripImplicitInclDirs`` to
``stripImplicitDirs``.
- Add new boolean function parameter ``appendAllImplicitDirs``
with a default value ``false``.
The old default behavior of the function stays the same, but a specialized
behavior can be requested by AUTOMOC for Qt4/Qt5 respectively.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3df701e..647697a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -844,7 +844,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget const* target,
const std::string& lang,
const std::string& config,
- bool stripImplicitInclDirs) const
+ bool stripImplicitDirs,
+ bool appendAllImplicitDirs) const
{
// Do not repeat an include path.
std::set<std::string> emitted;
@@ -898,12 +899,12 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
std::vector<std::string> impDirVec;
cmSystemTools::ExpandListArgument(value, impDirVec);
for (std::string const& i : impDirVec) {
- std::string d = rootPath + i;
- cmSystemTools::ConvertToUnixSlashes(d);
- emitted.insert(std::move(d));
- if (!stripImplicitInclDirs) {
- implicitDirs.push_back(i);
+ {
+ std::string d = rootPath + i;
+ cmSystemTools::ConvertToUnixSlashes(d);
+ emitted.insert(std::move(d));
}
+ implicitDirs.push_back(i);
}
}
}
@@ -958,9 +959,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
}
- for (std::string const& i : implicitDirs) {
- if (std::find(userDirs.begin(), userDirs.end(), i) != userDirs.end()) {
- dirs.push_back(i);
+ if (!stripImplicitDirs) {
+ if (!appendAllImplicitDirs) {
+ // Append only those implicit directories that were requested by the user
+ for (std::string const& i : implicitDirs) {
+ if (std::find(userDirs.begin(), userDirs.end(), i) != userDirs.end()) {
+ dirs.push_back(i);
+ }
+ }
+ } else {
+ // Append all implicit directories
+ for (std::string const& i : implicitDirs) {
+ if (std::find(dirs.begin(), dirs.end(), i) == dirs.end()) {
+ dirs.push_back(i);
+ }
+ }
}
}
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 9ba62cc..52f0396 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -237,12 +237,18 @@ public:
return true;
}
- /** Get the include flags for the current makefile and language. */
+ /** @brief Get the include directories for the current makefile and language.
+ * @arg stripImplicitDirs Strip all directories found in
+ * CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES from the result.
+ * @arg appendAllImplicitDirs Append all directories found in
+ * CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to the result.
+ */
void GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget const* target,
const std::string& lang = "C",
const std::string& config = "",
- bool stripImplicitInclDirs = true) const;
+ bool stripImplicitDirs = true,
+ bool appendAllImplicitDirs = false) const;
void AddCompileOptions(std::string& flags, cmGeneratorTarget* target,
const std::string& lang, const std::string& config);
void AddCompileDefinitions(std::set<std::string>& defines,
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f36652ef4062d784620caa59e3ddd5de06cd976
commit 1f36652ef4062d784620caa59e3ddd5de06cd976
Author: Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed Jul 25 12:26:25 2018 +0200
Commit: Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed Jul 25 12:26:25 2018 +0200
cmLocalGenerator: Style changes: Private local variable renames
Code style change in ``cmLocalGenerator::GetIncludeDirectories``.
Rename a variable to reflect its purpose a little bit better.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 826ff84..3df701e 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -909,7 +909,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
// Get the target-specific include directories.
- std::vector<std::string> includes =
+ std::vector<std::string> userDirs =
target->GetIncludeDirectories(config, lang);
// Support putting all the in-project include directories first if
@@ -917,7 +917,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
if (this->Makefile->IsOn("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE")) {
std::string const &topSourceDir = this->GetState()->GetSourceDirectory(),
&topBinaryDir = this->GetState()->GetBinaryDirectory();
- for (std::string const& i : includes) {
+ for (std::string const& i : userDirs) {
// Emit this directory only if it is a subdirectory of the
// top-level source or binary tree.
if (cmSystemTools::ComparePath(i, topSourceDir) ||
@@ -932,7 +932,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
// Construct the final ordered include directory list.
- for (std::string const& i : includes) {
+ for (std::string const& i : userDirs) {
if (emitted.insert(i).second) {
dirs.push_back(i);
}
@@ -942,16 +942,16 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
// Add standard include directories for this language.
{
- std::vector<std::string>::size_type const before = includes.size();
+ std::vector<std::string>::size_type const before = userDirs.size();
{
std::string key = "CMAKE_";
key += lang;
key += "_STANDARD_INCLUDE_DIRECTORIES";
std::string const value = this->Makefile->GetSafeDefinition(key);
- cmSystemTools::ExpandListArgument(value, includes);
+ cmSystemTools::ExpandListArgument(value, userDirs);
}
- for (std::vector<std::string>::iterator i = includes.begin() + before,
- ie = includes.end();
+ for (std::vector<std::string>::iterator i = userDirs.begin() + before,
+ ie = userDirs.end();
i != ie; ++i) {
cmSystemTools::ConvertToUnixSlashes(*i);
dirs.push_back(*i);
@@ -959,7 +959,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
for (std::string const& i : implicitDirs) {
- if (std::find(includes.begin(), includes.end(), i) != includes.end()) {
+ if (std::find(userDirs.begin(), userDirs.end(), i) != userDirs.end()) {
dirs.push_back(i);
}
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db866d05deb1d345793aff4152211f7651451213
commit db866d05deb1d345793aff4152211f7651451213
Author: Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed Jul 25 12:18:49 2018 +0200
Commit: Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed Jul 25 12:24:16 2018 +0200
cmLocalGenerator: Style change: Wrap temporary strings and code in braces
Code style change in ``cmLocalGenerator::GetIncludeDirectories``.
Embrace ``{}`` temporary strings and code that uses them to minimize their
lifetime.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 0c50759..826ff84 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -909,9 +909,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
// Get the target-specific include directories.
- std::vector<std::string> includes;
-
- includes = target->GetIncludeDirectories(config, lang);
+ std::vector<std::string> includes =
+ target->GetIncludeDirectories(config, lang);
// Support putting all the in-project include directories first if
// it is requested by the project.
@@ -942,17 +941,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
this->MoveSystemIncludesToEnd(dirs, config, lang, target);
// Add standard include directories for this language.
- // We do not filter out implicit directories here.
- std::string const standardIncludesVar =
- "CMAKE_" + lang + "_STANDARD_INCLUDE_DIRECTORIES";
- std::string const standardIncludes =
- this->Makefile->GetSafeDefinition(standardIncludesVar);
- std::vector<std::string>::size_type const before = includes.size();
- cmSystemTools::ExpandListArgument(standardIncludes, includes);
- for (std::vector<std::string>::iterator i = includes.begin() + before;
- i != includes.end(); ++i) {
- cmSystemTools::ConvertToUnixSlashes(*i);
- dirs.push_back(*i);
+ {
+ std::vector<std::string>::size_type const before = includes.size();
+ {
+ std::string key = "CMAKE_";
+ key += lang;
+ key += "_STANDARD_INCLUDE_DIRECTORIES";
+ std::string const value = this->Makefile->GetSafeDefinition(key);
+ cmSystemTools::ExpandListArgument(value, includes);
+ }
+ for (std::vector<std::string>::iterator i = includes.begin() + before,
+ ie = includes.end();
+ i != ie; ++i) {
+ cmSystemTools::ConvertToUnixSlashes(*i);
+ dirs.push_back(*i);
+ }
}
for (std::string const& i : implicitDirs) {
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3713dc9b8e0662279e7f84133d5953998dcfe254
commit 3713dc9b8e0662279e7f84133d5953998dcfe254
Author: Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed Jul 25 12:11:58 2018 +0200
Commit: Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed Jul 25 12:20:56 2018 +0200
cmLocalGenerator: Style change: Wrap temporary strings and code in braces
Code style change in ``cmLocalGenerator::GetIncludeDirectories``.
Embrace ``{}`` temporary strings and code that uses them to minimize their
lifetime.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f0db28d..0c50759 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -879,28 +879,31 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
return;
}
- std::string rootPath;
- if (const char* sysrootCompile =
- this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
- rootPath = sysrootCompile;
- } else {
- rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
- }
-
+ // Implicit include directories
std::vector<std::string> implicitDirs;
- // Load implicit include directories for this language.
- std::string impDirVar = "CMAKE_";
- impDirVar += lang;
- impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
- if (const char* value = this->Makefile->GetDefinition(impDirVar)) {
- std::vector<std::string> impDirVec;
- cmSystemTools::ExpandListArgument(value, impDirVec);
- for (std::string const& i : impDirVec) {
- std::string d = rootPath + i;
- cmSystemTools::ConvertToUnixSlashes(d);
- emitted.insert(std::move(d));
- if (!stripImplicitInclDirs) {
- implicitDirs.push_back(i);
+ {
+ std::string rootPath;
+ if (const char* sysrootCompile =
+ this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
+ rootPath = sysrootCompile;
+ } else {
+ rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
+ }
+
+ // Load implicit include directories for this language.
+ std::string key = "CMAKE_";
+ key += lang;
+ key += "_IMPLICIT_INCLUDE_DIRECTORIES";
+ if (const char* value = this->Makefile->GetDefinition(key)) {
+ std::vector<std::string> impDirVec;
+ cmSystemTools::ExpandListArgument(value, impDirVec);
+ for (std::string const& i : impDirVec) {
+ std::string d = rootPath + i;
+ cmSystemTools::ConvertToUnixSlashes(d);
+ emitted.insert(std::move(d));
+ if (!stripImplicitInclDirs) {
+ implicitDirs.push_back(i);
+ }
}
}
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1077c1ce6310f02c93962cbb89e82dc57a6dd31
commit d1077c1ce6310f02c93962cbb89e82dc57a6dd31
Author: Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed Jul 25 12:08:19 2018 +0200
Commit: Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed Jul 25 12:08:19 2018 +0200
cmLocalGenerator: Style change: Use return value of std::set::insert
Code style change in ``cmLocalGenerator::GetIncludeDirectories()``.
Use the return value of ``std::set::insert`` instead of testing
if the entry already exists in the set using ``std::find``.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 072b958..f0db28d 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -846,10 +846,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
const std::string& config,
bool stripImplicitInclDirs) const
{
- // Need to decide whether to automatically include the source and
- // binary directories at the beginning of the include path.
- bool includeSourceDir = false;
- bool includeBinaryDir = false;
+ // Do not repeat an include path.
+ std::set<std::string> emitted;
// When automatic include directories are requested for a build then
// include the source and binary directories at the beginning of the
@@ -859,26 +857,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
// cannot fix this because not all native build tools support
// per-source-file include paths.
if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR")) {
- includeSourceDir = true;
- includeBinaryDir = true;
- }
-
- // Do not repeat an include path.
- std::set<std::string> emitted;
-
- // Store the automatic include paths.
- if (includeBinaryDir) {
- std::string binDir = this->StateSnapshot.GetDirectory().GetCurrentBinary();
- if (emitted.find(binDir) == emitted.end()) {
- dirs.push_back(binDir);
- emitted.insert(binDir);
+ // Current binary directory
+ {
+ std::string binDir =
+ this->StateSnapshot.GetDirectory().GetCurrentBinary();
+ if (emitted.insert(binDir).second) {
+ dirs.push_back(std::move(binDir));
+ }
}
- }
- if (includeSourceDir) {
- std::string srcDir = this->StateSnapshot.GetDirectory().GetCurrentSource();
- if (emitted.find(srcDir) == emitted.end()) {
- dirs.push_back(srcDir);
- emitted.insert(srcDir);
+ // Current source directory
+ {
+ std::string srcDir =
+ this->StateSnapshot.GetDirectory().GetCurrentSource();
+ if (emitted.insert(srcDir).second) {
+ dirs.push_back(std::move(srcDir));
+ }
}
}
-----------------------------------------------------------------------
Summary of changes:
Modules/GoogleTest.cmake | 7 +++
Source/cmLocalGenerator.cxx | 142 ++++++++++++++++++++++++--------------------
Source/cmLocalGenerator.h | 10 +++-
3 files changed, 92 insertions(+), 67 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list