cmTarget: Require a compatible INTERFACE_AUTOUIC_OPTIONS from dependencies.
Revert the origin-tracking infrastructure from commit 98093c45
(QtAutoUic:
Add INTERFACE_AUTOUIC_OPTIONS target property., 2013-11-20). Use the
compatibility-tracking for compatible strings instead.
If two different dependencies require different AUTOUIC_OPTIONS,
cmake will now appropriately issue an error.
This commit is contained in:
parent
2e60b5fcf7
commit
77f3772784
|
@ -135,7 +135,6 @@ public:
|
||||||
};
|
};
|
||||||
std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
|
std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
|
||||||
std::vector<TargetPropertyEntry*> CompileOptionsEntries;
|
std::vector<TargetPropertyEntry*> CompileOptionsEntries;
|
||||||
std::vector<TargetPropertyEntry*> AutoUicOptionsEntries;
|
|
||||||
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
|
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
|
||||||
std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
|
std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
|
||||||
|
|
||||||
|
@ -143,15 +142,12 @@ public:
|
||||||
CachedLinkInterfaceIncludeDirectoriesEntries;
|
CachedLinkInterfaceIncludeDirectoriesEntries;
|
||||||
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
||||||
CachedLinkInterfaceCompileOptionsEntries;
|
CachedLinkInterfaceCompileOptionsEntries;
|
||||||
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
|
||||||
CachedLinkInterfaceAutoUicOptionsEntries;
|
|
||||||
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
||||||
CachedLinkInterfaceCompileDefinitionsEntries;
|
CachedLinkInterfaceCompileDefinitionsEntries;
|
||||||
|
|
||||||
mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
|
mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
|
||||||
mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
|
mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
|
||||||
mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
|
mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
|
||||||
mutable std::map<std::string, bool> CacheLinkInterfaceAutoUicOptionsDone;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -186,7 +182,6 @@ cmTargetInternals::~cmTargetInternals()
|
||||||
{
|
{
|
||||||
deleteAndClear(this->CachedLinkInterfaceIncludeDirectoriesEntries);
|
deleteAndClear(this->CachedLinkInterfaceIncludeDirectoriesEntries);
|
||||||
deleteAndClear(this->CachedLinkInterfaceCompileOptionsEntries);
|
deleteAndClear(this->CachedLinkInterfaceCompileOptionsEntries);
|
||||||
deleteAndClear(this->CachedLinkInterfaceAutoUicOptionsEntries);
|
|
||||||
deleteAndClear(this->CachedLinkInterfaceCompileDefinitionsEntries);
|
deleteAndClear(this->CachedLinkInterfaceCompileDefinitionsEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1478,17 +1473,6 @@ void cmTarget::SetProperty(const char* prop, const char* value)
|
||||||
new cmTargetInternals::TargetPropertyEntry(cge));
|
new cmTargetInternals::TargetPropertyEntry(cge));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strcmp(prop,"AUTOUIC_OPTIONS") == 0)
|
|
||||||
{
|
|
||||||
cmListFileBacktrace lfbt;
|
|
||||||
this->Makefile->GetBacktrace(lfbt);
|
|
||||||
cmGeneratorExpression ge(lfbt);
|
|
||||||
deleteAndClear(this->Internal->AutoUicOptionsEntries);
|
|
||||||
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
|
|
||||||
this->Internal->AutoUicOptionsEntries.push_back(
|
|
||||||
new cmTargetInternals::TargetPropertyEntry(cge));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
|
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
|
||||||
{
|
{
|
||||||
cmListFileBacktrace lfbt;
|
cmListFileBacktrace lfbt;
|
||||||
|
@ -1563,15 +1547,6 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
|
||||||
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
|
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strcmp(prop,"AUTOUIC_OPTIONS") == 0)
|
|
||||||
{
|
|
||||||
cmListFileBacktrace lfbt;
|
|
||||||
this->Makefile->GetBacktrace(lfbt);
|
|
||||||
cmGeneratorExpression ge(lfbt);
|
|
||||||
this->Internal->AutoUicOptionsEntries.push_back(
|
|
||||||
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
|
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
|
||||||
{
|
{
|
||||||
cmListFileBacktrace lfbt;
|
cmListFileBacktrace lfbt;
|
||||||
|
@ -2071,100 +2046,26 @@ static void processCompileOptions(cmTarget const* tgt,
|
||||||
void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
|
void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
|
||||||
const char *config) const
|
const char *config) const
|
||||||
{
|
{
|
||||||
std::set<std::string> uniqueOptions;
|
const char *prop
|
||||||
|
= this->GetLinkInterfaceDependentStringProperty("AUTOUIC_OPTIONS",
|
||||||
|
config);
|
||||||
|
if (!prop)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
cmListFileBacktrace lfbt;
|
cmListFileBacktrace lfbt;
|
||||||
|
cmGeneratorExpression ge(lfbt);
|
||||||
|
|
||||||
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
|
cmGeneratorExpressionDAGChecker dagChecker(lfbt,
|
||||||
this->GetName(),
|
this->GetName(),
|
||||||
"AUTOUIC_OPTIONS", 0, 0);
|
"AUTOUIC_OPTIONS", 0, 0);
|
||||||
|
cmSystemTools::ExpandListArgument(ge.Parse(prop)
|
||||||
std::vector<std::string> debugProperties;
|
->Evaluate(this->Makefile,
|
||||||
const char *debugProp =
|
|
||||||
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
|
|
||||||
if (debugProp)
|
|
||||||
{
|
|
||||||
cmSystemTools::ExpandListArgument(debugProp, debugProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool debugOptions = !this->DebugCompileOptionsDone
|
|
||||||
&& std::find(debugProperties.begin(),
|
|
||||||
debugProperties.end(),
|
|
||||||
"AUTOUIC_OPTIONS")
|
|
||||||
!= debugProperties.end();
|
|
||||||
|
|
||||||
if (this->Makefile->IsGeneratingBuildSystem())
|
|
||||||
{
|
|
||||||
this->DebugAutoUicOptionsDone = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
processCompileOptions(this,
|
|
||||||
this->Internal->AutoUicOptionsEntries,
|
|
||||||
result,
|
|
||||||
uniqueOptions,
|
|
||||||
&dagChecker,
|
|
||||||
config,
|
config,
|
||||||
debugOptions);
|
false,
|
||||||
|
this,
|
||||||
std::string configString = config ? config : "";
|
&dagChecker),
|
||||||
if (!this->Internal->CacheLinkInterfaceAutoUicOptionsDone[configString])
|
result);
|
||||||
{
|
|
||||||
for (std::vector<cmValueWithOrigin>::const_iterator
|
|
||||||
it = this->Internal->LinkInterfacePropertyEntries.begin(),
|
|
||||||
end = this->Internal->LinkInterfacePropertyEntries.end();
|
|
||||||
it != end; ++it)
|
|
||||||
{
|
|
||||||
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
|
|
||||||
&& cmGeneratorExpression::Find(it->Value) == std::string::npos)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
cmGeneratorExpression ge(lfbt);
|
|
||||||
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
|
|
||||||
ge.Parse(it->Value);
|
|
||||||
std::string targetResult = cge->Evaluate(this->Makefile, config,
|
|
||||||
false, this, 0, 0);
|
|
||||||
if (!this->Makefile->FindTargetToUse(targetResult.c_str()))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::string optionGenex = "$<TARGET_PROPERTY:" +
|
|
||||||
it->Value + ",INTERFACE_AUTOUIC_OPTIONS>";
|
|
||||||
if (cmGeneratorExpression::Find(it->Value) != std::string::npos)
|
|
||||||
{
|
|
||||||
// Because it->Value is a generator expression, ensure that it
|
|
||||||
// evaluates to the non-empty string before being used in the
|
|
||||||
// TARGET_PROPERTY expression.
|
|
||||||
optionGenex = "$<$<BOOL:" + it->Value + ">:" + optionGenex + ">";
|
|
||||||
}
|
|
||||||
cmGeneratorExpression ge(it->Backtrace);
|
|
||||||
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
|
|
||||||
optionGenex);
|
|
||||||
|
|
||||||
this->Internal
|
|
||||||
->CachedLinkInterfaceAutoUicOptionsEntries[configString].push_back(
|
|
||||||
new cmTargetInternals::TargetPropertyEntry(cge,
|
|
||||||
it->Value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
processCompileOptions(this,
|
|
||||||
this->Internal->CachedLinkInterfaceAutoUicOptionsEntries[configString],
|
|
||||||
result,
|
|
||||||
uniqueOptions,
|
|
||||||
&dagChecker,
|
|
||||||
config,
|
|
||||||
debugOptions);
|
|
||||||
|
|
||||||
if (!this->Makefile->IsGeneratingBuildSystem())
|
|
||||||
{
|
|
||||||
deleteAndClear(this->Internal->CachedLinkInterfaceAutoUicOptionsEntries);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->Internal->CacheLinkInterfaceAutoUicOptionsDone[configString] = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -2874,24 +2775,6 @@ const char *cmTarget::GetProperty(const char* prop,
|
||||||
}
|
}
|
||||||
return output.c_str();
|
return output.c_str();
|
||||||
}
|
}
|
||||||
if(strcmp(prop,"AUTOUIC_OPTIONS") == 0)
|
|
||||||
{
|
|
||||||
static std::string output;
|
|
||||||
output = "";
|
|
||||||
std::string sep;
|
|
||||||
typedef cmTargetInternals::TargetPropertyEntry
|
|
||||||
TargetPropertyEntry;
|
|
||||||
for (std::vector<TargetPropertyEntry*>::const_iterator
|
|
||||||
it = this->Internal->AutoUicOptionsEntries.begin(),
|
|
||||||
end = this->Internal->AutoUicOptionsEntries.end();
|
|
||||||
it != end; ++it)
|
|
||||||
{
|
|
||||||
output += sep;
|
|
||||||
output += (*it)->ge->GetInput();
|
|
||||||
sep = ";";
|
|
||||||
}
|
|
||||||
return output.c_str();
|
|
||||||
}
|
|
||||||
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
|
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
|
||||||
{
|
{
|
||||||
static std::string output;
|
static std::string output;
|
||||||
|
@ -4503,7 +4386,7 @@ std::string compatibilityAgree(CompatibleType t, bool dominant)
|
||||||
{
|
{
|
||||||
case BoolType:
|
case BoolType:
|
||||||
case StringType:
|
case StringType:
|
||||||
return "(Agree)\n";
|
return dominant ? "(Disagree)\n" : "(Agree)\n";
|
||||||
case NumberMaxType:
|
case NumberMaxType:
|
||||||
case NumberMinType:
|
case NumberMinType:
|
||||||
return dominant ? "(Dominant)\n" : "(Ignored)\n";
|
return dominant ? "(Dominant)\n" : "(Ignored)\n";
|
||||||
|
@ -4594,6 +4477,8 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
{
|
{
|
||||||
PropertyType consistent = consistentProperty(propContent,
|
PropertyType consistent = consistentProperty(propContent,
|
||||||
ifacePropContent, t);
|
ifacePropContent, t);
|
||||||
|
report += reportEntry;
|
||||||
|
report += compatibilityAgree(t, propContent != consistent);
|
||||||
if (!consistent)
|
if (!consistent)
|
||||||
{
|
{
|
||||||
cmOStringStream e;
|
cmOStringStream e;
|
||||||
|
@ -4606,8 +4491,6 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
report += reportEntry;
|
|
||||||
report += compatibilityAgree(t, propContent != consistent);
|
|
||||||
propContent = consistent;
|
propContent = consistent;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -4632,6 +4515,8 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
{
|
{
|
||||||
PropertyType consistent = consistentProperty(propContent,
|
PropertyType consistent = consistentProperty(propContent,
|
||||||
ifacePropContent, t);
|
ifacePropContent, t);
|
||||||
|
report += reportEntry;
|
||||||
|
report += compatibilityAgree(t, propContent != consistent);
|
||||||
if (!consistent)
|
if (!consistent)
|
||||||
{
|
{
|
||||||
cmOStringStream e;
|
cmOStringStream e;
|
||||||
|
@ -4645,8 +4530,6 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
report += reportEntry;
|
|
||||||
report += compatibilityAgree(t, propContent != consistent);
|
|
||||||
propContent = consistent;
|
propContent = consistent;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -4665,6 +4548,8 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
{
|
{
|
||||||
PropertyType consistent = consistentProperty(propContent,
|
PropertyType consistent = consistentProperty(propContent,
|
||||||
ifacePropContent, t);
|
ifacePropContent, t);
|
||||||
|
report += reportEntry;
|
||||||
|
report += compatibilityAgree(t, propContent != consistent);
|
||||||
if (!consistent)
|
if (!consistent)
|
||||||
{
|
{
|
||||||
cmOStringStream e;
|
cmOStringStream e;
|
||||||
|
@ -4677,8 +4562,6 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
report += reportEntry;
|
|
||||||
report += compatibilityAgree(t, propContent != consistent);
|
|
||||||
propContent = consistent;
|
propContent = consistent;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -4813,7 +4696,8 @@ bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_STRING",
|
return (p == "AUTOUIC_OPTIONS") ||
|
||||||
|
isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_STRING",
|
||||||
config);
|
config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6232,7 +6116,6 @@ cmTargetInternalPointer::~cmTargetInternalPointer()
|
||||||
{
|
{
|
||||||
deleteAndClear(this->Pointer->IncludeDirectoriesEntries);
|
deleteAndClear(this->Pointer->IncludeDirectoriesEntries);
|
||||||
deleteAndClear(this->Pointer->CompileOptionsEntries);
|
deleteAndClear(this->Pointer->CompileOptionsEntries);
|
||||||
deleteAndClear(this->Pointer->AutoUicOptionsEntries);
|
|
||||||
deleteAndClear(this->Pointer->CompileDefinitionsEntries);
|
deleteAndClear(this->Pointer->CompileDefinitionsEntries);
|
||||||
delete this->Pointer;
|
delete this->Pointer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -698,7 +698,6 @@ private:
|
||||||
mutable bool DebugIncludesDone;
|
mutable bool DebugIncludesDone;
|
||||||
mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
|
mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
|
||||||
mutable bool DebugCompileOptionsDone;
|
mutable bool DebugCompileOptionsDone;
|
||||||
mutable bool DebugAutoUicOptionsDone;
|
|
||||||
mutable bool DebugCompileDefinitionsDone;
|
mutable bool DebugCompileDefinitionsDone;
|
||||||
mutable std::set<std::string> LinkImplicitNullProperties;
|
mutable std::set<std::string> LinkImplicitNullProperties;
|
||||||
bool BuildInterfaceIncludesAppended;
|
bool BuildInterfaceIncludesAppended;
|
||||||
|
|
|
@ -94,6 +94,9 @@ if(NOT WIN32)
|
||||||
add_RunCMake_test(VisibilityPreset)
|
add_RunCMake_test(VisibilityPreset)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if (QT4_FOUND)
|
||||||
|
set(CompatibleInterface_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
||||||
|
endif()
|
||||||
add_RunCMake_test(CompatibleInterface)
|
add_RunCMake_test(CompatibleInterface)
|
||||||
add_RunCMake_test(Syntax)
|
add_RunCMake_test(Syntax)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
|
@ -0,0 +1,11 @@
|
||||||
|
CMake Error: The INTERFACE_AUTOUIC_OPTIONS property of "OtherI18n" does
|
||||||
|
not agree with the value of AUTOUIC_OPTIONS already determined
|
||||||
|
for "LibWidget".
|
||||||
|
|
||||||
|
CMake Debug Log:
|
||||||
|
String compatibility of property "AUTOUIC_OPTIONS" for target "LibWidget"
|
||||||
|
\(result: "-tr;ki18n"\):
|
||||||
|
|
||||||
|
\* Target "LibWidget" property not set.
|
||||||
|
\* Target "KI18n" property value "-tr;ki18n" \(Interface set\)
|
||||||
|
\* Target "OtherI18n" property value "-tr;otheri18n" \(Disagree\)
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
find_package(Qt4 REQUIRED)
|
||||||
|
|
||||||
|
set(QT_CORE_TARGET Qt4::QtCore)
|
||||||
|
set(QT_GUI_TARGET Qt4::QtGui)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
set(CMAKE_DEBUG_TARGET_PROPERTIES AUTOUIC_OPTIONS)
|
||||||
|
|
||||||
|
add_library(KI18n INTERFACE)
|
||||||
|
set_property(TARGET KI18n APPEND PROPERTY
|
||||||
|
INTERFACE_AUTOUIC_OPTIONS -tr ki18n
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(OtherI18n INTERFACE)
|
||||||
|
set_property(TARGET OtherI18n APPEND PROPERTY
|
||||||
|
INTERFACE_AUTOUIC_OPTIONS -tr otheri18n
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(LibWidget empty.cpp)
|
||||||
|
target_link_libraries(LibWidget KI18n OtherI18n ${QT_GUI_TARGET})
|
|
@ -10,3 +10,8 @@ run_cmake(InterfaceString-mismatched-use)
|
||||||
run_cmake(InterfaceString-builtin-prop)
|
run_cmake(InterfaceString-builtin-prop)
|
||||||
run_cmake(InterfaceString-Bool-Conflict)
|
run_cmake(InterfaceString-Bool-Conflict)
|
||||||
run_cmake(DebugProperties)
|
run_cmake(DebugProperties)
|
||||||
|
|
||||||
|
if (QT_QMAKE_EXECUTABLE})
|
||||||
|
set(RunCMake_TEST_OPTIONS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
||||||
|
run_cmake(AutoUic)
|
||||||
|
endif()
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
// no content
|
Loading…
Reference in New Issue