Commit 92d76b50 authored by Stephen Kelly's avatar Stephen Kelly Committed by Brad King
Browse files

Make the add_custom_command output more predictable

I otherwise get:

   Expected stderr to match:

    expect-err> CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
    expect-err>   add_custom_command given APPEND option with output.*
    expect-err>   which is not already a custom command output.
    expect-err> Call Stack \(most recent call first\):
    expect-err>   CMakeLists.txt:3 \(include\)

   Actual stderr:

    actual-err> CMake Error at AppendNotOutput.cmake:1 (add_custom_command):
    actual-err>   add_custom_command given APPEND option with output
    actual-err>   "/home/stephen/dev/src/cmake/with
    actual-err> space/Tests/RunCMake/add_custom_command/AppendNotOutput-build/out" which is
    actual-err>   not already a custom command output.
    actual-err> Call Stack (most recent call first):
    actual-err>   CMakeLists.txt:3 (include)

Using a specific line for paths is a style already used elsewhere for
the same reason, such as CMP0041 output.
parent 00fd64d1
...@@ -263,8 +263,8 @@ bool cmAddCustomCommandCommand::InitialPass( ...@@ -263,8 +263,8 @@ bool cmAddCustomCommandCommand::InitialPass(
// No command for this output exists. // No command for this output exists.
std::ostringstream e; std::ostringstream e;
e << "given APPEND option with output \"" << output[0] e << "given APPEND option with output\n\"" << output[0]
<< "\" which is not already a custom command output."; << "\"\nwhich is not already a custom command output.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
......
CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\): CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
add_custom_command given APPEND option with output.* add_custom_command given APPEND option with output
.*RunCMake/add_custom_command/AppendNotOutput-build/out.*
which is not already a custom command output. which is not already a custom command output.
Call Stack \(most recent call first\): Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\) 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