GenEx: Report actual target name not found, not "0" each time.
This commit is contained in:
parent
d70650d6c3
commit
a4985a9af9
|
@ -278,14 +278,15 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||||
std::string propertyName = *parameters.begin();
|
std::string propertyName = *parameters.begin();
|
||||||
if (parameters.size() == 2)
|
if (parameters.size() == 2)
|
||||||
{
|
{
|
||||||
|
std::string targetName = parameters.front();
|
||||||
target = context->Makefile->FindGeneratorTargetToUse(
|
target = context->Makefile->FindGeneratorTargetToUse(
|
||||||
parameters.begin()->c_str());
|
targetName.c_str());
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
cmOStringStream e;
|
cmOStringStream e;
|
||||||
e << "Target \""
|
e << "Target \""
|
||||||
<< target
|
<< targetName
|
||||||
<< "\" not found.";
|
<< "\" not found.";
|
||||||
reportError(context, content->GetOriginalExpression(), e.str());
|
reportError(context, content->GetOriginalExpression(), e.str());
|
||||||
return std::string();
|
return std::string();
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
|
@ -0,0 +1,6 @@
|
||||||
|
CMake Error:
|
||||||
|
Error evaluating generator expression:
|
||||||
|
|
||||||
|
\$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES>
|
||||||
|
|
||||||
|
Target "NonExistant" not found.$
|
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
|
||||||
|
"int main(int, char **) { return 0; }\n")
|
||||||
|
|
||||||
|
add_executable(TargetPropertyGeneratorExpressions
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
|
||||||
|
include_directories("$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES>")
|
|
@ -6,3 +6,4 @@ run_cmake(BadSelfReference3)
|
||||||
run_cmake(BadSelfReference4)
|
run_cmake(BadSelfReference4)
|
||||||
run_cmake(BadSelfReference5)
|
run_cmake(BadSelfReference5)
|
||||||
run_cmake(BadSelfReference6)
|
run_cmake(BadSelfReference6)
|
||||||
|
run_cmake(BadNonTarget)
|
||||||
|
|
Loading…
Reference in New Issue