mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 13:19:51 -05:00
VS,Xcode: Add CMakeLists.txt sources without mutating targets
Rather than injecting `CMakeLists.txt` files into each target's `SOURCES`, teach the generators to add them during generation using dedicated code. This avoids mutating the original targets, and avoids polluting `$<TARGET_PROPERTY:foo,SOURCES>` with generator-specific content. This also avoids listing the `CMakeLists.txt` sources in the results of `CMAKE_DEBUG_TARGET_PROPERTIES==SOURCES` so the `RunCMake.TargetSources` test no longer needs a separate case for IDEs.
This commit is contained in:
@@ -1174,6 +1174,15 @@ void cmVisualStudio10TargetGenerator::WriteCustomCommands()
|
||||
si != customCommands.end(); ++si) {
|
||||
this->WriteCustomCommand(*si);
|
||||
}
|
||||
|
||||
// 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()) {
|
||||
this->WriteCustomCommand(sf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cmVisualStudio10TargetGenerator::WriteCustomCommand(
|
||||
|
||||
Reference in New Issue
Block a user