Commit c4d2f64f authored by Brad King's avatar Brad King

add_subdirectory: Fix error message on missing CMakeLists.txt (#15680)

Refactoring in commit v3.3.0-rc1~76^2 (cmMakefile: Handle CMP0014 before
configuring the generator, 2015-05-14) accidentally left the file name
"/CMakeLists.txt" in the error message.  Remove it and add a test case.
parent 3a0db022
...@@ -1564,8 +1564,8 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) ...@@ -1564,8 +1564,8 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
cmSystemTools::Message(msg.c_str()); cmSystemTools::Message(msg.c_str());
} }
currentStart += "/CMakeLists.txt"; std::string const currentStartFile = currentStart + "/CMakeLists.txt";
if(!cmSystemTools::FileExists(currentStart.c_str(), true)) if (!cmSystemTools::FileExists(currentStartFile, true))
{ {
// The file is missing. Check policy CMP0014. // The file is missing. Check policy CMP0014.
std::ostringstream e; std::ostringstream e;
...@@ -118,6 +118,7 @@ add_RunCMake_test(Syntax) ...@@ -118,6 +118,7 @@ add_RunCMake_test(Syntax)
add_RunCMake_test(add_custom_command) add_RunCMake_test(add_custom_command)
add_RunCMake_test(add_custom_target) add_RunCMake_test(add_custom_target)
add_RunCMake_test(add_dependencies) add_RunCMake_test(add_dependencies)
add_RunCMake_test(build_command) add_RunCMake_test(build_command)
add_RunCMake_test(execute_process) add_RunCMake_test(execute_process)
add_RunCMake_test(export) add_RunCMake_test(export)
cmake_minimum_required(VERSION 3.2)
project(${RunCMake_TEST} NONE)
^CMake Error at DoesNotExist.cmake:1 \(add_subdirectory\):
add_subdirectory given source "DoesNotExist" which is not an existing
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
^CMake Error at Missing.cmake:1 \(add_subdirectory\):
The source directory
does not contain a CMakeLists.txt file.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment