mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Kate: make it possible to force a mode for the "files" entry
By default, kate will try to autodetect whether the project is a svn or git checkout or not. In case this does not give a satisfying result, the user can now set CMAKE_KATE_FILES_MODE to the mode he wants.
This commit is contained in:
committed by
Brad King
parent
8a7aa2642b
commit
9a7612d2d0
@@ -220,14 +220,32 @@ void cmExtraKateGenerator::CreateDummyKateProjectFile(
|
||||
std::string cmExtraKateGenerator::GenerateFilesString(
|
||||
const cmLocalGenerator& lg) const
|
||||
{
|
||||
std::string s = cmStrCat(lg.GetSourceDirectory(), "/.git");
|
||||
if (cmSystemTools::FileExists(s)) {
|
||||
return "\"git\": 1 ";
|
||||
const cmMakefile* mf = lg.GetMakefile();
|
||||
std::string mode =
|
||||
cmSystemTools::UpperCase(mf->GetSafeDefinition("CMAKE_KATE_FILES_MODE"));
|
||||
static const std::string gitString = "\"git\": 1 ";
|
||||
static const std::string svnString = "\"svn\": 1 ";
|
||||
|
||||
if (mode == "SVN") {
|
||||
return svnString;
|
||||
}
|
||||
if (mode == "GIT") {
|
||||
return gitString;
|
||||
}
|
||||
|
||||
s = cmStrCat(lg.GetSourceDirectory(), "/.svn");
|
||||
if (cmSystemTools::FileExists(s)) {
|
||||
return "\"svn\": 1 ";
|
||||
std::string s;
|
||||
|
||||
// check for the VCS files except when "forced" to "FILES" mode:
|
||||
if (mode != "LIST") {
|
||||
s = cmStrCat(lg.GetSourceDirectory(), "/.git");
|
||||
if (cmSystemTools::FileExists(s)) {
|
||||
return gitString;
|
||||
}
|
||||
|
||||
s = cmStrCat(lg.GetSourceDirectory(), "/.svn");
|
||||
if (cmSystemTools::FileExists(s)) {
|
||||
return svnString;
|
||||
}
|
||||
}
|
||||
|
||||
s = cmStrCat(lg.GetSourceDirectory(), '/');
|
||||
|
||||
Reference in New Issue
Block a user