diff options
author | Brad King <brad.king@kitware.com> | 2017-10-18 17:30:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-18 18:24:07 (GMT) |
commit | 344d149ae45251125f3dad038d9f10e531eb6fd1 (patch) | |
tree | fc945d8bc8a6b4239b2125bf55ae3b9b193f87ef /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 6dec363028ad969fb1a7b160e42ab815ccbb60ca (diff) | |
download | CMake-344d149ae45251125f3dad038d9f10e531eb6fd1.zip CMake-344d149ae45251125f3dad038d9f10e531eb6fd1.tar.gz CMake-344d149ae45251125f3dad038d9f10e531eb6fd1.tar.bz2 |
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.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index c61902a..1a1b1e2 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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( |