mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
ENH: Make add_custom_command interpret relative OUTPUT locations with respect to the build tre instead of the source tree. This can greatly simplify user code since generating a file will not need to reference CMAKE_CURRENT_BINARY_DIR. The new behavior is what users expect 99% of the time.
This commit is contained in:
@@ -152,7 +152,17 @@ bool cmAddCustomCommandCommand
|
||||
case doing_outputs:
|
||||
if (!cmSystemTools::FileIsFullPath(copy.c_str()))
|
||||
{
|
||||
filename = this->Makefile->GetStartDirectory();
|
||||
// This is an output to be generated, so it should be
|
||||
// under the build tree. CMake 2.4 placed this under the
|
||||
// source tree. However the only case that this change
|
||||
// will break is when someone writes
|
||||
//
|
||||
// add_custom_command(OUTPUT out.txt ...)
|
||||
//
|
||||
// and later references "${CMAKE_CURRENT_SOURCE_DIR}/out.txt".
|
||||
// This is fairly obscure so we can wait for someone to
|
||||
// complain.
|
||||
filename = this->Makefile->GetCurrentOutputDirectory();
|
||||
filename += "/";
|
||||
}
|
||||
filename += copy;
|
||||
|
||||
Reference in New Issue
Block a user