summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-15 13:19:24 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-18 19:33:16 (GMT)
commit1222327c897437dd674a7f278aebeaec44366bb0 (patch)
tree7788798a773e6da18f15398ab2df3917402df6b5 /Source
parent65fe58a4b46c0233be39f580814a05d5b5fb50a3 (diff)
downloadCMake-1222327c897437dd674a7f278aebeaec44366bb0.zip
CMake-1222327c897437dd674a7f278aebeaec44366bb0.tar.gz
CMake-1222327c897437dd674a7f278aebeaec44366bb0.tar.bz2
VS: Write custom commands for sources from all configurations
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index c829ff9..4e1cc55 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1326,21 +1326,27 @@ void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues(
void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0)
{
this->CSharpCustomCommandNames.clear();
- std::vector<cmSourceFile const*> customCommands;
- this->GeneratorTarget->GetCustomCommands(customCommands, "");
- for (cmSourceFile const* si : customCommands) {
- this->WriteCustomCommand(e0, si);
+
+ cmSourceFile const* srcCMakeLists =
+ this->LocalGenerator->CreateVCProjBuildRule();
+
+ for (cmGeneratorTarget::AllConfigSource const& si :
+ this->GeneratorTarget->GetAllConfigSources()) {
+ if (si.Source == srcCMakeLists) {
+ // Skip explicit reference to CMakeLists.txt source.
+ continue;
+ }
+ this->WriteCustomCommand(e0, si.Source);
}
// Add CMakeLists.txt file with rule to re-run CMake for user convenience.
if (this->GeneratorTarget->GetType() != cmStateEnums::GLOBAL_TARGET &&
this->GeneratorTarget->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
- if (cmSourceFile const* sf =
- this->LocalGenerator->CreateVCProjBuildRule()) {
+ if (srcCMakeLists) {
// Write directly rather than through WriteCustomCommand because
// we do not want the de-duplication and it has no dependencies.
- if (cmCustomCommand const* command = sf->GetCustomCommand()) {
- this->WriteCustomRule(e0, sf, *command);
+ if (cmCustomCommand const* command = srcCMakeLists->GetCustomCommand()) {
+ this->WriteCustomRule(e0, srcCMakeLists, *command);
}
}
}