mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-28 11:48:36 -06:00
cmLocalGenerator: move the CMakeFiles subdir from the target to output root
When target directories are shortened, the `CMakeFiles` path component will be part of the root, not the target directory. Since other files end up constructing paths manually, move the differing component into the correct logical path construction part.
This commit is contained in:
@@ -92,7 +92,7 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
|
||||
std::string cmLocalCommonGenerator::GetTargetDirectory(
|
||||
cmGeneratorTarget const* target) const
|
||||
{
|
||||
std::string dir = cmStrCat("CMakeFiles/", target->GetName());
|
||||
std::string dir = target->GetName();
|
||||
#if defined(__VMS)
|
||||
dir += "_dir";
|
||||
#else
|
||||
|
||||
@@ -4288,7 +4288,7 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
|
||||
|
||||
std::string cmLocalGenerator::GetObjectOutputRoot() const
|
||||
{
|
||||
return this->GetCurrentBinaryDirectory();
|
||||
return cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles");
|
||||
}
|
||||
|
||||
std::string cmLocalGenerator::GetSourceFileLanguage(cmSourceFile const& source)
|
||||
|
||||
@@ -1150,11 +1150,13 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
|
||||
std::set<std::string> languages;
|
||||
target->GetLanguages(
|
||||
languages, this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
|
||||
auto langFileDir = cmSystemTools::GetFilenamePath(
|
||||
this->MaybeRelativeToCurBinDir(cleanfile));
|
||||
/* clang-format off */
|
||||
fout << "\n"
|
||||
"# Per-language clean rules from dependency scanning.\n"
|
||||
"foreach(lang " << cmJoin(languages, " ") << ")\n"
|
||||
" include(" << this->GetTargetDirectory(target)
|
||||
" include(" << langFileDir
|
||||
<< "/cmake_clean_${lang}.cmake OPTIONAL)\n"
|
||||
"endforeach()\n";
|
||||
/* clang-format on */
|
||||
|
||||
@@ -84,6 +84,11 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
|
||||
}
|
||||
}
|
||||
|
||||
std::string cmLocalVisualStudioGenerator::GetObjectOutputRoot() const
|
||||
{
|
||||
return this->GetCurrentBinaryDirectory();
|
||||
}
|
||||
|
||||
std::unique_ptr<cmCustomCommand>
|
||||
cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target,
|
||||
std::string const& config,
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
std::map<cmSourceFile const*, std::string>& mapping,
|
||||
cmGeneratorTarget const* = nullptr) override;
|
||||
|
||||
std::string GetObjectOutputRoot() const override;
|
||||
|
||||
protected:
|
||||
virtual char const* ReportErrorLabel() const;
|
||||
virtual bool CustomCommandUseLocal() const { return false; }
|
||||
|
||||
@@ -462,6 +462,9 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
|
||||
std::string(), this->Makefile->GetCurrentBinaryDirectory());
|
||||
|
||||
// Info directory
|
||||
// TODO: Split this? `AutogenInfo.json` is expected to always be under the
|
||||
// `CMakeFiles` directory, but not all generators places its `<tgt>.dir`
|
||||
// directories there.
|
||||
this->Dir.Info = cmStrCat(cbd, "/CMakeFiles/", this->GenTarget->GetName(),
|
||||
"_autogen.dir");
|
||||
cmSystemTools::ConvertToUnixSlashes(this->Dir.Info);
|
||||
|
||||
Reference in New Issue
Block a user