diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-01-29 15:32:51 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-01-31 16:29:04 (GMT) |
commit | 2c3654c3de718fe822f8960063373774fc019494 (patch) | |
tree | 5f42f91ec97411fbf56e4b7393de95084d4c63ad /Source/cmExportFileGenerator.cxx | |
parent | d4297d5697cd10114f8accb7a233aa1f5ebc50ab (diff) | |
download | CMake-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.cxx | 7 |
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"; } } |