mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 20:00:38 -06:00
Only append build interface include dirs to particular targets.
We shouldn't set the property on all custom targets.
This commit is contained in:
@@ -1150,9 +1150,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
|
||||
("CMAKE_BUILD_INTERFACE_INCLUDES", cmProperty::VARIABLE,
|
||||
"Automatically add the current source- and build directories "
|
||||
"to the INTERFACE_INCLUDE_DIRECTORIES.",
|
||||
"If this variable is enabled, CMake automatically adds for each "
|
||||
"target ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CURRENT_BINARY_DIR} "
|
||||
"to the INTERFACE_INCLUDE_DIRECTORIES."
|
||||
"If this variable is enabled, CMake automatically adds for each shared "
|
||||
"library target, static library target, module target and executable "
|
||||
"target, ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CURRENT_BINARY_DIR} to "
|
||||
"the INTERFACE_INCLUDE_DIRECTORIES."
|
||||
"By default CMAKE_BUILD_INTERFACE_INCLUDES is OFF.",
|
||||
false,
|
||||
"Variables that Control the Build");
|
||||
|
||||
@@ -2714,6 +2714,13 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
|
||||
//----------------------------------------------------------------------------
|
||||
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)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user