summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-01-29 15:32:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-01-31 16:29:04 (GMT)
commit2c3654c3de718fe822f8960063373774fc019494 (patch)
tree5f42f91ec97411fbf56e4b7393de95084d4c63ad /Source/cmExportFileGenerator.cxx
parentd4297d5697cd10114f8accb7a233aa1f5ebc50ab (diff)
downloadCMake-2c3654c3de718fe822f8960063373774fc019494.zip
CMake-2c3654c3de718fe822f8960063373774fc019494.tar.gz
CMake-2c3654c3de718fe822f8960063373774fc019494.tar.bz2
Add a way to exclude INTERFACE properties from exported targets.
Projects set interface requirements upstream, and existing downstreams use of target_link_libraries will consume those interfaces. This can create a backward compatibility concern as the result may be changing the order of include directories of downstreams, or another side-effect of using the INTERFACE properties. Provide a way for them to emulate the behavior of a version-based policy in the config file.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index e772327..2ecac84 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -264,15 +264,16 @@ void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target,
{
if (!properties.empty())
{
+ os << "if(NOT ${CMAKE_FIND_PACKAGE_NAME}_NO_INTERFACES)\n";
std::string targetName = this->Namespace;
targetName += target->GetName();
- os << "set_target_properties(" << targetName << " PROPERTIES\n";
+ os << " set_target_properties(" << targetName << " PROPERTIES\n";
for(ImportPropertyMap::const_iterator pi = properties.begin();
pi != properties.end(); ++pi)
{
- os << " " << pi->first << " \"" << pi->second << "\"\n";
+ os << " " << pi->first << " \"" << pi->second << "\"\n";
}
- os << ")\n\n";
+ os << " )\nendif()\n\n";
}
}