diff options
author | Alex Neundorf <neundorf@kde.org> | 2018-01-23 22:03:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-24 13:30:02 (GMT) |
commit | 9198e6a27b02a39ae5b7a96839e54da6588c3a3f (patch) | |
tree | 9bdf91162477bcd4d1bbd9cf1c41a488709faa25 | |
parent | 1345bdf1b6520a2f0c9891ad3c6fee00a6a5f18d (diff) | |
download | CMake-9198e6a27b02a39ae5b7a96839e54da6588c3a3f.zip CMake-9198e6a27b02a39ae5b7a96839e54da6588c3a3f.tar.gz CMake-9198e6a27b02a39ae5b7a96839e54da6588c3a3f.tar.bz2 |
Generators: remove KDevelop3 generator
The last KDevelop3 release was many years ago, in 2008 I think.
I haven't seen or read about anybody using KDevelop 3 since a
long time, so I think it can safely be removed from CMake.
KDevelop 4 (first released in 2010) has its own proper CMake
support now, independent from this generator.
Alex
-rw-r--r-- | CTestCustom.cmake.in | 6 | ||||
-rw-r--r-- | Help/generator/KDevelop3.rst | 25 | ||||
-rw-r--r-- | Help/manual/cmake-generators.7.rst | 1 | ||||
-rw-r--r-- | Help/release/dev/RemoveKDevelop3.rst | 4 | ||||
-rw-r--r-- | Help/variable/CMAKE_EXTRA_GENERATOR.rst | 2 | ||||
-rw-r--r-- | Modules/CMakeFindKDevelop3.cmake | 13 | ||||
-rw-r--r-- | Source/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 9 | ||||
-rw-r--r-- | Source/cmExternalMakefileProjectGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmExtraCodeLiteGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalKdevelopGenerator.cxx | 589 | ||||
-rw-r--r-- | Source/cmGlobalKdevelopGenerator.h | 81 | ||||
-rw-r--r-- | Source/cmUtils.hxx | 2 | ||||
-rw-r--r-- | Source/cmake.cxx | 15 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/Server/cmakelib.py | 2 |
17 files changed, 11 insertions, 752 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 0e4e9fe..eb8b630 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -102,12 +102,6 @@ if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") ) endif () -if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") - list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE - "Kdevelop" - ) -endif () - list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE # Exclude kwsys files from coverage results. They are reported # (with better coverage results) on kwsys dashboards... diff --git a/Help/generator/KDevelop3.rst b/Help/generator/KDevelop3.rst deleted file mode 100644 index eaa218b..0000000 --- a/Help/generator/KDevelop3.rst +++ /dev/null @@ -1,25 +0,0 @@ -KDevelop3 ---------- - -Generates KDevelop 3 project files. - -Project files for KDevelop 3 will be created in the top directory and -in every subdirectory which features a CMakeLists.txt file containing -a PROJECT() call. If you change the settings using KDevelop cmake -will try its best to keep your changes when regenerating the project -files. Additionally a hierarchy of UNIX makefiles is generated into -the build tree. Any standard UNIX-style make program can build the -project through the default make target. A "make install" target is -also provided. - -This "extra" generator may be specified as: - -``KDevelop3 - Unix Makefiles`` - Generate with :generator:`Unix Makefiles`. - -``KDevelop3`` - Generate with :generator:`Unix Makefiles`. - - For historical reasons this extra generator may be specified - directly as the main generator and it will be used as the - extra generator with :generator:`Unix Makefiles` automatically. diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index a37c65b..0287767 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -108,6 +108,5 @@ The following extra generators are known to CMake. /generator/CodeBlocks /generator/CodeLite /generator/Eclipse CDT4 - /generator/KDevelop3 /generator/Kate /generator/Sublime Text 2 diff --git a/Help/release/dev/RemoveKDevelop3.rst b/Help/release/dev/RemoveKDevelop3.rst new file mode 100644 index 0000000..805ad26 --- /dev/null +++ b/Help/release/dev/RemoveKDevelop3.rst @@ -0,0 +1,4 @@ +RemoveKDevelop3 +--------------- + +* The ``KDevelop3`` generator has been removed. diff --git a/Help/variable/CMAKE_EXTRA_GENERATOR.rst b/Help/variable/CMAKE_EXTRA_GENERATOR.rst index 4d513e4..2c92323 100644 --- a/Help/variable/CMAKE_EXTRA_GENERATOR.rst +++ b/Help/variable/CMAKE_EXTRA_GENERATOR.rst @@ -4,7 +4,7 @@ CMAKE_EXTRA_GENERATOR The extra generator used to build the project. See :manual:`cmake-generators(7)`. -When using the Eclipse, CodeBlocks or KDevelop generators, CMake +When using the Eclipse, CodeBlocks, CodeLite, Kate or Sublime generators, CMake generates Makefiles (:variable:`CMAKE_GENERATOR`) and additionally project files for the respective IDE. This IDE project file generator is stored in ``CMAKE_EXTRA_GENERATOR`` (e.g. ``Eclipse CDT4``). diff --git a/Modules/CMakeFindKDevelop3.cmake b/Modules/CMakeFindKDevelop3.cmake deleted file mode 100644 index 488acf7..0000000 --- a/Modules/CMakeFindKDevelop3.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - - -# This file is included in CMakeSystemSpecificInformation.cmake if -# the KDevelop3 extra generator has been selected. - -find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable") - -if(CMAKE_KDEVELOP3_EXECUTABLE) - set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" ) -endif() - diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index cd1287c..c680fd2 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -607,11 +607,6 @@ set(SRCS SET_PROPERTY(SOURCE cmProcessOutput.cxx APPEND PROPERTY COMPILE_DEFINITIONS KWSYS_ENCODING_DEFAULT_CODEPAGE=${KWSYS_ENCODING_DEFAULT_CODEPAGE}) -# Kdevelop only works on UNIX and not windows -if(UNIX) - set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx) -endif() - # Xcode only works on Apple if(APPLE) set(SRCS ${SRCS} diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 7e94a27..a84429b 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -39,15 +39,6 @@ QCMake::QCMake(QObject* p) std::vector<cmake::GeneratorInfo>::const_iterator it; for (it = generators.begin(); it != generators.end(); ++it) { - // Skip the generator "KDevelop3", since there is also - // "KDevelop3 - Unix Makefiles", which is the full and official name. - // The short name is actually only still there since this was the name - // in CMake 2.4, to keep "command line argument compatibility", but - // this is not necessary in the GUI. - if (it->name == "KDevelop3") { - continue; - } - this->AvailableGenerators.push_back(*it); } } diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h index 7f332a8..5cc6442 100644 --- a/Source/cmExternalMakefileProjectGenerator.h +++ b/Source/cmExternalMakefileProjectGenerator.h @@ -17,7 +17,7 @@ class cmMakefile; * cmExternalMakefileProjectGenerator is a base class for generators * for "external makefile based projects", i.e. IDE projects which work * an already existing makefiles. - * See cmGlobalKdevelopGenerator as an example. + * See cmExtraEclipseCDT4Generator as an example. * After the makefiles have been generated by one of the Makefile * generators, the Generate() method is called and this generator * can iterate over the local generators and/or projects to produce the diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 31c8bca..e4bec7f 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -416,7 +416,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( // C/C++ source files, // replacing the file name extension with ".h" and checks whether such a // file exists. If it does, it is inserted into the map of files. - // A very similar version of that code exists also in the kdevelop + // A very similar version of that code exists also in the CodeLite // project generator. for (std::string const& fileName : cFiles) { std::string headerBasename = cmSystemTools::GetFilenamePath(fileName); diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index fad0723..a37348d 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -300,7 +300,7 @@ void cmExtraCodeLiteGenerator::FindMatchingHeaderfiles( // files to the project. It does that by iterating over all source files, // replacing the file name extension with ".h" and checks whether such a // file exists. If it does, it is inserted into the map of files. - // A very similar version of that code exists also in the kdevelop + // A very similar version of that code exists also in the CodeBlocks // project generator. for (auto const& sit : cFiles) { std::string headerBasename = cmSystemTools::GetFilenamePath(sit.first); diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx deleted file mode 100644 index 80aadb9..0000000 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ /dev/null @@ -1,589 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmGlobalKdevelopGenerator.h" - -#include "cmGeneratedFileStream.h" -#include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" -#include "cmSourceFile.h" -#include "cmStateTypes.h" -#include "cmSystemTools.h" -#include "cmTarget.h" -#include "cmXMLWriter.h" -#include "cmake.h" - -#include "cmsys/Directory.hxx" -#include "cmsys/FStream.hxx" -#include <set> -#include <string.h> -#include <utility> - -cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator() - : cmExternalMakefileProjectGenerator() -{ -} - -cmExternalMakefileProjectGeneratorFactory* -cmGlobalKdevelopGenerator::GetFactory() -{ - static cmExternalMakefileProjectGeneratorSimpleFactory< - cmGlobalKdevelopGenerator> - factory("KDevelop3", "Generates KDevelop 3 project files."); - - if (factory.GetSupportedGlobalGenerators().empty()) { - factory.AddSupportedGlobalGenerator("Unix Makefiles"); -#ifdef CMAKE_USE_NINJA - factory.AddSupportedGlobalGenerator("Ninja"); -#endif - - factory.Aliases.push_back("KDevelop3"); - } - - return &factory; -} - -void cmGlobalKdevelopGenerator::Generate() -{ - // for each sub project in the project create - // a kdevelop project - for (auto const& it : this->GlobalGenerator->GetProjectMap()) { - std::string outputDir = it.second[0]->GetCurrentBinaryDirectory(); - std::string projectDir = it.second[0]->GetSourceDirectory(); - std::string projectName = it.second[0]->GetProjectName(); - std::string cmakeFilePattern("CMakeLists.txt;*.cmake;"); - std::string fileToOpen; - const std::vector<cmLocalGenerator*>& lgs = it.second; - // create the project.kdevelop.filelist file - if (!this->CreateFilelistFile(lgs, outputDir, projectDir, projectName, - cmakeFilePattern, fileToOpen)) { - cmSystemTools::Error("Can not create filelist file"); - return; - } - // try to find the name of an executable so we have something to - // run from kdevelop for now just pick the first executable found - std::string executable; - for (cmLocalGenerator* lg : lgs) { - std::vector<cmGeneratorTarget*> const& targets = - lg->GetGeneratorTargets(); - for (cmGeneratorTarget* target : targets) { - if (target->GetType() == cmStateEnums::EXECUTABLE) { - executable = target->GetLocation(""); - break; - } - } - if (!executable.empty()) { - break; - } - } - - // now create a project file - this->CreateProjectFile(outputDir, projectDir, projectName, executable, - cmakeFilePattern, fileToOpen); - } -} - -bool cmGlobalKdevelopGenerator::CreateFilelistFile( - const std::vector<cmLocalGenerator*>& lgs, const std::string& outputDir, - const std::string& projectDirIn, const std::string& projectname, - std::string& cmakeFilePattern, std::string& fileToOpen) -{ - std::string projectDir = projectDirIn + "/"; - std::string filename = outputDir + "/" + projectname + ".kdevelop.filelist"; - - std::set<std::string> files; - std::string tmp; - - std::vector<std::string> const& hdrExts = - this->GlobalGenerator->GetCMakeInstance()->GetHeaderExtensions(); - - for (cmLocalGenerator* lg : lgs) { - cmMakefile* makefile = lg->GetMakefile(); - const std::vector<std::string>& listFiles = makefile->GetListFiles(); - for (std::string const& listFile : listFiles) { - tmp = listFile; - cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - // make sure the file is part of this source tree - if ((tmp[0] != '/') && - (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - nullptr)) { - files.insert(tmp); - tmp = cmSystemTools::GetFilenameName(tmp); - // add all files which don't match the default - // */CMakeLists.txt;*cmake; to the file pattern - if ((tmp != "CMakeLists.txt") && - (strstr(tmp.c_str(), ".cmake") == nullptr)) { - cmakeFilePattern += tmp + ";"; - } - } - } - - // get all sources - const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets(); - for (cmGeneratorTarget* gt : targets) { - std::vector<cmSourceFile*> sources; - gt->GetSourceFiles(sources, gt->Target->GetMakefile()->GetSafeDefinition( - "CMAKE_BUILD_TYPE")); - for (cmSourceFile* sf : sources) { - tmp = sf->GetFullPath(); - std::string headerBasename = cmSystemTools::GetFilenamePath(tmp); - headerBasename += "/"; - headerBasename += cmSystemTools::GetFilenameWithoutExtension(tmp); - - cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - - if ((tmp[0] != '/') && - (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - nullptr) && - (cmSystemTools::GetFilenameExtension(tmp) != ".moc")) { - files.insert(tmp); - - // check if there's a matching header around - for (std::string const& hdrExt : hdrExts) { - std::string hname = headerBasename; - hname += "."; - hname += hdrExt; - if (cmSystemTools::FileExists(hname.c_str())) { - cmSystemTools::ReplaceString(hname, projectDir.c_str(), ""); - files.insert(hname); - break; - } - } - } - } - for (std::string const& listFile : listFiles) { - tmp = listFile; - cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - if ((tmp[0] != '/') && - (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == - nullptr)) { - files.insert(tmp); - } - } - } - } - - // check if the output file already exists and read it - // insert all files which exist into the set of files - cmsys::ifstream oldFilelist(filename.c_str()); - if (oldFilelist) { - while (cmSystemTools::GetLineFromStream(oldFilelist, tmp)) { - if (tmp[0] == '/') { - continue; - } - std::string completePath = projectDir + tmp; - if (cmSystemTools::FileExists(completePath.c_str())) { - files.insert(tmp); - } - } - oldFilelist.close(); - } - - // now write the new filename - cmGeneratedFileStream fout(filename.c_str()); - if (!fout) { - return false; - } - - fileToOpen = ""; - for (std::string const& file : files) { - // get the full path to the file - tmp = cmSystemTools::CollapseFullPath(file, projectDir.c_str()); - // just select the first source file - if (fileToOpen.empty()) { - std::string ext = cmSystemTools::GetFilenameExtension(tmp); - if ((ext == ".c") || (ext == ".cc") || (ext == ".cpp") || - (ext == ".cxx") || (ext == ".C") || (ext == ".h") || - (ext == ".hpp")) { - fileToOpen = tmp; - } - } - // make it relative to the project dir - cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - // only put relative paths - if (!tmp.empty() && tmp[0] != '/') { - fout << tmp << "\n"; - } - } - return true; -} - -/* create the project file, if it already exists, merge it with the -existing one, otherwise create a new one */ -void cmGlobalKdevelopGenerator::CreateProjectFile( - const std::string& outputDir, const std::string& projectDir, - const std::string& projectname, const std::string& executable, - const std::string& cmakeFilePattern, const std::string& fileToOpen) -{ - this->Blacklist.clear(); - - std::string filename = outputDir + "/"; - filename += projectname + ".kdevelop"; - std::string sessionFilename = outputDir + "/"; - sessionFilename += projectname + ".kdevses"; - - if (cmSystemTools::FileExists(filename.c_str())) { - this->MergeProjectFiles(outputDir, projectDir, filename, executable, - cmakeFilePattern, fileToOpen, sessionFilename); - } else { - // add all subdirectories which are cmake build directories to the - // kdevelop blacklist so they are not monitored for added or removed files - // since this is handled by adding files to the cmake files - cmsys::Directory d; - if (d.Load(projectDir)) { - size_t numf = d.GetNumberOfFiles(); - for (unsigned int i = 0; i < numf; i++) { - std::string nextFile = d.GetFile(i); - if ((nextFile != ".") && (nextFile != "..")) { - std::string tmp = projectDir; - tmp += "/"; - tmp += nextFile; - if (cmSystemTools::FileIsDirectory(tmp)) { - tmp += "/CMakeCache.txt"; - if ((nextFile == "CMakeFiles") || - (cmSystemTools::FileExists(tmp.c_str()))) { - this->Blacklist.push_back(nextFile); - } - } - } - } - } - this->CreateNewProjectFile(outputDir, projectDir, filename, executable, - cmakeFilePattern, fileToOpen, sessionFilename); - } -} - -void cmGlobalKdevelopGenerator::MergeProjectFiles( - const std::string& outputDir, const std::string& projectDir, - const std::string& filename, const std::string& executable, - const std::string& cmakeFilePattern, const std::string& fileToOpen, - const std::string& sessionFilename) -{ - cmsys::ifstream oldProjectFile(filename.c_str()); - if (!oldProjectFile) { - this->CreateNewProjectFile(outputDir, projectDir, filename, executable, - cmakeFilePattern, fileToOpen, sessionFilename); - return; - } - - /* Read the existing project file (line by line), copy all lines - into the new project file, except the ones which can be reliably - set from contents of the CMakeLists.txt */ - std::string tmp; - std::vector<std::string> lines; - while (cmSystemTools::GetLineFromStream(oldProjectFile, tmp)) { - lines.push_back(tmp); - } - oldProjectFile.close(); - - cmGeneratedFileStream fout(filename.c_str()); - if (!fout) { - return; - } - - for (std::string const& l : lines) { - const char* line = l.c_str(); - // skip these tags as they are always replaced - if ((strstr(line, "<projectdirectory>") != nullptr) || - (strstr(line, "<projectmanagement>") != nullptr) || - (strstr(line, "<absoluteprojectpath>") != nullptr) || - (strstr(line, "<filelistdirectory>") != nullptr) || - (strstr(line, "<buildtool>") != nullptr) || - (strstr(line, "<builddir>") != nullptr)) { - continue; - } - - // output the line from the file if it is not one of the above tags - fout << l << "\n"; - // if this is the <general> tag output the stuff that goes in the - // general tag - if (strstr(line, "<general>")) { - fout << " <projectmanagement>KDevCustomProject</projectmanagement>\n"; - fout << " <projectdirectory>" << projectDir - << "</projectdirectory>\n"; // this one is important - fout << " <absoluteprojectpath>true</absoluteprojectpath>\n"; - // and this one - } - // inside kdevcustomproject the <filelistdirectory> must be put - if (strstr(line, "<kdevcustomproject>")) { - fout << " <filelistdirectory>" << outputDir - << "</filelistdirectory>\n"; - } - // buildtool and builddir go inside <build> - if (strstr(line, "<build>")) { - fout << " <buildtool>make</buildtool>\n"; - fout << " <builddir>" << outputDir << "</builddir>\n"; - } - } -} - -void cmGlobalKdevelopGenerator::CreateNewProjectFile( - const std::string& outputDir, const std::string& projectDir, - const std::string& filename, const std::string& executable, - const std::string& cmakeFilePattern, const std::string& fileToOpen, - const std::string& sessionFilename) -{ - cmGeneratedFileStream fout(filename.c_str()); - if (!fout) { - return; - } - cmXMLWriter xml(fout); - - // check for a version control system - bool hasSvn = cmSystemTools::FileExists((projectDir + "/.svn").c_str()); - bool hasCvs = cmSystemTools::FileExists((projectDir + "/CVS").c_str()); - - bool enableCxx = (this->GlobalGenerator->GetLanguageEnabled("C") || - this->GlobalGenerator->GetLanguageEnabled("CXX")); - bool enableFortran = this->GlobalGenerator->GetLanguageEnabled("Fortran"); - std::string primaryLanguage = "C++"; - if (enableFortran && !enableCxx) { - primaryLanguage = "Fortran77"; - } - - xml.StartDocument(); - xml.StartElement("kdevelop"); - xml.StartElement("general"); - - xml.Element("author", ""); - xml.Element("email", ""); - xml.Element("version", "$VERSION$"); - xml.Element("projectmanagement", "KDevCustomProject"); - xml.Element("primarylanguage", primaryLanguage); - xml.Element("ignoreparts"); - xml.Element("projectdirectory", projectDir); // this one is important - xml.Element("absoluteprojectpath", "true"); // and this one - - // setup additional languages - xml.StartElement("secondaryLanguages"); - if (enableFortran && enableCxx) { - xml.Element("language", "Fortran"); - } - if (enableCxx) { - xml.Element("language", "C"); - } - xml.EndElement(); - - if (hasSvn) { - xml.Element("versioncontrol", "kdevsubversion"); - } else if (hasCvs) { - xml.Element("versioncontrol", "kdevcvsservice"); - } - - xml.EndElement(); // general - xml.StartElement("kdevcustomproject"); - - xml.Element("filelistdirectory", outputDir); - - xml.StartElement("run"); - xml.Element("mainprogram", executable); - xml.Element("directoryradio", "custom"); - xml.Element("customdirectory", outputDir); - xml.Element("programargs", ""); - xml.Element("terminal", "false"); - xml.Element("autocompile", "true"); - xml.Element("envvars"); - xml.EndElement(); - - xml.StartElement("build"); - xml.Element("buildtool", "make"); // this one is important - xml.Element("builddir", outputDir); // and this one - xml.EndElement(); - - xml.StartElement("make"); - xml.Element("abortonerror", "false"); - xml.Element("numberofjobs", 1); - xml.Element("dontact", "false"); - xml.Element("makebin", this->GlobalGenerator->GetLocalGenerators()[0] - ->GetMakefile() - ->GetRequiredDefinition("CMAKE_MAKE_PROGRAM")); - xml.Element("selectedenvironment", "default"); - - xml.StartElement("environments"); - xml.StartElement("default"); - - xml.StartElement("envvar"); - xml.Attribute("value", 1); - xml.Attribute("name", "VERBOSE"); - xml.EndElement(); - - xml.StartElement("envvar"); - xml.Attribute("value", 1); - xml.Attribute("name", "CMAKE_NO_VERBOSE"); - xml.EndElement(); - - xml.EndElement(); // default - xml.EndElement(); // environments - xml.EndElement(); // make - - xml.StartElement("blacklist"); - for (std::string const& dir : this->Blacklist) { - xml.Element("path", dir); - } - xml.EndElement(); - - xml.EndElement(); // kdevcustomproject - - xml.StartElement("kdevfilecreate"); - xml.Element("filetypes"); - xml.StartElement("useglobaltypes"); - - xml.StartElement("type"); - xml.Attribute("ext", "ui"); - xml.EndElement(); - - xml.StartElement("type"); - xml.Attribute("ext", "cpp"); - xml.EndElement(); - - xml.StartElement("type"); - xml.Attribute("ext", "h"); - xml.EndElement(); - - xml.EndElement(); // useglobaltypes - xml.EndElement(); // kdevfilecreate - - xml.StartElement("kdevdoctreeview"); - xml.StartElement("projectdoc"); - xml.Element("userdocDir", "html/"); - xml.Element("apidocDir", "html/"); - xml.EndElement(); // projectdoc - xml.Element("ignoreqt_xml"); - xml.Element("ignoredoxygen"); - xml.Element("ignorekdocs"); - xml.Element("ignoretocs"); - xml.Element("ignoredevhelp"); - xml.EndElement(); // kdevdoctreeview; - - if (enableCxx) { - xml.StartElement("cppsupportpart"); - xml.StartElement("filetemplates"); - xml.Element("interfacesuffix", ".h"); - xml.Element("implementationsuffix", ".cpp"); - xml.EndElement(); // filetemplates - xml.EndElement(); // cppsupportpart - - xml.StartElement("kdevcppsupport"); - xml.StartElement("codecompletion"); - xml.Element("includeGlobalFunctions", "true"); - xml.Element("includeTypes", "true"); - xml.Element("includeEnums", "true"); - xml.Element("includeTypedefs", "false"); - xml.Element("automaticCodeCompletion", "true"); - xml.Element("automaticArgumentsHint", "true"); - xml.Element("automaticHeaderCompletion", "true"); - xml.Element("codeCompletionDelay", 250); - xml.Element("argumentsHintDelay", 400); - xml.Element("headerCompletionDelay", 250); - xml.EndElement(); // codecompletion - xml.Element("references"); - xml.EndElement(); // kdevcppsupport; - } - - if (enableFortran) { - xml.StartElement("kdevfortransupport"); - xml.StartElement("ftnchek"); - xml.Element("division", "false"); - xml.Element("extern", "false"); - xml.Element("declare", "false"); - xml.Element("pure", "false"); - xml.Element("argumentsall", "false"); - xml.Element("commonall", "false"); - xml.Element("truncationall", "false"); - xml.Element("usageall", "false"); - xml.Element("f77all", "false"); - xml.Element("portabilityall", "false"); - xml.Element("argumentsonly"); - xml.Element("commononly"); - xml.Element("truncationonly"); - xml.Element("usageonly"); - xml.Element("f77only"); - xml.Element("portabilityonly"); - xml.EndElement(); // ftnchek - xml.EndElement(); // kdevfortransupport; - } - - // set up file groups. maybe this can be used with the CMake SOURCE_GROUP() - // command - xml.StartElement("kdevfileview"); - xml.StartElement("groups"); - - xml.StartElement("group"); - xml.Attribute("pattern", cmakeFilePattern); - xml.Attribute("name", "CMake"); - xml.EndElement(); - - if (enableCxx) { - xml.StartElement("group"); - xml.Attribute("pattern", "*.h;*.hxx;*.hpp"); - xml.Attribute("name", "Header"); - xml.EndElement(); - - xml.StartElement("group"); - xml.Attribute("pattern", "*.c"); - xml.Attribute("name", "C Sources"); - xml.EndElement(); - - xml.StartElement("group"); - xml.Attribute("pattern", "*.cpp;*.C;*.cxx;*.cc"); - xml.Attribute("name", "C++ Sources"); - xml.EndElement(); - } - - if (enableFortran) { - xml.StartElement("group"); - xml.Attribute("pattern", - "*.f;*.F;*.f77;*.F77;*.f90;*.F90;*.for;*.f95;*.F95"); - xml.Attribute("name", "Fortran Sources"); - xml.EndElement(); - } - - xml.StartElement("group"); - xml.Attribute("pattern", "*.ui"); - xml.Attribute("name", "Qt Designer files"); - xml.EndElement(); - - xml.Element("hidenonprojectfiles", "true"); - xml.EndElement(); // groups - - xml.StartElement("tree"); - xml.Element("hidepatterns", "*.o,*.lo,CVS,*~,cmake*"); - xml.Element("hidenonprojectfiles", "true"); - xml.EndElement(); // tree - - xml.EndElement(); // kdevfileview - xml.EndElement(); // kdevelop; - xml.EndDocument(); - - if (sessionFilename.empty()) { - return; - } - - // and a session file, so that kdevelop opens a file if it opens the - // project the first time - cmGeneratedFileStream devses(sessionFilename.c_str()); - if (!devses) { - return; - } - cmXMLWriter sesxml(devses); - sesxml.StartDocument("UTF-8"); - sesxml.Doctype("KDevPrjSession"); - sesxml.StartElement("KDevPrjSession"); - - sesxml.StartElement("DocsAndViews"); - sesxml.Attribute("NumberOfDocuments", 1); - - sesxml.StartElement("Doc0"); - sesxml.Attribute("NumberOfViews", 1); - sesxml.Attribute("URL", "file://" + fileToOpen); - - sesxml.StartElement("View0"); - sesxml.Attribute("line", 0); - sesxml.Attribute("Type", "Source"); - sesxml.EndElement(); // View0 - - sesxml.EndElement(); // Doc0 - sesxml.EndElement(); // DocsAndViews - sesxml.EndElement(); // KDevPrjSession; -} diff --git a/Source/cmGlobalKdevelopGenerator.h b/Source/cmGlobalKdevelopGenerator.h deleted file mode 100644 index d6c43f3..0000000 --- a/Source/cmGlobalKdevelopGenerator.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmGlobalKdevelopGenerator_h -#define cmGlobalKdevelopGenerator_h - -#include "cmConfigure.h" // IWYU pragma: keep - -#include "cmExternalMakefileProjectGenerator.h" - -#include <string> -#include <vector> - -class cmLocalGenerator; - -/** \class cmGlobalKdevelopGenerator - * \brief Write Unix Makefiles accompanied by KDevelop3 project files. - * - * cmGlobalKdevelopGenerator produces a project file for KDevelop 3 (KDevelop - * > 3.1.1). The project is based on the "Custom Makefile based C/C++" - * project of KDevelop. Such a project consists of Unix Makefiles in the - * build directory together with a \<your_project\>.kdevelop project file, - * which contains the project settings and a \<your_project\>.kdevelop.filelist - * file, which lists the source files relative to the kdevelop project - * directory. The kdevelop project directory is the base source directory. - */ -class cmGlobalKdevelopGenerator : public cmExternalMakefileProjectGenerator -{ -public: - cmGlobalKdevelopGenerator(); - - static cmExternalMakefileProjectGeneratorFactory* GetFactory(); - - void Generate() override; - -private: - /*** Create the foo.kdevelop.filelist file, return false if it doesn't - succeed. If the file already exists the contents will be merged. - */ - bool CreateFilelistFile(const std::vector<cmLocalGenerator*>& lgs, - const std::string& outputDir, - const std::string& projectDirIn, - const std::string& projectname, - std::string& cmakeFilePattern, - std::string& fileToOpen); - - /** Create the foo.kdevelop file. This one calls MergeProjectFiles() - if it already exists, otherwise createNewProjectFile() The project - files will be created in \a outputDir (in the build tree), the - kdevelop project dir will be set to \a projectDir (in the source - tree). \a cmakeFilePattern consists of a lists of all cmake - listfiles used by this CMakeLists.txt */ - void CreateProjectFile(const std::string& outputDir, - const std::string& projectDir, - const std::string& projectname, - const std::string& executable, - const std::string& cmakeFilePattern, - const std::string& fileToOpen); - - /*** Reads the old foo.kdevelop line by line and only replaces the - "important" lines - */ - void MergeProjectFiles(const std::string& outputDir, - const std::string& projectDir, - const std::string& filename, - const std::string& executable, - const std::string& cmakeFilePattern, - const std::string& fileToOpen, - const std::string& sessionFilename); - ///! Creates a new foo.kdevelop and a new foo.kdevses file - void CreateNewProjectFile(const std::string& outputDir, - const std::string& projectDir, - const std::string& filename, - const std::string& executable, - const std::string& cmakeFilePattern, - const std::string& fileToOpen, - const std::string& sessionFilename); - - std::vector<std::string> Blacklist; -}; - -#endif diff --git a/Source/cmUtils.hxx b/Source/cmUtils.hxx index c5c767c..a7a3e81 100644 --- a/Source/cmUtils.hxx +++ b/Source/cmUtils.hxx @@ -7,7 +7,7 @@ // Use the make system's VERBOSE environment variable to enable // verbose output. This can be skipped by also setting CMAKE_NO_VERBOSE -// (which is set by the Eclipse and KDevelop generators). +// (which is set by the Eclipse generator). inline bool isCMakeVerbose() { return (cmSystemTools::HasEnv("VERBOSE") && diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 480646e..4d501df 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -34,14 +34,6 @@ #include <unordered_map> #endif -// only build kdevelop generator on non-windows platforms -// when not bootstrapping cmake -#if !defined(_WIN32) -#if defined(CMAKE_BUILD_WITH_CMAKE) -#define CMAKE_USE_KDEVELOP -#endif -#endif - #if defined(CMAKE_BUILD_WITH_CMAKE) #define CMAKE_USE_ECLIPSE #endif @@ -87,10 +79,6 @@ #include "cmExtraKateGenerator.h" #include "cmExtraSublimeTextGenerator.h" -#ifdef CMAKE_USE_KDEVELOP -#include "cmGlobalKdevelopGenerator.h" -#endif - #ifdef CMAKE_USE_ECLIPSE #include "cmExtraEclipseCDT4Generator.h" #endif @@ -902,9 +890,6 @@ void cmake::AddDefaultExtraGenerators() this->ExtraGenerators.push_back(cmExtraEclipseCDT4Generator::GetFactory()); #endif -#ifdef CMAKE_USE_KDEVELOP - this->ExtraGenerators.push_back(cmGlobalKdevelopGenerator::GetFactory()); -#endif #endif } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index fb7313f..8b38a70 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -624,7 +624,6 @@ if(BUILD_TESTING) "CodeLite" "Eclipse CDT4" "Kate" - "KDevelop3" "Sublime Text 2") foreach(extraGenerator ${extraGenerators}) @@ -3224,7 +3223,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() # add some cross compiler tests, for now only with makefile based generators - if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "KDevelop") + if(CMAKE_GENERATOR MATCHES "Makefiles") # if sdcc is found, build the SimpleCOnly project with sdcc find_program(SDCC_EXECUTABLE sdcc) diff --git a/Tests/Server/cmakelib.py b/Tests/Server/cmakelib.py index 6e8761a..edb5af6 100644 --- a/Tests/Server/cmakelib.py +++ b/Tests/Server/cmakelib.py @@ -288,7 +288,7 @@ def validateGlobalSettings(cmakeCommand, cmakeCommandPath, data): tmp = line.strip() if tmp.endswith(" [arch]"): tmp = tmp[0:len(tmp) - 7] - if (len(tmp) > 0) and (" - " not in tmp) and (tmp != 'KDevelop3'): + if (len(tmp) > 0) and (" - " not in tmp): cmakeGenerators.append(tmp) generators = [] |