Skip to content
Snippets Groups Projects
Commit 4c8760c9 authored by Brad King's avatar Brad King
Browse files

find_path: Fix crash on empty old-style list of names

Fixes: #19651
parent 40bbe50e
Branches
Tags
No related merge requests found
......@@ -141,7 +141,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
// look for old style
// FIND_*(VAR name path1 path2 ...)
if (!newStyle) {
if (!newStyle && !this->Names.empty()) {
// All the short-hand arguments have been recorded as names.
std::vector<std::string> shortArgs = this->Names;
this->Names.clear(); // clear out any values in Names
......
-- VAR-NOTFOUND
find_path(VAR ONLY_CMAKE_FIND_ROOT_PATH)
message(STATUS "${VAR}")
include(RunCMake)
run_cmake(EmptyOldStyle)
if(WIN32 OR CYGWIN)
run_cmake(PrefixInPATH)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment