Only append build interface include dirs to particular targets.

We shouldn't set the property on all custom targets.
This commit is contained in:
Stephen Kelly 2013-02-07 19:31:23 +01:00
parent d4e5c6787c
commit df74bc34d4
2 changed files with 11 additions and 3 deletions

View File

@ -1150,9 +1150,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
("CMAKE_BUILD_INTERFACE_INCLUDES", cmProperty::VARIABLE, ("CMAKE_BUILD_INTERFACE_INCLUDES", cmProperty::VARIABLE,
"Automatically add the current source- and build directories " "Automatically add the current source- and build directories "
"to the INTERFACE_INCLUDE_DIRECTORIES.", "to the INTERFACE_INCLUDE_DIRECTORIES.",
"If this variable is enabled, CMake automatically adds for each " "If this variable is enabled, CMake automatically adds for each shared "
"target ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CURRENT_BINARY_DIR} " "library target, static library target, module target and executable "
"to the INTERFACE_INCLUDE_DIRECTORIES." "target, ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CURRENT_BINARY_DIR} to "
"the INTERFACE_INCLUDE_DIRECTORIES."
"By default CMAKE_BUILD_INTERFACE_INCLUDES is OFF.", "By default CMAKE_BUILD_INTERFACE_INCLUDES is OFF.",
false, false,
"Variables that Control the Build"); "Variables that Control the Build");

View File

@ -2714,6 +2714,13 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::AppendBuildInterfaceIncludes() void cmTarget::AppendBuildInterfaceIncludes()
{ {
if(this->GetType() != cmTarget::SHARED_LIBRARY &&
this->GetType() != cmTarget::STATIC_LIBRARY &&
this->GetType() != cmTarget::MODULE_LIBRARY &&
!this->IsExecutableWithExports())
{
return;
}
if (this->BuildInterfaceIncludesAppended) if (this->BuildInterfaceIncludesAppended)
{ {
return; return;