diff options
author | Alexander Neundorf <neundorf@kde.org> | 2023-02-02 21:23:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-02-06 15:22:10 (GMT) |
commit | 96389b4cd3dfa2632619fee5e1a16ca872f55973 (patch) | |
tree | edbc758e3a5738f20b59cf595590311838278f71 | |
parent | 4c32623f5fcf66f4ef8dc2fb10a1ea15aeb063a6 (diff) | |
download | CMake-96389b4cd3dfa2632619fee5e1a16ca872f55973.zip CMake-96389b4cd3dfa2632619fee5e1a16ca872f55973.tar.gz CMake-96389b4cd3dfa2632619fee5e1a16ca872f55973.tar.bz2 |
Kate: add support for hg and fossil
Both VCS are supported by kate nowadays.
-rw-r--r-- | Help/variable/CMAKE_KATE_FILES_MODE.rst | 10 | ||||
-rw-r--r-- | Source/cmExtraKateGenerator.cxx | 16 |
2 files changed, 21 insertions, 5 deletions
diff --git a/Help/variable/CMAKE_KATE_FILES_MODE.rst b/Help/variable/CMAKE_KATE_FILES_MODE.rst index e568e00..195c15d 100644 --- a/Help/variable/CMAKE_KATE_FILES_MODE.rst +++ b/Help/variable/CMAKE_KATE_FILES_MODE.rst @@ -7,14 +7,14 @@ This cache variable is used by the Kate project generator and controls to what mode the ``files`` entry in the project file will be set. See :manual:`cmake-generators(7)`. -Possible values are ``AUTO``, ``SVN``, ``GIT`` and ``LIST``. +Possible values are ``AUTO``, ``SVN``, ``GIT``, ``HG``, ``FOSSIL`` and ``LIST``. When set to ``LIST``, CMake will put the list of source files known to CMake in the project file. -When set to ``SVN``, CMake will put ``svn`` into the project file so that Kate -will use svn to retrieve the list of files in the project. -When set to ``GIT``, CMake will put ``git`` into the project file so that Kate -will use git to retrieve the list of files in the project. +When set to ``SVN``, ``GIT``, ``HG`` or ``FOSSIL``, CMake will set +the generated project accordingly to Subversion, git, Mercurial +or Fossil, and Kate will then use the respective command line tool to +retrieve the list of files in the project. When unset or set to ``AUTO``, CMake will try to detect whether the source directory is part of a git or svn checkout or not, and put the respective entry into the project file. diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 5418fd3..5be8f26 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -225,6 +225,8 @@ std::string cmExtraKateGenerator::GenerateFilesString( cmSystemTools::UpperCase(mf->GetSafeDefinition("CMAKE_KATE_FILES_MODE")); static const std::string gitString = "\"git\": 1 "; static const std::string svnString = "\"svn\": 1 "; + static const std::string hgString = "\"hg\": 1 "; + static const std::string fossilString = "\"fossil\": 1 "; if (mode == "SVN") { return svnString; @@ -232,6 +234,12 @@ std::string cmExtraKateGenerator::GenerateFilesString( if (mode == "GIT") { return gitString; } + if (mode == "HG") { + return hgString; + } + if (mode == "FOSSIL") { + return fossilString; + } std::string s; @@ -246,6 +254,14 @@ std::string cmExtraKateGenerator::GenerateFilesString( if (cmSystemTools::FileExists(s)) { return svnString; } + s = cmStrCat(lg.GetSourceDirectory(), "/.hg"); + if (cmSystemTools::FileExists(s)) { + return hgString; + } + s = cmStrCat(lg.GetSourceDirectory(), "/.fslckout"); + if (cmSystemTools::FileExists(s)) { + return fossilString; + } } s = cmStrCat(lg.GetSourceDirectory(), '/'); |