From 16d995d728a73b07751458333c401de5dbec2fc3 Mon Sep 17 00:00:00 2001 From: David Cole Date: Sat, 17 Oct 2009 11:43:15 -0400 Subject: Fixed issues with message text in FILE command error situations. Added many new test cases to increase the coverage of the FILE command even further. --- Source/cmFileCommand.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Source/cmFileCommand.cxx') diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index abe6bc9f62..396ce05707 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2290,7 +2290,7 @@ bool cmFileCommand::HandleRelativePathCommand( { if(args.size() != 4 ) { - this->SetError("called with incorrect number of arguments"); + this->SetError("RELATIVE_PATH called with incorrect number of arguments"); return false; } @@ -2301,7 +2301,7 @@ bool cmFileCommand::HandleRelativePathCommand( if(!cmSystemTools::FileIsFullPath(directoryName.c_str())) { std::string errstring = - "RelativePath must be passed a full path to the directory: " + "RELATIVE_PATH must be passed a full path to the directory: " + directoryName; this->SetError(errstring.c_str()); return false; @@ -2309,7 +2309,7 @@ bool cmFileCommand::HandleRelativePathCommand( if(!cmSystemTools::FileIsFullPath(fileName.c_str())) { std::string errstring = - "RelativePath must be passed a full path to the file: " + "RELATIVE_PATH must be passed a full path to the file: " + fileName; this->SetError(errstring.c_str()); return false; @@ -2328,7 +2328,7 @@ bool cmFileCommand::HandleRename(std::vector const& args) { if(args.size() != 3) { - this->SetError("given incorrect number of arguments."); + this->SetError("RENAME given incorrect number of arguments."); return false; } @@ -2400,8 +2400,8 @@ bool cmFileCommand::HandleCMakePathCommand(std::vector std::vector::const_iterator i = args.begin(); if(args.size() != 3) { - this->SetError("FILE(SYSTEM_PATH ENV result) must be called with " - "only three arguments."); + this->SetError("FILE([TO_CMAKE_PATH|TO_NATIVE_PATH] path result) must be " + "called with exactly three arguments."); return false; } i++; // Get rid of subcommand @@ -2539,8 +2539,9 @@ cmFileCommand::HandleDownloadCommand(std::vector if(!cmSystemTools::FileExists(dir.c_str()) && !cmSystemTools::MakeDirectory(dir.c_str())) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot create directory: " - + dir + ". Maybe need administrative privileges."; + std::string errstring = "DOWNLOAD error: cannot create directory '" + + dir + "' - Specify file by full path name and verify that you " + "have directory creation and file write privileges."; this->SetError(errstring.c_str()); return false; } -- cgit v1.2.1