Merge topic 'missing-file-dir-issue-11677'

7af41c3 Test that missing source mentions directory (#11677)
9cefce0 Report directory with missing source file (#11677)
This commit is contained in:
Brad King 2011-01-19 14:02:44 -05:00 committed by CMake Topic Stage
commit cc6ba3abff
3 changed files with 9 additions and 4 deletions

View File

@ -188,8 +188,13 @@ bool cmSourceFile::FindFullPath(std::string* error)
}
cmOStringStream e;
e << "Cannot find source file \"" << this->Location.GetName() << "\"";
e << ". Tried extensions";
std::string missing = this->Location.GetDirectory();
if(!missing.empty())
{
missing += "/";
}
missing += this->Location.GetName();
e << "Cannot find source file:\n " << missing << "\nTried extensions";
for(std::vector<std::string>::const_iterator ext = srcExts.begin();
ext != srcExts.end(); ++ext)
{

View File

@ -149,7 +149,7 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(PreOrder PreOrder)
ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file \"MissingSourceFile.c\"")
PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
ADD_TEST_MACRO(COnly COnly)
ADD_TEST_MACRO(CxxOnly CxxOnly)
ADD_TEST_MACRO(IPO COnly/COnly)

View File

@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8)
project(MissingSourceFile C)
add_executable(MissingSourceFile MissingSourceFile.c)
add_executable(MissingSourceFile DoesNotExist/MissingSourceFile.c)