mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-08 23:44:00 +03:00
GenEx: Report actual target name not found, not "0" each time.
This commit is contained in:
1 parent
d70650d6c3
commit
a4985a9af9
5 files changed
+18
-2
No files matched your search
@@ -278,14 +278,15 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
||||
std::string propertyName = *parameters.begin();
|
||||
if (parameters.size() == 2)
|
||||
{
|
||||
std::string targetName = parameters.front();
|
||||
target = context->Makefile->FindGeneratorTargetToUse(
|
||||
parameters.begin()->c_str());
|
||||
targetName.c_str());
|
||||
|
||||
if (!target)
|
||||
{
|
||||
cmOStringStream e;
|
||||
e << "Target \""
|
||||
<< target
|
||||
<< targetName
|
||||
<< "\" not found.";
|
||||
reportError(context, content->GetOriginalExpression(), e.str());
|
||||
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(BadSelfReference5)
|
||||
run_cmake(BadSelfReference6)
|
||||
run_cmake(BadNonTarget)
|
||||
Reference in new issue
Block a user