[Cmake-commits] CMake branch, next, updated. v3.1.1-2256-g73637b8
Stephen Kelly
steveire at gmail.com
Thu Jan 22 18:17:07 EST 2015
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, next has been updated
via 73637b85b622bda8d327a19be52e4ba0947f5cc6 (commit)
via 85857e6d1c1859bdc8ab4206e0329e846b6ef020 (commit)
via ee38062be8ccdb7f4c53156ef00db0d42a41a6a7 (commit)
from d12f442c9453cdde4f95f708447bf77a9e87debd (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73637b85b622bda8d327a19be52e4ba0947f5cc6
commit 73637b85b622bda8d327a19be52e4ba0947f5cc6
Merge: d12f442 85857e6
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jan 22 18:17:06 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jan 22 18:17:06 2015 -0500
Merge topic 'INTERFACE_SYSTEM_INCLUDE_DIRECTORIES-update' into next
85857e6d Help: Clarify INTERFACE_SYSTEM_INCLUDE_DIRECTORIES documentation.
ee38062b IncludeDirectories: Respect SYSTEM flag when using CONFIG genex.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85857e6d1c1859bdc8ab4206e0329e846b6ef020
commit 85857e6d1c1859bdc8ab4206e0329e846b6ef020
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jan 23 00:14:32 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Jan 23 00:15:02 2015 +0100
Help: Clarify INTERFACE_SYSTEM_INCLUDE_DIRECTORIES documentation.
diff --git a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst
index b54b6c1..a0a97ad 100644
--- a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst
+++ b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst
@@ -7,8 +7,15 @@ Targets may populate this property to publish the include directories
which contain system headers, and therefore should not result in
compiler warnings. The :command:`target_include_directories(SYSTEM)`
command signature populates this property with values given to the
-``PUBLIC`` and ``INTERFACE`` keywords. Projects may also get and set the
-property directly.
+``PUBLIC`` and ``INTERFACE`` keywords.
+
+Projects may also get and set the property directly, but must be aware that
+adding directories to this property does not make those directories used
+during compilation. Adding directories to this property marks directories
+as ``SYSTEM`` which otherwise would be used in a non-``SYSTEM`` manner. This
+can appear similar to 'duplication', so prefer the
+high-level :command:`target_include_directories(SYSTEM)` command and avoid
+setting the property by low-level means.
When target dependencies are specified using :command:`target_link_libraries`,
CMake will read this property from all target dependencies to mark the
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee38062be8ccdb7f4c53156ef00db0d42a41a6a7
commit ee38062be8ccdb7f4c53156ef00db0d42a41a6a7
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jan 22 23:40:27 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Jan 23 00:08:18 2015 +0100
IncludeDirectories: Respect SYSTEM flag when using CONFIG genex.
Update the Makefile and Ninja generators to use the config when
requesting the include flags.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index f8471fd..7ed0c10 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1870,7 +1870,8 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
std::string includeFlags =
this->LocalGenerator->GetIncludeFlags(includes, this->GeneratorTarget,
- lang, false, useResponseFile);
+ lang, false, useResponseFile,
+ config);
if(includeFlags.empty())
{
return;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c019ceb..67824c6 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -170,8 +170,10 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
std::string includeFlags =
this->LocalGenerator->GetIncludeFlags(includes, this->GeneratorTarget,
language,
- language == "RC" ? true : false); // full include paths for RC
+ language == "RC" ? true : false, // full include paths for RC
// needed by cmcldeps
+ false,
+ this->GetConfigName());
if(cmGlobalNinjaGenerator::IsMinGW())
cmSystemTools::ReplaceString(includeFlags, "\\", "/");
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index abe9f74..0215e93 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
@@ -14,8 +14,14 @@ target_include_directories(upstream SYSTEM PUBLIC
$<TARGET_PROPERTY:systemlib,INTERFACE_INCLUDE_DIRECTORIES>
)
+add_library(config_specific INTERFACE)
+set(testConfig ${CMAKE_BUILD_TYPE})
+target_include_directories(config_specific SYSTEM INTERFACE
+ "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>"
+)
+
add_library(consumer consumer.cpp)
-target_link_libraries(consumer upstream)
+target_link_libraries(consumer upstream config_specific)
target_compile_options(consumer PRIVATE -Werror=unused-variable)
add_library(iface IMPORTED INTERFACE)
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h b/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h
new file mode 100644
index 0000000..05d3604
--- /dev/null
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h
@@ -0,0 +1,14 @@
+
+#ifndef CONFIG_IFACE_H
+#define CONFIG_IFACE_H
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int configUnusedFunc()
+{
+ int unused;
+ return 0;
+}
+
+#endif
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp
index 197dae8..be18ebf 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp
@@ -1,6 +1,8 @@
#include "upstream.h"
+#include "config_iface.h"
+
int consumer()
{
return upstream();
-----------------------------------------------------------------------
Summary of changes:
Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst | 11 +++++++++--
Source/cmMakefileTargetGenerator.cxx | 3 ++-
Source/cmNinjaTargetGenerator.cxx | 4 +++-
.../SystemIncludeDirectories/CMakeLists.txt | 8 +++++++-
.../config_specific/config_iface.h | 14 ++++++++++++++
.../SystemIncludeDirectories/consumer.cpp | 2 ++
6 files changed, 37 insertions(+), 5 deletions(-)
create mode 100644 Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list