diff options
author | Brad King <brad.king@kitware.com> | 2019-08-28 15:19:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-28 15:19:39 (GMT) |
commit | 84e33e6da4aef67f5eeae06cf73fd461a2d634d6 (patch) | |
tree | 8d1ba831afd9de78fd8ca36b735e03380435c1c8 | |
parent | 96291764a11fccd11e913fc9bdb99c4f9ed31e40 (diff) | |
parent | 4c8760c9fb2951d897a307637a761c371e48e615 (diff) | |
download | CMake-84e33e6da4aef67f5eeae06cf73fd461a2d634d6.zip CMake-84e33e6da4aef67f5eeae06cf73fd461a2d634d6.tar.gz CMake-84e33e6da4aef67f5eeae06cf73fd461a2d634d6.tar.bz2 |
Merge branch 'backport-find-no-name' into find-no-name
-rw-r--r-- | Source/cmFindBase.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/find_path/EmptyOldStyle.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_path/RunCMakeTest.cmake | 1 |
4 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 191d7bb..cdc5f63 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -145,7 +145,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 diff --git a/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt b/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt new file mode 100644 index 0000000..8f21eb8 --- /dev/null +++ b/Tests/RunCMake/find_path/EmptyOldStyle-stdout.txt @@ -0,0 +1 @@ +-- VAR-NOTFOUND diff --git a/Tests/RunCMake/find_path/EmptyOldStyle.cmake b/Tests/RunCMake/find_path/EmptyOldStyle.cmake new file mode 100644 index 0000000..d78bb65 --- /dev/null +++ b/Tests/RunCMake/find_path/EmptyOldStyle.cmake @@ -0,0 +1,2 @@ +find_path(VAR ONLY_CMAKE_FIND_ROOT_PATH) +message(STATUS "${VAR}") diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake index 8b5b5b7..ed55f51 100644 --- a/Tests/RunCMake/find_path/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(EmptyOldStyle) run_cmake(FromPATHEnv) run_cmake(PrefixInPATH) |