This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 65522e5e0ef95b7424714ec4d67345bf00e9b8bd (commit) via 9463d73cc4d58b190fac0cac6aeee424b5d29514 (commit) via f29e2292c90d4fbdadce041b1c9d649aca3c602b (commit) via 860338491ee96274ac110459b3b316149d4585f7 (commit) via e855bd5248bbb7b77b45e269e4fa098b29c9e889 (commit) via 8ba2a8d4a415d2288786a0d56e90b3d7693ad32e (commit) via 85498fccd8ac1dd7345d995e52e1bf63d663071e (commit) via e24ef9694275b9345bf08cf46ca1cf064b34813b (commit) via e4554149c476e9eb9fe00368b2ac1ac7ac9ffe5c (commit) via 3de551cc22bf80f63ec9f05e3e934f42f79b8965 (commit) via eba7273c203f0698ccd716604cc298b7da1d3ee6 (commit) from 8db4bd115c566460986ddd2f7a8f4f90ee5baf26 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65522e5e0ef95b7424714ec4d67345bf00e9b8bd commit 65522e5e0ef95b7424714ec4d67345bf00e9b8bd Merge: 9463d73 f29e229 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Nov 9 15:37:07 2018 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Nov 9 10:37:14 2018 -0500 Merge topic 'cpack-improve-unknown-generator-error' f29e2292c9 cpack: When given an unknown generator print out all valid generators eba7273c20 cpack: Better error message when generator doesn't exist. Acked-by: Kitware Robot <kwro...@kitware.com> Acked-by: David Cole <dlrd...@aol.com> Merge-request: !2580 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9463d73cc4d58b190fac0cac6aeee424b5d29514 commit 9463d73cc4d58b190fac0cac6aeee424b5d29514 Merge: 8db4bd1 8603384 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Nov 9 15:34:40 2018 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Fri Nov 9 10:35:28 2018 -0500 Merge topic 'env' 860338491e Help: Describe $CACHE and $ENV as operators e855bd5248 Help: Document if(DEFINED ENV{name}) 8ba2a8d4a4 Help: short/long variable reference in if command 85498fccd8 Help: Provide backreferences. e24ef96942 Help: New section on Environment Variables in cmake-language.7 e4554149c4 Help: Remove over-precise clause. 3de551cc22 Help: Clarify effect of set(ENV{..} ..) and unset(ENV{..}) Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2538 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f29e2292c90d4fbdadce041b1c9d649aca3c602b commit f29e2292c90d4fbdadce041b1c9d649aca3c602b Author: Robert Maynard <robert.mayn...@kitware.com> AuthorDate: Thu Nov 8 09:27:28 2018 -0500 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Nov 8 19:07:24 2018 -0500 cpack: When given an unknown generator print out all valid generators This makes cpack behavior match cmake when passed an invalid generator diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 3df1b36..7cf69fc 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -21,6 +21,7 @@ #include "cmCPackLog.h" #include "cmDocumentation.h" #include "cmDocumentationEntry.h" +#include "cmDocumentationFormatter.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmStateSnapshot.h" @@ -360,7 +361,19 @@ int main(int argc, char const* const* argv) cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Could not create CPack generator: " << gen << std::endl); - + // Print out all the valid generators + cmDocumentation generatorDocs; + std::vector<cmDocumentationEntry> v; + for (auto const& g : generators.GetGeneratorsList()) { + cmDocumentationEntry e; + e.Name = g.first; + e.Brief = g.second; + v.push_back(std::move(e)); + } + generatorDocs.SetSection("Generators", v); + std::cerr << "\n"; + generatorDocs.PrintDocumentation(cmDocumentation::ListGenerators, + std::cerr); parsed = 0; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=860338491ee96274ac110459b3b316149d4585f7 commit 860338491ee96274ac110459b3b316149d4585f7 Author: Joachim Wuttke (l) <j.wut...@fz-juelich.de> AuthorDate: Thu Nov 1 11:18:15 2018 +0100 Commit: Joachim Wuttke (h) <j.wut...@fz-juelich.de> CommitDate: Thu Nov 8 20:33:13 2018 +0100 Help: Describe $CACHE and $ENV as operators This resolves issue #18514 Also add a cross-reference to if(DEFINED ENV{var}). diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index efb217d..7a7f0b8 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -241,7 +241,6 @@ Variables that Describe the System /variable/ANDROID /variable/APPLE /variable/BORLAND - /variable/CACHE /variable/CMAKE_CL_64 /variable/CMAKE_COMPILER_2005 /variable/CMAKE_HOST_APPLE @@ -260,7 +259,6 @@ Variables that Describe the System /variable/CMAKE_SYSTEM_PROCESSOR /variable/CMAKE_SYSTEM_VERSION /variable/CYGWIN - /variable/ENV /variable/GHS-MULTI /variable/MINGW /variable/MSVC @@ -599,3 +597,12 @@ Variables for CPack /variable/CPACK_PACKAGING_INSTALL_PREFIX /variable/CPACK_SET_DESTDIR /variable/CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION + +Variable Expansion Operators +============================ + +.. toctree:: + :maxdepth: 1 + + /variable/CACHE + /variable/ENV diff --git a/Help/variable/CACHE.rst b/Help/variable/CACHE.rst index 230739a..2cef27e 100644 --- a/Help/variable/CACHE.rst +++ b/Help/variable/CACHE.rst @@ -1,7 +1,7 @@ CACHE ----- -Read cache variables. +Operator to read cache variables. Use the syntax ``$CACHE{VAR}`` to read cache entry ``VAR``. See the :ref:`cmake-language(7) variables <CMake Language Variables>` @@ -14,4 +14,5 @@ found CMake will search for a cache entry with that name. The ``$CACHE{VAR}`` syntax can be used to do direct cache lookup and ignore any existing normal variable. -See the :command:`set` command to see how to write cache variables. +See the :command:`set` and :command:`unset` commands to see how to +write or remove cache variables. diff --git a/Help/variable/ENV.rst b/Help/variable/ENV.rst index 98677dd..2b43934 100644 --- a/Help/variable/ENV.rst +++ b/Help/variable/ENV.rst @@ -1,8 +1,12 @@ ENV --- -Read environment variables. +Operator to read environment variables. Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``. -See the :command:`set` command to see how to write environment variables. +To test whether an environment variable is defined, use the signature +``if(DEFINED ENV{<name>})`` of the :command:`if` command. + +See the :command:`set` and :command:`unset` commands to see how to +write or remove environment variables. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e855bd5248bbb7b77b45e269e4fa098b29c9e889 commit e855bd5248bbb7b77b45e269e4fa098b29c9e889 Author: Joachim Wuttke (h) <j.wut...@fz-juelich.de> AuthorDate: Thu Nov 1 22:26:32 2018 +0100 Commit: Joachim Wuttke (h) <j.wut...@fz-juelich.de> CommitDate: Thu Nov 8 20:30:05 2018 +0100 Help: Document if(DEFINED ENV{name}) diff --git a/Help/command/if.rst b/Help/command/if.rst index ea5de7f..1cd9965 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -187,10 +187,11 @@ Possible conditions are: ``if(<variable|string> IN_LIST <variable>)`` True if the given element is contained in the named list variable. -``if(DEFINED <variable>)`` - True if the given variable is defined. It does not matter if the - variable is true or false just if it has been set. (Note macro - arguments are not variables.) +``if(DEFINED <name>|ENV{<name>})`` + True if a variable or environment variable + with given ``<name>`` is defined. + The value of the variable does not matter. + Note that macro arguments are not variables. ``if((condition) AND (condition OR (condition)))`` The conditions inside the parenthesis are evaluated first and then @@ -270,6 +271,7 @@ A quoted or bracketed variable or keyword will be interpreted as a string and not dereferenced or interpreted. See policy :policy:`CMP0054`. -There is no short form for environment or cache :ref:`Variable References`. -They can be referenced as ``$ENV{<name>}`` or ``$CACHE{<name>}`` -wherever the above-documented condition syntax accepts <variable|string>. +There is no automatic evaluation for environment or cache +:ref:`Variable References`. Their values must be referenced as +``$ENV{<name>}`` or ``$CACHE{<name>}`` wherever the above-documented +condition syntax accepts ``<variable|string>``. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ba2a8d4a415d2288786a0d56e90b3d7693ad32e commit 8ba2a8d4a415d2288786a0d56e90b3d7693ad32e Author: Joachim Wuttke (l) <j.wut...@fz-juelich.de> AuthorDate: Thu Nov 1 11:13:03 2018 +0100 Commit: Joachim Wuttke (h) <j.wut...@fz-juelich.de> CommitDate: Thu Nov 8 20:27:49 2018 +0100 Help: short/long variable reference in if command Explain that the short form of variable references in the if command does not apply to ENV and CACHE vars. diff --git a/Help/command/if.rst b/Help/command/if.rst index 4781f35..ea5de7f 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -231,7 +231,7 @@ which is true because ``var2`` is defined to "var1" which is not a false constant. Automatic evaluation applies in the other cases whenever the -above-documented signature accepts ``<variable|string>``: +above-documented condition syntax accepts ``<variable|string>``: * The left hand argument to ``MATCHES`` is first checked to see if it is a defined variable, if so the variable's value is used, otherwise the @@ -269,3 +269,7 @@ specified in a :ref:`Quoted Argument` or a :ref:`Bracket Argument`. A quoted or bracketed variable or keyword will be interpreted as a string and not dereferenced or interpreted. See policy :policy:`CMP0054`. + +There is no short form for environment or cache :ref:`Variable References`. +They can be referenced as ``$ENV{<name>}`` or ``$CACHE{<name>}`` +wherever the above-documented condition syntax accepts <variable|string>. diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 1b5281a..5e5cfff 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -389,7 +389,7 @@ historical considerations.) Variable References ------------------- -A *variable reference* has the form ``${variable_name}`` and is +A *variable reference* has the form ``${<variable>}`` and is evaluated inside a `Quoted Argument`_ or an `Unquoted Argument`_. A variable reference is replaced by the value of the variable, or by the empty string if the variable is not set. @@ -405,12 +405,18 @@ the ``$`` is also technically permitted but is discouraged. The `Variables`_ section documents the scope of variable names and how their values are set. -An *environment variable reference* has the form ``$ENV{VAR}``. +An *environment variable reference* has the form ``$ENV{<variable>}``. See the `Environment Variables`_ section for more information. -A *cache variable reference* has the form ``$CACHE{VAR}``. +A *cache variable reference* has the form ``$CACHE{<variable>}``. See :variable:`CACHE` for more information. +The :command:`if` command has a special condition syntax that +allows for variable references in the short form ``<variable>`` +instead of ``${<variable>}``. +However, environment and cache variables always need to be +referenced as ``$ENV{<variable>}`` or ``$CACHE{<variable>}``. + Comments -------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85498fccd8ac1dd7345d995e52e1bf63d663071e commit 85498fccd8ac1dd7345d995e52e1bf63d663071e Author: Joachim Wuttke (h) <j.wut...@fz-juelich.de> AuthorDate: Sat Oct 27 16:04:15 2018 +0200 Commit: Joachim Wuttke (h) <j.wut...@fz-juelich.de> CommitDate: Thu Nov 8 20:27:49 2018 +0100 Help: Provide backreferences. Short intro to pages cmake-variables.7 and cmake-env-variables.7, with backlinks to cmake-language.7. diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst index 31aa723..edf80f4 100644 --- a/Help/manual/cmake-env-variables.7.rst +++ b/Help/manual/cmake-env-variables.7.rst @@ -7,6 +7,14 @@ cmake-env-variables(7) .. contents:: +This page lists environment variables that have special +meaning to CMake. + +For general information on environment variables, see the +:ref:`Environment Variables <CMake Language Environment Variables>` +section in the cmake-language manual. + + Environment Variables that Control the Build ============================================ diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index ef5bb50..1b5281a 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -557,11 +557,11 @@ Otherwise, the variable reference evaluates to an empty string. The ``$CACHE{VAR}`` syntax can be used to do direct cache entry lookups. -The :manual:`cmake-variables(7)` manual documents many variables +The :manual:`cmake-variables(7)` manual documents the many variables that are provided by CMake or have meaning to CMake when set by project code. -.. _`CMake Language Lists`: +.. _`CMake Language Environment Variables`: Environment Variables ===================== @@ -589,6 +589,7 @@ Initialization The :manual:`cmake-env-variables(7)` manual documents environment variables that have special meaning to CMake. +.. _`CMake Language Lists`: Lists ===== diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 9b12fc5..efb217d 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -7,6 +7,14 @@ cmake-variables(7) .. contents:: +This page documents variables that are provided by CMake +or have meaning to CMake when set by project code. + +For general information on variables, see the +:ref:`Variables <CMake Language Variables>` +section in the cmake-language manual. + + Variables that Provide Information ================================== https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e24ef9694275b9345bf08cf46ca1cf064b34813b commit e24ef9694275b9345bf08cf46ca1cf064b34813b Author: Joachim Wuttke (h) <j.wut...@fz-juelich.de> AuthorDate: Sat Oct 27 15:53:05 2018 +0200 Commit: Joachim Wuttke (h) <j.wut...@fz-juelich.de> CommitDate: Thu Nov 8 20:27:49 2018 +0100 Help: New section on Environment Variables in cmake-language.7 diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 0283232..ef5bb50 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -406,7 +406,7 @@ The `Variables`_ section documents the scope of variable names and how their values are set. An *environment variable reference* has the form ``$ENV{VAR}``. -See :variable:`ENV` for more information. +See the `Environment Variables`_ section for more information. A *cache variable reference* has the form ``$CACHE{VAR}``. See :variable:`CACHE` for more information. @@ -563,6 +563,33 @@ by project code. .. _`CMake Language Lists`: +Environment Variables +===================== + +Environment Variables are like ordinary `Variables`_, with the +following differences: + +Scope + Environment variables have global scope in a CMake process. + They are never cached. + +References + `Variable References`_ have the form ``$ENV{<variable>}``. + +Initialization + Initial values of the CMake environment variables are those of + the calling process. + Values can be changed using the :command:`set` and :command:`unset` + commands. + These commands only affect the running CMake process, + not the system environment at large. + Changed values are not written back to the calling process, + and they are not seen by subsequent build or test processes. + +The :manual:`cmake-env-variables(7)` manual documents environment +variables that have special meaning to CMake. + + Lists ===== https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4554149c476e9eb9fe00368b2ac1ac7ac9ffe5c commit e4554149c476e9eb9fe00368b2ac1ac7ac9ffe5c Author: Joachim Wuttke (h) <j.wut...@fz-juelich.de> AuthorDate: Sat Oct 27 15:27:31 2018 +0200 Commit: Joachim Wuttke (h) <j.wut...@fz-juelich.de> CommitDate: Thu Nov 8 20:27:49 2018 +0100 Help: Remove over-precise clause. Section "Variables References" said that environment and cache variables are "evaluated in the same contexts as a normal variable reference". The reader has to guess what "contexts" means in this context. Probably "inside a Quoted Argument or an Unquoted Argument", exactly as for ordinary variable references. But this is exactly what the reader would tacitly assume anyway. Therefore I think the removed clause was unnecessary, and possibly more confusing than helpful. diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 630a86b..0283232 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -405,12 +405,10 @@ the ``$`` is also technically permitted but is discouraged. The `Variables`_ section documents the scope of variable names and how their values are set. -An *environment variable reference* has the form ``$ENV{VAR}`` and -is evaluated in the same contexts as a normal variable reference. +An *environment variable reference* has the form ``$ENV{VAR}``. See :variable:`ENV` for more information. -A *cache variable reference* has the form ``$CACHE{VAR}`` and -is evaluated in the same contexts as a normal variable reference. +A *cache variable reference* has the form ``$CACHE{VAR}``. See :variable:`CACHE` for more information. Comments https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3de551cc22bf80f63ec9f05e3e934f42f79b8965 commit 3de551cc22bf80f63ec9f05e3e934f42f79b8965 Author: Joachim Wuttke (h) <j.wut...@fz-juelich.de> AuthorDate: Sat Oct 27 15:08:43 2018 +0200 Commit: Joachim Wuttke (h) <j.wut...@fz-juelich.de> CommitDate: Thu Nov 8 20:27:10 2018 +0100 Help: Clarify effect of set(ENV{..} ..) and unset(ENV{..}) Explain that the commands affect only the current CMake process, not the process from which CMake was called, nor the system environment at large, nor the environment of subsequent build or test processes. diff --git a/Help/command/set.rst b/Help/command/set.rst index e37e693..dd5ea13 100644 --- a/Help/command/set.rst +++ b/Help/command/set.rst @@ -88,4 +88,10 @@ Set Environment Variable set(ENV{<variable>} <value>...) -Sets the current process environment ``<variable>`` to the given value. +Sets an :manual:`Environment Variable <cmake-env-variables(7)>` +to the given value. +Subsequent calls of ``$ENV{<variable>}`` will return this new value. + +This command affects only the current CMake process, not the process +from which CMake was called, nor the system environment at large, +nor the environment of subsequent build or test processes. diff --git a/Help/command/unset.rst b/Help/command/unset.rst index 1a5e49f..7521052 100644 --- a/Help/command/unset.rst +++ b/Help/command/unset.rst @@ -3,6 +3,9 @@ unset Unset a variable, cache variable, or environment variable. +Unset Normal Variable or Cache Entry +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. code-block:: cmake unset(<variable> [CACHE | PARENT_SCOPE]) @@ -22,11 +25,17 @@ If ``PARENT_SCOPE`` is present then the variable is removed from the scope above the current scope. See the same option in the :command:`set` command for further details. -``<variable>`` can be an environment variable such as: +Unset Environment Variable +^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: cmake - unset(ENV{LD_LIBRARY_PATH}) + unset(ENV{<variable>}) + +Removes ``<variable>`` from the currently available +:manual:`Environment Variables <cmake-env-variables(7)>`. +Subsequent calls of ``$ENV{<variable>}`` will return the empty string. -in which case the variable will be removed from the current -environment. +This command affects only the current CMake process, not the process +from which CMake was called, nor the system environment at large, +nor the environment of subsequent build or test processes. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eba7273c203f0698ccd716604cc298b7da1d3ee6 commit eba7273c203f0698ccd716604cc298b7da1d3ee6 Author: Robert Maynard <robert.mayn...@kitware.com> AuthorDate: Thu Nov 8 09:06:52 2018 -0500 Commit: Robert Maynard <robert.mayn...@kitware.com> CommitDate: Thu Nov 8 09:32:18 2018 -0500 cpack: Better error message when generator doesn't exist. Currently the CPack error message when passed an invalid generator name reads like the generator failed to work, rather than the name was invalid. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index c083945..3df1b36 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -358,8 +358,9 @@ int main(int argc, char const* const* argv) cpackGenerator->SetTraceExpand(traceExpand); } else { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, - "Cannot initialize CPack generator: " << gen - << std::endl); + "Could not create CPack generator: " << gen + << std::endl); + parsed = 0; } diff --git a/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt b/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt index fe4e455..a553bde 100644 --- a/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt +++ b/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt @@ -1 +1 @@ -^CPack Error: Cannot initialize CPack generator: NotAGenerator +^CPack Error: Could not create CPack generator: NotAGenerator ----------------------------------------------------------------------- Summary of changes: Help/command/if.rst | 16 +++++--- Help/command/set.rst | 8 +++- Help/command/unset.rst | 17 ++++++-- Help/manual/cmake-env-variables.7.rst | 8 ++++ Help/manual/cmake-language.7.rst | 46 ++++++++++++++++++---- Help/manual/cmake-variables.7.rst | 19 ++++++++- Help/variable/CACHE.rst | 5 ++- Help/variable/ENV.rst | 8 +++- Source/CPack/cpack.cxx | 18 ++++++++- .../CPackCommandLine/NotAGenerator-stderr.txt | 2 +- 10 files changed, 121 insertions(+), 26 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits