summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-04-20 11:06:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-20 11:06:55 (GMT)
commit1121be24cc73c8ab006e45e7c38564e8ee6a7436 (patch)
treea63f7a7d96fccc735446d03288b249716b2fd5f1
parent38d854dccff6ddeb69c217252dd9ed9f87fe1b19 (diff)
parent63e0c16e3de5d3524a409a73ac430109416050de (diff)
downloadCMake-1121be24cc73c8ab006e45e7c38564e8ee6a7436.zip
CMake-1121be24cc73c8ab006e45e7c38564e8ee6a7436.tar.gz
CMake-1121be24cc73c8ab006e45e7c38564e8ee6a7436.tar.bz2
Merge topic 'doc-xref-envvar'
63e0c16e3d Help: Link from CMAKE_<LANG>_FLAGS to <LANG>FLAGS environment variables 8acf46caf1 Utilities/Sphinx: Add role and directive for 'envvar' in CMake domain 7e532abc78 Utilities/Sphinx: Fix QtHelp generator identifiers Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !1985
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS.rst11
-rw-r--r--Utilities/Sphinx/cmake.py4
-rwxr-xr-xUtilities/Sphinx/create_identifiers.py2
3 files changed, 17 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_LANG_FLAGS.rst b/Help/variable/CMAKE_LANG_FLAGS.rst
index c57d92c..14b2694 100644
--- a/Help/variable/CMAKE_LANG_FLAGS.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS.rst
@@ -4,3 +4,14 @@ CMAKE_<LANG>_FLAGS
Flags for all build types.
``<LANG>`` flags used regardless of the value of :variable:`CMAKE_BUILD_TYPE`.
+
+This is initialized for each language from environment variables:
+
+* ``CMAKE_C_FLAGS``:
+ Initialized by the :envvar:`CFLAGS` environment variable.
+* ``CMAKE_CXX_FLAGS``:
+ Initialized by the :envvar:`CXXFLAGS` environment variable.
+* ``CMAKE_CUDA_FLAGS``:
+ Initialized by the :envvar:`CUDAFLAGS` environment variable.
+* ``CMAKE_Fortran_FLAGS``:
+ Initialized by the :envvar:`FFLAGS` environment variable.
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index cfda2d4..90ddd36 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -144,6 +144,7 @@ class _cmake_index_entry:
_cmake_index_objs = {
'command': _cmake_index_entry('command'),
+ 'envvar': _cmake_index_entry('envvar'),
'generator': _cmake_index_entry('generator'),
'manual': _cmake_index_entry('manual'),
'module': _cmake_index_entry('module'),
@@ -324,6 +325,7 @@ class CMakeDomain(Domain):
label = 'CMake'
object_types = {
'command': ObjType('command', 'command'),
+ 'envvar': ObjType('envvar', 'envvar'),
'generator': ObjType('generator', 'generator'),
'variable': ObjType('variable', 'variable'),
'module': ObjType('module', 'module'),
@@ -339,6 +341,7 @@ class CMakeDomain(Domain):
}
directives = {
'command': CMakeObject,
+ 'envvar': CMakeObject,
'variable': CMakeObject,
# Other object types cannot be created except by the CMakeTransform
# 'generator': CMakeObject,
@@ -355,6 +358,7 @@ class CMakeDomain(Domain):
}
roles = {
'command': CMakeXRefRole(fix_parens = True, lowercase = True),
+ 'envvar': CMakeXRefRole(),
'generator': CMakeXRefRole(),
'variable': CMakeXRefRole(),
'module': CMakeXRefRole(),
diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py
index 3fe3fcb..e638950 100755
--- a/Utilities/Sphinx/create_identifiers.py
+++ b/Utilities/Sphinx/create_identifiers.py
@@ -21,7 +21,9 @@ newlines = []
for line in lines:
mapping = (("command", "command"),
+ ("envvar", "envvar"),
("variable", "variable"),
+ ("generator", "generator"),
("target property", "prop_tgt"),
("test property", "prop_test"),
("source file property", "prop_sf"),