diff options
author | Brad King <brad.king@kitware.com> | 2008-01-30 11:22:10 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-30 11:22:10 -0500 |
commit | e9503a174ecff5301ab2252cbf06d2d29889ceb4 (patch) | |
tree | ae6faecf093c887be2afb1239db7b6f7dc41b184 /Source/cmAddCustomCommandCommand.cxx | |
parent | d5db5a275a1f6839d70ca0c76dfedb2e63705b58 (diff) | |
download | cmake-e9503a174ecff5301ab2252cbf06d2d29889ceb4.tar.gz |
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.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r-- | Source/cmAddCustomCommandCommand.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 3161ef17d2..5912a79f0e 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -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; |