diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-08-27 22:20:29 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-08-27 22:49:29 (GMT) |
commit | d26594f39073ce08eaa0ebab2f85d09c8673668c (patch) | |
tree | 527b0c46674c8767d3125e8ac13cf33eca3a6ac8 /Source/cmMakefileTargetGenerator.cxx | |
parent | b15ad0d1de7524be3b32d6691b68d3578ee00ca5 (diff) | |
download | CMake-d26594f39073ce08eaa0ebab2f85d09c8673668c.zip CMake-d26594f39073ce08eaa0ebab2f85d09c8673668c.tar.gz CMake-d26594f39073ce08eaa0ebab2f85d09c8673668c.tar.bz2 |
Genex: Evaluate genexes for additional make clean files.
This is necessary because custom commands and targets may create
custom files whose names are determined by generator expressions.
For example, clang should be using $<TARGET_FILE> and $<TARGET_FILE_DIR>
instead of reverse engineering the output file name:
http://thread.gmane.org/gmane.comp.compilers.clang.scm/80523
However, that can only be done when ADDITIONAL_MAKE_CLEAN_FILES
also accepts and evaluates generator expressions.
Similarly, KDE uses the LOCATION property where $<TARGET_FILE>
would also be better in KDE4_HANDLE_RPATH_FOR_EXECUTABLE but
also appends the result to ADDITIONAL_MAKE_CLEAN_FILES.
After this patch, both can be ported to generator expressions.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 0829cab..4e40f6c 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -21,6 +21,7 @@ #include "cmTarget.h" #include "cmake.h" #include "cmComputeLinkInformation.h" +#include "cmGeneratorExpression.h" #include "cmMakefileExecutableTargetGenerator.h" #include "cmMakefileLibraryTargetGenerator.h" @@ -131,7 +132,14 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() this->Makefile->GetProperty ("ADDITIONAL_MAKE_CLEAN_FILES")) { - cmSystemTools::ExpandListArgument(additional_clean_files, + const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); + cmListFileBacktrace lfbt; + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(additional_clean_files); + + cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, config, + false, this->Target, 0, 0), this->CleanFiles); } |