diff options
author | Brad King <brad.king@kitware.com> | 2006-02-14 21:32:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-02-14 21:32:20 (GMT) |
commit | 916ea2bad28e5e7cd7c8290c522bfdc20754be5c (patch) | |
tree | 3d6f0c514d1d85002bbcb90e96a8cb5ee79001bc | |
parent | bd0b829ffb6bf540fb9d3938687705deea0532e2 (diff) | |
download | CMake-916ea2bad28e5e7cd7c8290c522bfdc20754be5c.zip CMake-916ea2bad28e5e7cd7c8290c522bfdc20754be5c.tar.gz CMake-916ea2bad28e5e7cd7c8290c522bfdc20754be5c.tar.bz2 |
BUG: Avoid adding unused rules to special targets like ALL_BUILD. Make sure project regeneration rules go only in desired targets.
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 14 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 13 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 14 |
3 files changed, 39 insertions, 2 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 39562c4..bbd5138 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -86,6 +86,12 @@ void cmGlobalVisualStudio8Generator::Generate() no_output, no_depends, no_working_directory, "echo", "Checking build system"); + cmTarget* tgt = mf->FindTarget(CMAKE_CHECK_BUILD_SYSTEM_TARGET); + if(!tgt) + { + cmSystemTools::Error("Error adding target " CMAKE_CHECK_BUILD_SYSTEM_TARGET); + continue; + } // Add a custom rule to re-run CMake if any input files changed. const char* suppRegenRule = @@ -134,6 +140,14 @@ void cmGlobalVisualStudio8Generator::Generate() mf->AddCustomCommandToOutput( CMAKE_CHECK_BUILD_SYSTEM_TARGET ".vcproj.cmake", listFiles, no_main_dependency, commandLines, no_comment, no_working_directory, true); + if(cmSourceFile* file = mf->GetSource(CMAKE_CHECK_BUILD_SYSTEM_TARGET ".vcproj.cmake.rule")) + { + tgt->GetSourceFiles().push_back(file); + } + else + { + cmSystemTools::Error("Error adding rule for " CMAKE_CHECK_BUILD_SYSTEM_TARGET ".vcproj.cmake"); + } } } } diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 50e266f..5601375 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -120,7 +120,10 @@ void cmLocalVisualStudio6Generator::OutputDSPFile() { if ((l->second.GetType() != cmTarget::INSTALL_FILES) && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS) - && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)) + && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0) + && (strcmp(l->first.c_str(), "ALL_BUILD") != 0) + && (strcmp(l->first.c_str(), "RUN_TESTS") != 0) + && (strcmp(l->first.c_str(), "INSTALL") != 0)) { cmTarget& target = l->second; bool sameAsTarget = false; @@ -264,6 +267,14 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt) const char* no_working_directory = 0; m_Makefile->AddCustomCommandToOutput(dspname.c_str(), listFiles, makefileIn.c_str(), commandLines, no_comment, no_working_directory, true); + if(cmSourceFile* file = m_Makefile->GetSource(makefileIn.c_str())) + { + tgt.GetSourceFiles().push_back(file); + } + else + { + cmSystemTools::Error("Error adding rule for ", makefileIn.c_str()); + } } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index e2a2531..dffae0a 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -160,7 +160,11 @@ void cmLocalVisualStudio7Generator::OutputVCProjFile() { if ((l->second.GetType() != cmTarget::INSTALL_FILES) && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS) - && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)) + && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0) + && (strcmp(l->first.c_str(), "ALL_BUILD") != 0) + && (strcmp(l->first.c_str(), "RUN_TESTS") != 0) + && (strcmp(l->first.c_str(), "INSTALL") != 0) + && (strcmp(l->first.c_str(), CMAKE_CHECK_BUILD_SYSTEM_TARGET) != 0)) { cmTarget& target = l->second; bool sameAsTarget = false; @@ -268,6 +272,14 @@ void cmLocalVisualStudio7Generator::AddVCProjBuildRule(cmTarget& tgt) const char* no_comment = 0; m_Makefile->AddCustomCommandToOutput(dspname.c_str(), listFiles, makefileIn.c_str(), commandLines, no_comment, no_working_directory, true); + if(cmSourceFile* file = m_Makefile->GetSource(makefileIn.c_str())) + { + tgt.GetSourceFiles().push_back(file); + } + else + { + cmSystemTools::Error("Error adding rule for ", makefileIn.c_str()); + } } |