Deprecate "extra" generators in favor of cmake-file-api(7)

The "extra" generators were created in CMake's early years to provide
support for users of specific IDEs by directly generating their project
files alongside make or ninja files.  Nowadays the file-api provides a
more generic, maintainable, well-tested, and robust way for IDEs to view
CMake project build trees.  Deprecate the legacy "extra" generators to
encourage the corresponding IDEs to use the file-api.

Fixes: #19090
This commit is contained in:
Brad King 2023-02-15 10:38:45 -05:00
parent 37f068083b
commit ef5a4d964b
17 changed files with 75 additions and 7 deletions

View File

@ -1,6 +1,12 @@
CodeBlocks
----------
.. deprecated:: 3.27
Support for :ref:`Extra Generators` is deprecated and will be removed from
a future version of CMake. IDEs may use the :manual:`cmake-file-api(7)`
to view CMake-generated project build trees.
Generates CodeBlocks project files.
Project files for CodeBlocks will be created in the top directory and

View File

@ -1,6 +1,12 @@
CodeLite
----------
.. deprecated:: 3.27
Support for :ref:`Extra Generators` is deprecated and will be removed from
a future version of CMake. IDEs may use the :manual:`cmake-file-api(7)`
to view CMake-generated project build trees.
Generates CodeLite project files.
Project files for CodeLite will be created in the top directory and

View File

@ -1,6 +1,12 @@
Eclipse CDT4
------------
.. deprecated:: 3.27
Support for :ref:`Extra Generators` is deprecated and will be removed from
a future version of CMake. IDEs may use the :manual:`cmake-file-api(7)`
to view CMake-generated project build trees.
Generates Eclipse CDT 4.0 project files.
Project files for Eclipse will be created in the top directory. In

View File

@ -1,6 +1,12 @@
Kate
----
.. deprecated:: 3.27
Support for :ref:`Extra Generators` is deprecated and will be removed from
a future version of CMake. IDEs may use the :manual:`cmake-file-api(7)`
to view CMake-generated project build trees.
Generates Kate project files.
A project file for Kate will be created in the top directory in the top level

View File

@ -1,6 +1,12 @@
Sublime Text 2
--------------
.. deprecated:: 3.27
Support for :ref:`Extra Generators` is deprecated and will be removed from
a future version of CMake. IDEs may use the :manual:`cmake-file-api(7)`
to view CMake-generated project build trees.
Generates Sublime Text 2 project files.
Project files for Sublime Text 2 will be created in the top directory

View File

@ -107,6 +107,12 @@ Other Generators
Extra Generators
================
.. deprecated:: 3.27
Support for "Extra Generators" is deprecated and will be removed from
a future version of CMake. IDEs may use the :manual:`cmake-file-api(7)`
to view CMake-generated project build trees.
Some of the `CMake Generators`_ listed in the :manual:`cmake(1)`
command-line tool :option:`--help <cmake --help>` output may have
variants that specify an extra generator for an auxiliary IDE tool.

View File

@ -781,7 +781,7 @@ Available commands are:
(:option:`-A ... <cmake -A>`). The value is a list of platforms known to
be supported.
``extraGenerators``
A list of strings with all the extra generators compatible with
A list of strings with all the :ref:`Extra Generators` compatible with
the generator.
``fileApi``

View File

@ -0,0 +1,5 @@
deprecate-extra-generators
--------------------------
* The :ref:`Extra Generators` have been deprecated. IDEs may use the
:manual:`cmake-file-api(7)` to view CMake-generated project build trees.

View File

@ -2,7 +2,8 @@ CMAKE_EDIT_COMMAND
------------------
Full path to :manual:`cmake-gui(1)` or :manual:`ccmake(1)`. Defined only for
:ref:`Makefile Generators` when not using an "extra" generator for an IDE.
:ref:`Makefile Generators` and :ref:`Ninja Generators` when not using any
:ref:`Extra Generators`.
This is the full path to the CMake executable that can graphically
edit the cache. For example, :manual:`cmake-gui(1)` or :manual:`ccmake(1)`.

View File

@ -1,6 +1,12 @@
CMAKE_EXTRA_GENERATOR
---------------------
.. deprecated:: 3.27
Support for :ref:`Extra Generators` is deprecated and will be removed from
a future version of CMake. IDEs may use the :manual:`cmake-file-api(7)`
to view CMake-generated project build trees.
The extra generator used to build the project. See
:manual:`cmake-generators(7)`.

View File

@ -45,7 +45,7 @@ cmExtraCodeBlocksGenerator::GetFactory()
{
static cmExternalMakefileProjectGeneratorSimpleFactory<
cmExtraCodeBlocksGenerator>
factory("CodeBlocks", "Generates CodeBlocks project files.");
factory("CodeBlocks", "Generates CodeBlocks project files (deprecated).");
if (factory.GetSupportedGlobalGenerators().empty()) {
#if defined(_WIN32)

View File

@ -33,7 +33,7 @@ cmExtraCodeLiteGenerator::GetFactory()
{
static cmExternalMakefileProjectGeneratorSimpleFactory<
cmExtraCodeLiteGenerator>
factory("CodeLite", "Generates CodeLite project files.");
factory("CodeLite", "Generates CodeLite project files (deprecated).");
if (factory.GetSupportedGlobalGenerators().empty()) {
#if defined(_WIN32)

View File

@ -63,7 +63,8 @@ cmExtraEclipseCDT4Generator::GetFactory()
{
static cmExternalMakefileProjectGeneratorSimpleFactory<
cmExtraEclipseCDT4Generator>
factory("Eclipse CDT4", "Generates Eclipse CDT 4.0 project files.");
factory("Eclipse CDT4",
"Generates Eclipse CDT 4.0 project files (deprecated).");
if (factory.GetSupportedGlobalGenerators().empty()) {
// TODO: Verify if __CYGWIN__ should be checked.

View File

@ -25,7 +25,7 @@ cmExtraKateGenerator::cmExtraKateGenerator() = default;
cmExternalMakefileProjectGeneratorFactory* cmExtraKateGenerator::GetFactory()
{
static cmExternalMakefileProjectGeneratorSimpleFactory<cmExtraKateGenerator>
factory("Kate", "Generates Kate project files.");
factory("Kate", "Generates Kate project files (deprecated).");
if (factory.GetSupportedGlobalGenerators().empty()) {
#if defined(_WIN32)

View File

@ -43,7 +43,8 @@ cmExtraSublimeTextGenerator::GetFactory()
{
static cmExternalMakefileProjectGeneratorSimpleFactory<
cmExtraSublimeTextGenerator>
factory("Sublime Text 2", "Generates Sublime Text 2 project files.");
factory("Sublime Text 2",
"Generates Sublime Text 2 project files (deprecated).");
if (factory.GetSupportedGlobalGenerators().empty()) {
#if defined(_WIN32)

View File

@ -1327,6 +1327,16 @@ void cmGlobalGenerator::Configure()
this->BinaryDirectories.insert(
this->CMakeInstance->GetHomeOutputDirectory());
if (this->ExtraGenerator && !this->CMakeInstance->GetIsInTryCompile()) {
this->CMakeInstance->IssueMessage(
MessageType::DEPRECATION_WARNING,
cmStrCat("Support for \"Extra Generators\" like\n ",
this->ExtraGenerator->GetName(),
"\nis deprecated and will be removed from a future version "
"of CMake. IDEs may use the cmake-file-api(7) to view "
"CMake-generated project build trees."));
}
// now do it
this->ConfigureDoneCMP0026AndCMP0024 = false;
dirMf->Configure();

View File

@ -0,0 +1,8 @@
^CMake Deprecation Warning:
Support for "Extra Generators" like
[^
]+
is deprecated and will be removed from a future version of CMake\. IDEs may
use the cmake-file-api\(7\) to view CMake-generated project build trees\.