Only append build interface include dirs to particular targets.
We shouldn't set the property on all custom targets.
This commit is contained in:
parent
d4e5c6787c
commit
df74bc34d4
|
@ -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");
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue