ExternalProject: Fix step dependency on mkdir step

When looking at `list(FIND)` result, zero index is ignored due to
incorrect error handling, and users can't set dependencies on mkdir
step.

Fixes: #20605
This commit is contained in:
Vyacheslav Yurkov
2020-04-20 15:58:22 +02:00
parent 5d32699975
commit e5b33871ed
2 changed files with 2 additions and 2 deletions

View File

@@ -2282,7 +2282,7 @@ function(ExternalProject_Add_StepDependencies name step)
get_property(steps TARGET ${name} PROPERTY _EP_STEPS)
list(FIND steps ${step} is_step)
if(NOT is_step)
if(is_step LESS 0)
message(FATAL_ERROR "External project \"${name}\" does not have a step \"${step}\".")
endif()

View File

@@ -1,5 +1,5 @@
^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
Target "MyProj-IFace" was not generated by ExternalProject_Add_StepTargets.
External project "MyProj" does not have a step "IFace".
Call Stack \(most recent call first\):
Add_StepDependencies_iface_step.cmake:[0-9]+ \(ExternalProject_Add_StepDependencies\)
CMakeLists.txt:[0-9]+ \(include\)$