From 8713e9cbbc847cf0a97be1d831b555d8fe623287 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Oct 2018 12:55:56 -0400 Subject: [PATCH 001/907] Begin post-3.13 development --- Help/release/dev/0-sample-topic.rst | 7 +++++++ Help/release/index.rst | 2 ++ Source/CMakeVersion.cmake | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/0-sample-topic.rst diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 00000000000..e4cc01e23fe --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/index.rst b/Help/release/index.rst index fbe4cf62562..7ef3a8ed73b 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 626dbb8a363..47990cde1b3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 1) +set(CMake_VERSION_PATCH 20181003) +#set(CMake_VERSION_RC 1) From e07b6f69d821420050706f48e699f48cf70569f7 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 4 Oct 2018 00:01:15 -0400 Subject: [PATCH 002/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 47990cde1b3..59d4316ba06 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181003) +set(CMake_VERSION_PATCH 20181004) #set(CMake_VERSION_RC 1) From 0813581859bd61a9d30c97aa893030bea85f134e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20S=C5=82odkowicz?= Date: Thu, 4 Oct 2018 23:52:30 +0200 Subject: [PATCH 003/907] FindwxWidgets: honor OPTIONAL_COMPONENTS --- Modules/FindwxWidgets.cmake | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index f2d62854382..e61c84efee4 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -12,7 +12,7 @@ # modules that you will use, you need to name them as components to the # package: # -# find_package(wxWidgets COMPONENTS core base ...) +# find_package(wxWidgets COMPONENTS core base ... OPTIONAL_COMPONENTS net ...) # # There are two search branches: a windows style and a unix style. For # windows, the following variables are searched for and set to defaults @@ -89,7 +89,7 @@ # :: # # # Note that for MinGW users the order of libs is important! -# find_package(wxWidgets COMPONENTS net gl core base) +# find_package(wxWidgets COMPONENTS gl core base OPTIONAL_COMPONENTS net) # if(wxWidgets_FOUND) # include(${wxWidgets_USE_FILE}) # # and for each of your dependent executable/library targets: @@ -102,7 +102,7 @@ # # :: # -# find_package(wxWidgets REQUIRED net gl core base) +# find_package(wxWidgets REQUIRED gl core base OPTIONAL_COMPONENTS net) # include(${wxWidgets_USE_FILE}) # # and for each of your dependent executable/library targets: # target_link_libraries( ${wxWidgets_LIBRARIES}) @@ -396,6 +396,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") list(APPEND wxWidgets_LIBRARIES debug ${WX_${LIB}d} optimized ${WX_${LIB}} ) + elseif(NOT wxWidgets_FIND_REQUIRED_${LIB}) + DBG_MSG_V("- ignored optional missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}") else() DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}") set(wxWidgets_FOUND FALSE) @@ -408,9 +410,10 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") if(WX_${LIB}${_DBG}) DBG_MSG_V("Found ${LIB}${_DBG}") list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}}) + elseif(NOT wxWidgets_FIND_REQUIRED_${LIB}) + DBG_MSG_V("- ignored optional missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") else() - DBG_MSG_V( - "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") + DBG_MSG_V("- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") set(wxWidgets_FOUND FALSE) endif() endforeach() @@ -803,11 +806,24 @@ else() # - NOTE: wx-config doesn't verify that the libs requested exist # it just produces the names. Maybe a TRY_COMPILE would # be useful here... - string(REPLACE ";" "," - wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}") + unset(_cmp_req) + unset(_cmp_opt) + foreach(_cmp IN LISTS wxWidgets_FIND_COMPONENTS) + if(wxWidgets_FIND_REQUIRED_${_cmp}) + list(APPEND _cmp_req "${_cmp}") + else() + list(APPEND _cmp_opt "${_cmp}") + endif() + endforeach() + DBG_MSG_V("wxWidgets required components : ${_cmp_req}") + DBG_MSG_V("wxWidgets optional components : ${_cmp_opt}") + if(DEFINED _cmp_opt) + string(REPLACE ";" "," _cmp_opt "--optional-libs ${_cmp_opt}") + endif() + string(REPLACE ";" "," _cmp_req "${_cmp_req}") execute_process( COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" - ${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS} + ${wxWidgets_SELECT_OPTIONS} --libs ${_cmp_req} ${_cmp_opt} OUTPUT_VARIABLE wxWidgets_LIBRARIES RESULT_VARIABLE RET ERROR_QUIET @@ -833,8 +849,10 @@ else() else() set(wxWidgets_FOUND FALSE) - DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}") + DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${_cmp_req} ${_cmp_opt} FAILED with RET=${RET}") endif() + unset(_cmp_req) + unset(_cmp_opt) endif() # When using wx-config in MSYS, the include paths are UNIX style paths which may or may From 25a970405800e9a79dbd1927cdd2f298e646917c Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 5 Oct 2018 00:01:06 -0400 Subject: [PATCH 004/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 59d4316ba06..b2be3c0d5b9 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181004) +set(CMake_VERSION_PATCH 20181005) #set(CMake_VERSION_RC 1) From 342551be71c8ed300e5e6d99fa81ab0ed3a62600 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 6 Oct 2018 00:01:10 -0400 Subject: [PATCH 005/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index b2be3c0d5b9..60b7a9b63a5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181005) +set(CMake_VERSION_PATCH 20181006) #set(CMake_VERSION_RC 1) From f0c8d162f58270d7902fef36e0df2da1a22d2890 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 7 Oct 2018 00:01:05 -0400 Subject: [PATCH 006/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 60b7a9b63a5..9e9a08ea296 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181006) +set(CMake_VERSION_PATCH 20181007) #set(CMake_VERSION_RC 1) From e3666e8ffeeda24dcee69a27942678927e895fbc Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 8 Oct 2018 00:01:06 -0400 Subject: [PATCH 007/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9e9a08ea296..cd2bc0b7e78 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181007) +set(CMake_VERSION_PATCH 20181008) #set(CMake_VERSION_RC 1) From ab6bf9d0adc3de143599d5558a6475af3ba172eb Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 8 Oct 2018 10:42:12 -0400 Subject: [PATCH 008/907] Utilities/Release: Update to openssl-1.1.1 Update the prebuilt binary build configurations for machines where we build our own OpenSSL library to use a newer version. --- Utilities/Release/linux64_release.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake index dc3412020f3..fa585d74ba9 100644 --- a/Utilities/Release/linux64_release.cmake +++ b/Utilities/Release/linux64_release.cmake @@ -29,9 +29,9 @@ CURSES_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libncurses.a CURSES_INCLUDE_PATH:PATH=/home/kitware/ncurses-5.9/include FORM_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libform.a CMAKE_USE_OPENSSL:BOOL=ON -OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.0h/lib/libcrypto.a;-pthread -OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.0h/include -OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.0h/lib/libssl.a +OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.1/lib/libcrypto.a;-pthread +OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.1/include +OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.1/lib/libssl.a PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 CPACK_SYSTEM_NAME:STRING=Linux-x86_64 BUILD_CursesDialog:BOOL=ON From 0ab5db035ed47182fb8551f9872045eeae1f9cec Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 9 Oct 2018 00:01:08 -0400 Subject: [PATCH 009/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index cd2bc0b7e78..7466205e6ac 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181008) +set(CMake_VERSION_PATCH 20181009) #set(CMake_VERSION_RC 1) From ae80271ed35469d4d1092beb9665837963ba22ad Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Tue, 9 Oct 2018 09:58:30 +0200 Subject: [PATCH 010/907] README: Fix typo (rm space). --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f1dbd9d1af0..2e271ed869b 100644 --- a/README.rst +++ b/README.rst @@ -68,7 +68,7 @@ Windows ^^^^^^^ You need to download and install a binary release of CMake in order to build -CMake. You can get these releases from the `CMake Download Page`_ . Then +CMake. You can get these releases from the `CMake Download Page`_. Then proceed with the instructions below. .. _`CMake Download Page`: https://cmake.org/cmake/resources/software.html From c9cedd675b0023c21e5350d69b25df2156836800 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" Date: Tue, 9 Oct 2018 08:42:13 +0200 Subject: [PATCH 011/907] Help: Add link to cmake-qt(7) to FindQt.cmake. --- Modules/FindQt.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 68dfa7d285d..4dff7c3e473 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -5,9 +5,12 @@ # FindQt # ------ # -# Searches for all installed versions of Qt. +# Searches for all installed versions of Qt3 or Qt4. # -# This should only be used if your project can work with multiple +# This module cannot handle Qt5 or any later versions. +# For those, see :manual:`cmake-qt(7)`. +# +# This module should only be used if your project can work with multiple # versions of Qt. If not, you should just directly use FindQt4 or # FindQt3. If multiple versions of Qt are found on the machine, then # The user must set the option DESIRED_QT_VERSION to the version they @@ -16,9 +19,6 @@ # or FindQt4 module is included. Once the user sets DESIRED_QT_VERSION, # then the FindQt3 or FindQt4 module is included. # -# This module can only detect and switch between Qt versions 3 and 4. It -# cannot handle Qt5 or any later versions. -# # :: # # QT_REQUIRED if this is set to TRUE then if CMake can From ba906112253737715e635c0ade10d52fbb185233 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" Date: Fri, 5 Oct 2018 14:51:50 +0200 Subject: [PATCH 012/907] Help: Make synopsis of if command more compact; add section headers Also replace 'expression' by 'condition' (as in the while command); relegate optional arguments of else() and endif() to the text; revise explanation of operator precedence in Condition Syntax section. --- Help/command/if.rst | 90 ++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git a/Help/command/if.rst b/Help/command/if.rst index 5294ce8e30a..8abe9ba73fa 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -3,41 +3,46 @@ if Conditionally execute a group of commands. -.. code-block:: cmake - - if(expression) - # then section. - COMMAND1(ARGS ...) - COMMAND2(ARGS ...) - #... - elseif(expression2) - # elseif section. - COMMAND1(ARGS ...) - COMMAND2(ARGS ...) - #... - else(expression) - # else section. - COMMAND1(ARGS ...) - COMMAND2(ARGS ...) - #... - endif(expression) - -Evaluates the given expression. If the result is true, the commands -in the THEN section are invoked. Otherwise, the commands in the else -section are invoked. The elseif and else sections are optional. You -may have multiple elseif clauses. Note that the expression in the -else and endif clause is optional. Long expressions can be used and -there is a traditional order of precedence. Parenthetical expressions -are evaluated first followed by unary tests such as ``EXISTS``, -``COMMAND``, and ``DEFINED``. Then any binary tests such as +Synopsis +^^^^^^^^ + +:: + + if() + + elseif() # optional block, can be repeated + + else() # optional block + + endif() + +Evaluates the ``condition`` argument of the ``if`` clause according to the +`Condition syntax`_ described below. If the result is true, then the +``commands`` in the ``if`` block are executed. +Otherwise, optional ``elseif`` blocks are processed in the same way. +Finally, if no ``condition`` is true, ``commands`` in the optional ``else`` +block are executed. + +Per legacy, the ``else`` and ``endif`` clause may also have a ``condition`` argument, +which then must be a verbatim repeat of the argument of the opening ``if`` clause. + +Condition Syntax +^^^^^^^^^^^^^^^^ + +The following syntax applies to the ``condition`` argument of +the ``if``, ``elseif`` and :command:`while` clauses. + +Compound conditions are evaluated in the following order of precedence: +Innermost parentheses are evaluated first. Next come unary tests such +as ``EXISTS``, ``COMMAND``, and ``DEFINED``. Then binary tests such as ``EQUAL``, ``LESS``, ``LESS_EQUAL``, ``GREATER``, ``GREATER_EQUAL``, ``STREQUAL``, ``STRLESS``, ``STRLESS_EQUAL``, ``STRGREATER``, ``STRGREATER_EQUAL``, ``VERSION_EQUAL``, ``VERSION_LESS``, ``VERSION_LESS_EQUAL``, ``VERSION_GREATER``, ``VERSION_GREATER_EQUAL``, -and ``MATCHES`` will be evaluated. Then boolean ``NOT`` operators and -finally boolean ``AND`` and then ``OR`` operators will be evaluated. +and ``MATCHES``. Then the boolean operators in the order ``NOT``, ``AND``, +and finally ``OR``. -Possible expressions are: +Possible conditions are: ``if()`` True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``, @@ -52,14 +57,14 @@ Possible expressions are: True if given a variable that is defined to a value that is not a false constant. False otherwise. (Note macro arguments are not variables.) -``if(NOT )`` - True if the expression is not true. +``if(NOT )`` + True if the condition is not true. -``if( AND )`` - True if both expressions would be considered true individually. +``if( AND )`` + True if both conditions would be considered true individually. -``if( OR )`` - True if either expression would be considered true individually. +``if( OR )`` + True if either condition would be considered true individually. ``if(COMMAND command-name)`` True if the given name is a command, macro or function that can be @@ -103,7 +108,7 @@ Possible expressions are: ``if( MATCHES regex)`` True if the given string or variable's value matches the given regular - expression. See :ref:`Regex Specification` for regex format. + condition. See :ref:`Regex Specification` for regex format. ``()`` groups are captured in :variable:`CMAKE_MATCH_` variables. ``if( LESS )`` @@ -184,11 +189,14 @@ Possible expressions are: variable is true or false just if it has been set. (Note macro arguments are not variables.) -``if((expression) AND (expression OR (expression)))`` - The expressions inside the parenthesis are evaluated first and then - the remaining expression is evaluated as in the previous examples. +``if((condition) AND (condition OR (condition)))`` + The conditions inside the parenthesis are evaluated first and then + the remaining condition is evaluated as in the previous examples. Where there are nested parenthesis the innermost are evaluated as part - of evaluating the expression that contains them. + of evaluating the condition that contains them. + +Variable Expansion +^^^^^^^^^^^^^^^^^^ The if command was written very early in CMake's history, predating the ``${}`` variable evaluation syntax, and for convenience evaluates From 5b56795d57ad79dcc4ce9070481101f28f737eda Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" Date: Fri, 5 Oct 2018 15:23:15 +0200 Subject: [PATCH 013/907] Help: make the two signatures of command "project" orthogonal --- Help/command/project.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Help/command/project.rst b/Help/command/project.rst index bd8b4ef5c45..f91eed8ea1a 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -5,7 +5,7 @@ Sets project details such as name, version, etc. and enables languages. .. code-block:: cmake - project( [LANGUAGES] [...]) + project( [...]) project( [VERSION [.[.[.]]]] [DESCRIPTION ] From e3e5445d83c253c3ddc18b5b02b59e90aa0b9df9 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" Date: Fri, 5 Oct 2018 15:32:46 +0200 Subject: [PATCH 014/907] Help: Describe options of command project in a definition list. Also add section headers; explain default setting of optional argument variables. --- Help/command/project.rst | 123 +++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 51 deletions(-) diff --git a/Help/command/project.rst b/Help/command/project.rst index f91eed8ea1a..18420e47b3f 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -1,7 +1,10 @@ project ------- -Sets project details such as name, version, etc. and enables languages. +Set the name of the project. + +Synopsis +^^^^^^^^ .. code-block:: cmake @@ -12,65 +15,83 @@ Sets project details such as name, version, etc. and enables languages. [HOMEPAGE_URL ] [LANGUAGES ...]) -Sets the name of the project and stores the name in the -:variable:`PROJECT_NAME` variable. Additionally this sets variables +Sets the name of the project, and stores it in the variable +:variable:`PROJECT_NAME`. Also sets the variables * :variable:`PROJECT_SOURCE_DIR`, :variable:`_SOURCE_DIR` * :variable:`PROJECT_BINARY_DIR`, :variable:`_BINARY_DIR` -If ``VERSION`` is specified, given components must be non-negative integers. -If ``VERSION`` is not specified, the default version is the empty string. -The ``VERSION`` option may not be used unless policy :policy:`CMP0048` is -set to ``NEW``. - -The :command:`project()` command stores the version number and its components -in variables - -* :variable:`PROJECT_VERSION`, - :variable:`_VERSION` -* :variable:`PROJECT_VERSION_MAJOR`, - :variable:`_VERSION_MAJOR` -* :variable:`PROJECT_VERSION_MINOR`, - :variable:`_VERSION_MINOR` -* :variable:`PROJECT_VERSION_PATCH`, - :variable:`_VERSION_PATCH` -* :variable:`PROJECT_VERSION_TWEAK`, - :variable:`_VERSION_TWEAK` - -Variables corresponding to unspecified versions are set to the empty string -(if policy :policy:`CMP0048` is set to ``NEW``). - -If the optional ``DESCRIPTION`` is given, then :variable:`PROJECT_DESCRIPTION` -and :variable:`_DESCRIPTION` will be set to its argument. -These variables will be cleared if ``DESCRIPTION`` is not given. -The description is expected to be a relatively short string, usually no more -than a few words. - -The optional ``HOMEPAGE_URL`` sets the analogous variables -:variable:`PROJECT_HOMEPAGE_URL` and :variable:`_HOMEPAGE_URL`. -When this option is given, the URL provided should be the canonical home for -the project. -These variables will be cleared if ``HOMEPAGE_URL`` is not given. - -Note that the description and homepage URL may be used as defaults for -things like packaging meta-data, documentation, etc. - -Optionally you can specify which languages your project supports. -Example languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``, -``Fortran``, and ``ASM``. -By default ``C`` and ``CXX`` are enabled if no language options are -given. Specify language ``NONE``, or use the ``LANGUAGES`` keyword -and list no languages, to skip enabling any languages. - -If enabling ``ASM``, list it last so that CMake can check whether -compilers for other languages like ``C`` work for assembly too. - -If a variable exists called :variable:`CMAKE_PROJECT__INCLUDE`, +Further variables are set by the optional arguments described in the following. +If any of these arguments is not used, then the corresponding variables are +set to the empty string. + +If the variable :variable:`CMAKE_PROJECT__INCLUDE` exists, the file pointed to by that variable will be included as the last step of the project command. +Options +^^^^^^^ + +The options are: + +``VERSION `` + Optional; may not be used unless policy :policy:`CMP0048` is + set to ``NEW``. + + Takes a ```` argument composed of non-negative integer components, + i.e. ``[.[.[.]]]``, + and sets the variables + + * :variable:`PROJECT_VERSION`, + :variable:`_VERSION` + * :variable:`PROJECT_VERSION_MAJOR`, + :variable:`_VERSION_MAJOR` + * :variable:`PROJECT_VERSION_MINOR`, + :variable:`_VERSION_MINOR` + * :variable:`PROJECT_VERSION_PATCH`, + :variable:`_VERSION_PATCH` + * :variable:`PROJECT_VERSION_TWEAK`, + :variable:`_VERSION_TWEAK`. + +``DESCRIPTION `` + Optional. + Sets the variables + + * :variable:`PROJECT_DESCRIPTION`, :variable:`_DESCRIPTION` + + to ````. + It is recommended that this description is a relatively short string, + usually no more than a few words. + +``HOMEPAGE_URL `` + Optional. + Sets the variables + + * :variable:`PROJECT_HOMEPAGE_URL`, :variable:`_HOMEPAGE_URL` + + to ````, which should be the canonical home URL for the project. + +``LANGUAGES ...`` + Optional. + Can also be specified without ``LANGUAGES`` keyword per the first, short signature. + + Selects which programming languages are needed to build the project. + Supported languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``, ``Fortran``, and ``ASM``. + By default ``C`` and ``CXX`` are enabled if no language options are given. + Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages, + to skip enabling any languages. + + If enabling ``ASM``, list it last so that CMake can check whether + compilers for other languages like ``C`` work for assembly too. + +The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL`` +options are intended for use as default values in package metadata and documentation. + +Usage +^^^^^ + The top-level ``CMakeLists.txt`` file for a project must contain a literal, direct call to the :command:`project` command; loading one through the :command:`include` command is not sufficient. If no such From 2f43bd3b6ca886b52fadae50a3bfbbf44029b9cd Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Tue, 9 Oct 2018 15:28:53 +0200 Subject: [PATCH 015/907] Help: move description of CMAKE_PROJECT_* variables Describe these variables along with the other variables. --- Help/command/project.rst | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Help/command/project.rst b/Help/command/project.rst index 18420e47b3f..688e56c3f9f 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -16,7 +16,11 @@ Synopsis [LANGUAGES ...]) Sets the name of the project, and stores it in the variable -:variable:`PROJECT_NAME`. Also sets the variables +:variable:`PROJECT_NAME`. When called from the top-level +``CMakeLists.txt`` also stores the project name in the +variable :variable:`CMAKE_PROJECT_NAME`. + +Also sets the variables * :variable:`PROJECT_SOURCE_DIR`, :variable:`_SOURCE_DIR` @@ -55,6 +59,9 @@ The options are: * :variable:`PROJECT_VERSION_TWEAK`, :variable:`_VERSION_TWEAK`. + When the :command:`project()` command is called from the top-level ``CMakeLists.txt``, + then the version is also stored in the variable :variable:`CMAKE_PROJECT_VERSION`. + ``DESCRIPTION `` Optional. Sets the variables @@ -65,6 +72,9 @@ The options are: It is recommended that this description is a relatively short string, usually no more than a few words. + When the :command:`project()` command is called from the top-level ``CMakeLists.txt``, + then the description is also stored in the variable :variable:`CMAKE_PROJECT_DESCRIPTION`. + ``HOMEPAGE_URL `` Optional. Sets the variables @@ -73,6 +83,9 @@ The options are: to ````, which should be the canonical home URL for the project. + When the :command:`project()` command is called from the top-level ``CMakeLists.txt``, + then the URL also is stored in the variable :variable:`CMAKE_PROJECT_HOMEPAGE_URL`. + ``LANGUAGES ...`` Optional. Can also be specified without ``LANGUAGES`` keyword per the first, short signature. @@ -96,16 +109,11 @@ The top-level ``CMakeLists.txt`` file for a project must contain a literal, direct call to the :command:`project` command; loading one through the :command:`include` command is not sufficient. If no such call exists CMake will implicitly add one to the top that enables the -default languages (``C`` and ``CXX``). The name of the project set in -the top level ``CMakeLists.txt`` file is available from the -:variable:`CMAKE_PROJECT_NAME` variable, its description from -:variable:`CMAKE_PROJECT_DESCRIPTION`, its homepage URL from -:variable:`CMAKE_PROJECT_HOMEPAGE_URL` and its version from -:variable:`CMAKE_PROJECT_VERSION`. +default languages (``C`` and ``CXX``). .. note:: Call the :command:`cmake_minimum_required` command at the beginning of the top-level ``CMakeLists.txt`` file even before calling the - ``project()`` command. It is important to establish version and + :command:`project()` command. It is important to establish version and policy settings before invoking other commands whose behavior they may affect. See also policy :policy:`CMP0000`. From 846e3d2ceb0c8532e19425afc36455f0d4eedb14 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" Date: Mon, 8 Oct 2018 21:42:09 +0200 Subject: [PATCH 016/907] Help: Reorganise module index into sections * Split up module list into separate sections for utility modules and find modules. * Improve wording to explain how the different module types are expected to be called/used. * Move deprecated modules to their own separate sections. --- Help/manual/cmake-modules.7.rst | 103 ++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 37 deletions(-) diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index b7276b65777..189e3be545c 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -3,12 +3,14 @@ cmake-modules(7) **************** -.. only:: html +The modules listed here are part of the CMake distribution. +Projects may provide further modules; their location(s) +can be specified in the :variable:`CMAKE_MODULE_PATH` variable. - .. contents:: +Utility Modules +^^^^^^^^^^^^^^^ -All Modules -=========== +These modules are loaded using the :command:`include` command. .. toctree:: :maxdepth: 1 @@ -41,12 +43,9 @@ All Modules /module/CMakeAddFortranSubdirectory /module/CMakeBackwardCompatibilityCXX /module/CMakeDependentOption - /module/CMakeDetermineVSServicePack - /module/CMakeExpandImportedTargets /module/CMakeFindDependencyMacro /module/CMakeFindFrameworks /module/CMakeFindPackageMode - /module/CMakeForceCompiler /module/CMakeGraphVizOptions /module/CMakePackageConfigHelpers /module/CMakeParseArguments @@ -70,6 +69,42 @@ All Modules /module/ExternalProject /module/FeatureSummary /module/FetchContent + /module/FindPackageHandleStandardArgs + /module/FindPackageMessage + /module/FortranCInterface + /module/GenerateExportHeader + /module/GetPrerequisites + /module/GNUInstallDirs + /module/GoogleTest + /module/InstallRequiredSystemLibraries + /module/MacroAddFileDependencies + /module/ProcessorCount + /module/SelectLibraryConfigurations + /module/SquishTestScript + /module/TestBigEndian + /module/TestForANSIForScope + /module/TestForANSIStreamHeaders + /module/TestForSSTREAM + /module/TestForSTDNamespace + /module/UseEcos + /module/UseJavaClassFilelist + /module/UseJava + /module/UseJavaSymlinks + /module/UsePkgConfig + /module/UseSWIG + /module/UsewxWidgets + /module/Use_wxWindows + /module/WriteCompilerDetectionHeader + +Find Modules +^^^^^^^^^^^^ + +These modules search for third-party software. +They are normally called through the :command:`find_package` command. + +.. toctree:: + :maxdepth: 1 + /module/FindALSA /module/FindArmadillo /module/FindASPELL @@ -82,7 +117,6 @@ All Modules /module/FindBZip2 /module/FindCABLE /module/FindCoin3D - /module/FindCUDA /module/FindCups /module/FindCURL /module/FindCurses @@ -173,8 +207,6 @@ All Modules /module/FindosgViewer /module/FindosgVolume /module/FindosgWidget - /module/FindPackageHandleStandardArgs - /module/FindPackageMessage /module/FindPatch /module/FindPerlLibs /module/FindPerl @@ -189,8 +221,6 @@ All Modules /module/FindPython /module/FindPython2 /module/FindPython3 - /module/FindPythonInterp - /module/FindPythonLibs /module/FindQt3 /module/FindQt4 /module/FindQt @@ -218,39 +248,38 @@ All Modules /module/FindWget /module/FindWish /module/FindwxWidgets - /module/FindwxWindows /module/FindXCTest /module/FindXalanC /module/FindXercesC /module/FindX11 /module/FindXMLRPC /module/FindZLIB - /module/FortranCInterface - /module/GenerateExportHeader - /module/GetPrerequisites - /module/GNUInstallDirs - /module/GoogleTest - /module/InstallRequiredSystemLibraries - /module/MacroAddFileDependencies - /module/ProcessorCount - /module/SelectLibraryConfigurations - /module/SquishTestScript - /module/TestBigEndian + +Deprecated Modules +^^^^^^^^^^^^^^^^^^^ + +Deprecated Utility Modules +========================== + +.. toctree:: + :maxdepth: 1 + + /module/CMakeDetermineVSServicePack + /module/CMakeExpandImportedTargets + /module/CMakeForceCompiler /module/TestCXXAcceptsFlag - /module/TestForANSIForScope - /module/TestForANSIStreamHeaders - /module/TestForSSTREAM - /module/TestForSTDNamespace - /module/UseEcos - /module/UseJavaClassFilelist - /module/UseJava - /module/UseJavaSymlinks - /module/UsePkgConfig - /module/UseSWIG - /module/UsewxWidgets - /module/Use_wxWindows /module/WriteBasicConfigVersionFile - /module/WriteCompilerDetectionHeader + +Deprecated Find Modules +======================= + +.. toctree:: + :maxdepth: 1 + + /module/FindCUDA + /module/FindPythonInterp + /module/FindPythonLibs + /module/FindwxWindows Legacy CPack Modules ==================== From dc372f6eef54f8a4b436cf631cbf621437076677 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Tue, 9 Oct 2018 22:54:46 +1100 Subject: [PATCH 017/907] Help: Document Use_wxWindows.cmake as deprecated The implementation already logged a message saying that the module was deprecated. This change adds that message to the module docs. --- Help/manual/cmake-modules.7.rst | 1 + Modules/Use_wxWindows.cmake | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 189e3be545c..af8e33f0444 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -268,6 +268,7 @@ Deprecated Utility Modules /module/CMakeExpandImportedTargets /module/CMakeForceCompiler /module/TestCXXAcceptsFlag + /module/Use_wxWindows /module/WriteBasicConfigVersionFile Deprecated Find Modules diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake index bd8cc01c1b9..7cdd92eee61 100644 --- a/Modules/Use_wxWindows.cmake +++ b/Modules/Use_wxWindows.cmake @@ -5,7 +5,8 @@ # Use_wxWindows # ------------- # -# +# Deprecated. Use ``find_package(wxWidgets)`` and +# ``include(${wxWidgets_USE_FILE})`` instead. # # # This convenience include finds if wxWindows is installed and set the From af6f16f1e8a820ff5a08dfa273ceaa309fed7461 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Tue, 9 Oct 2018 13:26:50 +0200 Subject: [PATCH 018/907] README: Explain how to build CMake with the docs --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 2e271ed869b..1e8561abcd5 100644 --- a/README.rst +++ b/README.rst @@ -83,6 +83,13 @@ For instructions how to do this, see documentation on `Running CMake`_. .. _`Running CMake`: https://cmake.org/cmake/help/runningcmake.html +To build the documentation, install `Sphinx`_ and configure CMake with +``-DSPHINX_HTML=ON`` and/or ``-DSPHINX_MAN=ON`` to enable the "html" or +"man" builder. Add ``-DSPHINX_EXECUTABLE=/path/to/sphinx-build`` if the +tool is not found automatically. + +.. _`Sphinx`: http://sphinx-doc.org + Reporting Bugs ============== From a35981249d9efbf3db943698a1258ac6cbf3a5d5 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 10 Oct 2018 00:01:07 -0400 Subject: [PATCH 019/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7466205e6ac..6a2cb16a03a 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181009) +set(CMake_VERSION_PATCH 20181010) #set(CMake_VERSION_RC 1) From 045b0beae13366420186337170d70e73ec96ebca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20S=C5=82odkowicz?= Date: Thu, 4 Oct 2018 23:57:24 +0200 Subject: [PATCH 020/907] FindwxWidgets: implement detailed components status on Windows --- Modules/FindwxWidgets.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index e61c84efee4..e36684232ac 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -396,6 +396,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") list(APPEND wxWidgets_LIBRARIES debug ${WX_${LIB}d} optimized ${WX_${LIB}} ) + set(wxWidgets_${LIB}_FOUND TRUE) elseif(NOT wxWidgets_FIND_REQUIRED_${LIB}) DBG_MSG_V("- ignored optional missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}") else() @@ -410,6 +411,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") if(WX_${LIB}${_DBG}) DBG_MSG_V("Found ${LIB}${_DBG}") list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}}) + set(wxWidgets_${LIB}_FOUND TRUE) elseif(NOT wxWidgets_FIND_REQUIRED_${LIB}) DBG_MSG_V("- ignored optional missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") else() @@ -978,10 +980,18 @@ DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}") include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +# FIXME: set wxWidgets__FOUND for wx-config branch +# and use HANDLE_COMPONENTS on Unix too +if(wxWidgets_FIND_STYLE STREQUAL "win32") + set(wxWidgets_HANDLE_COMPONENTS "HANDLE_COMPONENTS") +endif() + find_package_handle_standard_args(wxWidgets REQUIRED_VARS wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS VERSION_VAR wxWidgets_VERSION_STRING + ${wxWidgets_HANDLE_COMPONENTS} ) +unset(wxWidgets_HANDLE_COMPONENTS) #===================================================================== # Macros for use in wxWidgets apps. From f460bbd4c8afab56f93b9831f1f4d8336480fcc5 Mon Sep 17 00:00:00 2001 From: Betsy McPhail Date: Thu, 4 Oct 2018 11:34:27 -0400 Subject: [PATCH 021/907] ctest_submit: Refactor file list to use a vector instead of a set Remove duplicates in a way that preserves order. --- Source/CTest/cmCTestSubmitHandler.cxx | 51 +++++++++++++++------------ Source/CTest/cmCTestSubmitHandler.h | 12 +++---- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index ecf309a809a..38b5411f461 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -12,6 +12,7 @@ #include #include +#include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestCurl.h" #include "cmCTestScriptHandler.h" @@ -152,10 +153,9 @@ void cmCTestSubmitHandler::Initialize() this->Files.clear(); } -bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, - const std::set& files, - const std::string& remoteprefix, - const std::string& url) +bool cmCTestSubmitHandler::SubmitUsingFTP( + const std::string& localprefix, const std::vector& files, + const std::string& remoteprefix, const std::string& url) { CURL* curl; CURLcode res; @@ -299,10 +299,9 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, } // Uploading files is simpler -bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, - const std::set& files, - const std::string& remoteprefix, - const std::string& url) +bool cmCTestSubmitHandler::SubmitUsingHTTP( + const std::string& localprefix, const std::vector& files, + const std::string& remoteprefix, const std::string& url) { CURL* curl; CURLcode res; @@ -662,9 +661,9 @@ void cmCTestSubmitHandler::ParseResponse( } } -bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set& files, - const std::string& remoteprefix, - const std::string& url) +bool cmCTestSubmitHandler::TriggerUsingHTTP( + const std::vector& files, const std::string& remoteprefix, + const std::string& url) { CURL* curl; char error_buffer[1024]; @@ -792,11 +791,10 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set& files, return true; } -bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, - const std::string& localprefix, - const std::set& files, - const std::string& remoteprefix, - const std::string& url) +bool cmCTestSubmitHandler::SubmitUsingSCP( + const std::string& scp_command, const std::string& localprefix, + const std::vector& files, const std::string& remoteprefix, + const std::string& url) { if (scp_command.empty() || localprefix.empty() || files.empty() || remoteprefix.empty() || url.empty()) { @@ -890,7 +888,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command, } bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, - const std::set& files, + const std::vector& files, const std::string& remoteprefix, const std::string& destination) { @@ -925,7 +923,7 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix, #if defined(CTEST_USE_XMLRPC) bool cmCTestSubmitHandler::SubmitUsingXMLRPC( - const std::string& localprefix, const std::set& files, + const std::string& localprefix, const std::vector& files, const std::string& remoteprefix, const std::string& url) { xmlrpc_env env; @@ -1020,7 +1018,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( } #else bool cmCTestSubmitHandler::SubmitUsingXMLRPC( - std::string const& /*unused*/, std::set const& /*unused*/, + std::string const& /*unused*/, std::vector const& /*unused*/, std::string const& /*unused*/, std::string const& /*unused*/) { return false; @@ -1351,13 +1349,13 @@ int cmCTestSubmitHandler::ProcessHandler() cmGeneratedFileStream ofs; this->StartLogFile("Submit", ofs); - cmCTest::SetOfStrings files; + std::vector files; std::string prefix = this->GetSubmitResultsPrefix(); if (!this->Files.empty()) { // Submit the explicitly selected files: // - files.insert(this->Files.begin(), this->Files.end()); + files.insert(files.end(), this->Files.begin(), this->Files.end()); } // Add to the list of files to submit from any selected, existing parts: @@ -1404,7 +1402,16 @@ int cmCTestSubmitHandler::ProcessHandler() // Submit files from this part. std::vector const& pfiles = this->CTest->GetSubmitFiles(p); - files.insert(pfiles.begin(), pfiles.end()); + files.insert(files.end(), pfiles.begin(), pfiles.end()); + } + + // Make sure files are unique, but preserve order. + { + // This endPos intermediate is needed to work around non-conformant C++11 + // standard libraries that have erase(iterator,iterator) instead of + // erase(const_iterator,const_iterator). + size_t endPos = cmRemoveDuplicates(files) - files.cbegin(); + files.erase(files.begin() + endPos, files.end()); } if (ofs) { diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index b4d0e777223..66f217398bf 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -57,27 +57,27 @@ class cmCTestSubmitHandler : public cmCTestGenericHandler * Submit file using various ways */ bool SubmitUsingFTP(const std::string& localprefix, - const std::set& files, + const std::vector& files, const std::string& remoteprefix, const std::string& url); bool SubmitUsingHTTP(const std::string& localprefix, - const std::set& files, + const std::vector& files, const std::string& remoteprefix, const std::string& url); bool SubmitUsingSCP(const std::string& scp_command, const std::string& localprefix, - const std::set& files, + const std::vector& files, const std::string& remoteprefix, const std::string& url); bool SubmitUsingCP(const std::string& localprefix, - const std::set& files, + const std::vector& files, const std::string& remoteprefix, const std::string& url); - bool TriggerUsingHTTP(const std::set& files, + bool TriggerUsingHTTP(const std::vector& files, const std::string& remoteprefix, const std::string& url); bool SubmitUsingXMLRPC(const std::string& localprefix, - const std::set& files, + const std::vector& files, const std::string& remoteprefix, const std::string& url); From a6e0158712bd25256fb66cf21c047b81d65bc4fe Mon Sep 17 00:00:00 2001 From: Betsy McPhail Date: Thu, 4 Oct 2018 11:34:27 -0400 Subject: [PATCH 022/907] ctest_submit: Add support for a "Done" part Teach CTest to submit Done.xml. Submission of this file indicates to CDash that a build is complete and no more files will be uploaded. It contains the build id returned by CDash and the current time. This file is submitted last for a given build when using the `ctest_submit()` command. If submitting by PARTS, use `ctest_submit(PARTS Done)`. --- Help/command/ctest_submit.rst | 1 + Help/release/dev/ctest-done.rst | 5 +++++ Source/CTest/cmCTestSubmitHandler.cxx | 10 +++++++++ Source/cmCTest.cxx | 21 +++++++++++++++++++ Source/cmCTest.h | 10 +++++++++ .../ctest_submit/PARTSDone-result.txt | 1 + .../ctest_submit/PARTSDone-stderr.txt | 3 +++ .../RunCMake/ctest_submit/RunCMakeTest.cmake | 1 + 8 files changed, 52 insertions(+) create mode 100644 Help/release/dev/ctest-done.rst create mode 100644 Tests/RunCMake/ctest_submit/PARTSDone-result.txt create mode 100644 Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index 2ba6bef3d12..426475c251f 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -33,6 +33,7 @@ The options are: ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES Upload = Files prepared for upload by ctest_upload(), in Upload.xml Submit = nothing + Done = Build is complete, in Done.xml ``FILES ...`` Specify an explicit list of specific files to be submitted. diff --git a/Help/release/dev/ctest-done.rst b/Help/release/dev/ctest-done.rst new file mode 100644 index 00000000000..9ec0e24eebf --- /dev/null +++ b/Help/release/dev/ctest-done.rst @@ -0,0 +1,5 @@ +ctest-done +---------- + +* The :command:`ctest_submit` command learned a new ``Done`` part that can be used + to inform CDash that a build is complete and that no more parts will be uploaded. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 38b5411f461..6ad0e03d322 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -56,6 +56,7 @@ class cmCTestSubmitHandler::ResponseParser : public cmXMLParser std::string Filename; std::string MD5; std::string Message; + std::string BuildID; private: std::vector CurrentValue; @@ -97,6 +98,8 @@ class cmCTestSubmitHandler::ResponseParser : public cmXMLParser this->MD5 = this->GetCurrentValue(); } else if (name == "message") { this->Message = this->GetCurrentValue(); + } else if (name == "buildId") { + this->BuildID = this->GetCurrentValue(); } } }; @@ -645,6 +648,7 @@ void cmCTestSubmitHandler::ParseResponse( " Submission failed: " << parser.Message << std::endl); return; } + this->CTest->SetBuildID(parser.BuildID); } output = cmSystemTools::UpperCase(output); if (output.find("WARNING") != std::string::npos) { @@ -1414,6 +1418,12 @@ int cmCTestSubmitHandler::ProcessHandler() files.erase(files.begin() + endPos, files.end()); } + // Submit Done.xml last + if (this->SubmitPart[cmCTest::PartDone]) { + this->CTest->GenerateDoneFile(); + files.push_back("Done.xml"); + } + if (ofs) { ofs << "Upload files:" << std::endl; int cnt = 0; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 908eea14589..d0d5db630b1 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -294,6 +294,7 @@ cmCTest::cmCTest() this->SuppressUpdatingCTestConfiguration = false; this->DartVersion = 1; this->DropSiteCDash = false; + this->BuildID = ""; this->OutputTestOutputOnTestFailure = false; this->RepeatTests = 1; // default to run each test once this->RepeatUntilFail = false; @@ -320,6 +321,7 @@ cmCTest::cmCTest() this->Parts[PartNotes].SetName("Notes"); this->Parts[PartExtraFiles].SetName("ExtraFiles"); this->Parts[PartUpload].SetName("Upload"); + this->Parts[PartDone].SetName("Done"); // Fill the part name-to-id map. for (Part p = PartStart; p != PartCount; p = Part(p + 1)) { @@ -612,6 +614,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) std::string bld_dir = this->GetCTestConfiguration("BuildDirectory"); this->DartVersion = 1; this->DropSiteCDash = false; + this->BuildID = ""; for (Part p = PartStart; p != PartCount; p = Part(p + 1)) { this->Parts[p].SubmitFiles.clear(); } @@ -1565,6 +1568,24 @@ int cmCTest::GenerateNotesFile(const char* cfiles) return this->GenerateNotesFile(files); } +int cmCTest::GenerateDoneFile() +{ + cmGeneratedFileStream ofs; + if (!this->OpenOutputFile(this->CurrentTag, "Done.xml", ofs)) { + cmCTestLog(this, ERROR_MESSAGE, "Cannot open done file" << std::endl); + return 1; + } + cmXMLWriter xml(ofs); + xml.StartDocument(); + xml.StartElement("Done"); + xml.Element("buildId", this->BuildID); + xml.Element("time", std::chrono::system_clock::now()); + xml.EndElement(); // Done + xml.EndDocument(); + + return 0; +} + std::string cmCTest::Base64GzipEncodeFile(std::string const& file) { std::string tarFile = file + "_temp.tar.gz"; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 345b538e748..1ee002a92e8 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -50,6 +50,7 @@ class cmCTest PartNotes, PartExtraFiles, PartUpload, + PartDone, PartCount // Update names in constructor when adding a part }; @@ -373,6 +374,9 @@ class cmCTest /** Create XML file that contains all the notes specified */ int GenerateNotesFile(const VectorOfStrings& files); + /** Create XML file to indicate that build is complete */ + int GenerateDoneFile(); + /** Submit extra files to the server */ bool SubmitExtraFiles(const char* files); bool SubmitExtraFiles(const VectorOfStrings& files); @@ -405,6 +409,10 @@ class cmCTest int GetDartVersion() { return this->DartVersion; } int GetDropSiteCDash() { return this->DropSiteCDash; } + /** The Build ID is assigned by CDash */ + void SetBuildID(const std::string& id) { this->BuildID = id; } + std::string GetBuildID() { return this->BuildID; } + /** Add file to be submitted */ void AddSubmitFile(Part part, const char* name); std::vector const& GetSubmitFiles(Part part) @@ -607,6 +615,8 @@ class cmCTest int DartVersion; bool DropSiteCDash; + std::string BuildID; + std::vector InitialCommandLineArguments; int SubmitIndex; diff --git a/Tests/RunCMake/ctest_submit/PARTSDone-result.txt b/Tests/RunCMake/ctest_submit/PARTSDone-result.txt new file mode 100644 index 00000000000..b57e2deb77b --- /dev/null +++ b/Tests/RunCMake/ctest_submit/PARTSDone-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt b/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt new file mode 100644 index 00000000000..0020a0fe344 --- /dev/null +++ b/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt @@ -0,0 +1,3 @@ + *Error when uploading file: .*/Done.xml + *Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*) + *Problems when submitting via HTTP diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake index 952368d8387..178f0cb286f 100644 --- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake +++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake @@ -24,6 +24,7 @@ run_ctest_submit(BadFILES FILES bad-file) run_ctest_submit(RepeatRETURN_VALUE RETURN_VALUE res RETURN_VALUE res) run_ctest_submit(PARTSCDashUpload PARTS Configure CDASH_UPLOAD) run_ctest_submit(PARTSCDashUploadType PARTS Configure CDASH_UPLOAD_TYPE) +run_ctest_submit(PARTSDone PARTS Done) run_ctest_submit(CDashUploadPARTS CDASH_UPLOAD bad-upload PARTS) run_ctest_submit(CDashUploadFILES CDASH_UPLOAD bad-upload FILES) run_ctest_submit(CDashUploadNone CDASH_UPLOAD) From 8f076acdb0af6e319005338e3e25d127043e3275 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 10 Oct 2018 09:02:41 -0400 Subject: [PATCH 023/907] cmLocalGenerator: Remove AddCompileDefinitions method This method offers the same definitions as `GetTargetDefines` except that it excludes the "export" macro on shared libraries. Update call sites to use `GetTargetDefines` instead. Some of them were incorrectly excluding the export macro. --- Source/cmExtraSublimeTextGenerator.cxx | 7 +------ Source/cmGhsMultiTargetGenerator.cxx | 9 ++------- Source/cmLocalGenerator.cxx | 14 +++----------- Source/cmLocalGenerator.h | 4 ---- Source/cmLocalUnixMakefileGenerator3.cxx | 4 ++-- Source/cmQtAutoGenInitializer.cxx | 2 +- 6 files changed, 9 insertions(+), 31 deletions(-) diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index c4cca072b95..882d39f0f45 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -384,13 +384,8 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines( cmGeneratorExpressionInterpreter genexInterpreter(lg, config, target, language); - // Add the export symbol definition for shared library objects. - if (const char* exportMacro = target->GetExportMacro()) { - lg->AppendDefines(defines, exportMacro); - } - // Add preprocessor definitions for this target and configuration. - lg->AddCompileDefinitions(defines, target, config, language); + lg->GetTargetDefines(target, config, language, defines); const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); if (const char* compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) { lg->AppendDefines( diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 847230a82b9..4d98d55a1d1 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -267,14 +267,9 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string& language, if (i == this->DefinesByLanguage.end()) { std::set defines; const char* lang = language.c_str(); - // Add the export symbol definition for shared library objects. - if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) { - this->LocalGenerator->AppendDefines(defines, exportMacro); - } - // Add preprocessor definitions for this target and configuration. - this->LocalGenerator->AddCompileDefinitions(defines, this->GeneratorTarget, - config, language); + this->LocalGenerator->GetTargetDefines(this->GeneratorTarget, config, + language, defines); std::string definesString; this->LocalGenerator->JoinDefines(defines, definesString, lang); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 70307252e20..40e183ca88b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -773,16 +773,6 @@ std::string cmLocalGenerator::GetIncludeFlags( return flags; } -void cmLocalGenerator::AddCompileDefinitions(std::set& defines, - cmGeneratorTarget const* target, - const std::string& config, - const std::string& lang) const -{ - std::vector targetDefines; - target->GetCompileDefinitions(targetDefines, config, lang); - this->AppendDefines(defines, targetDefines); -} - void cmLocalGenerator::AddCompileOptions(std::string& flags, cmGeneratorTarget* target, const std::string& lang, @@ -1237,7 +1227,9 @@ void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target, } // Add preprocessor definitions for this target and configuration. - this->AddCompileDefinitions(defines, target, config, lang); + std::vector targetDefines; + target->GetCompileDefinitions(targetDefines, config, lang); + this->AppendDefines(defines, targetDefines); } std::string cmLocalGenerator::GetTargetFortranFlags( diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 58b7762255a..f8d70ca30ad 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -251,10 +251,6 @@ class cmLocalGenerator : public cmOutputConverter bool appendAllImplicitDirs = false) const; void AddCompileOptions(std::string& flags, cmGeneratorTarget* target, const std::string& lang, const std::string& config); - void AddCompileDefinitions(std::set& defines, - cmGeneratorTarget const* target, - const std::string& config, - const std::string& lang) const; std::string GetProjectName() const; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4d19b3acbbc..68cdef050d5 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1819,8 +1819,8 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo( // Build a list of preprocessor definitions for the target. std::set defines; - this->AddCompileDefinitions(defines, target, this->ConfigName, - implicitLang.first); + this->GetTargetDefines(target, this->ConfigName, implicitLang.first, + defines); if (!defines.empty()) { /* clang-format off */ cmakefileStream diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 8a202a2f64a..6bc3b618594 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -416,7 +416,7 @@ bool cmQtAutoGenInitializer::InitMoc() auto GetCompileDefinitions = [this, localGen](std::string const& cfg) -> std::string { std::set defines; - localGen->AddCompileDefinitions(defines, this->Target, cfg, "CXX"); + localGen->GetTargetDefines(this->Target, cfg, "CXX", defines); return cmJoin(defines, ";"); }; From 7772bd31f57fd8b4d6a7937a97671eb34c966835 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Mon, 27 Aug 2018 14:57:17 -0400 Subject: [PATCH 024/907] FindMatlab: Guard against nonexistent installation Logic added by commit v3.12.0-rc1~183^2 (FindMatlab: Matlab Runtime Compiler support, 2017-04-29) assumes that `VersionInfo.xml` exists in the installation. Fix it to tolerate a missing or empty file. This change was originally made by commit v3.13.0-rc1~173^2 (FindMatlab: Guard against nonexistent installation, 2018-08-27). Here we backport it to the 3.12.x series. Fixes: #18436 --- Modules/FindMatlab.cmake | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 2d04b84dd2f..d765bdf473e 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1163,21 +1163,24 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve # return the updated value set(${matlab_final_version} ${Matlab_VERSION_STRING_INTERNAL} PARENT_SCOPE) - else() + elseif(EXISTS "${matlab_root}/VersionInfo.xml") # MCR # we cannot run anything in order to extract the version. We assume that the file # VersionInfo.xml exists under the MatlabRoot, we look for it and extract the version from there set(_matlab_version_tmp "unknown") file(STRINGS "${matlab_root}/VersionInfo.xml" versioninfo_string NEWLINE_CONSUME) - # parses "9.2.0.538062" - string(REGEX MATCH "(.*)" - version_reg_match - ${versioninfo_string} - ) - - if(NOT "${version_reg_match}" STREQUAL "") - if("${CMAKE_MATCH_1}" MATCHES "(([0-9])\\.([0-9]))[\\.0-9]*") - set(_matlab_version_tmp "${CMAKE_MATCH_1}") + + if(versioninfo_string) + # parses "9.2.0.538062" + string(REGEX MATCH "(.*)" + version_reg_match + ${versioninfo_string} + ) + + if(NOT "${version_reg_match}" STREQUAL "") + if("${CMAKE_MATCH_1}" MATCHES "(([0-9])\\.([0-9]))[\\.0-9]*") + set(_matlab_version_tmp "${CMAKE_MATCH_1}") + endif() endif() endif() set(${matlab_final_version} "${_matlab_version_tmp}" PARENT_SCOPE) @@ -1185,8 +1188,7 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve "${_matlab_version_tmp}" CACHE INTERNAL "Matlab (MCR) version (automatically determined)" FORCE) - - endif() # Matlab or MCR + endif() # Matlab or MCR endfunction() From 514f0b572ea8ca2ba87810aa8f48185f266a8eaa Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 3 Oct 2018 11:50:19 -0400 Subject: [PATCH 025/907] Testing: Update hard-coded line numbers to [0-9]+ in some tests --- .../CMP0026-CONFIG-LOCATION-NEW-stderr.txt | 2 +- .../CMP0026-CONFIG-LOCATION-OLD-stderr.txt | 2 +- .../CMP0026-CONFIG-LOCATION-WARN-stderr.txt | 2 +- .../CMP0026-LOCATION-CONFIG-NEW-stderr.txt | 2 +- .../CMP0026-LOCATION-CONFIG-OLD-stderr.txt | 2 +- .../CMP0026-LOCATION-CONFIG-WARN-stderr.txt | 2 +- Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt | 2 +- Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt | 2 +- Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt | 4 ++-- .../LOCATION-and-TARGET_OBJECTS-stderr.txt | 2 +- .../RunCMake/CMP0026/ObjlibNotDefined-stderr.txt | 2 +- .../CMP0026/clear-cached-information-stderr.txt | 2 +- Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt | 2 +- Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt | 4 ++-- .../RunCMake/CommandLine/Wdeprecated-stderr.txt | 2 +- Tests/RunCMake/CommandLine/Wdev-stderr.txt | 4 ++-- .../CommandLine/Werror_deprecated-stderr.txt | 2 +- Tests/RunCMake/CommandLine/Werror_dev-stderr.txt | 4 ++-- .../CommandLine/Wno-error_deprecated-stderr.txt | 2 +- .../CommandLine/Wno-error_dev-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadAlgoMap1-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadAlgoMap2-stderr.txt | 4 ++-- .../ExternalData/BadHashAlgo1-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadOption1-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadOption2-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadRecurse1-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadRecurse2-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadRecurse3-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadSeries1-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadSeries2-stderr.txt | 4 ++-- .../RunCMake/ExternalData/BadSeries3-stderr.txt | 4 ++-- .../RunCMake/ExternalData/Directory1-stderr.txt | 4 ++-- .../RunCMake/ExternalData/Directory2-stderr.txt | 4 ++-- .../RunCMake/ExternalData/Directory3-stderr.txt | 4 ++-- .../RunCMake/ExternalData/Directory4-stderr.txt | 4 ++-- .../RunCMake/ExternalData/Directory5-stderr.txt | 4 ++-- .../RunCMake/ExternalData/MissingData-stderr.txt | 4 ++-- .../MissingDataWithAssociated-stderr.txt | 4 ++-- .../ExternalData/NoLinkInSource-stderr.txt | 4 ++-- .../ExternalData/NoURLTemplates-stderr.txt | 4 ++-- .../BadInvalidName-stderr.txt | 16 ++++++++-------- .../BadNonTarget-stderr.txt | 2 +- .../LinkImplementationCycle1-stderr.txt | 2 +- .../LinkImplementationCycle2-stderr.txt | 2 +- .../TargetSources/CMP0076-WARN-stderr.txt | 4 ++-- .../TargetSources/OriginDebug-stderr.txt | 8 ++++---- Tests/RunCMake/file/FileOpenFailRead-stderr.txt | 2 +- .../RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt | 12 ++++++------ .../RunCMake/get_property/BadArgument-stderr.txt | 2 +- .../get_property/BadDirectory-stderr.txt | 2 +- Tests/RunCMake/get_property/BadScope-stderr.txt | 2 +- Tests/RunCMake/get_property/BadTarget-stderr.txt | 2 +- Tests/RunCMake/get_property/BadTest-stderr.txt | 2 +- .../RunCMake/get_property/GlobalName-stderr.txt | 2 +- .../get_property/MissingArgument-stderr.txt | 2 +- Tests/RunCMake/get_property/NoCache-stderr.txt | 2 +- .../RunCMake/get_property/NoProperty-stderr.txt | 2 +- Tests/RunCMake/get_property/NoSource-stderr.txt | 2 +- Tests/RunCMake/get_property/NoTarget-stderr.txt | 2 +- Tests/RunCMake/get_property/NoTest-stderr.txt | 2 +- .../get_property/VariableName-stderr.txt | 2 +- .../InvalidArgumentsNumber-stderr.txt | 2 +- .../include_guard/InvalidScope-stderr.txt | 2 +- .../DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt | 2 +- ...TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt | 2 +- ...TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt | 2 +- .../set_property/IMPORTED_GLOBAL-stderr.txt | 14 +++++++------- Tests/RunCMake/string/AppendNoArgs-stderr.txt | 2 +- Tests/RunCMake/string/ConcatNoArgs-stderr.txt | 2 +- Tests/RunCMake/string/JoinNoArgs-stderr.txt | 2 +- Tests/RunCMake/string/JoinNoVar-stderr.txt | 2 +- Tests/RunCMake/string/PrependNoArgs-stderr.txt | 2 +- .../RunCMake/string/UuidBadNamespace-stderr.txt | 2 +- Tests/RunCMake/string/UuidBadType-stderr.txt | 2 +- .../string/UuidMissingNameValue-stderr.txt | 2 +- .../string/UuidMissingNamespace-stderr.txt | 2 +- .../string/UuidMissingNamespaceValue-stderr.txt | 2 +- .../string/UuidMissingTypeValue-stderr.txt | 2 +- .../alias_target-stderr.txt | 2 +- .../cxx_not_enabled-stderr.txt | 2 +- .../imported_target-stderr.txt | 2 +- .../invalid_args-stderr.txt | 2 +- .../invalid_args_on_interface-stderr.txt | 2 +- .../no_matching_c_feature-stderr.txt | 2 +- .../no_matching_cxx_feature-stderr.txt | 2 +- .../target_compile_features/no_target-stderr.txt | 2 +- .../not_a_c_feature-stderr.txt | 2 +- .../not_a_cxx_feature-stderr.txt | 2 +- .../not_enough_args-stderr.txt | 2 +- .../utility_target-stderr.txt | 2 +- .../CMP0023-NEW-2-stderr.txt | 2 +- .../target_link_libraries/CMP0023-NEW-stderr.txt | 2 +- .../CMP0023-WARN-2-stderr.txt | 2 +- .../CMP0023-WARN-stderr.txt | 2 +- .../CMP0079-link-NEW-bogus-stderr.txt | 2 +- .../MixedSignature-stderr.txt | 2 +- 96 files changed, 143 insertions(+), 143 deletions(-) diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt index 05b021746b7..6a1f1bde438 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt @@ -4,4 +4,4 @@ CMake Error at CMP0026-CONFIG-LOCATION-NEW.cmake:7 \(get_target_property\): expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt index edeb3372808..84dec32127f 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt @@ -7,4 +7,4 @@ specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt index d44dcb48d9d..d2209fdc84a 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt @@ -8,5 +8,5 @@ CMake Warning \(dev\) at CMP0026-CONFIG-LOCATION-WARN.cmake:5 \(get_target_prope expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt index fec9dfb4d10..1490103d597 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt @@ -4,4 +4,4 @@ CMake Error at CMP0026-LOCATION-CONFIG-NEW.cmake:7 \(get_target_property\): expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt index 32ff698f1cb..1fb4ef6793a 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt @@ -7,4 +7,4 @@ specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt index cd6f3d095d2..8b4faf011a3 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt @@ -8,5 +8,5 @@ CMake Warning \(dev\) at CMP0026-LOCATION-CONFIG-WARN.cmake:5 \(get_target_prope expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt index fa025129fbf..8c47c2ab3e6 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt @@ -4,4 +4,4 @@ CMake Error at CMP0026-NEW.cmake:7 \(get_target_property\): expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt index b3f79fc4dad..b4282f54598 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt @@ -7,4 +7,4 @@ specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt index d122c4a2eb4..0d39596b416 100644 --- a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt @@ -8,7 +8,7 @@ CMake Warning \(dev\) at CMP0026-WARN.cmake:5 \(get_target_property\): expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. + CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\): @@ -21,5 +21,5 @@ CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\): expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt index 0996cb6b4c1..63779219ae8 100644 --- a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt +++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt @@ -8,5 +8,5 @@ CMake Warning \(dev\) at LOCATION-and-TARGET_OBJECTS.cmake:[0-9]+ \(get_target_p \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt index 87d198d00ff..360d9876587 100644 --- a/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt +++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt @@ -8,5 +8,5 @@ CMake Warning \(dev\) at ObjlibNotDefined.cmake:[0-9]+ \(get_target_property\): expression \$, as appropriate. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt index 157a0468a95..3525704bbaa 100644 --- a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt +++ b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt @@ -7,4 +7,4 @@ specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt index 697265e910c..e1c44e507fb 100644 --- a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt @@ -7,6 +7,6 @@ specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + Sources: "empty.cpp"$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt index ae2e4684828..78c6b6d30fb 100644 --- a/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt @@ -9,7 +9,7 @@ CMake Warning \(dev\) at CMP0051-WARN.cmake:6 \(get_target_property\): needs to be adapted to ignore the generator expression using the string\(GENEX_STRIP\) command. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. Sources: "empty.cpp" @@ -25,7 +25,7 @@ CMake Warning \(dev\) at CMP0051-WARN.cmake:12 \(get_target_property\): needs to be adapted to ignore the generator expression using the string\(GENEX_STRIP\) command. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. Sources: "../empty.cpp"$ diff --git a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt b/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt index e9be1dcb308..30385f88ef7 100644 --- a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt +++ b/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt @@ -1,4 +1,4 @@ ^CMake Deprecation Warning at Wdeprecated.cmake:1 \(message\): Some deprecated warning Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt index 88cfb3a302c..172fb81555d 100644 --- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt +++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt @@ -1,11 +1,11 @@ ^CMake Warning \(dev\) at Wdev.cmake:1 \(message\): Some author warning Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning \(dev\) at Wdev.cmake:6 \(include\): include\(\) given empty file name \(ignored\). Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt b/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt index 6acdc73621e..d681836b20a 100644 --- a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt +++ b/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt @@ -1,4 +1,4 @@ ^CMake Deprecation Error at Werror_deprecated.cmake:1 \(message\): Some deprecated warning Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt b/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt index 590ec96d308..35890fc9930 100644 --- a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt +++ b/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt @@ -1,11 +1,11 @@ ^CMake Error \(dev\) at Werror_dev.cmake:4 \(include\): include\(\) given empty file name \(ignored\). Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This error is for project developers. Use -Wno-error=dev to suppress it. CMake Error \(dev\) at Werror_dev.cmake:7 \(message\): Some author warning Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This error is for project developers. Use -Wno-error=dev to suppress it.$ diff --git a/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt b/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt index 0ed16986141..45897062d53 100644 --- a/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt +++ b/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt @@ -1,4 +1,4 @@ ^CMake Deprecation Warning at Wno-error_deprecated.cmake:2 \(message\): Some deprecated warning Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt b/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt index dd22d55680e..ee28d7f0240 100644 --- a/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt +++ b/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt @@ -1,11 +1,11 @@ ^CMake Warning \(dev\) at Wno-error_dev.cmake:2 \(message\): Some author warning Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning \(dev\) at Wno-error_dev.cmake:6 \(include\): include\(\) given empty file name \(ignored\). Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt b/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt index c3708a9c870..5388c46dec2 100644 --- a/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt @@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): The transform name must be a valid C identifier. Call Stack \(most recent call first\): - BadAlgoMap1.cmake:[0-9]+ \(ExternalData_Add_Target\) - CMakeLists.txt:3 \(include\) + BadAlgoMap1\.cmake:[0-9]+ \(ExternalData_Add_Target\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt b/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt index 1f10644dc83..a48e414558d 100644 --- a/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt @@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): The transform name must be a valid C identifier. Call Stack \(most recent call first\): - BadAlgoMap2.cmake:[0-9]+ \(ExternalData_Add_Target\) - CMakeLists.txt:3 \(include\) + BadAlgoMap2\.cmake:[0-9]+ \(ExternalData_Add_Target\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt b/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt index f68f0be6b18..1f9f6b51bb4 100644 --- a/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt @@ -4,5 +4,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): BAD Call Stack \(most recent call first\): .* - BadHashAlgo1.cmake:3 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + BadHashAlgo1\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadOption1-stderr.txt b/Tests/RunCMake/ExternalData/BadOption1-stderr.txt index b63d098c0b4..fece87703de 100644 --- a/Tests/RunCMake/ExternalData/BadOption1-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadOption1-stderr.txt @@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Call Stack \(most recent call first\): .* - BadOption1.cmake:2 \(ExternalData_Add_Test\) - CMakeLists.txt:3 \(include\) + BadOption1\.cmake:[0-9]+ \(ExternalData_Add_Test\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadOption2-stderr.txt b/Tests/RunCMake/ExternalData/BadOption2-stderr.txt index d114c8aa9b5..865552aca8f 100644 --- a/Tests/RunCMake/ExternalData/BadOption2-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadOption2-stderr.txt @@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Call Stack \(most recent call first\): .* - BadOption2.cmake:2 \(ExternalData_Add_Test\) - CMakeLists.txt:3 \(include\) + BadOption2\.cmake:[0-9]+ \(ExternalData_Add_Test\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt b/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt index aedc3301559..9d04693ca62 100644 --- a/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt @@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Recurse option "RECURSE:" allowed only with directories. Call Stack \(most recent call first\): .* - BadRecurse1.cmake:2 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + BadRecurse1\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt b/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt index 3f809ca69cb..135b424770b 100644 --- a/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt @@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Recurse option "RECURSE:" allowed only with directories. Call Stack \(most recent call first\): .* - BadRecurse2.cmake:2 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + BadRecurse2\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt b/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt index 37740e0f736..df9bb0e17ae 100644 --- a/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt @@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Call Stack \(most recent call first\): .* - BadRecurse3.cmake:2 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + BadRecurse3\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt b/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt index 3099be579c5..5b3495985d5 100644 --- a/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt @@ -15,5 +15,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Call Stack \(most recent call first\): .* - BadSeries1.cmake:3 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + BadSeries1\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt b/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt index 3a02c25e945..82b2311d2f4 100644 --- a/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt @@ -12,5 +12,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): \(x\)\(y\)\$ Call Stack \(most recent call first\): .* - BadSeries2.cmake:3 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + BadSeries2\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt b/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt index 594cb6f6a40..13e75c5c5e4 100644 --- a/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt +++ b/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt @@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Series option ":" not allowed with associated files. Call Stack \(most recent call first\): .* - BadSeries3.cmake:2 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + BadSeries3\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/Directory1-stderr.txt b/Tests/RunCMake/ExternalData/Directory1-stderr.txt index 2bc3c601d12..833683285a5 100644 --- a/Tests/RunCMake/ExternalData/Directory1-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory1-stderr.txt @@ -10,5 +10,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): that is directory instead of a file! Call Stack \(most recent call first\): .* - Directory1.cmake:3 \(ExternalData_Add_Test\) - CMakeLists.txt:3 \(include\) + Directory1\.cmake:[0-9]+ \(ExternalData_Add_Test\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/Directory2-stderr.txt b/Tests/RunCMake/ExternalData/Directory2-stderr.txt index 92c9a2ff59e..ad6d814ec54 100644 --- a/Tests/RunCMake/ExternalData/Directory2-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory2-stderr.txt @@ -6,5 +6,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): must list associated files. Call Stack \(most recent call first\): .* - Directory2.cmake:3 \(ExternalData_Add_Test\) - CMakeLists.txt:3 \(include\) + Directory2\.cmake:[0-9]+ \(ExternalData_Add_Test\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/Directory3-stderr.txt b/Tests/RunCMake/ExternalData/Directory3-stderr.txt index ceed2a04d76..5538c38a8e7 100644 --- a/Tests/RunCMake/ExternalData/Directory3-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory3-stderr.txt @@ -10,6 +10,6 @@ CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): that does not exist as a file \(with or without an extension\)! Call Stack \(most recent call first\): .* - Directory3.cmake:3 \(ExternalData_Add_Test\) - CMakeLists.txt:3 \(include\) + Directory3\.cmake:[0-9]+ \(ExternalData_Add_Test\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/Directory4-stderr.txt b/Tests/RunCMake/ExternalData/Directory4-stderr.txt index dcb8522f88c..ef884768550 100644 --- a/Tests/RunCMake/ExternalData/Directory4-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory4-stderr.txt @@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Series option ":" not allowed with directories. Call Stack \(most recent call first\): .* - Directory4.cmake:3 \(ExternalData_Add_Test\) - CMakeLists.txt:3 \(include\) + Directory4\.cmake:[0-9]+ \(ExternalData_Add_Test\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/Directory5-stderr.txt b/Tests/RunCMake/ExternalData/Directory5-stderr.txt index 8e54aecd2a1..3fcde414d32 100644 --- a/Tests/RunCMake/ExternalData/Directory5-stderr.txt +++ b/Tests/RunCMake/ExternalData/Directory5-stderr.txt @@ -10,5 +10,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): that does not exist as a directory! Call Stack \(most recent call first\): .* - Directory5.cmake:3 \(ExternalData_Add_Test\) - CMakeLists.txt:3 \(include\) + Directory5\.cmake:[0-9]+ \(ExternalData_Add_Test\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/MissingData-stderr.txt b/Tests/RunCMake/ExternalData/MissingData-stderr.txt index 39ed2f15f2d..b10997681b7 100644 --- a/Tests/RunCMake/ExternalData/MissingData-stderr.txt +++ b/Tests/RunCMake/ExternalData/MissingData-stderr.txt @@ -10,6 +10,6 @@ CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): that does not exist as a file \(with or without an extension\)! Call Stack \(most recent call first\): .* - MissingData.cmake:4 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + MissingData\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt index 315af5e492f..426d86ccd30 100644 --- a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt +++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt @@ -10,6 +10,6 @@ CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): that does not exist as a file \(with or without an extension\)! Call Stack \(most recent call first\): .* - MissingDataWithAssociated.cmake:4 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + MissingDataWithAssociated\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt b/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt index 496ad8ae4e8..33cef07b476 100644 --- a/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt +++ b/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt @@ -2,5 +2,5 @@ CMake Warning at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): ExternalData_LINK_CONTENT cannot be used in-source Call Stack \(most recent call first\): .* - NoLinkInSource.cmake:8 \(ExternalData_Expand_Arguments\) - CMakeLists.txt:3 \(include\) + NoLinkInSource\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt index ccbaf5af31a..45dfb94cb01 100644 --- a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt +++ b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt @@ -1,5 +1,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set! Call Stack \(most recent call first\): - NoURLTemplates.cmake:2 \(ExternalData_Add_Target\) - CMakeLists.txt:3 \(include\) + NoURLTemplates\.cmake:[0-9]+ \(ExternalData_Add_Target\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt index 6e891047c00..fec12ae8361 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt @@ -1,47 +1,47 @@ -^(CMake Error at BadInvalidName1/CMakeLists.txt:2 \(include_directories\): +^(CMake Error at BadInvalidName1/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ Target name not supported. -+)+(CMake Error at BadInvalidName2/CMakeLists.txt:2 \(include_directories\): ++)+(CMake Error at BadInvalidName2/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ Target name and property name not supported. -+)+(CMake Error at BadInvalidName3/CMakeLists.txt:2 \(include_directories\): ++)+(CMake Error at BadInvalidName3/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ Property name not supported. -+)+(CMake Error at BadInvalidName4/CMakeLists.txt:2 \(include_directories\): ++)+(CMake Error at BadInvalidName4/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ Property name not supported. -+)+(CMake Error at BadInvalidName5/CMakeLists.txt:2 \(include_directories\): ++)+(CMake Error at BadInvalidName5/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ \$ expression requires a non-empty target name and property name. -+)+(CMake Error at BadInvalidName6/CMakeLists.txt:2 \(include_directories\): ++)+(CMake Error at BadInvalidName6/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ \$ expression requires a non-empty target name. -+)+(CMake Error at BadInvalidName7/CMakeLists.txt:2 \(include_directories\): ++)+(CMake Error at BadInvalidName7/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ \$ expression requires a non-empty property name. -+)+(CMake Error at BadInvalidName8/CMakeLists.txt:2 \(include_directories\): ++)+(CMake Error at BadInvalidName8/CMakeLists\.txt:[0-9]+ \(include_directories\): Error evaluating generator expression: \$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt index 3adf73ea0fe..75865adc1ea 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt @@ -5,4 +5,4 @@ CMake Error at BadNonTarget.cmake:7 \(include_directories\): Target "NonExistent" not found. Call Stack \(most recent call first\): - CMakeLists.txt:8 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt index 7e002f54797..8bff68e08f1 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt @@ -7,4 +7,4 @@ CMake Error at LinkImplementationCycle1.cmake:5 \(target_link_libraries\): target property which is transitive over the link libraries, creating a recursion. Call Stack \(most recent call first\): - CMakeLists.txt:8 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt index 2f72de6eca7..044b77cc654 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt @@ -7,4 +7,4 @@ CMake Error at LinkImplementationCycle2.cmake:5 \(target_link_libraries\): target property which is transitive over the link libraries, creating a recursion. Call Stack \(most recent call first\): - CMakeLists.txt:8 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt b/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt index 217c7626abd..bd888eed55b 100644 --- a/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt +++ b/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMP0076-WARN/CMakeLists.txt:2 \(target_sources\): +CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\): Policy CMP0076 is not set: target_sources\(\) command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. @@ -6,7 +6,7 @@ CMake Warning \(dev\) at CMP0076-WARN/CMakeLists.txt:2 \(target_sources\): An interface source of target "publiclib" has a relative path. This warning is for project developers. Use -Wno-dev to suppress it. -CMake Warning \(dev\) at CMP0076-WARN/CMakeLists.txt:2 \(target_sources\): +CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\): Policy CMP0076 is not set: target_sources\(\) command converts relative paths to absolute. Run "cmake --help-policy CMP0076" for policy details. Use the cmake_policy command to set the policy and suppress this warning. diff --git a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt index 11bc96cf985..a40f4631571 100644 --- a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt +++ b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt @@ -4,7 +4,7 @@ CMake Debug Log at OriginDebug.cmake:13 \(add_library\): \* .*Tests/RunCMake/TargetSources/empty_2.cpp Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) .* CMake Debug Log at OriginDebug.cmake:16 \(set_property\): Used sources for target OriginDebug: @@ -12,7 +12,7 @@ CMake Debug Log at OriginDebug.cmake:16 \(set_property\): \* .*Tests/RunCMake/TargetSources/empty_3.cpp Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) .* CMake Debug Log at OriginDebug.cmake:20 \(target_sources\): Used sources for target OriginDebug: @@ -20,7 +20,7 @@ CMake Debug Log at OriginDebug.cmake:20 \(target_sources\): \* .*Tests/RunCMake/TargetSources/empty_4.cpp Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) .* CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\): Used sources for target OriginDebug: @@ -28,4 +28,4 @@ CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\): \* .*Tests/RunCMake/TargetSources/empty_1.cpp Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/file/FileOpenFailRead-stderr.txt b/Tests/RunCMake/file/FileOpenFailRead-stderr.txt index 23d4337f4e4..9f8cee26a50 100644 --- a/Tests/RunCMake/file/FileOpenFailRead-stderr.txt +++ b/Tests/RunCMake/file/FileOpenFailRead-stderr.txt @@ -3,4 +3,4 @@ CMake Error at FileOpenFailRead.cmake:[0-9]+ \(file\): .*/Tests/RunCMake/file/does_not_exist/file.txt Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt index 557b817bb0f..bb7e4d2cc3f 100644 --- a/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt +++ b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt @@ -2,31 +2,31 @@ CMake Error at INSTALL-MESSAGE-bad.cmake:1 \(file\): file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are mutually exclusive. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + CMake Error at INSTALL-MESSAGE-bad.cmake:2 \(file\): file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are mutually exclusive. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + CMake Error at INSTALL-MESSAGE-bad.cmake:3 \(file\): file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are mutually exclusive. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + CMake Error at INSTALL-MESSAGE-bad.cmake:4 \(file\): file option MESSAGE_ALWAYS may not appear after PATTERN or REGEX. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + CMake Error at INSTALL-MESSAGE-bad.cmake:5 \(file\): file option MESSAGE_LAZY may not appear after PATTERN or REGEX. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + CMake Error at INSTALL-MESSAGE-bad.cmake:6 \(file\): file option MESSAGE_NEVER may not appear after PATTERN or REGEX. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/get_property/BadArgument-stderr.txt b/Tests/RunCMake/get_property/BadArgument-stderr.txt index 37c44775cec..ce5a2092360 100644 --- a/Tests/RunCMake/get_property/BadArgument-stderr.txt +++ b/Tests/RunCMake/get_property/BadArgument-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at BadArgument.cmake:1 \(get_property\): get_property given invalid argument "FOO". Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/BadDirectory-stderr.txt b/Tests/RunCMake/get_property/BadDirectory-stderr.txt index 98464f8dcb9..6afec038a5a 100644 --- a/Tests/RunCMake/get_property/BadDirectory-stderr.txt +++ b/Tests/RunCMake/get_property/BadDirectory-stderr.txt @@ -3,4 +3,4 @@ found. This could be because the directory argument was invalid or, it is valid but has not been processed yet. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/BadScope-stderr.txt b/Tests/RunCMake/get_property/BadScope-stderr.txt index 4cc32c87b9c..3084bb7fdc2 100644 --- a/Tests/RunCMake/get_property/BadScope-stderr.txt +++ b/Tests/RunCMake/get_property/BadScope-stderr.txt @@ -2,4 +2,4 @@ get_property given invalid scope FOO. Valid scopes are GLOBAL, DIRECTORY, TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/BadTarget-stderr.txt b/Tests/RunCMake/get_property/BadTarget-stderr.txt index 45a0df6c91f..e8571172150 100644 --- a/Tests/RunCMake/get_property/BadTarget-stderr.txt +++ b/Tests/RunCMake/get_property/BadTarget-stderr.txt @@ -2,4 +2,4 @@ get_property could not find TARGET FOO. Perhaps it has not yet been created. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/BadTest-stderr.txt b/Tests/RunCMake/get_property/BadTest-stderr.txt index 819c0704a1c..aec9e9e9ce4 100644 --- a/Tests/RunCMake/get_property/BadTest-stderr.txt +++ b/Tests/RunCMake/get_property/BadTest-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at BadTest.cmake:1 \(get_property\): get_property given TEST name that does not exist: FOO Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/GlobalName-stderr.txt b/Tests/RunCMake/get_property/GlobalName-stderr.txt index a7d4971c2ee..4ddceb25746 100644 --- a/Tests/RunCMake/get_property/GlobalName-stderr.txt +++ b/Tests/RunCMake/get_property/GlobalName-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at GlobalName.cmake:1 \(get_property\): get_property given name for GLOBAL scope. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/MissingArgument-stderr.txt b/Tests/RunCMake/get_property/MissingArgument-stderr.txt index 87227127a28..00d3311afdb 100644 --- a/Tests/RunCMake/get_property/MissingArgument-stderr.txt +++ b/Tests/RunCMake/get_property/MissingArgument-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at MissingArgument.cmake:1 \(get_property\): get_property called with incorrect number of arguments Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/NoCache-stderr.txt b/Tests/RunCMake/get_property/NoCache-stderr.txt index defafb62d04..7348cffdb0f 100644 --- a/Tests/RunCMake/get_property/NoCache-stderr.txt +++ b/Tests/RunCMake/get_property/NoCache-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at NoCache.cmake:1 \(get_property\): get_property not given name for CACHE scope. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/NoProperty-stderr.txt b/Tests/RunCMake/get_property/NoProperty-stderr.txt index 0ef147fdb1d..79b8c8702bb 100644 --- a/Tests/RunCMake/get_property/NoProperty-stderr.txt +++ b/Tests/RunCMake/get_property/NoProperty-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at NoProperty.cmake:1 \(get_property\): get_property not given a PROPERTY argument. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/NoSource-stderr.txt b/Tests/RunCMake/get_property/NoSource-stderr.txt index 59fd0add7b5..cefff4167ad 100644 --- a/Tests/RunCMake/get_property/NoSource-stderr.txt +++ b/Tests/RunCMake/get_property/NoSource-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at NoSource.cmake:1 \(get_property\): get_property not given name for SOURCE scope. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/NoTarget-stderr.txt b/Tests/RunCMake/get_property/NoTarget-stderr.txt index a0e1a94403c..fb1c8f4e846 100644 --- a/Tests/RunCMake/get_property/NoTarget-stderr.txt +++ b/Tests/RunCMake/get_property/NoTarget-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at NoTarget.cmake:1 \(get_property\): get_property not given name for TARGET scope. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/NoTest-stderr.txt b/Tests/RunCMake/get_property/NoTest-stderr.txt index c90a0ffc214..93c3e982186 100644 --- a/Tests/RunCMake/get_property/NoTest-stderr.txt +++ b/Tests/RunCMake/get_property/NoTest-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at NoTest.cmake:1 \(get_property\): get_property not given name for TEST scope. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_property/VariableName-stderr.txt b/Tests/RunCMake/get_property/VariableName-stderr.txt index e9f3827593f..250d920b41b 100644 --- a/Tests/RunCMake/get_property/VariableName-stderr.txt +++ b/Tests/RunCMake/get_property/VariableName-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at VariableName.cmake:1 \(get_property\): get_property given name for VARIABLE scope. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt index cdd33ac0d02..698e89ab06f 100644 --- a/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt +++ b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt @@ -2,4 +2,4 @@ CMake Error at InvalidArgumentsNumber.cmake:1 \(include_guard\): include_guard given an invalid number of arguments. The command takes at most 1 argument. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/include_guard/InvalidScope-stderr.txt b/Tests/RunCMake/include_guard/InvalidScope-stderr.txt index 456709da797..58f62a3628f 100644 --- a/Tests/RunCMake/include_guard/InvalidScope-stderr.txt +++ b/Tests/RunCMake/include_guard/InvalidScope-stderr.txt @@ -1,4 +1,4 @@ CMake Error at InvalidScope.cmake:1 \(include_guard\): include_guard given an invalid scope: INVALID Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt index 166ba6f04ef..c8074e96f84 100644 --- a/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt +++ b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt @@ -1,4 +1,4 @@ CMake Error at DIRECTORY-PATTERN-MESSAGE_NEVER.cmake:[0-9]+ \(install\): install DIRECTORY does not allow "MESSAGE_NEVER" after PATTERN or REGEX. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt index 187a8261d47..fe65fd3006a 100644 --- a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt +++ b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt @@ -2,4 +2,4 @@ install TARGETS given NAMELINK_COMPONENT option not in LIBRARY group\. The NAMELINK_COMPONENT option may be specified only following LIBRARY\. Call Stack \(most recent call first\): - CMakeLists\.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt index d1002bac866..60f52c48897 100644 --- a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt +++ b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt @@ -2,4 +2,4 @@ install TARGETS given NAMELINK_COMPONENT option not in LIBRARY group\. The NAMELINK_COMPONENT option may be specified only following LIBRARY\. Call Stack \(most recent call first\): - CMakeLists\.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt index f21b1dee9ab..e45fc64b166 100644 --- a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt +++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt @@ -3,7 +3,7 @@ \(\"ImportedGlobalTarget\"\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) CMake Error at IMPORTED_GLOBAL.cmake:16 \(set_property\): @@ -11,7 +11,7 @@ CMake Error at IMPORTED_GLOBAL.cmake:16 \(set_property\): \(\"ImportedGlobalTarget\"\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) CMake Error at IMPORTED_GLOBAL.cmake:26 \(set_property\): @@ -19,7 +19,7 @@ CMake Error at IMPORTED_GLOBAL.cmake:26 \(set_property\): \(\"ImportedLocalTarget\"\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) CMake Error at IMPORTED_GLOBAL.cmake:32 \(set_property\): @@ -27,10 +27,10 @@ CMake Error at IMPORTED_GLOBAL.cmake:32 \(set_property\): \(\"NonImportedTarget\"\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) -CMake Error at IMPORTED_GLOBAL/CMakeLists.txt:8 \(set_property\): +CMake Error at IMPORTED_GLOBAL/CMakeLists\.txt:[0-9]+ \(set_property\): Attempt to promote imported target \"ImportedLocalTarget2\" to global scope \(by setting IMPORTED_GLOBAL\) which is not built in this directory. @@ -45,7 +45,7 @@ CMake Error at IMPORTED_GLOBAL.cmake:50 \(set_property\): Attempt to promote imported target \"ImportedSubdirTarget1\" to global scope \(by setting IMPORTED_GLOBAL\) which is not built in this directory. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) CMake Error in IMPORTED_GLOBAL/CMakeLists.txt: @@ -58,4 +58,4 @@ CMake Error at IMPORTED_GLOBAL.cmake:52 \(set_property\): Attempt to promote imported target \"ImportedSubdirTarget2\" to global scope \(by setting IMPORTED_GLOBAL\) which is not built in this directory. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/string/AppendNoArgs-stderr.txt b/Tests/RunCMake/string/AppendNoArgs-stderr.txt index 75ad427fdac..9b7e9facd29 100644 --- a/Tests/RunCMake/string/AppendNoArgs-stderr.txt +++ b/Tests/RunCMake/string/AppendNoArgs-stderr.txt @@ -1,4 +1,4 @@ CMake Error at AppendNoArgs.cmake:1 \(string\): string sub-command APPEND requires at least one argument. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/ConcatNoArgs-stderr.txt b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt index efea5f1d869..22b608dd763 100644 --- a/Tests/RunCMake/string/ConcatNoArgs-stderr.txt +++ b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt @@ -1,4 +1,4 @@ CMake Error at ConcatNoArgs.cmake:1 \(string\): string sub-command CONCAT requires at least one argument. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/JoinNoArgs-stderr.txt b/Tests/RunCMake/string/JoinNoArgs-stderr.txt index d9dcec3eb12..7fcd3524db5 100644 --- a/Tests/RunCMake/string/JoinNoArgs-stderr.txt +++ b/Tests/RunCMake/string/JoinNoArgs-stderr.txt @@ -1,4 +1,4 @@ CMake Error at JoinNoArgs.cmake:1 \(string\): string sub-command JOIN requires at least two arguments. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/JoinNoVar-stderr.txt b/Tests/RunCMake/string/JoinNoVar-stderr.txt index 90701a96f83..b4a09c31c82 100644 --- a/Tests/RunCMake/string/JoinNoVar-stderr.txt +++ b/Tests/RunCMake/string/JoinNoVar-stderr.txt @@ -1,4 +1,4 @@ CMake Error at JoinNoVar.cmake:1 \(string\): string sub-command JOIN requires at least two arguments. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/PrependNoArgs-stderr.txt b/Tests/RunCMake/string/PrependNoArgs-stderr.txt index 8d433f93afe..c8acba8f0ad 100644 --- a/Tests/RunCMake/string/PrependNoArgs-stderr.txt +++ b/Tests/RunCMake/string/PrependNoArgs-stderr.txt @@ -1,4 +1,4 @@ CMake Error at PrependNoArgs.cmake:1 \(string\): string sub-command PREPEND requires at least one argument. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/UuidBadNamespace-stderr.txt b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt index cb12903e13d..340189b9fb0 100644 --- a/Tests/RunCMake/string/UuidBadNamespace-stderr.txt +++ b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt @@ -1,4 +1,4 @@ CMake Error at UuidBadNamespace.cmake:3 \(string\): string UUID sub-command, malformed NAMESPACE UUID. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/UuidBadType-stderr.txt b/Tests/RunCMake/string/UuidBadType-stderr.txt index 1993c044a3c..2734d86a657 100644 --- a/Tests/RunCMake/string/UuidBadType-stderr.txt +++ b/Tests/RunCMake/string/UuidBadType-stderr.txt @@ -1,4 +1,4 @@ CMake Error at UuidBadType.cmake:3 \(string\): string UUID sub-command, unknown TYPE 'FOO'. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt index 0b7cde46332..79819a97d53 100644 --- a/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt +++ b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt @@ -1,4 +1,4 @@ CMake Error at UuidMissingNameValue.cmake:3 \(string\): string UUID sub-command, NAME requires a value. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt index dfcfe42b2b1..1ffc53fe026 100644 --- a/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt +++ b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt @@ -1,4 +1,4 @@ CMake Error at UuidMissingNamespace.cmake:3 \(string\): string UUID sub-command, malformed NAMESPACE UUID. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt index 86585ad4047..2a73d3f0c63 100644 --- a/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt +++ b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt @@ -1,4 +1,4 @@ CMake Error at UuidMissingNamespaceValue.cmake:3 \(string\): string UUID sub-command, NAMESPACE requires a value. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt index 70252f8cd85..44bd479cd33 100644 --- a/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt +++ b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt @@ -1,4 +1,4 @@ CMake Error at UuidMissingTypeValue.cmake:3 \(string\): string UUID sub-command, TYPE requires a value. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt index 5ebe170c36c..1658f58df79 100644 --- a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt +++ b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt @@ -1,4 +1,4 @@ CMake Error at alias_target.cmake:[0-9]+ \(target_compile_features\): target_compile_features can not be used on an ALIAS target. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt b/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt index 4f707c7b9a2..5b4761c60ba 100644 --- a/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt +++ b/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at cxx_not_enabled.cmake:[0-9]+ \(target_compile_features\): target_compile_features cannot use features from non-enabled language CXX Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt index afad5374b64..f2a1aba9c8c 100644 --- a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt +++ b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt @@ -2,4 +2,4 @@ target_compile_features may only set INTERFACE properties on INTERFACE targets Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt index 9917be77a1e..ee57b548499 100644 --- a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt +++ b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt @@ -1,4 +1,4 @@ CMake Error at invalid_args.cmake:[0-9]+ \(target_compile_features\): target_compile_features called with invalid arguments Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt index 23a8eebac80..d6564f4c006 100644 --- a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt +++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt @@ -2,4 +2,4 @@ CMake Error at invalid_args_on_interface.cmake:[0-9]+ \(target_compile_features\ target_compile_features may only set INTERFACE properties on INTERFACE targets Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt index 1875d1209e3..07ddd6a55e8 100644 --- a/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt +++ b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt @@ -5,4 +5,4 @@ CMake Error at no_matching_c_feature.cmake:[0-9]+ \((target_compile_features|mes version 4.8.1. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt index 90d41c95765..9392f4b25b0 100644 --- a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt +++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt @@ -5,4 +5,4 @@ CMake Error at no_matching_cxx_feature.cmake:[0-9]+ \((target_compile_features|m version *[.0-9]+\. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/no_target-stderr.txt b/Tests/RunCMake/target_compile_features/no_target-stderr.txt index 65974b4d6c4..7b62c947eda 100644 --- a/Tests/RunCMake/target_compile_features/no_target-stderr.txt +++ b/Tests/RunCMake/target_compile_features/no_target-stderr.txt @@ -2,4 +2,4 @@ CMake Error at no_target.cmake:[0-9]+ \(target_compile_features\): Cannot specify compile features for target "main" which is not built by this project. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt index 493c5826c61..8a4055d0764 100644 --- a/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt +++ b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt @@ -2,4 +2,4 @@ CMake Error at not_a_c_feature.cmake:[0-9]+ \(target_compile_features\): target_compile_features specified unknown feature "c_not_a_feature" for target "main". Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt index 3dbf0e6549f..bd7f2c6b478 100644 --- a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt +++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt @@ -2,4 +2,4 @@ CMake Error at not_a_cxx_feature.cmake:[0-9]+ \(target_compile_features\): target_compile_features specified unknown feature "cxx_not_a_feature" for target "main". Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt index c0c2efac48b..34f1ce222aa 100644 --- a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt +++ b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt @@ -1,4 +1,4 @@ CMake Error at not_enough_args.cmake:[0-9]+ \(target_compile_features\): target_compile_features called with incorrect number of arguments Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt index ff03310d136..0c01377faf9 100644 --- a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt +++ b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt @@ -1,4 +1,4 @@ CMake Error at utility_target.cmake:[0-9]+ \(target_compile_features\): target_compile_features called with non-compilable target type Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt index 8e3f3153bc1..12c00fb01ff 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt @@ -8,4 +8,4 @@ CMake Error at CMP0023-NEW-2.cmake:11 \(target_link_libraries\): \* CMP0023-NEW-2.cmake:10 \(target_link_libraries\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt index 2ef22903444..117c8061430 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt @@ -8,4 +8,4 @@ CMake Error at CMP0023-NEW.cmake:11 \(target_link_libraries\): \* CMP0023-NEW.cmake:10 \(target_link_libraries\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt index 5147861540f..7e49d525e15 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt @@ -13,4 +13,4 @@ CMake Warning \(dev\) at CMP0023-WARN-2.cmake:9 \(target_link_libraries\): \* CMP0023-WARN-2.cmake:8 \(target_link_libraries\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt index a7474fac9d3..df1288e353f 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt @@ -13,4 +13,4 @@ CMake Warning \(dev\) at CMP0023-WARN.cmake:9 \(target_link_libraries\): \* CMP0023-WARN.cmake:8 \(target_link_libraries\) Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt index b9fe3f694f4..8ef35c1dccc 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt @@ -3,4 +3,4 @@ found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or an ALIAS target is missing\? Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt index c6237f46112..5b0caf757f7 100644 --- a/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt +++ b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt @@ -2,4 +2,4 @@ CMake Error at MixedSignature.cmake:6 \(target_link_libraries\): The INTERFACE, PUBLIC or PRIVATE option must appear as the second argument, just after the target name. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists\.txt:[0-9]+ \(include\) From fc8955e8891c645cd369a3cc8b607a14a8ed5bd7 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 2 Oct 2018 16:38:26 -0400 Subject: [PATCH 026/907] add_subdirectory: Run subdirectory install rules in correct order Before this change, install rules created by add_subdirectory() would be executed after all of the top-level install rules, even if they were declared before the top-level rules. This change adds a new policy, CMP0082, which interleaves the add_subdirectory() install rules with the other install rules so they are run in the correct order. --- Help/manual/cmake-policies.7.rst | 8 ++ Help/policy/CMP0082.rst | 24 ++++++ .../dev/install-subdirectory-order.rst | 5 ++ .../variable/CMAKE_POLICY_WARNING_CMPNNNN.rst | 2 + Source/CMakeLists.txt | 2 + Source/cmInstallGenerator.cxx | 13 ++++ Source/cmInstallGenerator.h | 4 + Source/cmInstallScriptGenerator.cxx | 4 +- Source/cmInstallSubdirectoryGenerator.cxx | 77 +++++++++++++++++++ Source/cmInstallSubdirectoryGenerator.h | 41 ++++++++++ Source/cmLocalGenerator.cxx | 63 +++++++++++---- Source/cmMakefile.cxx | 4 + Source/cmPolicies.h | 6 +- bootstrap | 1 + 14 files changed, 235 insertions(+), 19 deletions(-) create mode 100644 Help/policy/CMP0082.rst create mode 100644 Help/release/dev/install-subdirectory-order.rst create mode 100644 Source/cmInstallSubdirectoryGenerator.cxx create mode 100644 Source/cmInstallSubdirectoryGenerator.h diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 2cc52fe1aa0..0587429050f 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -51,6 +51,14 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used to determine whether to report an error on use of deprecated macros or functions. +Policies Introduced by CMake 3.14 +================================= + +.. toctree:: + :maxdepth: 1 + + CMP0082: Install rules from add_subdirectory() are interleaved with those in caller. + Policies Introduced by CMake 3.13 ================================= diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst new file mode 100644 index 00000000000..7b2ef04f069 --- /dev/null +++ b/Help/policy/CMP0082.rst @@ -0,0 +1,24 @@ +CMP0082 +------- + +Install rules from :command:`add_subdirectory` calls are interleaved with +those in caller. + +CMake 3.13 and lower ran the install rules from :command:`add_subdirectory` +after all other install rules, even if :command:`add_subdirectory` was called +before the other install rules. CMake 3.14 and later interleaves these +:command:`add_subdirectory` install rules with the others so that they are +run in the order they are declared. + +The ``OLD`` behavior for this policy is to run the install rules from +:command:`add_subdirectory` after the other install rules. The ``NEW`` +behavior for this policy is to run all install rules in the order they are +declared. + +This policy was introduced in CMake version 3.14. Unlike most policies, +CMake version |release| does *not* warn by default when this policy +is not set and simply uses OLD behavior. See documentation of the +:variable:`CMAKE_POLICY_WARNING_CMP0082 >` +variable to control the warning. + +.. include:: DEPRECATED.txt diff --git a/Help/release/dev/install-subdirectory-order.rst b/Help/release/dev/install-subdirectory-order.rst new file mode 100644 index 00000000000..c52e6176a36 --- /dev/null +++ b/Help/release/dev/install-subdirectory-order.rst @@ -0,0 +1,5 @@ +install-subdirectory-order +-------------------------- + +* Install rules under :command:`add_subdirectory` now interleave with those in + the calling directory. See policy :policy:`CMP0082` for details. diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst index aa23b65f9fc..d1797287355 100644 --- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst +++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst @@ -19,6 +19,8 @@ warn by default: policy :policy:`CMP0066`. * ``CMAKE_POLICY_WARNING_CMP0067`` controls the warning for policy :policy:`CMP0067`. +* ``CMAKE_POLICY_WARNING_CMP0082`` controls the warning for + policy :policy:`CMP0082`. This variable should not be set by a project in CMake code. Project developers running CMake may set this variable in their cache to diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 3cf6c8f871a..5e2758adfa2 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -260,6 +260,8 @@ set(SRCS cmInstallFilesGenerator.cxx cmInstallScriptGenerator.h cmInstallScriptGenerator.cxx + cmInstallSubdirectoryGenerator.h + cmInstallSubdirectoryGenerator.cxx cmInstallTargetGenerator.h cmInstallTargetGenerator.cxx cmInstallDirectoryGenerator.h diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 53ac71622d2..2b236584a43 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -22,6 +22,19 @@ cmInstallGenerator::~cmInstallGenerator() { } +bool cmInstallGenerator::HaveInstall() +{ + return true; +} + +void cmInstallGenerator::CheckCMP0082(bool& haveSubdirectoryInstall, + bool& haveInstallAfterSubdirectory) +{ + if (haveSubdirectoryInstall) { + haveInstallAfterSubdirectory = true; + } +} + void cmInstallGenerator::AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector const& files, bool optional /* = false */, diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index fc1ce864f77..e5b88c3858b 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -38,6 +38,10 @@ class cmInstallGenerator : public cmScriptGenerator bool exclude_from_all); ~cmInstallGenerator() override; + virtual bool HaveInstall(); + virtual void CheckCMP0082(bool& haveSubdirectoryInstall, + bool& haveInstallAfterSubdirectory); + void AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector const& files, bool optional = false, diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index 3a90f4c8d7c..1d7784efb86 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -37,9 +37,9 @@ void cmInstallScriptGenerator::AddScriptInstallRule(std::ostream& os, std::string const& script) { if (this->Code) { - os << indent.Next() << script << "\n"; + os << indent << script << "\n"; } else { - os << indent.Next() << "include(\"" << script << "\")\n"; + os << indent << "include(\"" << script << "\")\n"; } } diff --git a/Source/cmInstallSubdirectoryGenerator.cxx b/Source/cmInstallSubdirectoryGenerator.cxx new file mode 100644 index 00000000000..ca9f13454c4 --- /dev/null +++ b/Source/cmInstallSubdirectoryGenerator.cxx @@ -0,0 +1,77 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmInstallSubdirectoryGenerator.h" + +#include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmScriptGenerator.h" +#include "cmSystemTools.h" + +#include +#include + +cmInstallSubdirectoryGenerator::cmInstallSubdirectoryGenerator( + cmMakefile* makefile, const char* binaryDirectory, bool excludeFromAll) + : cmInstallGenerator(nullptr, std::vector(), nullptr, + MessageDefault, excludeFromAll) + , Makefile(makefile) + , BinaryDirectory(binaryDirectory) +{ +} + +cmInstallSubdirectoryGenerator::~cmInstallSubdirectoryGenerator() +{ +} + +bool cmInstallSubdirectoryGenerator::HaveInstall() +{ + for (auto generator : this->Makefile->GetInstallGenerators()) { + if (generator->HaveInstall()) { + return true; + } + } + + return false; +} + +void cmInstallSubdirectoryGenerator::CheckCMP0082( + bool& haveSubdirectoryInstall, bool& /*unused*/) +{ + if (this->HaveInstall()) { + haveSubdirectoryInstall = true; + } +} + +void cmInstallSubdirectoryGenerator::Compute(cmLocalGenerator* lg) +{ + this->LocalGenerator = lg; +} + +void cmInstallSubdirectoryGenerator::GenerateScript(std::ostream& os) +{ + if (!this->ExcludeFromAll) { + cmPolicies::PolicyStatus status = + this->LocalGenerator->GetPolicyStatus(cmPolicies::CMP0082); + switch (status) { + case cmPolicies::WARN: + case cmPolicies::OLD: + // OLD behavior is handled in cmLocalGenerator::GenerateInstallRules() + break; + + case cmPolicies::NEW: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: { + Indent indent; + std::string odir = this->BinaryDirectory; + cmSystemTools::ConvertToUnixSlashes(odir); + os << indent << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n" + << indent.Next() + << "# Include the install script for the subdirectory.\n" + << indent.Next() << "include(\"" << odir + << "/cmake_install.cmake\")\n" + << indent << "endif()\n\n"; + } break; + } + } +} diff --git a/Source/cmInstallSubdirectoryGenerator.h b/Source/cmInstallSubdirectoryGenerator.h new file mode 100644 index 00000000000..35471dda053 --- /dev/null +++ b/Source/cmInstallSubdirectoryGenerator.h @@ -0,0 +1,41 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmInstallSubdirectoryGenerator_h +#define cmInstallSubdirectoryGenerator_h + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cmInstallGenerator.h" + +#include +#include + +class cmLocalGenerator; +class cmMakefile; + +/** \class cmInstallSubdirectoryGenerator + * \brief Generate target installation rules. + */ +class cmInstallSubdirectoryGenerator : public cmInstallGenerator +{ +public: + cmInstallSubdirectoryGenerator(cmMakefile* makefile, + const char* binaryDirectory, + bool excludeFromAll); + ~cmInstallSubdirectoryGenerator() override; + + bool HaveInstall() override; + void CheckCMP0082(bool& haveSubdirectoryInstall, + bool& haveInstallAfterSubdirectory) override; + + void Compute(cmLocalGenerator* lg) override; + +protected: + void GenerateScript(std::ostream& os) override; + + cmMakefile* Makefile; + std::string BinaryDirectory; + cmLocalGenerator* LocalGenerator; +}; + +#endif diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 70307252e20..21b029ed1ea 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -517,31 +517,62 @@ void cmLocalGenerator::GenerateInstallRules() } // Ask each install generator to write its code. + cmPolicies::PolicyStatus status = this->GetPolicyStatus(cmPolicies::CMP0082); std::vector const& installers = this->Makefile->GetInstallGenerators(); - for (cmInstallGenerator* installer : installers) { - installer->Generate(fout, config, configurationTypes); + bool haveSubdirectoryInstall = false; + bool haveInstallAfterSubdirectory = false; + if (status == cmPolicies::WARN) { + for (cmInstallGenerator* installer : installers) { + installer->CheckCMP0082(haveSubdirectoryInstall, + haveInstallAfterSubdirectory); + installer->Generate(fout, config, configurationTypes); + } + } else { + for (cmInstallGenerator* installer : installers) { + installer->Generate(fout, config, configurationTypes); + } } // Write rules from old-style specification stored in targets. this->GenerateTargetInstallRules(fout, config, configurationTypes); // Include install scripts from subdirectories. - std::vector children = - this->Makefile->GetStateSnapshot().GetChildren(); - if (!children.empty()) { - fout << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n"; - fout << " # Include the install script for each subdirectory.\n"; - for (cmStateSnapshot const& c : children) { - if (!c.GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) { - std::string odir = c.GetDirectory().GetCurrentBinary(); - cmSystemTools::ConvertToUnixSlashes(odir); - fout << " include(\"" << odir << "/cmake_install.cmake\")" - << std::endl; + switch (status) { + case cmPolicies::WARN: + if (haveInstallAfterSubdirectory && + this->Makefile->PolicyOptionalWarningEnabled( + "CMAKE_POLICY_WARNING_CMP0082")) { + std::ostringstream e; + e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0082) << "\n"; + this->IssueMessage(cmake::AUTHOR_WARNING, e.str()); } - } - fout << "\n"; - fout << "endif()\n\n"; + CM_FALLTHROUGH; + case cmPolicies::OLD: { + std::vector children = + this->Makefile->GetStateSnapshot().GetChildren(); + if (!children.empty()) { + fout << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n"; + fout << " # Include the install script for each subdirectory.\n"; + for (cmStateSnapshot const& c : children) { + if (!c.GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) { + std::string odir = c.GetDirectory().GetCurrentBinary(); + cmSystemTools::ConvertToUnixSlashes(odir); + fout << " include(\"" << odir << "/cmake_install.cmake\")" + << std::endl; + } + } + fout << "\n"; + fout << "endif()\n\n"; + } + } break; + + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + // NEW behavior is handled in + // cmInstallSubdirectoryGenerator::GenerateScript() + break; } // Record the install manifest. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8d163b77d9d..0a69d0930ff 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -28,6 +28,7 @@ #include "cmGeneratorExpressionEvaluationFile.h" #include "cmGlobalGenerator.h" #include "cmInstallGenerator.h" // IWYU pragma: keep +#include "cmInstallSubdirectoryGenerator.h" #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" @@ -1669,6 +1670,9 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, } else { this->UnConfiguredDirectories.push_back(subMf); } + + this->AddInstallGenerator(new cmInstallSubdirectoryGenerator( + subMf, binPath.c_str(), excludeFromAll)); } const std::string& cmMakefile::GetCurrentSourceDirectory() const diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a367e47ddd5..a469f1ecf41 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -240,7 +240,11 @@ class cmMakefile; cmPolicies::WARN) \ SELECT(POLICY, CMP0081, \ "Relative paths not allowed in LINK_DIRECTORIES target property.", \ - 3, 13, 0, cmPolicies::WARN) + 3, 13, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0082, \ + "Install rules from add_subdirectory() are interleaved with those " \ + "in caller.", \ + 3, 14, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ diff --git a/bootstrap b/bootstrap index 416a3d67809..6710d1a0724 100755 --- a/bootstrap +++ b/bootstrap @@ -348,6 +348,7 @@ CMAKE_CXX_SOURCES="\ cmInstallFilesGenerator \ cmInstallGenerator \ cmInstallScriptGenerator \ + cmInstallSubdirectoryGenerator \ cmInstallTargetGenerator \ cmInstallTargetsCommand \ cmInstalledFile \ From b56f2db87aebd34bfaf24439d56632aa3f3019f8 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 3 Oct 2018 11:49:18 -0400 Subject: [PATCH 027/907] Testing: Add test for CMP0082 --- .../CMP0082-ExcludeFromAll/CMakeLists.txt | 1 + .../CMP0082-NEW-install-component-stdout.txt | 4 ++++ .../CMP0082-NEW-install-stdout.txt | 3 +++ .../add_subdirectory/CMP0082-NEW.cmake | 3 +++ .../CMP0082-Nested/CMakeLists.txt | 1 + .../CMP0082-Nested/sub/CMakeLists.txt | 1 + .../CMP0082-NestedSub/CMakeLists.txt | 2 ++ .../CMP0082-NestedSub/sub/CMakeLists.txt | 1 + .../CMP0082-None/CMakeLists.txt | 0 .../CMP0082-OLD-install-component-stdout.txt | 4 ++++ .../CMP0082-OLD-install-stdout.txt | 3 +++ .../add_subdirectory/CMP0082-OLD.cmake | 3 +++ ...2-WARN-Nested-install-component-stdout.txt | 4 ++++ .../CMP0082-WARN-Nested-install-stdout.txt | 3 +++ .../CMP0082-WARN-Nested-stderr.txt | 7 ++++++ .../CMP0082-WARN-Nested.cmake | 2 ++ ...ARN-NestedSub-install-component-stdout.txt | 4 ++++ .../CMP0082-WARN-NestedSub-install-stdout.txt | 3 +++ .../CMP0082-WARN-NestedSub-stderr.txt | 7 ++++++ .../CMP0082-WARN-NestedSub.cmake | 1 + ...-NoTopInstall-install-component-stdout.txt | 3 +++ ...P0082-WARN-NoTopInstall-install-stdout.txt | 2 ++ .../CMP0082-WARN-NoTopInstall.cmake | 1 + ...082-WARN-None-install-component-stdout.txt | 3 +++ .../CMP0082-WARN-None-install-stdout.txt | 2 ++ .../add_subdirectory/CMP0082-WARN-None.cmake | 2 ++ .../CMP0082-WARN-install-component-stdout.txt | 4 ++++ .../CMP0082-WARN-install-stdout.txt | 3 +++ .../add_subdirectory/CMP0082-WARN-stderr.txt | 7 ++++++ .../add_subdirectory/CMP0082-WARN.cmake | 3 +++ .../add_subdirectory/CMP0082/CMakeLists.txt | 1 + .../RunCMake/add_subdirectory/CMakeLists.txt | 7 ++++++ .../add_subdirectory/DoesNotExist-stderr.txt | 2 +- .../add_subdirectory/Missing-stderr.txt | 2 +- .../add_subdirectory/RunCMakeTest.cmake | 22 +++++++++++++++++++ 35 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake create mode 100644 Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt new file mode 100644 index 00000000000..1bd7f495bf6 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"exclude\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt new file mode 100644 index 00000000000..7d76ed959c2 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- sub +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt new file mode 100644 index 00000000000..35b0bb5e14f --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- sub +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake new file mode 100644 index 00000000000..56c1b81f79d --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake @@ -0,0 +1,3 @@ +add_subdirectory(CMP0082) +add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt new file mode 100644 index 00000000000..8f26c248e5b --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sub) diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt new file mode 100644 index 00000000000..91a8936dc3e --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"sub\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt new file mode 100644 index 00000000000..52a0665048b --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(sub) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt new file mode 100644 index 00000000000..91a8936dc3e --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"sub\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt new file mode 100644 index 00000000000..4b39789f764 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt new file mode 100644 index 00000000000..8f3a5f71d51 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake new file mode 100644 index 00000000000..56c1b81f79d --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake @@ -0,0 +1,3 @@ +add_subdirectory(CMP0082) +add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt new file mode 100644 index 00000000000..4b39789f764 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt new file mode 100644 index 00000000000..8f3a5f71d51 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt new file mode 100644 index 00000000000..3624c43a4bd --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt @@ -0,0 +1,7 @@ +CMake Warning \(dev\) in CMakeLists\.txt: + Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are + interleaved with those in caller\. Run "cmake --help-policy CMP0082" for + policy details\. Use the cmake_policy command to set the policy and + suppress this warning\. + +This warning is for project developers\. Use -Wno-dev to suppress it\. diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake new file mode 100644 index 00000000000..df5688af369 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake @@ -0,0 +1,2 @@ +add_subdirectory(CMP0082-Nested) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt new file mode 100644 index 00000000000..4b39789f764 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt new file mode 100644 index 00000000000..8f3a5f71d51 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt new file mode 100644 index 00000000000..93629053bb6 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt @@ -0,0 +1,7 @@ +CMake Warning \(dev\) in CMP0082-NestedSub/CMakeLists\.txt: + Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are + interleaved with those in caller\. Run "cmake --help-policy CMP0082" for + policy details\. Use the cmake_policy command to set the policy and + suppress this warning\. + +This warning is for project developers\. Use -Wno-dev to suppress it\. diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake new file mode 100644 index 00000000000..88a0856a6b2 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake @@ -0,0 +1 @@ +add_subdirectory(CMP0082-NestedSub) diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt new file mode 100644 index 00000000000..f7a331df2b5 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt new file mode 100644 index 00000000000..6f22ae24dd5 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt @@ -0,0 +1,2 @@ +^-- Install configuration: "[^\n]*" +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake new file mode 100644 index 00000000000..70bc9edf192 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake @@ -0,0 +1 @@ +add_subdirectory(CMP0082) diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt new file mode 100644 index 00000000000..157ab37e2c9 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt new file mode 100644 index 00000000000..9e15872bd97 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt @@ -0,0 +1,2 @@ +^-- Install configuration: "[^\n]*" +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake new file mode 100644 index 00000000000..670f89b04a3 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake @@ -0,0 +1,2 @@ +add_subdirectory(CMP0082-None) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt new file mode 100644 index 00000000000..4b39789f764 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt new file mode 100644 index 00000000000..8f3a5f71d51 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt new file mode 100644 index 00000000000..3624c43a4bd --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt @@ -0,0 +1,7 @@ +CMake Warning \(dev\) in CMakeLists\.txt: + Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are + interleaved with those in caller\. Run "cmake --help-policy CMP0082" for + policy details\. Use the cmake_policy command to set the policy and + suppress this warning\. + +This warning is for project developers\. Use -Wno-dev to suppress it\. diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake new file mode 100644 index 00000000000..56c1b81f79d --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake @@ -0,0 +1,3 @@ +add_subdirectory(CMP0082) +add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt new file mode 100644 index 00000000000..91a8936dc3e --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"sub\")") diff --git a/Tests/RunCMake/add_subdirectory/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMakeLists.txt index 18dfd2686f6..47d249cce03 100644 --- a/Tests/RunCMake/add_subdirectory/CMakeLists.txt +++ b/Tests/RunCMake/add_subdirectory/CMakeLists.txt @@ -1,3 +1,10 @@ cmake_minimum_required(VERSION 3.2) + +# Have to set policy here due to policy scope +if(DEFINED CMP0082_VALUE) + cmake_policy(SET CMP0082 "${CMP0082_VALUE}") +endif() +set(CMAKE_POLICY_WARNING_CMP0082 ON) + project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt index 369a956e610..01305811134 100644 --- a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt +++ b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt @@ -2,4 +2,4 @@ add_subdirectory given source "DoesNotExist" which is not an existing directory. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt index aba06755a17..dd831406ebb 100644 --- a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt +++ b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt @@ -5,4 +5,4 @@ does not contain a CMakeLists.txt file. Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake index 88b92830857..343e65b59e5 100644 --- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake @@ -4,6 +4,28 @@ run_cmake(DoesNotExist) run_cmake(Missing) run_cmake(Function) +macro(run_cmake_install case) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS ${ARGN}) + + run_cmake(${case}) + run_cmake_command(${case}-install ${CMAKE_COMMAND} -P cmake_install.cmake) + run_cmake_command(${case}-install-component ${CMAKE_COMMAND} -DCOMPONENT=Unspecified -P cmake_install.cmake) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) +endmacro() + +run_cmake_install(CMP0082-WARN) +run_cmake_install(CMP0082-WARN-Nested) +run_cmake_install(CMP0082-WARN-NestedSub) +run_cmake_install(CMP0082-WARN-None) +run_cmake_install(CMP0082-WARN-NoTopInstall) +run_cmake_install(CMP0082-OLD -DCMP0082_VALUE=OLD) +run_cmake_install(CMP0082-NEW -DCMP0082_VALUE=NEW) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ExcludeFromAll-build) set(RunCMake_TEST_NO_CLEAN 1) From f9f96598df3164cf12b6da7764bc74361e3fa414 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 10 Oct 2018 10:55:40 -0400 Subject: [PATCH 028/907] Help: Convert FindOpenGL documentation to block comment --- Modules/FindOpenGL.cmake | 239 ++++++++++++++++++++------------------- 1 file changed, 120 insertions(+), 119 deletions(-) diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 4d0786cd2fc..16c794b52cb 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -1,125 +1,126 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -#.rst: -# FindOpenGL -# ---------- -# -# FindModule for OpenGL and GLU. -# -# Optional COMPONENTS -# ^^^^^^^^^^^^^^^^^^^ -# -# This module respects several optional COMPONENTS: ``EGL``, ``GLX``, and -# ``OpenGL``. There are corresponding import targets for each of these flags. -# -# IMPORTED Targets -# ^^^^^^^^^^^^^^^^ -# -# This module defines the :prop_tgt:`IMPORTED` targets: -# -# ``OpenGL::GL`` -# Defined to the platform-specific OpenGL libraries if the system has OpenGL. -# ``OpenGL::OpenGL`` -# Defined to libOpenGL if the system is GLVND-based. -# ``OpenGL::GLU`` -# Defined if the system has GLU. -# ``OpenGL::GLX`` -# Defined if the system has GLX. -# ``OpenGL::EGL`` -# Defined if the system has EGL. -# -# Result Variables -# ^^^^^^^^^^^^^^^^ -# -# This module sets the following variables: -# -# ``OPENGL_FOUND`` -# True, if the system has OpenGL and all components are found. -# ``OPENGL_XMESA_FOUND`` -# True, if the system has XMESA. -# ``OPENGL_GLU_FOUND`` -# True, if the system has GLU. -# ``OpenGL_OpenGL_FOUND`` -# True, if the system has an OpenGL library. -# ``OpenGL_GLX_FOUND`` -# True, if the system has GLX. -# ``OpenGL_EGL_FOUND`` -# True, if the system has EGL. -# ``OPENGL_INCLUDE_DIR`` -# Path to the OpenGL include directory. -# ``OPENGL_EGL_INCLUDE_DIRS`` -# Path to the EGL include directory. -# ``OPENGL_LIBRARIES`` -# Paths to the OpenGL library, windowing system libraries, and GLU libraries. -# On Linux, this assumes GLX and is never correct for EGL-based targets. -# Clients are encouraged to use the ``OpenGL::*`` import targets instead. -# -# Cache variables -# ^^^^^^^^^^^^^^^ -# -# The following cache variables may also be set: -# -# ``OPENGL_egl_LIBRARY`` -# Path to the EGL library. -# ``OPENGL_glu_LIBRARY`` -# Path to the GLU library. -# ``OPENGL_glx_LIBRARY`` -# Path to the GLVND 'GLX' library. -# ``OPENGL_opengl_LIBRARY`` -# Path to the GLVND 'OpenGL' library -# ``OPENGL_gl_LIBRARY`` -# Path to the OpenGL library. New code should prefer the ``OpenGL::*`` import -# targets. -# -# Linux-specific -# ^^^^^^^^^^^^^^ -# -# Some Linux systems utilize GLVND as a new ABI for OpenGL. GLVND separates -# context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and -# contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way -# to get OpenGL 3+ functionality via EGL in a manner portable across vendors. -# Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either -# ``OpenGL::GLX`` or ``OpenGL::EGL``. -# -# Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable) -# to use legacy GL interfaces. These will use the legacy GL library located -# by ``OPENGL_gl_LIBRARY``, if available. If ``OPENGL_gl_LIBRARY`` is empty or -# not found and GLVND is available, the ``OpenGL::GL`` target will use GLVND -# ``OpenGL::OpenGL`` and ``OpenGL::GLX`` (and the ``OPENGL_LIBRARIES`` -# variable will use the corresponding libraries). Thus, for non-EGL-based -# Linux targets, the ``OpenGL::GL`` target is most portable. -# -# A ``OpenGL_GL_PREFERENCE`` variable may be set to specify the preferred way -# to provide legacy GL interfaces in case multiple choices are available. -# The value may be one of: -# -# ``GLVND`` -# If the GLVND OpenGL and GLX libraries are available, prefer them. -# This forces ``OPENGL_gl_LIBRARY`` to be empty. -# This is the default if components were requested (since components -# correspond to GLVND libraries) or if policy :policy:`CMP0072` is -# set to ``NEW``. -# -# ``LEGACY`` -# Prefer to use the legacy libGL library, if available. -# This is the default if no components were requested and -# policy :policy:`CMP0072` is not set to ``NEW``. -# -# For EGL targets the client must rely on GLVND support on the user's system. -# Linking should use the ``OpenGL::OpenGL OpenGL::EGL`` targets. Using GLES* -# libraries is theoretically possible in place of ``OpenGL::OpenGL``, but this -# module does not currently support that; contributions welcome. -# -# ``OPENGL_egl_LIBRARY`` and ``OPENGL_EGL_INCLUDE_DIRS`` are defined in the case of -# GLVND. For non-GLVND Linux and other systems these are left undefined. -# -# macOS-Specific -# ^^^^^^^^^^^^^^ -# -# On OSX FindOpenGL defaults to using the framework version of OpenGL. People -# will have to change the cache values of OPENGL_glu_LIBRARY and -# OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX. +#[=======================================================================[.rst: +FindOpenGL +---------- + +FindModule for OpenGL and GLU. + +Optional COMPONENTS +^^^^^^^^^^^^^^^^^^^ + +This module respects several optional COMPONENTS: ``EGL``, ``GLX``, and +``OpenGL``. There are corresponding import targets for each of these flags. + +IMPORTED Targets +^^^^^^^^^^^^^^^^ + +This module defines the :prop_tgt:`IMPORTED` targets: + +``OpenGL::GL`` + Defined to the platform-specific OpenGL libraries if the system has OpenGL. +``OpenGL::OpenGL`` + Defined to libOpenGL if the system is GLVND-based. +``OpenGL::GLU`` + Defined if the system has GLU. +``OpenGL::GLX`` + Defined if the system has GLX. +``OpenGL::EGL`` + Defined if the system has EGL. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module sets the following variables: + +``OPENGL_FOUND`` + True, if the system has OpenGL and all components are found. +``OPENGL_XMESA_FOUND`` + True, if the system has XMESA. +``OPENGL_GLU_FOUND`` + True, if the system has GLU. +``OpenGL_OpenGL_FOUND`` + True, if the system has an OpenGL library. +``OpenGL_GLX_FOUND`` + True, if the system has GLX. +``OpenGL_EGL_FOUND`` + True, if the system has EGL. +``OPENGL_INCLUDE_DIR`` + Path to the OpenGL include directory. +``OPENGL_EGL_INCLUDE_DIRS`` + Path to the EGL include directory. +``OPENGL_LIBRARIES`` + Paths to the OpenGL library, windowing system libraries, and GLU libraries. + On Linux, this assumes GLX and is never correct for EGL-based targets. + Clients are encouraged to use the ``OpenGL::*`` import targets instead. + +Cache variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``OPENGL_egl_LIBRARY`` + Path to the EGL library. +``OPENGL_glu_LIBRARY`` + Path to the GLU library. +``OPENGL_glx_LIBRARY`` + Path to the GLVND 'GLX' library. +``OPENGL_opengl_LIBRARY`` + Path to the GLVND 'OpenGL' library +``OPENGL_gl_LIBRARY`` + Path to the OpenGL library. New code should prefer the ``OpenGL::*`` import + targets. + +Linux-specific +^^^^^^^^^^^^^^ + +Some Linux systems utilize GLVND as a new ABI for OpenGL. GLVND separates +context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and +contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way +to get OpenGL 3+ functionality via EGL in a manner portable across vendors. +Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either +``OpenGL::GLX`` or ``OpenGL::EGL``. + +Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable) +to use legacy GL interfaces. These will use the legacy GL library located +by ``OPENGL_gl_LIBRARY``, if available. If ``OPENGL_gl_LIBRARY`` is empty or +not found and GLVND is available, the ``OpenGL::GL`` target will use GLVND +``OpenGL::OpenGL`` and ``OpenGL::GLX`` (and the ``OPENGL_LIBRARIES`` +variable will use the corresponding libraries). Thus, for non-EGL-based +Linux targets, the ``OpenGL::GL`` target is most portable. + +A ``OpenGL_GL_PREFERENCE`` variable may be set to specify the preferred way +to provide legacy GL interfaces in case multiple choices are available. +The value may be one of: + +``GLVND`` + If the GLVND OpenGL and GLX libraries are available, prefer them. + This forces ``OPENGL_gl_LIBRARY`` to be empty. + This is the default if components were requested (since components + correspond to GLVND libraries) or if policy :policy:`CMP0072` is + set to ``NEW``. + +``LEGACY`` + Prefer to use the legacy libGL library, if available. + This is the default if no components were requested and + policy :policy:`CMP0072` is not set to ``NEW``. + +For EGL targets the client must rely on GLVND support on the user's system. +Linking should use the ``OpenGL::OpenGL OpenGL::EGL`` targets. Using GLES* +libraries is theoretically possible in place of ``OpenGL::OpenGL``, but this +module does not currently support that; contributions welcome. + +``OPENGL_egl_LIBRARY`` and ``OPENGL_EGL_INCLUDE_DIRS`` are defined in the case of +GLVND. For non-GLVND Linux and other systems these are left undefined. + +macOS-Specific +^^^^^^^^^^^^^^ + +On OSX FindOpenGL defaults to using the framework version of OpenGL. People +will have to change the cache values of OPENGL_glu_LIBRARY and +OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX. +#]=======================================================================] set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY) From 0d988f98e531333b32d0f1628acf86f8baa22241 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 3 Oct 2018 09:36:58 -0400 Subject: [PATCH 029/907] cmake_policy: Add undocumented GET_WARNING command This command is intended for modules that issue policy warnings so they can get the warning string from CMake in a uniform manner, rather than duplicating the string. Several modules been updated to include an example of the usage of this new command. --- Modules/BundleUtilities.cmake | 7 ++-- Modules/FindOpenGL.cmake | 6 ++-- Modules/UseSWIG.cmake | 7 ++-- Source/cmCMakePolicyCommand.cxx | 33 +++++++++++++++++++ Source/cmCMakePolicyCommand.h | 1 + Source/cmPolicies.h | 2 +- .../BundleUtilities/CMP0080-WARN-stderr.txt | 11 +++++-- .../RunCMake/UseSWIG/CMP0078-WARN-stderr.txt | 15 +++++---- 8 files changed, 57 insertions(+), 25 deletions(-) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 31db25a1a68..a7e80e796bd 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -230,11 +230,8 @@ if(DEFINED CMAKE_GENERATOR) if(_BundleUtilities_CMP0080 STREQUAL "NEW") message(FATAL_ERROR "BundleUtilities cannot be included at configure time!") elseif(NOT _BundleUtilities_CMP0080 STREQUAL "OLD") - message(AUTHOR_WARNING - "Policy CMP0080 is not set: BundleUtilities prefers not to be included at configure time. " - "Run \"cmake --help-policy CMP0080\" for policy details. " - "Use the cmake_policy command to set the policy and suppress this warning." - ) + cmake_policy(GET_WARNING CMP0080 _cmp0080_warning) + message(AUTHOR_WARNING "${_cmp0080_warning}\n") endif() endif() diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 16c794b52cb..832dca27498 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -268,11 +268,9 @@ else() endif() if(_OpenGL_GL_POLICY_WARN AND OPENGL_gl_LIBRARY AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY) + cmake_policy(GET_WARNING CMP0072 _cmp0072_warning) message(AUTHOR_WARNING - "Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when available. " - "Run \"cmake --help-policy CMP0072\" for policy details. " - "Use the cmake_policy command to set the policy and suppress this warning." - "\n" + "${_cmp0072_warning}\n" "FindOpenGL found both a legacy GL library:\n" " OPENGL_gl_LIBRARY: ${OPENGL_gl_LIBRARY}\n" "and GLVND libraries for OpenGL and GLX:\n" diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index f20a53b798c..edb829489c4 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -554,11 +554,8 @@ function(SWIG_ADD_LIBRARY name) set (UseSWIG_TARGET_NAME_PREFERENCE STANDARD) else() if (NOT target_name_policy) - message(AUTHOR_WARNING - "Policy CMP0078 is not set. " - "Run \"cmake --help-policy CMP0078\" for policy details. " - "Use the cmake_policy command to set the policy and suppress this warning." - ) + cmake_policy(GET_WARNING CMP0078 _cmp0078_warning) + message(AUTHOR_WARNING "${_cmp0078_warning}\n") endif() if (NOT DEFINED UseSWIG_TARGET_NAME_PREFERENCE) set (UseSWIG_TARGET_NAME_PREFERENCE LEGACY) diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index adf9ef80efe..3209ea548ad 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -46,6 +46,9 @@ bool cmCMakePolicyCommand::InitialPass(std::vector const& args, if (args[0] == "VERSION") { return this->HandleVersionMode(args); } + if (args[0] == "GET_WARNING") { + return this->HandleGetWarningMode(args); + } std::ostringstream e; e << "given unknown first argument \"" << args[0] << "\""; @@ -181,3 +184,33 @@ bool cmCMakePolicyCommand::HandleVersionMode( this->Makefile->SetPolicyVersion(version_min, version_max); return true; } + +bool cmCMakePolicyCommand::HandleGetWarningMode( + std::vector const& args) +{ + if (args.size() != 3) { + this->SetError( + "GET_WARNING must be given exactly 2 additional arguments."); + return false; + } + + // Get arguments. + std::string const& id = args[1]; + std::string const& var = args[2]; + + // Lookup the policy number. + cmPolicies::PolicyID pid; + if (!cmPolicies::GetPolicyID(id.c_str(), pid)) { + std::ostringstream e; + e << "GET_WARNING given policy \"" << id + << "\" which is not known to this version of CMake."; + this->SetError(e.str()); + return false; + } + + // Lookup the policy warning. + this->Makefile->AddDefinition(var, + cmPolicies::GetPolicyWarning(pid).c_str()); + + return true; +} diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h index b18576c67f7..cca14061731 100644 --- a/Source/cmCMakePolicyCommand.h +++ b/Source/cmCMakePolicyCommand.h @@ -37,6 +37,7 @@ class cmCMakePolicyCommand : public cmCommand bool HandleSetMode(std::vector const& args); bool HandleGetMode(std::vector const& args); bool HandleVersionMode(std::vector const& args); + bool HandleGetWarningMode(std::vector const& args); }; #endif diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a367e47ddd5..551cba17fae 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -236,7 +236,7 @@ class cmMakefile; "target_link_libraries allows use with targets in other directories.", 3, \ 13, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0080, \ - "BundleUtilities cannot be included at configure time", 3, 13, 0, \ + "BundleUtilities cannot be included at configure time.", 3, 13, 0, \ cmPolicies::WARN) \ SELECT(POLICY, CMP0081, \ "Relative paths not allowed in LINK_DIRECTORIES target property.", \ diff --git a/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt b/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt index a1a0e8fe4d3..460bbaede3d 100644 --- a/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt +++ b/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt @@ -1,4 +1,9 @@ CMake Warning \(dev\) at .*/Modules/BundleUtilities\.cmake:[0-9]+ \(message\): - Policy CMP0080 is not set: BundleUtilities prefers not to be included at - configure time\. Run "cmake --help-policy CMP0080" for policy details\. Use - the cmake_policy command to set the policy and suppress this warning\. + Policy CMP0080 is not set: BundleUtilities cannot be included at configure + time\. Run "cmake --help-policy CMP0080" for policy details\. Use the + cmake_policy command to set the policy and suppress this warning\. + +Call Stack \(most recent call first\): + CMP0080-WARN\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. diff --git a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt index bc8da4c290d..f0ed577599f 100644 --- a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt +++ b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt @@ -1,9 +1,10 @@ -CMake Warning \(dev\) at .*/Modules/UseSWIG.cmake:[0-9]+ \(message\): - Policy CMP0078 is not set. Run "cmake --help-policy CMP0078" for policy - details. Use the cmake_policy command to set the policy and suppress this - warning. +CMake Warning \(dev\) at .*/Modules/UseSWIG\.cmake:[0-9]+ \(message\): + Policy CMP0078 is not set: UseSWIG generates standard target names\. Run + "cmake --help-policy CMP0078" for policy details\. Use the cmake_policy + command to set the policy and suppress this warning\. + Call Stack \(most recent call first\): - CMP0078-common.cmake:6 \(swig_add_library\) - CMP0078-WARN.cmake:1 \(include\) - CMakeLists.txt:3 \(include\) + CMP0078-common\.cmake:6 \(swig_add_library\) + CMP0078-WARN\.cmake:1 \(include\) + CMakeLists\.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it.$ From 8563e29c81c23b758350ba1716ef3c6213b8c615 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 11 Oct 2018 00:01:09 -0400 Subject: [PATCH 030/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6a2cb16a03a..4d3e783565a 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181010) +set(CMake_VERSION_PATCH 20181011) #set(CMake_VERSION_RC 1) From 3b80cd77fb3e1d0ee6a77a590830e7dc620df1a5 Mon Sep 17 00:00:00 2001 From: Harald Brinkmann Date: Tue, 9 Oct 2018 08:18:29 +0200 Subject: [PATCH 031/907] Fail the build if cppcheck returns a non-zero exit code This allows the build failure to be tuned with cppcheck's options --error-exitcode= and --exitcode-suppressions=. --- Help/prop_tgt/LANG_CPPCHECK.rst | 4 +++- Help/release/dev/cppcheck-exit-code.rst | 6 ++++++ Source/cmcmd.cxx | 10 +++++++--- .../RunCMake/Cppcheck/C-bad-Build-result.txt | 2 +- .../Cppcheck/C-error-Build-result.txt | 1 + .../Cppcheck/C-error-Build-stdout.txt | 1 + Tests/RunCMake/Cppcheck/C-error.cmake | 3 +++ Tests/RunCMake/Cppcheck/RunCMakeTest.cmake | 1 + Tests/RunCMake/pseudo_cppcheck.c | 19 +++++++++++-------- 9 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 Help/release/dev/cppcheck-exit-code.rst create mode 100644 Tests/RunCMake/Cppcheck/C-error-Build-result.txt create mode 100644 Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt create mode 100644 Tests/RunCMake/Cppcheck/C-error.cmake diff --git a/Help/prop_tgt/LANG_CPPCHECK.rst b/Help/prop_tgt/LANG_CPPCHECK.rst index 5f8be00f1b0..16b0f482981 100644 --- a/Help/prop_tgt/LANG_CPPCHECK.rst +++ b/Help/prop_tgt/LANG_CPPCHECK.rst @@ -6,7 +6,9 @@ This property is supported only when ```` is ``C`` or ``CXX``. Specify a :ref:`;-list ` containing a command line for the ``cppcheck`` static analysis tool. The :ref:`Makefile Generators` and the :generator:`Ninja` generator will run ``cppcheck`` along with the -compiler and report any problems. +compiler and report any problems. If the command-line specifies the +exit code options to ``cppcheck`` then the build will fail if the +tool returns non-zero. This property is initialized by the value of the :variable:`CMAKE__CPPCHECK` variable if it is set when a target is diff --git a/Help/release/dev/cppcheck-exit-code.rst b/Help/release/dev/cppcheck-exit-code.rst new file mode 100644 index 00000000000..d66c762fb21 --- /dev/null +++ b/Help/release/dev/cppcheck-exit-code.rst @@ -0,0 +1,6 @@ +cppcheck-exit-code +------------------ + +* When using cppcheck via the :variable:`CMAKE__CPPCHECK` variable + or :prop_tgt:`_CPPCHECK` property, the build will now fail if + ``cppcheck`` returns non-zero as configured by its command-line options. diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 1d2f741d80d..e2225ff339e 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -323,11 +323,15 @@ static int HandleCppCheck(const std::string& runCmd, stdErr.find("(performance)") != std::string::npos || stdErr.find("(portability)") != std::string::npos || stdErr.find("(information)") != std::string::npos) { - std::cerr << "Warning: cppcheck reported diagnostics:\n"; + if (ret == 0) { + std::cerr << "Warning: cppcheck reported diagnostics:\n"; + } else { + std::cerr << "Error: cppcheck reported failure:\n"; + } } std::cerr << stdErr; - // ignore errors so build continues - return 0; + + return ret; } typedef int (*CoCompileHandler)(const std::string&, const std::string&, diff --git a/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt b/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt index 573541ac970..d197c913c2b 100644 --- a/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt +++ b/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt @@ -1 +1 @@ -0 +[^0] diff --git a/Tests/RunCMake/Cppcheck/C-error-Build-result.txt b/Tests/RunCMake/Cppcheck/C-error-Build-result.txt new file mode 100644 index 00000000000..d197c913c2b --- /dev/null +++ b/Tests/RunCMake/Cppcheck/C-error-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt b/Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt new file mode 100644 index 00000000000..4a24c0ccd5d --- /dev/null +++ b/Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt @@ -0,0 +1 @@ +.*Error: cppcheck reported failure.*error.*warning.*style.*performance.*information.* diff --git a/Tests/RunCMake/Cppcheck/C-error.cmake b/Tests/RunCMake/Cppcheck/C-error.cmake new file mode 100644 index 00000000000..2254d7511f6 --- /dev/null +++ b/Tests/RunCMake/Cppcheck/C-error.cmake @@ -0,0 +1,3 @@ +enable_language(C) +set(CMAKE_C_CPPCHECK "${PSEUDO_CPPCHECK}" -error) +add_executable(main main.c) diff --git a/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake b/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake index 5fd4ead139e..e395f369698 100644 --- a/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake +++ b/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake @@ -15,6 +15,7 @@ endfunction() run_cppcheck(C) run_cppcheck(CXX) +run_cppcheck(C-error) run_cppcheck(C-bad) if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") diff --git a/Tests/RunCMake/pseudo_cppcheck.c b/Tests/RunCMake/pseudo_cppcheck.c index 75f3cec185c..5b1531bb46f 100644 --- a/Tests/RunCMake/pseudo_cppcheck.c +++ b/Tests/RunCMake/pseudo_cppcheck.c @@ -5,13 +5,16 @@ int main(int argc, char* argv[]) { int i; + int result = 0; for (i = 1; i < argc; ++i) { - if (strcmp(argv[i], "-bad") == 0) - if (strcmp(argv[i], "-bad") == 0) { - fprintf(stdout, "stdout from bad command line arg '-bad'\n"); - fprintf(stderr, "stderr from bad command line arg '-bad'\n"); - return 1; - } + if (strcmp(argv[i], "-bad") == 0) { + fprintf(stdout, "stdout from bad command line arg '-bad'\n"); + fprintf(stderr, "stderr from bad command line arg '-bad'\n"); + return 1; + } else if (strcmp(argv[i], "-error") == 0) { + // The real cppcheck allows to set the exitcode with --error-exitcode + result = 5; + } } fprintf(stderr, "[/foo/bar.c:2]: (error) Array 'abc[10]' accessed at index 12," @@ -31,6 +34,6 @@ int main(int argc, char* argv[]) fprintf(stderr, "[/foo/bar.c:2]: (information) cannot find all the include " "files (use --check-config for details)\n"); - // we allow this to return 1 as we ignore it - return 1; + + return result; } From f76047f34a960272ca29518551fb23504c61ee7e Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 27 Sep 2018 09:41:02 +0200 Subject: [PATCH 032/907] FindLibinput: Add module to find libinput This module is inspired by one from KDE's KWin. --- Copyright.txt | 2 + Help/manual/cmake-modules.7.rst | 1 + Help/module/FindLibinput.rst | 1 + Help/release/dev/find_libinput.rst | 6 ++ Modules/FindLibinput.cmake | 83 ++++++++++++++++++++++++++ Tests/CMakeLists.txt | 4 ++ Tests/FindLibinput/CMakeLists.txt | 10 ++++ Tests/FindLibinput/Test/CMakeLists.txt | 14 +++++ Tests/FindLibinput/Test/main.c | 13 ++++ 9 files changed, 134 insertions(+) create mode 100644 Help/module/FindLibinput.rst create mode 100644 Help/release/dev/find_libinput.rst create mode 100644 Modules/FindLibinput.cmake create mode 100644 Tests/FindLibinput/CMakeLists.txt create mode 100644 Tests/FindLibinput/Test/CMakeLists.txt create mode 100644 Tests/FindLibinput/Test/main.c diff --git a/Copyright.txt b/Copyright.txt index 743c63418e3..0b0fbf1cc8e 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -39,6 +39,7 @@ The following individuals and institutions are among the Contributors: * Alexander Neundorf * Alexander Smorkalov * Alexey Sokolov +* Alex Merry * Alex Turbov * Andreas Pakulat * Andreas Schneider @@ -65,6 +66,7 @@ The following individuals and institutions are among the Contributors: * Kelly Thompson * Konstantin Podsvirov * Mario Bensi +* Martin Gräßlin * Mathieu Malaterre * Matthaeus G. Chajdas * Matthias Kretz diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index af8e33f0444..f9b4afb3806 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -165,6 +165,7 @@ They are normally called through the :command:`find_package` command. /module/FindLAPACK /module/FindLATEX /module/FindLibArchive + /module/FindLibinput /module/FindLibLZMA /module/FindLibXml2 /module/FindLibXslt diff --git a/Help/module/FindLibinput.rst b/Help/module/FindLibinput.rst new file mode 100644 index 00000000000..a8ca0b02452 --- /dev/null +++ b/Help/module/FindLibinput.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/FindLibinput.cmake diff --git a/Help/release/dev/find_libinput.rst b/Help/release/dev/find_libinput.rst new file mode 100644 index 00000000000..ebb9e7ae5dd --- /dev/null +++ b/Help/release/dev/find_libinput.rst @@ -0,0 +1,6 @@ +find_libinput +------------- + +* The :module:`FindLibinput` module was added to find `libinput`_. + +.. _`libinput`: https://www.freedesktop.org/wiki/Software/libinput/ diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake new file mode 100644 index 00000000000..df66cfff296 --- /dev/null +++ b/Modules/FindLibinput.cmake @@ -0,0 +1,83 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindLibinput +------------ + +Find libinput headers and library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +``Libinput::Libinput`` + The libinput library, if found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables in your project: + +``Libinput_FOUND`` + true if (the requested version of) libinput is available. +``Libinput_VERSION`` + the version of libinput. +``Libinput_LIBRARIES`` + the libraries to link against to use libinput. +``Libinput_INCLUDE_DIRS`` + where to find the libinput headers. +``Libinput_DEFINITIONS`` + this should be passed to target_compile_options(), if the + target is not used for linking + +#]=======================================================================] + + +# Use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig QUIET) +pkg_check_modules(PKG_Libinput QUIET libinput) + +set(Libinput_DEFINITIONS ${PKG_Libinput_CFLAGS_OTHER}) +set(Libinput_VERSION ${PKG_Libinput_VERSION}) + +find_path(Libinput_INCLUDE_DIR + NAMES + libinput.h + HINTS + ${PKG_Libinput_INCLUDE_DIRS} +) +find_library(Libinput_LIBRARY + NAMES + input + HINTS + ${PKG_Libinput_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libinput + FOUND_VAR + Libinput_FOUND + REQUIRED_VARS + Libinput_LIBRARY + Libinput_INCLUDE_DIR + VERSION_VAR + Libinput_VERSION +) + +if(Libinput_FOUND AND NOT TARGET Libinput::Libinput) + add_library(Libinput::Libinput UNKNOWN IMPORTED) + set_target_properties(Libinput::Libinput PROPERTIES + IMPORTED_LOCATION "${Libinput_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${Libinput_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${Libinput_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(Libinput_LIBRARY Libinput_INCLUDE_DIR) + +if(Libinput_FOUND) + set(Libinput_LIBRARIES ${Libinput_LIBRARY}) + set(Libinput_INCLUDE_DIRS ${Libinput_INCLUDE_DIR}) + set(Libinput_VERSION_STRING ${Libinput_VERSION}) +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 0de6c416e50..9e192be620c 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1409,6 +1409,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindLibRHash) endif() + if(CMake_TEST_FindLibinput) + add_subdirectory(FindLibinput) + endif() + if(CMake_TEST_FindLibUV) add_subdirectory(FindLibUV) endif() diff --git a/Tests/FindLibinput/CMakeLists.txt b/Tests/FindLibinput/CMakeLists.txt new file mode 100644 index 00000000000..8538a55edf6 --- /dev/null +++ b/Tests/FindLibinput/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindLibinput.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindLibinput/Test" + "${CMake_BINARY_DIR}/Tests/FindLibinput/Test" + ${build_generator_args} + --build-project TestFindLibinput + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) diff --git a/Tests/FindLibinput/Test/CMakeLists.txt b/Tests/FindLibinput/Test/CMakeLists.txt new file mode 100644 index 00000000000..1cc68d48e9a --- /dev/null +++ b/Tests/FindLibinput/Test/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindLibinput C) +include(CTest) + +find_package(Libinput REQUIRED) + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt Libinput::Libinput) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${Libinput_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${Libinput_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindLibinput/Test/main.c b/Tests/FindLibinput/Test/main.c new file mode 100644 index 00000000000..39199628081 --- /dev/null +++ b/Tests/FindLibinput/Test/main.c @@ -0,0 +1,13 @@ +#include +#include + +int main() +{ + struct libinput_interface interface; + interface.open_restricted = 0; + interface.close_restricted = 0; + struct libinput* li; + li = libinput_udev_create_context(&interface, NULL, NULL); + printf("Found Libinput.\n"); + return 0; +} From bf572ac952d7ddf2b7208efc56f104844aea72e2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 11 Oct 2018 17:22:45 -0400 Subject: [PATCH 033/907] cmListCommand: check list(FILTER) operation before the list A future commit will make the not-a-list case a success, but invalid operations should still be diagnosed in that case. --- Source/cmListCommand.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index d7de2fa5b83..b9c7adaa270 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -1289,14 +1289,6 @@ bool cmListCommand::HandleFilterCommand(std::vector const& args) return false; } - const std::string& listName = args[1]; - // expand the variable - std::vector varArgsExpanded; - if (!this->GetList(varArgsExpanded, listName)) { - this->SetError("sub-command FILTER requires list to be present."); - return false; - } - const std::string& op = args[2]; bool includeMatches; if (op == "INCLUDE") { @@ -1308,6 +1300,14 @@ bool cmListCommand::HandleFilterCommand(std::vector const& args) return false; } + const std::string& listName = args[1]; + // expand the variable + std::vector varArgsExpanded; + if (!this->GetList(varArgsExpanded, listName)) { + this->SetError("sub-command FILTER requires list to be present."); + return false; + } + const std::string& mode = args[3]; if (mode == "REGEX") { if (args.size() != 5) { From aeb24db55400b16c9d53d10b50cdb4668ba93e5f Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Fri, 12 Oct 2018 00:01:08 -0400 Subject: [PATCH 034/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4d3e783565a..1bc2632f78a 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181011) +set(CMake_VERSION_PATCH 20181012) #set(CMake_VERSION_RC 1) From fd71ad37152d2d3b843fc491abb2202e155c0114 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sat, 13 Oct 2018 00:01:08 -0400 Subject: [PATCH 035/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1bc2632f78a..43b81a8dfa1 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181012) +set(CMake_VERSION_PATCH 20181013) #set(CMake_VERSION_RC 1) From f77a9576e542f7f0b2d32096a65fd232a1fd089e Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Sun, 14 Oct 2018 00:01:05 -0400 Subject: [PATCH 036/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 43b81a8dfa1..77419ff7fc0 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181013) +set(CMake_VERSION_PATCH 20181014) #set(CMake_VERSION_RC 1) From 1601388212e633d5e83d788cf6e52fd7c99e4883 Mon Sep 17 00:00:00 2001 From: Vitaly Stakhovsky Date: Sun, 14 Oct 2018 18:32:53 -0400 Subject: [PATCH 037/907] cmVisualStudio10TargetGenerator: Code improvement Disallow incompletely initialized Elem objects --- Source/cmVisualStudio10TargetGenerator.cxx | 75 +++++++++------------- Source/cmVisualStudio10TargetGenerator.h | 2 +- 2 files changed, 31 insertions(+), 46 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 2d39cbbf66c..9b96f56aaba 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -45,24 +45,21 @@ struct cmVisualStudio10TargetGenerator::Elem bool HasContent = false; std::string Tag; - Elem(std::ostream& s) + Elem(std::ostream& s, const char* tag) : S(s) , Indent(0) + , Tag(tag) { + this->StartElement(); } Elem(const Elem&) = delete; - Elem(Elem& par) - : S(par.S) - , Indent(par.Indent + 1) - { - par.SetHasElements(); - } Elem(Elem& par, const char* tag) : S(par.S) , Indent(par.Indent + 1) + , Tag(tag) { par.SetHasElements(); - this->StartElement(tag); + this->StartElement(); } void SetHasElements() { @@ -72,12 +69,7 @@ struct cmVisualStudio10TargetGenerator::Elem } } std::ostream& WriteString(const char* line); - Elem& StartElement(const std::string& tag) - { - this->Tag = tag; - this->WriteString("<") << tag; - return *this; - } + void StartElement() { this->WriteString("<") << this->Tag; } void Element(const char* tag, const std::string& val) { Elem(*this, tag).Content(val); @@ -87,8 +79,6 @@ struct cmVisualStudio10TargetGenerator::Elem this->S << " " << an << "=\"" << cmVS10EscapeAttr(av) << "\""; return *this; } - // This method for now assumes that this->Tag has been set, e.g. by calling - // StartElement(). void Content(const std::string& val) { if (!this->HasContent) { @@ -380,8 +370,7 @@ void cmVisualStudio10TargetGenerator::Generate() << this->GlobalGenerator->Encoding() << "\"?>" << "\n"; { - Elem e0(BuildFileStream); - e0.StartElement("Project"); + Elem e0(BuildFileStream, "Project"); e0.Attribute("DefaultTargets", "Build"); e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion()); e0.Attribute("xmlns", @@ -922,8 +911,8 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0) xamlType = "Page"; } - Elem e2(e1); - this->WriteSource(e2, xamlType, oi); + Elem e2(e1, xamlType); + this->WriteSource(e2, oi); e2.SetHasElements(); if (this->ProjectType == csproj && !this->InSourceBuild) { // add tag to written XAML source if necessary @@ -1275,15 +1264,15 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule( std::unique_ptr spe2; if (this->ProjectType != csproj) { spe1 = cm::make_unique(e0, "ItemGroup"); - spe2 = cm::make_unique(*spe1); - this->WriteSource(*spe2, "CustomBuild", source); + spe2 = cm::make_unique(*spe1, "CustomBuild"); + this->WriteSource(*spe2, source); spe2->SetHasElements(); } else { Elem e1(e0, "ItemGroup"); - Elem e2(e1); + Elem e2(e1, "None"); std::string link; this->GetCSharpSourceLink(source, link); - this->WriteSource(e2, "None", source); + this->WriteSource(e2, source); e2.SetHasElements(); if (!link.empty()) { e2.Element("Link", link); @@ -1417,8 +1406,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups() << this->GlobalGenerator->Encoding() << "\"?>" << "\n"; { - Elem e0(fout); - e0.StartElement("Project"); + Elem e0(fout, "Project"); e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion()); e0.Attribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003"); @@ -1569,8 +1557,8 @@ void cmVisualStudio10TargetGenerator::WriteHeaderSource(Elem& e1, cmSourceFile const* sf) { std::string const& fileName = sf->GetFullPath(); - Elem e2(e1); - this->WriteSource(e2, "ClInclude", sf); + Elem e2(e1, "ClInclude"); + this->WriteSource(e2, sf); if (this->IsResxHeader(fileName)) { e2.Element("FileType", "CppForm"); } else if (this->IsXamlHeader(fileName)) { @@ -1738,8 +1726,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, } } - Elem e2(e1); - this->WriteSource(e2, tool, sf); + Elem e2(e1, tool); + this->WriteSource(e2, sf); if (toolHasSettings) { e2.SetHasElements(); @@ -1859,7 +1847,6 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1, } void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2, - std::string const& tool, cmSourceFile const* sf) { // Visual Studio tools append relative paths to the current dir, as in: @@ -1895,11 +1882,10 @@ void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2, } } ConvertToWindowsSlash(sourceFile); - e2.StartElement(tool); e2.Attribute("Include", sourceFile); ToolSource toolSource = { sf, forceRelative }; - this->Tools[tool].push_back(toolSource); + this->Tools[e2.Tag].push_back(toolSource); } void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) @@ -2003,8 +1989,8 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0) include_configs.begin(), include_configs.end(), std::back_inserter(exclude_configs)); - Elem e2(e1); - this->WriteSource(e2, tool, si.Source); + Elem e2(e1, tool); + this->WriteSource(e2, si.Source); if (si.Kind == cmGeneratorTarget::SourceKindObjectSource) { this->OutputSourceSpecificFlags(e2, si.Source); } @@ -3882,15 +3868,13 @@ void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension( void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) { std::vector sdkReferences; - Elem e1(e0); - bool hasWrittenItemGroup = false; + std::unique_ptr spe1; if (const char* vsSDKReferences = this->GeneratorTarget->GetProperty("VS_SDK_REFERENCES")) { cmSystemTools::ExpandListArgument(vsSDKReferences, sdkReferences); - e1.StartElement("ItemGroup"); - hasWrittenItemGroup = true; + spe1 = cm::make_unique(e0, "ItemGroup"); for (std::string const& ri : sdkReferences) { - Elem(e1, "SDKReference").Attribute("Include", ri); + Elem(*spe1, "SDKReference").Attribute("Include", ri); } } @@ -3906,19 +3890,20 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0) if (desktopExtensionsVersion || mobileExtensionsVersion || iotExtensionsVersion) { - if (!hasWrittenItemGroup) { - e1.StartElement("ItemGroup"); + if (!spe1) { + spe1 = cm::make_unique(e0, "ItemGroup"); } if (desktopExtensionsVersion) { - this->WriteSingleSDKReference(e1, "WindowsDesktop", + this->WriteSingleSDKReference(*spe1, "WindowsDesktop", desktopExtensionsVersion); } if (mobileExtensionsVersion) { - this->WriteSingleSDKReference(e1, "WindowsMobile", + this->WriteSingleSDKReference(*spe1, "WindowsMobile", mobileExtensionsVersion); } if (iotExtensionsVersion) { - this->WriteSingleSDKReference(e1, "WindowsIoT", iotExtensionsVersion); + this->WriteSingleSDKReference(*spe1, "WindowsIoT", + iotExtensionsVersion); } } } diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 0dc03b6556f..b17b5f8efed 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -63,7 +63,7 @@ class cmVisualStudio10TargetGenerator void WriteExtraSource(Elem& e1, cmSourceFile const* sf); void WriteNsightTegraConfigurationValues(Elem& e1, std::string const& config); - void WriteSource(Elem& e2, std::string const& tool, cmSourceFile const* sf); + void WriteSource(Elem& e2, cmSourceFile const* sf); void WriteExcludeFromBuild(Elem& e2, std::vector const& exclude_configs); void WriteAllSources(Elem& e0); From d543eb2260fff6c49ab6e5066d376c502e91bf9f Mon Sep 17 00:00:00 2001 From: Vitaly Stakhovsky Date: Sun, 14 Oct 2018 19:26:25 -0400 Subject: [PATCH 038/907] cmCustomCommand: remove the default constructor Unused; no longer mandated by STL --- Source/cmCustomCommand.cxx | 10 ---------- Source/cmCustomCommand.h | 13 +++++-------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index cfd260c2347..e87eb1eab58 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -4,16 +4,6 @@ #include "cmMakefile.h" -cmCustomCommand::cmCustomCommand() - : Backtrace() -{ - this->HaveComment = false; - this->EscapeOldStyle = true; - this->EscapeAllowMakeVars = false; - this->UsesTerminal = false; - this->CommandExpandLists = false; -} - cmCustomCommand::cmCustomCommand(cmMakefile const* mf, const std::vector& outputs, const std::vector& byproducts, diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h index 9e82f2505c6..d82160bad9c 100644 --- a/Source/cmCustomCommand.h +++ b/Source/cmCustomCommand.h @@ -22,9 +22,6 @@ class cmMakefile; class cmCustomCommand { public: - /** Default and copy constructors for STL containers. */ - cmCustomCommand(); - /** Main constructor specifies all information for the command. */ cmCustomCommand(cmMakefile const* mf, const std::vector& outputs, @@ -103,11 +100,11 @@ class cmCustomCommand std::string Comment; std::string WorkingDirectory; std::string Depfile; - bool HaveComment; - bool EscapeAllowMakeVars; - bool EscapeOldStyle; - bool UsesTerminal; - bool CommandExpandLists; + bool HaveComment = false; + bool EscapeAllowMakeVars = false; + bool EscapeOldStyle = true; + bool UsesTerminal = false; + bool CommandExpandLists = false; }; #endif From 6c281138a577ccf07ae71b1286df30a3d22746e0 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Mon, 15 Oct 2018 00:01:05 -0400 Subject: [PATCH 039/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 77419ff7fc0..ce35d02259e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181014) +set(CMake_VERSION_PATCH 20181015) #set(CMake_VERSION_RC 1) From 60ca88d7261da8ad77e68d8f82ae67099af70df0 Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Thu, 11 Oct 2018 13:48:53 -0400 Subject: [PATCH 040/907] ctest_submit: Generate Done.xml at submit time This fixes a bug where calling `ctest_submit()` would result in a Done.xml file with an empty element. CDash responds with a buildId when CTest submits a file. For this reason, Done.xml needs to generated after CTest has submitted some other file to CDash. This change also has the benefit of making Done.xml's timestamp as late as possible, giving us a more accurate record of how long the entire build took to complete. --- Source/CTest/cmCTestSubmitHandler.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 6ad0e03d322..98872a57111 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -467,6 +467,17 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5); } + // Generate Done.xml right before it is submitted. + // The reason for this is two-fold: + // 1) It must be generated after some other part has been submitted + // so we have a buildId to refer to in its contents. + // 2) By generating Done.xml here its timestamp will be as late as + // possible. This gives us a more accurate record of how long the + // entire build took to complete. + if (file == "Done.xml") { + this->CTest->GenerateDoneFile(); + } + if (!cmSystemTools::FileExists(local_file)) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " << local_file << std::endl); @@ -1420,7 +1431,6 @@ int cmCTestSubmitHandler::ProcessHandler() // Submit Done.xml last if (this->SubmitPart[cmCTest::PartDone]) { - this->CTest->GenerateDoneFile(); files.push_back("Done.xml"); } From 92f3ad7caebe6922a6b682cbb8c8d687cbfc8256 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 16 Oct 2018 00:01:11 -0400 Subject: [PATCH 041/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ce35d02259e..3fe35490206 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181015) +set(CMake_VERSION_PATCH 20181016) #set(CMake_VERSION_RC 1) From f7d92deff487810f21b4f7979a5fe1892fabd255 Mon Sep 17 00:00:00 2001 From: Joseph Snyder Date: Mon, 15 Oct 2018 13:57:42 +0000 Subject: [PATCH 042/907] CTest: Fix GTM coverage handling of entry point named "%" Removing the "%" character from the name of the routine in the line parser causes CTest to be unable to find a routine entry point that is only named "%". Instead leave it during line parsing and handle routine names ending in "%" explicitly when loading files. --- Source/CTest/cmParseGTMCoverage.cxx | 9 ++- Tests/CMakeLists.txt | 4 +- .../Packages/Uncategorized/ZZCOVTST.m | 3 + Tests/MumpsCoverage/ZZCOVTST.cmcov | 63 ++++++++++--------- Tests/MumpsCoverage/ZZCOVTST.mcov | 3 + 5 files changed, 48 insertions(+), 34 deletions(-) diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 83dde3f75fd..072275372c5 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -1,5 +1,6 @@ #include "cmParseGTMCoverage.h" +#include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestCoverageHandler.h" #include "cmSystemTools.h" @@ -86,6 +87,10 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) } // Find the full path to the file bool found = this->FindMumpsFile(routine, filepath); + if (!found && cmHasLiteralSuffix(routine, "%")) { + routine.erase(0, 1); + found = this->FindMumpsFile(routine, filepath); + } if (found) { int lineoffset = 0; if (this->FindFunctionInMumpsFile(filepath, function, lineoffset)) { @@ -192,8 +197,8 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line, done = true; } } else { - // all chars except ", (, and % get stored in the arg string - if (cur != '\"' && cur != '(' && cur != '%') { + // all chars except " and ( get stored in the arg string + if (cur != '\"' && cur != '(') { arg.append(1, line[pos]); } } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 9e192be620c..2b2ac9580cf 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2669,7 +2669,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release $ -T Coverage --debug) set_tests_properties(CTestGTMCoverage PROPERTIES PASS_REGULAR_EXPRESSION - "Process file.*ZZCOVTST.m.*Total LOC:.*30.*Percentage Coverage: 80.00*" + "Process file.*ZZCOVTST.m.*Total LOC:.*32.*Percentage Coverage: 81.25*" ENVIRONMENT COVFILE=) configure_file( @@ -2687,7 +2687,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release $ -T Coverage --debug) set_tests_properties(CTestCacheCoverage PROPERTIES PASS_REGULAR_EXPRESSION - "Process file.*ZZCOVTST.m.*Total LOC:.*29.*Percentage Coverage: 86.21.*" + "Process file.*ZZCOVTST.m.*Total LOC:.*32.*Percentage Coverage: 87.50.*" ENVIRONMENT COVFILE=) # Adding a test case for Python Coverage diff --git a/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m b/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m index ee7068240a8..5567c4eef2f 100644 --- a/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m +++ b/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m @@ -12,6 +12,9 @@ ; This line not executable D T6^ZZCOVTST ; +% ; a line to test for a problem where % was dropped + N Do,Re,Mi + S Do="A#" T1 ; This line should always be found N D S D=2 diff --git a/Tests/MumpsCoverage/ZZCOVTST.cmcov b/Tests/MumpsCoverage/ZZCOVTST.cmcov index aec93368016..12f2aa6ebc2 100644 --- a/Tests/MumpsCoverage/ZZCOVTST.cmcov +++ b/Tests/MumpsCoverage/ZZCOVTST.cmcov @@ -13,33 +13,36 @@ ZZCOVTST,1,1,"ZZCOVTST;OSEHRA/JPS -- Test routine for Coverage Parsing;4/28/2014 ,12,1," Q" ,13,0," ; This line not executable" ,14,0," ;" -,15,0,"T1 ; This line should always be found" -,16,1," N D" -,17,1," S D=2" -,18,1," W !,D,!,""This is the second entry point"",!" -,19,1," D T2^ZZCOVTST(D)" -,20,1," Q" -,21,0," ;" -,22,0,"T2(EQ) ; This is debatable and only called with ENT^ROU notation" -,23,1," N D" -,24,1," S D=3" -,25,1," W !,D,!,EQ,""This is the third entry point"",!" -,26,1," D T3^ZZCOVTST" -,27,1," Q" -,28,0," ;" -,29,1,"T3 N D S D=4 W D,!,""Fourth Entry point"",! Q" -,30,0," ;" -,31,0,"T4 N D S D=5 W ""Shouldn't be executed""" -,32,0," W ""Lots to not do""" -,33,0," Q" -,34,1,"T5(EQ) ;this entry point is called with a $$ notation" -,35,1," W ""THIS IS THE $$ NOTATION!"",!" -,36,1," Q 0" -,37,0,"T6 ; An entry point to show comments inside of ""DO"" blocks" -,38,1," D" -,39,1," . W ""This is executable code"",!" -,40,0," . ; This is a comment inside the do block, not executable" -,41,1," . S ZZBLAH=""blah""" -,42,1," W ""Ending T6"",!" -,43,0," ;" -Totals for ZZCOVTST,,25, +,15,1,"% ; a line to test for a problem where % was dropped" +,16,1,"N Do,Re,Mi" +,17,1,"S Do=""A#""" +,18,0,"T1 ; This line should always be found" +,19,1," N D" +,20,1," S D=2" +,21,1," W !,D,!,""This is the second entry point"",!" +,22,1," D T2^ZZCOVTST(D)" +,23,1," Q" +,24,0," ;" +,25,0,"T2(EQ) ; This is debatable and only called with ENT^ROU notation" +,26,1," N D" +,27,1," S D=3" +,28,1," W !,D,!,EQ,""This is the third entry point"",!" +,29,1," D T3^ZZCOVTST" +,30,1," Q" +,31,0," ;" +,32,1,"T3 N D S D=4 W D,!,""Fourth Entry point"",! Q" +,33,0," ;" +,34,0,"T4 N D S D=5 W ""Shouldn't be executed""" +,35,0," W ""Lots to not do""" +,36,0," Q" +,37,1,"T5(EQ) ;this entry point is called with a $$ notation" +,38,1," W ""THIS IS THE $$ NOTATION!"",!" +,39,1," Q 0" +,40,0,"T6 ; An entry point to show comments inside of ""DO"" blocks" +,41,1," D" +,42,1," . W ""This is executable code"",!" +,43,0," . ; This is a comment inside the do block, not executable" +,44,1," . S ZZBLAH=""blah""" +,45,1," W ""Ending T6"",!" +,46,0," ;" +Toals for ZZCOVTST,,28, diff --git a/Tests/MumpsCoverage/ZZCOVTST.mcov b/Tests/MumpsCoverage/ZZCOVTST.mcov index b2608d952b5..e1fa18cadd2 100644 --- a/Tests/MumpsCoverage/ZZCOVTST.mcov +++ b/Tests/MumpsCoverage/ZZCOVTST.mcov @@ -9,6 +9,9 @@ GT.M 15-AUG-2014 10:14:32 ZWR ^ZZCOVERAGE("ZZCOVTST","EN",4)="1:0:0:0:74" ^ZZCOVERAGE("ZZCOVTST","EN",5)="1:0:0:0:66" ^ZZCOVERAGE("ZZCOVTST","EN",6)="1:0:0:0:40" +^ZZCOVERAGE("ZZCOVTST","%")="2:0:0:0:208" +^ZZCOVERAGE("ZZCOVTST","%",1)="2:0:0:0:208" +^ZZCOVERAGE("ZZCOVTST","%",2)="2:0:0:0:208" ^ZZCOVERAGE("ZZCOVTST","T1")="1:0:0:0:208" ^ZZCOVERAGE("ZZCOVTST","T1",1)="1:0:0:0:23" ^ZZCOVERAGE("ZZCOVTST","T1",2)="1:0:0:0:24" From 0c20d4d67b1f5da52da283f4237fb85a29385acd Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 16 Oct 2018 15:56:09 +0200 Subject: [PATCH 043/907] FindLibinput: Use _COMPILE_OPTIONS instead of _DEFINITIONS The value may contain flags. --- Modules/FindLibinput.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake index df66cfff296..1057c91bf62 100644 --- a/Modules/FindLibinput.cmake +++ b/Modules/FindLibinput.cmake @@ -26,7 +26,7 @@ This will define the following variables in your project: the libraries to link against to use libinput. ``Libinput_INCLUDE_DIRS`` where to find the libinput headers. -``Libinput_DEFINITIONS`` +``Libinput_COMPILE_OPTIONS`` this should be passed to target_compile_options(), if the target is not used for linking @@ -38,7 +38,7 @@ This will define the following variables in your project: find_package(PkgConfig QUIET) pkg_check_modules(PKG_Libinput QUIET libinput) -set(Libinput_DEFINITIONS ${PKG_Libinput_CFLAGS_OTHER}) +set(Libinput_COMPILE_OPTIONS ${PKG_Libinput_CFLAGS_OTHER}) set(Libinput_VERSION ${PKG_Libinput_VERSION}) find_path(Libinput_INCLUDE_DIR @@ -69,7 +69,7 @@ if(Libinput_FOUND AND NOT TARGET Libinput::Libinput) add_library(Libinput::Libinput UNKNOWN IMPORTED) set_target_properties(Libinput::Libinput PROPERTIES IMPORTED_LOCATION "${Libinput_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${Libinput_DEFINITIONS}" + INTERFACE_COMPILE_OPTIONS "${Libinput_COMPILE_OPTIONS}" INTERFACE_INCLUDE_DIRECTORIES "${Libinput_INCLUDE_DIR}" ) endif() From b8bb6ba653df9d53d93824bb7185bf022e9bf2ef Mon Sep 17 00:00:00 2001 From: Vitaly Stakhovsky Date: Sun, 14 Oct 2018 19:00:34 -0400 Subject: [PATCH 044/907] cmGeneratorTarget::GetExportMacro: return const std::string* --- Source/cmGeneratorTarget.cxx | 4 ++-- Source/cmGeneratorTarget.h | 2 +- Source/cmGlobalXCodeGenerator.cxx | 4 ++-- Source/cmLocalGenerator.cxx | 4 ++-- Source/cmLocalVisualStudio7Generator.cxx | 4 ++-- Source/cmVisualStudio10TargetGenerator.cxx | 10 ++++++---- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 80fb621e277..ea283c6fa69 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1730,7 +1730,7 @@ bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const this->GetType() == cmStateEnums::EXECUTABLE; } -const char* cmGeneratorTarget::GetExportMacro() const +const std::string* cmGeneratorTarget::GetExportMacro() const { // Define the symbol for targets that export symbols. if (this->GetType() == cmStateEnums::SHARED_LIBRARY || @@ -1743,7 +1743,7 @@ const char* cmGeneratorTarget::GetExportMacro() const in += "_EXPORTS"; this->ExportMacro = cmSystemTools::MakeCidentifier(in); } - return this->ExportMacro.c_str(); + return &this->ExportMacro; } return nullptr; } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index b1daa53a7b4..98669c35756 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -283,7 +283,7 @@ class cmGeneratorTarget /** Get the macro to define when building sources in this target. If no macro should be defined null is returned. */ - const char* GetExportMacro() const; + const std::string* GetExportMacro() const; /** Get the soname of the target. Allowed only for a shared library. */ std::string GetSOName(const std::string& config) const; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e353a377006..596bc6be899 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1814,9 +1814,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, BuildObjectListOrString ppDefs(this, true); this->AppendDefines( ppDefs, "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\""); - if (const char* exportMacro = gtgt->GetExportMacro()) { + if (const std::string* exportMacro = gtgt->GetExportMacro()) { // Add the export symbol definition for shared library objects. - this->AppendDefines(ppDefs, exportMacro); + this->AppendDefines(ppDefs, exportMacro->c_str()); } std::vector targetDefines; if (!langForPreprocessor.empty()) { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 229f88404ba..941d7878549 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1253,8 +1253,8 @@ void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target, std::set& defines) const { // Add the export symbol definition for shared library objects. - if (const char* exportMacro = target->GetExportMacro()) { - this->AppendDefines(defines, exportMacro); + if (const std::string* exportMacro = target->GetExportMacro()) { + this->AppendDefines(defines, *exportMacro); } // Add preprocessor definitions for this target and configuration. diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 842867264dd..1da077ebdf7 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -735,8 +735,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( targetOptions.AddDefine(configDefine); // Add the export symbol definition for shared library objects. - if (const char* exportMacro = target->GetExportMacro()) { - targetOptions.AddDefine(exportMacro); + if (const std::string* exportMacro = target->GetExportMacro()) { + targetOptions.AddDefine(*exportMacro); } // The intermediate directory name consists of a directory for the diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 2d39cbbf66c..44ec899ebb0 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2580,8 +2580,9 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( configDefine += configName; configDefine += "\""; clOptions.AddDefine(configDefine); - if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) { - clOptions.AddDefine(exportMacro); + if (const std::string* exportMacro = + this->GeneratorTarget->GetExportMacro()) { + clOptions.AddDefine(*exportMacro); } if (this->MSTools) { @@ -2877,8 +2878,9 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( configDefine += configName; configDefine += "\""; cudaOptions.AddDefine(configDefine); - if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) { - cudaOptions.AddDefine(exportMacro); + if (const std::string* exportMacro = + this->GeneratorTarget->GetExportMacro()) { + cudaOptions.AddDefine(*exportMacro); } // Get includes for this target From acfe53c58817c662b935fbe0f0443de298371731 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 11 Oct 2018 17:23:12 -0400 Subject: [PATCH 045/907] cmListCommand: make list(ACTION not_a_list) succeed when idempotent The operations changed here all are no-ops on empty lists anyways, so just have them succeed when given non-extant lists. - `list(REMOVE_ITEM)` - `list(REMOVE_DUPLICATES)` - `list(SORT)` - `list(FILTER)` - `list(REVERSE)` --- Help/release/dev/better-empty-list-behavior.rst | 6 ++++++ Source/cmListCommand.cxx | 16 +++++----------- Tests/RunCMake/list/FILTER-NotList-result.txt | 1 - Tests/RunCMake/list/FILTER-NotList-stderr.txt | 4 ---- Tests/RunCMake/list/FILTER-NotList.cmake | 4 ++++ .../list/REMOVE_DUPLICATES-NotList-result.txt | 1 - .../list/REMOVE_DUPLICATES-NotList-stderr.txt | 4 ---- .../list/REMOVE_DUPLICATES-NotList.cmake | 4 ++++ .../RunCMake/list/REMOVE_ITEM-NotList-result.txt | 1 - .../RunCMake/list/REMOVE_ITEM-NotList-stderr.txt | 4 ---- Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake | 4 ++++ Tests/RunCMake/list/REVERSE-NotList-result.txt | 1 - Tests/RunCMake/list/REVERSE-NotList-stderr.txt | 4 ---- Tests/RunCMake/list/REVERSE-NotList.cmake | 4 ++++ Tests/RunCMake/list/SORT-NotList-result.txt | 1 - Tests/RunCMake/list/SORT-NotList-stderr.txt | 4 ---- Tests/RunCMake/list/SORT-NotList.cmake | 4 ++++ 17 files changed, 31 insertions(+), 36 deletions(-) create mode 100644 Help/release/dev/better-empty-list-behavior.rst delete mode 100644 Tests/RunCMake/list/FILTER-NotList-result.txt delete mode 100644 Tests/RunCMake/list/FILTER-NotList-stderr.txt delete mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt delete mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt delete mode 100644 Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt delete mode 100644 Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt delete mode 100644 Tests/RunCMake/list/REVERSE-NotList-result.txt delete mode 100644 Tests/RunCMake/list/REVERSE-NotList-stderr.txt delete mode 100644 Tests/RunCMake/list/SORT-NotList-result.txt delete mode 100644 Tests/RunCMake/list/SORT-NotList-stderr.txt diff --git a/Help/release/dev/better-empty-list-behavior.rst b/Help/release/dev/better-empty-list-behavior.rst new file mode 100644 index 00000000000..12a131ff742 --- /dev/null +++ b/Help/release/dev/better-empty-list-behavior.rst @@ -0,0 +1,6 @@ +better-empty-list-behavior +-------------------------- + +* The :command:`list` operations ``REMOVE_ITEM``, ``REMOVE_DUPLICATES``, + ``SORT``, ``REVERSE``, and ``FILTER`` all now accept a non-existent variable + as the list since these operations on empty lists is also the empty list. diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index b9c7adaa270..b46eb6d0d3b 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -346,8 +346,7 @@ bool cmListCommand::HandleRemoveItemCommand( // expand the variable std::vector varArgsExpanded; if (!this->GetList(varArgsExpanded, listName)) { - this->SetError("sub-command REMOVE_ITEM requires list to be present."); - return false; + return true; } std::vector remove(args.begin() + 2, args.end()); @@ -376,8 +375,7 @@ bool cmListCommand::HandleReverseCommand(std::vector const& args) // expand the variable std::vector varArgsExpanded; if (!this->GetList(varArgsExpanded, listName)) { - this->SetError("sub-command REVERSE requires list to be present."); - return false; + return true; } std::string value = cmJoin(cmReverseRange(varArgsExpanded), ";"); @@ -399,9 +397,7 @@ bool cmListCommand::HandleRemoveDuplicatesCommand( // expand the variable std::vector varArgsExpanded; if (!this->GetList(varArgsExpanded, listName)) { - this->SetError( - "sub-command REMOVE_DUPLICATES requires list to be present."); - return false; + return true; } std::vector::const_iterator argsEnd = @@ -1152,8 +1148,7 @@ bool cmListCommand::HandleSortCommand(std::vector const& args) // expand the variable std::vector varArgsExpanded; if (!this->GetList(varArgsExpanded, listName)) { - this->SetError("sub-command SORT requires list to be present."); - return false; + return true; } if ((sortCompare == cmStringSorter::Compare::STRING) && @@ -1304,8 +1299,7 @@ bool cmListCommand::HandleFilterCommand(std::vector const& args) // expand the variable std::vector varArgsExpanded; if (!this->GetList(varArgsExpanded, listName)) { - this->SetError("sub-command FILTER requires list to be present."); - return false; + return true; } const std::string& mode = args[3]; diff --git a/Tests/RunCMake/list/FILTER-NotList-result.txt b/Tests/RunCMake/list/FILTER-NotList-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/list/FILTER-NotList-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/list/FILTER-NotList-stderr.txt b/Tests/RunCMake/list/FILTER-NotList-stderr.txt deleted file mode 100644 index 159c28dd4b0..00000000000 --- a/Tests/RunCMake/list/FILTER-NotList-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at FILTER-NotList.cmake:2 \(list\): - list sub-command FILTER requires list to be present. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/FILTER-NotList.cmake b/Tests/RunCMake/list/FILTER-NotList.cmake index 1e15635b94e..bf09ec74f77 100644 --- a/Tests/RunCMake/list/FILTER-NotList.cmake +++ b/Tests/RunCMake/list/FILTER-NotList.cmake @@ -1,2 +1,6 @@ unset(nosuchlist) list(FILTER nosuchlist EXCLUDE REGEX "^FILTER_THIS_.+") +if (DEFINED nosuchlist) + message(FATAL_ERROR + "list(FILTER) created our list") +endif () diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt deleted file mode 100644 index 96f3446ff9c..00000000000 --- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at REMOVE_DUPLICATES-NotList.cmake:2 \(list\): - list sub-command REMOVE_DUPLICATES requires list to be present. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake index 218f2272cda..b9f39994349 100644 --- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake +++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake @@ -1,2 +1,6 @@ unset(nosuchlist) list(REMOVE_DUPLICATES nosuchlist) +if (DEFINED nosuchlist) + message(FATAL_ERROR + "list(REMOVE_DUPLICATES) created our list") +endif () diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt b/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt deleted file mode 100644 index c32a4c0553b..00000000000 --- a/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at REMOVE_ITEM-NotList.cmake:2 \(list\): - list sub-command REMOVE_ITEM requires list to be present. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake b/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake index 079e7fbce2e..0c66837c513 100644 --- a/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake +++ b/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake @@ -1,2 +1,6 @@ unset(nosuchlist) list(REMOVE_ITEM nosuchlist alpha) +if (DEFINED nosuchlist) + message(FATAL_ERROR + "list(REMOVE_ITEM) created our list") +endif () diff --git a/Tests/RunCMake/list/REVERSE-NotList-result.txt b/Tests/RunCMake/list/REVERSE-NotList-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/list/REVERSE-NotList-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/list/REVERSE-NotList-stderr.txt b/Tests/RunCMake/list/REVERSE-NotList-stderr.txt deleted file mode 100644 index e9dcc06b3ab..00000000000 --- a/Tests/RunCMake/list/REVERSE-NotList-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at REVERSE-NotList.cmake:2 \(list\): - list sub-command REVERSE requires list to be present. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/REVERSE-NotList.cmake b/Tests/RunCMake/list/REVERSE-NotList.cmake index 977e2ccac17..71383294c9f 100644 --- a/Tests/RunCMake/list/REVERSE-NotList.cmake +++ b/Tests/RunCMake/list/REVERSE-NotList.cmake @@ -1,2 +1,6 @@ unset(nosuchlist) list(REVERSE nosuchlist) +if (DEFINED nosuchlist) + message(FATAL_ERROR + "list(REVERSE) created our list") +endif () diff --git a/Tests/RunCMake/list/SORT-NotList-result.txt b/Tests/RunCMake/list/SORT-NotList-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/list/SORT-NotList-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/list/SORT-NotList-stderr.txt b/Tests/RunCMake/list/SORT-NotList-stderr.txt deleted file mode 100644 index 396c5b57d09..00000000000 --- a/Tests/RunCMake/list/SORT-NotList-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Error at SORT-NotList.cmake:2 \(list\): - list sub-command SORT requires list to be present. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/SORT-NotList.cmake b/Tests/RunCMake/list/SORT-NotList.cmake index 8f48e104327..6314f149323 100644 --- a/Tests/RunCMake/list/SORT-NotList.cmake +++ b/Tests/RunCMake/list/SORT-NotList.cmake @@ -1,2 +1,6 @@ unset(nosuchlist) list(SORT nosuchlist) +if (DEFINED nosuchlist) + message(FATAL_ERROR + "list(SORT) created our list") +endif () From 121a036f73665a18ccadeaf50b00cc623d8ed9df Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 11 Oct 2018 17:26:44 -0400 Subject: [PATCH 046/907] cmListCommand: handle empty lists for list(REMOVE_AT) Treat an empty list as a list with no valid bounds and return an error message indicating that any given indices are out-of-bounds. --- .../release/dev/better-empty-list-behavior.rst | 3 +++ Source/cmListCommand.cxx | 18 +++++++++++------- Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt | 2 +- .../list/REMOVE_AT-EmptyList-result.txt | 1 + .../list/REMOVE_AT-EmptyList-stderr.txt | 4 ++++ Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake | 6 ++++++ .../RunCMake/list/REMOVE_AT-NotList-stderr.txt | 2 +- Tests/RunCMake/list/REMOVE_AT-NotList.cmake | 4 ++++ Tests/RunCMake/list/RunCMakeTest.cmake | 2 ++ 9 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt create mode 100644 Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt create mode 100644 Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake diff --git a/Help/release/dev/better-empty-list-behavior.rst b/Help/release/dev/better-empty-list-behavior.rst index 12a131ff742..cd864f4ba12 100644 --- a/Help/release/dev/better-empty-list-behavior.rst +++ b/Help/release/dev/better-empty-list-behavior.rst @@ -4,3 +4,6 @@ better-empty-list-behavior * The :command:`list` operations ``REMOVE_ITEM``, ``REMOVE_DUPLICATES``, ``SORT``, ``REVERSE``, and ``FILTER`` all now accept a non-existent variable as the list since these operations on empty lists is also the empty list. + +* The :command:`list` operation ``REMOVE_AT`` now indicates that the given + indices are invalid for a non-existent variable or empty list. diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index b46eb6d0d3b..b2acb90f8c9 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -1225,13 +1225,17 @@ bool cmListCommand::HandleRemoveAtCommand(std::vector const& args) const std::string& listName = args[1]; // expand the variable std::vector varArgsExpanded; - if (!this->GetList(varArgsExpanded, listName)) { - this->SetError("sub-command REMOVE_AT requires list to be present."); - return false; - } - // FIXME: Add policy to make non-existing lists an error like empty lists. - if (varArgsExpanded.empty()) { - this->SetError("REMOVE_AT given empty list"); + if (!this->GetList(varArgsExpanded, listName) || varArgsExpanded.empty()) { + std::ostringstream str; + str << "index: "; + for (size_t i = 1; i < args.size(); ++i) { + str << args[i]; + if (i != args.size() - 1) { + str << ", "; + } + } + str << " out of range (0, 0)"; + this->SetError(str.str()); return false; } diff --git a/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt b/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt index b24a0ed0b83..9368e880b5e 100644 --- a/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt +++ b/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt @@ -1,4 +1,4 @@ CMake Error at EmptyRemoveAt0.cmake:2 \(list\): - list REMOVE_AT given empty list + list index: mylist, 0 out of range \(0, 0\) Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt b/Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt b/Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt new file mode 100644 index 00000000000..582b74b043e --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at REMOVE_AT-EmptyList.cmake:2 \(list\): + list index: nosuchlist, 0 out of range \(0, 0\) +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake b/Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake new file mode 100644 index 00000000000..ff0dde84fdd --- /dev/null +++ b/Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake @@ -0,0 +1,6 @@ +set(nosuchlist "") +list(REMOVE_AT nosuchlist 0) +if (NOT DEFINED nosuchlist OR NOT nosuchlist STREQUAL "") + message(FATAL_ERROR + "list(REMOVE_AT) modified our list") +endif () diff --git a/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt index d6e8d85f5df..563d865ea57 100644 --- a/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt +++ b/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at REMOVE_AT-NotList.cmake:2 \(list\): - list sub-command REMOVE_AT requires list to be present. + list index: nosuchlist, 0 out of range \(0, 0\) Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/list/REMOVE_AT-NotList.cmake b/Tests/RunCMake/list/REMOVE_AT-NotList.cmake index 5266c7fe999..090df493373 100644 --- a/Tests/RunCMake/list/REMOVE_AT-NotList.cmake +++ b/Tests/RunCMake/list/REMOVE_AT-NotList.cmake @@ -1,2 +1,6 @@ unset(nosuchlist) list(REMOVE_AT nosuchlist 0) +if (DEFINED nosuchlist) + message(FATAL_ERROR + "list(REMOVE_AT) created our list") +endif () diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake index a8a0b571784..bf3d22db403 100644 --- a/Tests/RunCMake/list/RunCMakeTest.cmake +++ b/Tests/RunCMake/list/RunCMakeTest.cmake @@ -22,6 +22,8 @@ run_cmake(REMOVE_DUPLICATES-TooManyArguments) run_cmake(REVERSE-TooManyArguments) run_cmake(SUBLIST-TooManyArguments) +run_cmake(REMOVE_AT-EmptyList) + run_cmake(FILTER-NotList) run_cmake(REMOVE_AT-NotList) run_cmake(REMOVE_DUPLICATES-NotList) From 88ef5737a25b40ce738041b8f9e00df20a131eb6 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 17 Oct 2018 00:01:08 -0400 Subject: [PATCH 047/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3fe35490206..afd6f42f798 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181016) +set(CMake_VERSION_PATCH 20181017) #set(CMake_VERSION_RC 1) From 74b3eacdc755bc056aac65bf5c0b45aa02d097d4 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" Date: Wed, 10 Oct 2018 23:03:31 +0200 Subject: [PATCH 048/907] Help: Use appropriate list types in FindPkgConfig --- Modules/FindPkgConfig.cmake | 69 ++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 06beb7d8425..a451ba5ee7b 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -9,12 +9,14 @@ A ``pkg-config`` module for CMake. Finds the ``pkg-config`` executable and adds the :command:`pkg_get_variable`, :command:`pkg_check_modules` and :command:`pkg_search_module` commands. The -following variables will also be set:: +following variables will also be set: - PKG_CONFIG_FOUND ... if pkg-config executable was found - PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program - PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found - (since CMake 2.8.8) +``PKG_CONFIG_FOUND`` + if pkg-config executable was found +``PKG_CONFIG_EXECUTABLE`` + pathname of the pkg-config program +``PKG_CONFIG_VERSION_STRING`` + version of pkg-config (since CMake 2.8.8) #]========================================] @@ -543,27 +545,36 @@ endmacro() Each ```` can be either a bare module name or it can be a module name with a version constraint (operators ``=``, ``<``, ``>``, ``<=`` and ``>=`` are supported). The following are examples for a module - named ``foo`` with various constraints:: + named ``foo`` with various constraints: - foo # Any version matches - foo<2 # Only match versions before 2 - foo>=3.1 # Match any version from 3.1 or later - foo=1.2.3 # Foo must be exactly version 1.2.3 + - ``foo`` matches any version. + - ``foo<2`` only matches versions before 2. + - ``foo>=3.1`` matches any version from 3.1 or later. + - ``foo=1.2.3`` requires that foo must be exactly version 1.2.3. The following variables may be set upon return. Two sets of values exist, one for the common case (`` = ``) and another for the information ``pkg-config`` provides when it is called with the ``--static`` - option (`` = _STATIC``):: - - _FOUND ... set to 1 if module(s) exist - _LIBRARIES ... only the libraries (without the '-l') - _LINK_LIBRARIES ... the libraries and their absolute paths - _LIBRARY_DIRS ... the paths of the libraries (without the '-L') - _LDFLAGS ... all required linker flags - _LDFLAGS_OTHER ... all other linker flags - _INCLUDE_DIRS ... the '-I' preprocessor flags (without the '-I') - _CFLAGS ... all required cflags - _CFLAGS_OTHER ... the other compiler flags + option (`` = _STATIC``) + + ``_FOUND`` + set to 1 if module(s) exist + ``_LIBRARIES`` + only the libraries (without the '-l') + ``_LINK_LIBRARIES`` + the libraries and their absolute paths + ``_LIBRARY_DIRS`` + the paths of the libraries (without the '-L') + ``_LDFLAGS`` + all required linker flags + ``_LDFLAGS_OTHER`` + all other linker flags + ``_INCLUDE_DIRS`` + the '-I' preprocessor flags (without the '-I') + ``_CFLAGS`` + all required cflags + ``_CFLAGS_OTHER`` + the other compiler flags All but ``_FOUND`` may be a :ref:`;-list ` if the associated variable returned from ``pkg-config`` has multiple values. @@ -571,12 +582,16 @@ endmacro() There are some special variables whose prefix depends on the number of ```` given. When there is only one ````, ```` will simply be ````, but if two or more ```` - items are given, ```` will be ``_``:: - - _VERSION ... version of the module - _PREFIX ... prefix directory of the module - _INCLUDEDIR ... include directory of the module - _LIBDIR ... lib directory of the module + items are given, ```` will be ``_`` + + ``_VERSION`` + version of the module + ``_PREFIX`` + prefix directory of the module + ``_INCLUDEDIR`` + include directory of the module + ``_LIBDIR`` + lib directory of the module Examples From 33632898e9a831931fdb96089a244f53cdc37caf Mon Sep 17 00:00:00 2001 From: David Demelier Date: Wed, 17 Oct 2018 10:53:03 +0200 Subject: [PATCH 049/907] README: Suggest "sudo" for "make install" --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1e8561abcd5..775463e9fe7 100644 --- a/README.rst +++ b/README.rst @@ -62,7 +62,7 @@ within the CMake source directory or any other build directory of your choice. Once this has finished successfully, run ``make`` and ``make install``. In summary:: - $ ./bootstrap && make && make install + $ ./bootstrap && make && sudo make install Windows ^^^^^^^ From f1dd0eeaaf264ebb35b048f423c66296e6967d16 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Sep 2018 10:54:18 -0400 Subject: [PATCH 050/907] cmListFileCache: Add wrapper template for values with a backtrace --- Source/cmListFileCache.cxx | 7 ++++++- Source/cmListFileCache.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 4d7e1e2adc8..d79afc6d366 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -9,10 +9,10 @@ #include "cmSystemTools.h" #include "cmake.h" -#include #include #include #include +#include cmCommandContext::cmCommandName& cmCommandContext::cmCommandName::operator=( std::string const& name) @@ -474,3 +474,8 @@ bool operator!=(const cmListFileContext& lhs, const cmListFileContext& rhs) { return !(lhs == rhs); } + +std::ostream& operator<<(std::ostream& os, BT const& s) +{ + return os << s.Value; +} diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 3d3afdf9bbd..9f16b1667fe 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -9,6 +9,7 @@ #include // IWYU pragma: keep #include #include +#include #include #include "cmStateSnapshot.h" @@ -169,6 +170,34 @@ class cmListFileBacktrace cmListFileBacktrace(std::shared_ptr top); }; +// Wrap type T as a value with a backtrace. For purposes of +// ordering and equality comparison, only the original value is +// used. The backtrace is considered incidental. +template +class BT +{ +public: + BT(T v = T(), cmListFileBacktrace bt = cmListFileBacktrace()) + : Value(std::move(v)) + , Backtrace(std::move(bt)) + { + } + T Value; + cmListFileBacktrace Backtrace; + friend bool operator==(BT const& l, BT const& r) + { + return l.Value == r.Value; + } + friend bool operator<(BT const& l, BT const& r) + { + return l.Value < r.Value; + } + friend bool operator==(BT const& l, T const& r) { return l.Value == r; } + friend bool operator==(T const& l, BT const& r) { return l == r.Value; } +}; + +std::ostream& operator<<(std::ostream& os, BT const& s); + struct cmListFile { bool ParseFile(const char* path, cmMessenger* messenger, From e022e2d8734ffbc0378b75d85b32a2524302dd50 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 10 Oct 2018 08:56:36 -0400 Subject: [PATCH 051/907] cmListFileCache: Add ExpandListWithBacktrace helper --- Source/cmListFileCache.cxx | 13 +++++++++++++ Source/cmListFileCache.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index d79afc6d366..d0495f73e99 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -479,3 +479,16 @@ std::ostream& operator<<(std::ostream& os, BT const& s) { return os << s.Value; } + +std::vector> ExpandListWithBacktrace( + const char* list, cmListFileBacktrace const& bt) +{ + std::vector> result; + std::vector tmp; + cmSystemTools::ExpandListArgument(list, tmp); + result.reserve(tmp.size()); + for (std::string& i : tmp) { + result.emplace_back(std::move(i), bt); + } + return result; +} diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 9f16b1667fe..7c2802e15ef 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -198,6 +198,9 @@ class BT std::ostream& operator<<(std::ostream& os, BT const& s); +std::vector> ExpandListWithBacktrace( + const char* list, cmListFileBacktrace const& bt = cmListFileBacktrace()); + struct cmListFile { bool ParseFile(const char* path, cmMessenger* messenger, From 95b4b9137ab5af70671f88ed9e47ea8e173f748a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Oct 2018 14:24:13 -0400 Subject: [PATCH 052/907] Declare support for CMake versions through 3.12 for own build CMake 3.12 introduced a `...` syntax in the version given to `cmake_minimum_required` to automatically set policies to NEW up to that version. Use it to avoid listing policies explicitly. The syntax is compatible with older versions of CMake such that they use the extended version string for the `CMAKE_MINIMUM_REQUIRED_VERSION` variable (which we don't use) but otherwise ignore it. --- CMakeLists.txt | 2 +- Utilities/Doxygen/CMakeLists.txt | 2 +- Utilities/Sphinx/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e88e925a09c..ee987d0f6e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -cmake_minimum_required(VERSION 3.1 FATAL_ERROR) +cmake_minimum_required(VERSION 3.1...3.12 FATAL_ERROR) set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake) project(CMake) diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index 6a90c847452..2cdd7672de1 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeDeveloperReference_STANDALONE 1) - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + cmake_minimum_required(VERSION 3.1...3.12 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 1cbc463714d..15204d63f4a 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeHelp_STANDALONE 1) - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + cmake_minimum_required(VERSION 3.1...3.12 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) From aab69ccd9b20a7560d2c656bc1a53a4afa587240 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 18 Oct 2018 00:01:07 -0400 Subject: [PATCH 053/907] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index afd6f42f798..beafab2f586 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 13) -set(CMake_VERSION_PATCH 20181017) +set(CMake_VERSION_PATCH 20181018) #set(CMake_VERSION_RC 1) From a093b1a4f3c8c40c55c50ad8e701ceb599961140 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Oct 2018 10:44:09 -0400 Subject: [PATCH 054/907] cmLinkItem: Add backtrace Carry a backtrace on every link item, not just link implementation items. For now the non-impl items will still have empty backtraces at runtime, but this will allow us to introduce values over time. --- Source/cmComputeLinkDepends.cxx | 3 ++- Source/cmComputeTargetDepends.cxx | 20 +++++++------------- Source/cmGeneratorTarget.cxx | 28 +++++++++++++++++----------- Source/cmGeneratorTarget.h | 4 +++- Source/cmLinkItem.cxx | 12 ++++++------ Source/cmLinkItem.h | 9 ++++----- 6 files changed, 39 insertions(+), 37 deletions(-) diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index aa17de6e4f8..e3d53e4183a 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -6,6 +6,7 @@ #include "cmComputeComponentGraph.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmStateTypes.h" @@ -565,7 +566,7 @@ cmLinkItem cmComputeLinkDepends::ResolveLinkItem(int depender_index, from = depender; } } - return from->ResolveLinkItem(name); + return from->ResolveLinkItem(name, cmListFileBacktrace()); } void cmComputeLinkDepends::InferDependencies() diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 268e74970fb..28e12512822 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -6,6 +6,7 @@ #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLinkItem.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmPolicies.h" @@ -22,8 +23,6 @@ #include #include -class cmListFileBacktrace; - /* This class is meant to analyze inter-target dependencies globally @@ -208,7 +207,8 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) for (cmSourceFile const* o : objectFiles) { std::string const& objLib = o->GetObjectLibrary(); if (!objLib.empty()) { - cmLinkItem const& objItem = depender->ResolveLinkItem(objLib); + cmLinkItem const& objItem = + depender->ResolveLinkItem(objLib, cmListFileBacktrace()); if (emitted.insert(objItem).second) { if (depender->GetType() != cmStateEnums::EXECUTABLE && depender->GetType() != cmStateEnums::STATIC_LIBRARY && @@ -230,7 +230,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) cmLinkImplementation const* impl = depender->GetLinkImplementation(it); // A target should not depend on itself. - emitted.insert(cmLinkItem(depender)); + emitted.insert(cmLinkItem(depender, cmListFileBacktrace())); for (cmLinkImplItem const& lib : impl->Libraries) { // Don't emit the same library twice for this target. if (emitted.insert(lib).second) { @@ -246,7 +246,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) std::set const& tutils = depender->GetUtilityItems(); std::set emitted; // A target should not depend on itself. - emitted.insert(cmLinkItem(depender)); + emitted.insert(cmLinkItem(depender, cmListFileBacktrace())); for (cmLinkItem const& litem : tutils) { // Don't emit the same utility twice for this target. if (emitted.insert(litem).second) { @@ -289,7 +289,7 @@ void cmComputeTargetDepends::AddInterfaceDepends( if (dependee) { // A target should not depend on itself. - emitted.insert(cmLinkItem(depender)); + emitted.insert(cmLinkItem(depender, cmListFileBacktrace())); this->AddInterfaceDepends(depender_index, dependee, config, emitted); } } @@ -327,13 +327,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, e << "The dependency target \"" << dependee_name << "\" of target \"" << depender->GetName() << "\" does not exist."; - cmListFileBacktrace const* backtrace = - depender->GetUtilityBacktrace(dependee_name.AsStr()); - if (backtrace) { - cm->IssueMessage(messageType, e.str(), *backtrace); - } else { - cm->IssueMessage(messageType, e.str()); - } + cm->IssueMessage(messageType, e.str(), dependee_name.Backtrace); } } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ea283c6fa69..6ce65123785 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -676,11 +676,14 @@ std::set const& cmGeneratorTarget::GetUtilityItems() const this->UtilityItemsDone = true; std::set const& utilities = this->GetUtilities(); for (std::string const& i : utilities) { + cmListFileBacktrace const* bt = this->GetUtilityBacktrace(i); if (cmGeneratorTarget* gt = this->LocalGenerator->FindGeneratorTargetToUse(i)) { - this->UtilityItems.insert(cmLinkItem(gt)); + this->UtilityItems.insert( + cmLinkItem(gt, bt ? *bt : cmListFileBacktrace())); } else { - this->UtilityItems.insert(cmLinkItem(i)); + this->UtilityItems.insert( + cmLinkItem(i, bt ? *bt : cmListFileBacktrace())); } } } @@ -4618,6 +4621,7 @@ void cmGeneratorTarget::ReportPropertyOrigin( } void cmGeneratorTarget::LookupLinkItems(std::vector const& names, + cmListFileBacktrace const& bt, std::vector& items) const { for (std::string const& n : names) { @@ -4625,7 +4629,7 @@ void cmGeneratorTarget::LookupLinkItems(std::vector const& names, if (name == this->GetName() || name.empty()) { continue; } - items.push_back(this->ResolveLinkItem(name)); + items.push_back(this->ResolveLinkItem(name, bt)); } } @@ -4647,7 +4651,7 @@ void cmGeneratorTarget::ExpandLinkItems( false, headTarget, this, &dagChecker), libs); - this->LookupLinkItems(libs, items); + this->LookupLinkItems(libs, cge->GetBacktrace(), items); hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition(); } @@ -5200,7 +5204,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface( iface.HadHeadSensitiveCondition); std::vector deps; cmSystemTools::ExpandListArgument(info->SharedDeps, deps); - this->LookupLinkItems(deps, iface.SharedDeps); + this->LookupLinkItems(deps, cmListFileBacktrace(), iface.SharedDeps); } return &iface; @@ -5736,7 +5740,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( } // The entry is meant for this configuration. - impl.Libraries.emplace_back(this->ResolveLinkItem(name), *btIt, + impl.Libraries.emplace_back(this->ResolveLinkItem(name, *btIt), evaluated != *le); } @@ -5764,7 +5768,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( continue; } // Support OLD behavior for CMP0003. - impl.WrongConfigLibraries.push_back(this->ResolveLinkItem(name)); + impl.WrongConfigLibraries.push_back( + this->ResolveLinkItem(name, cmListFileBacktrace())); } } } @@ -5811,12 +5816,13 @@ cmGeneratorTarget::TargetOrString cmGeneratorTarget::ResolveTargetReference( return resolved; } -cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name) const +cmLinkItem cmGeneratorTarget::ResolveLinkItem( + std::string const& name, cmListFileBacktrace const& bt) const { TargetOrString resolved = this->ResolveTargetReference(name); if (!resolved.Target) { - return cmLinkItem(resolved.String); + return cmLinkItem(resolved.String, bt); } // Skip targets that will not really be linked. This is probably a @@ -5824,10 +5830,10 @@ cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name) const // within the project. if (resolved.Target->GetType() == cmStateEnums::EXECUTABLE && !resolved.Target->IsExecutableWithExports()) { - return cmLinkItem(resolved.Target->GetName()); + return cmLinkItem(resolved.Target->GetName(), bt); } - return cmLinkItem(resolved.Target); + return cmLinkItem(resolved.Target, bt); } std::string cmGeneratorTarget::GetPDBDirectory(const std::string& config) const diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 98669c35756..07274ce3f06 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -362,7 +362,8 @@ class cmGeneratorTarget }; TargetOrString ResolveTargetReference(std::string const& name) const; - cmLinkItem ResolveLinkItem(std::string const& name) const; + cmLinkItem ResolveLinkItem(std::string const& name, + cmListFileBacktrace const& bt) const; // Compute the set of languages compiled by the target. This is // computed every time it is called because the languages can change @@ -838,6 +839,7 @@ class cmGeneratorTarget std::vector& items, bool& hadHeadSensitiveCondition) const; void LookupLinkItems(std::vector const& names, + cmListFileBacktrace const& bt, std::vector& items) const; void GetSourceFiles(std::vector& files, diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx index 69b6821c162..121731df009 100644 --- a/Source/cmLinkItem.cxx +++ b/Source/cmLinkItem.cxx @@ -12,15 +12,18 @@ cmLinkItem::cmLinkItem() { } -cmLinkItem::cmLinkItem(std::string const& n) +cmLinkItem::cmLinkItem(std::string const& n, cmListFileBacktrace const& bt) : String(n) , Target(nullptr) + , Backtrace(bt) { } -cmLinkItem::cmLinkItem(cmGeneratorTarget const* t) +cmLinkItem::cmLinkItem(cmGeneratorTarget const* t, + cmListFileBacktrace const& bt) : String() , Target(t) + , Backtrace(bt) { } @@ -58,15 +61,12 @@ std::ostream& operator<<(std::ostream& os, cmLinkItem const& item) cmLinkImplItem::cmLinkImplItem() : cmLinkItem() - , Backtrace() , FromGenex(false) { } -cmLinkImplItem::cmLinkImplItem(cmLinkItem item, cmListFileBacktrace const& bt, - bool fromGenex) +cmLinkImplItem::cmLinkImplItem(cmLinkItem item, bool fromGenex) : cmLinkItem(std::move(item)) - , Backtrace(bt) , FromGenex(fromGenex) { } diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 74fd298e452..e1ddd225478 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -24,10 +24,11 @@ class cmLinkItem public: cmLinkItem(); - explicit cmLinkItem(std::string const& s); - explicit cmLinkItem(cmGeneratorTarget const* t); + cmLinkItem(std::string const& s, cmListFileBacktrace const& bt); + cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace const& bt); std::string const& AsStr() const; cmGeneratorTarget const* Target; + cmListFileBacktrace Backtrace; friend bool operator<(cmLinkItem const& l, cmLinkItem const& r); friend bool operator==(cmLinkItem const& l, cmLinkItem const& r); friend std::ostream& operator<<(std::ostream& os, cmLinkItem const& item); @@ -37,9 +38,7 @@ class cmLinkImplItem : public cmLinkItem { public: cmLinkImplItem(); - cmLinkImplItem(cmLinkItem item, cmListFileBacktrace const& bt, - bool fromGenex); - cmListFileBacktrace Backtrace; + cmLinkImplItem(cmLinkItem item, bool fromGenex); bool FromGenex; }; From a6e02f881dc5e74d79201f761fb28c99a9e7d2af Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Oct 2018 10:25:20 -0400 Subject: [PATCH 055/907] add_dependencies: Track backtraces internally Record backtraces for "utility" dependencies created by `add_dependencies` calls. --- Source/cmGeneratorTarget.cxx | 21 ++++++--------------- Source/cmGeneratorTarget.h | 3 +-- Source/cmGlobalNinjaGenerator.cxx | 8 +++++--- Source/cmGlobalVisualStudio71Generator.cxx | 9 +++++---- Source/cmGlobalVisualStudio71Generator.h | 2 +- Source/cmGlobalVisualStudio7Generator.h | 2 +- Source/cmGlobalVisualStudio8Generator.cxx | 4 ++-- Source/cmLocalUnixMakefileGenerator3.cxx | 7 +++++-- Source/cmQtAutoGenInitializer.cxx | 5 +++-- Source/cmTarget.cxx | 20 +++----------------- Source/cmTarget.h | 11 ++++++----- 11 files changed, 38 insertions(+), 54 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 6ce65123785..fa489e20b36 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -674,16 +674,13 @@ std::set const& cmGeneratorTarget::GetUtilityItems() const { if (!this->UtilityItemsDone) { this->UtilityItemsDone = true; - std::set const& utilities = this->GetUtilities(); - for (std::string const& i : utilities) { - cmListFileBacktrace const* bt = this->GetUtilityBacktrace(i); + std::set> const& utilities = this->GetUtilities(); + for (BT const& i : utilities) { if (cmGeneratorTarget* gt = - this->LocalGenerator->FindGeneratorTargetToUse(i)) { - this->UtilityItems.insert( - cmLinkItem(gt, bt ? *bt : cmListFileBacktrace())); + this->LocalGenerator->FindGeneratorTargetToUse(i.Value)) { + this->UtilityItems.insert(cmLinkItem(gt, i.Backtrace)); } else { - this->UtilityItems.insert( - cmLinkItem(i, bt ? *bt : cmListFileBacktrace())); + this->UtilityItems.insert(cmLinkItem(i.Value, i.Backtrace)); } } } @@ -1713,17 +1710,11 @@ cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const return this->Target->GetBacktrace(); } -const std::set& cmGeneratorTarget::GetUtilities() const +const std::set>& cmGeneratorTarget::GetUtilities() const { return this->Target->GetUtilities(); } -const cmListFileBacktrace* cmGeneratorTarget::GetUtilityBacktrace( - const std::string& u) const -{ - return this->Target->GetUtilityBacktrace(u); -} - bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const { return this->GetType() == cmStateEnums::STATIC_LIBRARY || diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 07274ce3f06..7de306ef0e8 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -273,8 +273,7 @@ class cmGeneratorTarget cmListFileBacktrace GetBacktrace() const; - std::set const& GetUtilities() const; - cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const; + std::set> const& GetUtilities() const; bool LinkLanguagePropagatesToDependents() const { diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index f5134037785..8c69f42ee29 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -19,6 +19,7 @@ #include "cmGeneratedFileStream.h" #include "cmGeneratorExpressionEvaluationFile.h" #include "cmGeneratorTarget.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmLocalNinjaGenerator.h" #include "cmMakefile.h" @@ -1008,10 +1009,11 @@ void cmGlobalNinjaGenerator::AppendTargetDepends( { if (target->GetType() == cmStateEnums::GLOBAL_TARGET) { // These depend only on other CMake-provided targets, e.g. "all". - std::set const& utils = target->GetUtilities(); - for (std::string const& util : utils) { + std::set> const& utils = target->GetUtilities(); + for (BT const& util : utils) { std::string d = - target->GetLocalGenerator()->GetCurrentBinaryDirectory() + "/" + util; + target->GetLocalGenerator()->GetCurrentBinaryDirectory() + "/" + + util.Value; outputs.push_back(this->ConvertToNinjaPath(d)); } } else { diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 0b086b064ac..a2163464e74 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -159,7 +159,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends( // executables to the libraries it uses are also done here void cmGlobalVisualStudio71Generator::WriteExternalProject( std::ostream& fout, const std::string& name, const char* location, - const char* typeGuid, const std::set& depends) + const char* typeGuid, const std::set>& depends) { fout << "Project(\"{" << (typeGuid ? typeGuid : this->ExternalProjectType(location)) @@ -171,9 +171,10 @@ void cmGlobalVisualStudio71Generator::WriteExternalProject( // project instead of in the global section if (!depends.empty()) { fout << "\tProjectSection(ProjectDependencies) = postProject\n"; - for (std::string const& it : depends) { - if (!it.empty()) { - fout << "\t\t{" << this->GetGUID(it) << "} = {" << this->GetGUID(it) + for (BT const& it : depends) { + std::string const& dep = it.Value; + if (!dep.empty()) { + fout << "\t\t{" << this->GetGUID(dep) << "} = {" << this->GetGUID(dep) << "}\n"; } } diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 054c3421d2e..b6e3131ab03 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -33,7 +33,7 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator const std::string& platformMapping = "") override; void WriteExternalProject(std::ostream& fout, const std::string& name, const char* path, const char* typeGuid, - const std::set& depends) override; + const std::set>& depends) override; void WriteSLNHeader(std::ostream& fout) override; // Folders are not supported by VS 7.1. diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 0c9dd889be0..251478d166c 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -145,7 +145,7 @@ class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator virtual void WriteExternalProject( std::ostream& fout, const std::string& name, const char* path, - const char* typeGuid, const std::set& dependencies) = 0; + const char* typeGuid, const std::set>& dependencies) = 0; std::string ConvertToSolutionPath(const char* path); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index ba138c22ed7..b155d9ca7e4 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -315,9 +315,9 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies( cmGeneratorTarget* target) { // Look for utility dependencies that magically link. - for (std::string const& ui : target->GetUtilities()) { + for (BT const& ui : target->GetUtilities()) { if (cmGeneratorTarget* depTarget = - target->GetLocalGenerator()->FindGeneratorTargetToUse(ui)) { + target->GetLocalGenerator()->FindGeneratorTargetToUse(ui.Value)) { if (depTarget->GetType() != cmStateEnums::INTERFACE_LIBRARY && depTarget->GetProperty("EXTERNAL_MSPROJECT")) { // This utility dependency names an external .vcproj target. diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 68cdef050d5..6a535c1bf6b 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -17,6 +17,7 @@ #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmGlobalUnixMakefileGenerator3.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmMakefileTargetGenerator.h" @@ -1546,8 +1547,10 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( if (!text) { text = "Running external command ..."; } - depends.insert(depends.end(), gt->GetUtilities().begin(), - gt->GetUtilities().end()); + depends.reserve(gt->GetUtilities().size()); + for (BT const& u : gt->GetUtilities()) { + depends.push_back(u.Value); + } this->AppendEcho(commands, text, cmLocalUnixMakefileGenerator3::EchoGlobal); diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 6bc3b618594..7700767168b 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -12,6 +12,7 @@ #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLinkItem.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" @@ -940,8 +941,8 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() new cmGeneratorTarget(autogenTarget, localGen)); // Forward origin utilities to autogen target - for (std::string const& depName : this->Target->Target->GetUtilities()) { - autogenTarget->AddUtility(depName, makefile); + for (BT const& depName : this->Target->GetUtilities()) { + autogenTarget->AddUtility(depName.Value, makefile); } // Add additional autogen target dependencies to autogen target for (cmTarget* depTarget : this->AutogenTarget.DependTargets) { diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f0d6519bb22..1458f012ff8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -486,24 +486,10 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const return this->GetMakefile()->GetGlobalGenerator(); } -void cmTarget::AddUtility(const std::string& u, cmMakefile* makefile) +void cmTarget::AddUtility(std::string const& u, cmMakefile* mf) { - if (this->Utilities.insert(u).second && makefile) { - this->UtilityBacktraces.insert( - std::make_pair(u, makefile->GetBacktrace())); - } -} - -cmListFileBacktrace const* cmTarget::GetUtilityBacktrace( - const std::string& u) const -{ - std::map::const_iterator i = - this->UtilityBacktraces.find(u); - if (i == this->UtilityBacktraces.end()) { - return nullptr; - } - - return &i->second; + BT util(u, mf ? mf->GetBacktrace() : cmListFileBacktrace()); + this->Utilities.insert(util); } cmListFileBacktrace const& cmTarget::GetBacktrace() const diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 694de1c3ceb..aa2859d0772 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -190,10 +190,12 @@ class cmTarget * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE * commands. It is not a full path nor does it have an extension. */ - void AddUtility(const std::string& u, cmMakefile* makefile = nullptr); + void AddUtility(std::string const& u, cmMakefile* mf = nullptr); ///! Get the utilities used by this target - std::set const& GetUtilities() const { return this->Utilities; } - cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const; + std::set> const& GetUtilities() const + { + return this->Utilities; + } ///! Set/Get a property of this target file void SetProperty(const std::string& prop, const char* value); @@ -307,8 +309,7 @@ class cmTarget bool IsGeneratorProvided; cmPropertyMap Properties; std::set SystemIncludeDirectories; - std::set Utilities; - std::map UtilityBacktraces; + std::set> Utilities; cmPolicies::PolicyMap PolicyMap; std::string Name; std::string InstallPath; From dacbb414550db63ff40225f3f6057c3c74bcf5c9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Oct 2018 10:46:00 -0400 Subject: [PATCH 056/907] Track backtraces in target dependencies internally Carry backtraces on target dependency edges to refer to the line in project code that caused the edge to appear. --- Source/cmComputeComponentGraph.cxx | 4 ++-- Source/cmComputeLinkDepends.cxx | 11 ++++++--- Source/cmComputeTargetDepends.cxx | 37 +++++++++++++++++++----------- Source/cmComputeTargetDepends.h | 3 +++ Source/cmGraphAdjacencyList.h | 8 ++++++- Source/cmTargetDepend.h | 6 +++++ 6 files changed, 50 insertions(+), 19 deletions(-) diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx index a7dc1ca03a9..5820df6f09b 100644 --- a/Source/cmComputeComponentGraph.cxx +++ b/Source/cmComputeComponentGraph.cxx @@ -125,8 +125,8 @@ void cmComputeComponentGraph::TransferEdges() if (i_component != j_component) { // We do not attempt to combine duplicate edges, but instead // store the inter-component edges with suitable multiplicity. - this->ComponentGraph[i_component].emplace_back(j_component, - ni.IsStrong()); + this->ComponentGraph[i_component].emplace_back( + j_component, ni.IsStrong(), ni.GetBacktrace()); } } } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index e3d53e4183a..4717cf6b522 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -420,7 +420,8 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep) // This shared library dependency must follow the item that listed // it. - this->EntryConstraintGraph[dep.DependerIndex].push_back(index); + this->EntryConstraintGraph[dep.DependerIndex].emplace_back( + index, true, cmListFileBacktrace()); // Target items may have their own dependencies. if (entry.Target) { @@ -523,7 +524,8 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index, // The dependee must come after the depender. if (depender_index >= 0) { - this->EntryConstraintGraph[depender_index].push_back(dependee_index); + this->EntryConstraintGraph[depender_index].emplace_back( + dependee_index, false, cmListFileBacktrace()); } else { // This is a direct dependency of the target being linked. this->OriginalEntries.push_back(dependee_index); @@ -595,7 +597,10 @@ void cmComputeLinkDepends::InferDependencies() // Add the inferred dependencies to the graph. cmGraphEdgeList& edges = this->EntryConstraintGraph[depender_index]; - edges.insert(edges.end(), common.begin(), common.end()); + edges.reserve(edges.size() + common.size()); + for (auto const& c : common) { + edges.emplace_back(c, true, cmListFileBacktrace()); + } } } diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 28e12512822..f8ac3337f8a 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -151,6 +151,7 @@ void cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t, cmGeneratorTarget const* dep = this->Targets[ni]; cmTargetDependSet::iterator di = deps.insert(dep).first; di->SetType(ni.IsStrong()); + di->SetBacktrace(ni.GetBacktrace()); } } @@ -258,7 +259,8 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) void cmComputeTargetDepends::AddInterfaceDepends( int depender_index, const cmGeneratorTarget* dependee, - const std::string& config, std::set& emitted) + cmListFileBacktrace const& dependee_backtrace, const std::string& config, + std::set& emitted) { cmGeneratorTarget const* depender = this->Targets[depender_index]; if (cmLinkInterface const* iface = @@ -266,8 +268,13 @@ void cmComputeTargetDepends::AddInterfaceDepends( for (cmLinkItem const& lib : iface->Libraries) { // Don't emit the same library twice for this target. if (emitted.insert(lib).second) { - this->AddTargetDepend(depender_index, lib, true); - this->AddInterfaceDepends(depender_index, lib, config, emitted); + // Inject the backtrace of the original link dependency whose + // link interface we are adding. This indicates the line of + // code in the project that caused this dependency to be added. + cmLinkItem libBT = lib; + libBT.Backtrace = dependee_backtrace; + this->AddTargetDepend(depender_index, libBT, true); + this->AddInterfaceDepends(depender_index, libBT, config, emitted); } } } @@ -290,7 +297,8 @@ void cmComputeTargetDepends::AddInterfaceDepends( if (dependee) { // A target should not depend on itself. emitted.insert(cmLinkItem(depender, cmListFileBacktrace())); - this->AddInterfaceDepends(depender_index, dependee, config, emitted); + this->AddInterfaceDepends(depender_index, dependee, + dependee_name.Backtrace, config, emitted); } } @@ -340,13 +348,14 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, } if (dependee) { - this->AddTargetDepend(depender_index, dependee, linking); + this->AddTargetDepend(depender_index, dependee, dependee_name.Backtrace, + linking); } } -void cmComputeTargetDepends::AddTargetDepend(int depender_index, - const cmGeneratorTarget* dependee, - bool linking) +void cmComputeTargetDepends::AddTargetDepend( + int depender_index, cmGeneratorTarget const* dependee, + cmListFileBacktrace const& dependee_backtrace, bool linking) { if (dependee->IsImported() || dependee->GetType() == cmStateEnums::INTERFACE_LIBRARY) { @@ -355,7 +364,8 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, std::set const& utils = dependee->GetUtilityItems(); for (cmLinkItem const& i : utils) { if (cmGeneratorTarget const* transitive_dependee = i.Target) { - this->AddTargetDepend(depender_index, transitive_dependee, false); + this->AddTargetDepend(depender_index, transitive_dependee, i.Backtrace, + false); } } } else { @@ -367,7 +377,8 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, int dependee_index = tii->second; // Add this entry to the dependency graph. - this->InitialGraph[depender_index].emplace_back(dependee_index, !linking); + this->InitialGraph[depender_index].emplace_back(dependee_index, !linking, + dependee_backtrace); } } @@ -501,7 +512,7 @@ bool cmComputeTargetDepends::IntraComponent(std::vector const& cmap, for (cmGraphEdge const& edge : el) { int j = edge; if (cmap[j] == c && edge.IsStrong()) { - this->FinalGraph[i].emplace_back(j, true); + this->FinalGraph[i].emplace_back(j, true, edge.GetBacktrace()); if (!this->IntraComponent(cmap, c, j, head, emitted, visited)) { return false; } @@ -510,7 +521,7 @@ bool cmComputeTargetDepends::IntraComponent(std::vector const& cmap, // Prepend to a linear linked-list of intra-component edges. if (*head >= 0) { - this->FinalGraph[i].emplace_back(*head, false); + this->FinalGraph[i].emplace_back(*head, false, cmListFileBacktrace()); } else { this->ComponentTail[c] = i; } @@ -561,7 +572,7 @@ bool cmComputeTargetDepends::ComputeFinalDepends( int dependee_component = ni; int dependee_component_head = this->ComponentHead[dependee_component]; this->FinalGraph[depender_component_tail].emplace_back( - dependee_component_head, ni.IsStrong()); + dependee_component_head, ni.IsStrong(), ni.GetBacktrace()); } } return true; diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h index 3046e8af92c..3840bd7526f 100644 --- a/Source/cmComputeTargetDepends.h +++ b/Source/cmComputeTargetDepends.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmGraphAdjacencyList.h" +#include "cmListFileCache.h" #include #include @@ -47,6 +48,7 @@ class cmComputeTargetDepends void AddTargetDepend(int depender_index, cmLinkItem const& dependee_name, bool linking); void AddTargetDepend(int depender_index, cmGeneratorTarget const* dependee, + cmListFileBacktrace const& dependee_backtrace, bool linking); bool ComputeFinalDepends(cmComputeComponentGraph const& ccg); void AddInterfaceDepends(int depender_index, cmLinkItem const& dependee_name, @@ -54,6 +56,7 @@ class cmComputeTargetDepends std::set& emitted); void AddInterfaceDepends(int depender_index, cmGeneratorTarget const* dependee, + cmListFileBacktrace const& dependee_backtrace, const std::string& config, std::set& emitted); cmGlobalGenerator* GlobalGenerator; diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index 6a0a79912d2..fb2eee23b1c 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -5,6 +5,8 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include "cmListFileCache.h" + #include /** @@ -15,18 +17,22 @@ class cmGraphEdge { public: - cmGraphEdge(int n = 0, bool s = true) + cmGraphEdge(int n, bool s, cmListFileBacktrace const& bt) : Dest(n) , Strong(s) + , Backtrace(bt) { } operator int() const { return this->Dest; } bool IsStrong() const { return this->Strong; } + cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; } + private: int Dest; bool Strong; + cmListFileBacktrace Backtrace; }; struct cmGraphEdgeList : public std::vector { diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index b698db60139..5ea00852390 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -19,6 +19,7 @@ class cmTargetDepend // mutable members to achieve a map with set syntax. mutable bool Link; mutable bool Util; + mutable cmListFileBacktrace Backtrace; public: cmTargetDepend(cmGeneratorTarget const* t) @@ -42,8 +43,13 @@ class cmTargetDepend this->Link = true; } } + void SetBacktrace(cmListFileBacktrace const& bt) const + { + this->Backtrace = bt; + } bool IsLink() const { return this->Link; } bool IsUtil() const { return this->Util; } + cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; } }; /** Unordered set of (direct) dependencies of a target. */ From 52311484dd8c7d3882f7f4c75efe0c3855c2f982 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 25 Sep 2018 11:21:00 -0400 Subject: [PATCH 057/907] cmLocalGenerator: Make MoveSystemIncludesToEnd file-local --- Source/cmLocalGenerator.cxx | 11 ++++++----- Source/cmLocalGenerator.h | 4 ---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 941d7878549..7d922d7c9c5 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -202,9 +202,10 @@ void cmLocalGenerator::ComputeObjectMaxPath() this->ObjectMaxPathViolations.clear(); } -void cmLocalGenerator::MoveSystemIncludesToEnd( - std::vector& includeDirs, const std::string& config, - const std::string& lang, const cmGeneratorTarget* target) const +static void MoveSystemIncludesToEnd(std::vector& includeDirs, + const std::string& config, + const std::string& lang, + const cmGeneratorTarget* target) { if (!target) { return; @@ -707,7 +708,7 @@ std::string cmLocalGenerator::GetIncludeFlags( } std::vector includes = includeDirs; - this->MoveSystemIncludesToEnd(includes, config, lang, target); + MoveSystemIncludesToEnd(includes, config, lang, target); OutputFormat shellFormat = forResponseFile ? RESPONSE : SHELL; std::ostringstream includeFlags; @@ -960,7 +961,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, } } - this->MoveSystemIncludesToEnd(dirs, config, lang, target); + MoveSystemIncludesToEnd(dirs, config, lang, target); // Add standard include directories for this language. { diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index f8d70ca30ad..acdad64d6a9 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -414,10 +414,6 @@ class cmLocalGenerator : public cmOutputConverter int targetType); void ComputeObjectMaxPath(); - void MoveSystemIncludesToEnd(std::vector& includeDirs, - const std::string& config, - const std::string& lang, - cmGeneratorTarget const* target) const; }; #if defined(CMAKE_BUILD_WITH_CMAKE) From 753ab3c978fa763fc5b7d9fc3d08b1a4d7b46e5e Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Sep 2018 10:54:51 -0400 Subject: [PATCH 058/907] Add generator APIs to get build settings with backtraces In cmGeneratorTarget and cmLocalGenerator we offer several APIs to get build settings like include directories, compile definitions, source files, etc. Add corresponding APIs that include backtrace information. --- Source/cmGeneratorTarget.cxx | 267 ++++++++++++++++++++++++++--------- Source/cmGeneratorTarget.h | 31 +++- Source/cmLocalGenerator.cxx | 125 +++++++++++----- Source/cmLocalGenerator.h | 18 ++- 4 files changed, 329 insertions(+), 112 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index fa489e20b36..b8c9598e8a0 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -439,7 +439,7 @@ static void handleSystemIncludesDep( KindedSources const& kinded = this->GetKindedSources(config); \ for (SourceAndKind const& s : kinded.Sources) { \ if (s.Kind == KIND) { \ - data.push_back(s.Source); \ + data.push_back(s.Source.Value); \ } \ } \ } @@ -865,7 +865,8 @@ static void AddObjectEntries( static bool processSources( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& srcs, std::unordered_set& uniqueSrcs, + std::vector>& srcs, + std::unordered_set& uniqueSrcs, cmGeneratorExpressionDAGChecker* dagChecker, std::string const& config, bool debugSources) { @@ -916,7 +917,7 @@ static bool processSources( std::string usedSources; for (std::string const& src : entrySources) { if (uniqueSrcs.insert(src).second) { - srcs.push_back(src); + srcs.emplace_back(src, entry->ge->GetBacktrace()); if (debugSources) { usedSources += " * " + src + "\n"; } @@ -933,9 +934,10 @@ static bool processSources( return contextDependent; } -void cmGeneratorTarget::GetSourceFiles(std::vector& files, - const std::string& config) const +std::vector> cmGeneratorTarget::GetSourceFilePaths( + std::string const& config) const { + std::vector> files; assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); if (!this->LocalGenerator->GetGlobalGenerator()->GetConfigureDoneCMP0026()) { @@ -957,7 +959,7 @@ void cmGeneratorTarget::GetSourceFiles(std::vector& files, files.push_back(item); } } - return; + return files; } std::vector debugProperties; @@ -1009,11 +1011,23 @@ void cmGeneratorTarget::GetSourceFiles(std::vector& files, cmDeleteAll(linkInterfaceSourcesEntries); cmDeleteAll(linkObjectsEntries); + return files; } void cmGeneratorTarget::GetSourceFiles(std::vector& files, const std::string& config) const { + std::vector> tmp = this->GetSourceFiles(config); + files.reserve(tmp.size()); + for (BT& v : tmp) { + files.push_back(v.Value); + } +} + +std::vector> cmGeneratorTarget::GetSourceFiles( + std::string const& config) const +{ + std::vector> files; if (!this->GlobalGenerator->GetConfigureDoneCMP0026()) { // Since we are still configuring not all sources may exist yet, // so we need to avoid full source classification because that @@ -1021,16 +1035,15 @@ void cmGeneratorTarget::GetSourceFiles(std::vector& files, // Since this is only for compatibility with old policies that // projects should not depend on anymore, just compute the files // without memoizing them. - std::vector srcs; - this->GetSourceFiles(srcs, config); + std::vector> srcs = this->GetSourceFilePaths(config); std::set emitted; - for (std::string const& s : srcs) { - cmSourceFile* sf = this->Makefile->GetOrCreateSource(s); + for (BT const& s : srcs) { + cmSourceFile* sf = this->Makefile->GetOrCreateSource(s.Value); if (emitted.insert(sf).second) { - files.push_back(sf); + files.emplace_back(sf, s.Backtrace); } } - return; + return files; } KindedSources const& kinded = this->GetKindedSources(config); @@ -1038,18 +1051,33 @@ void cmGeneratorTarget::GetSourceFiles(std::vector& files, for (SourceAndKind const& si : kinded.Sources) { files.push_back(si.Source); } + return files; } void cmGeneratorTarget::GetSourceFilesWithoutObjectLibraries( std::vector& files, const std::string& config) const { + std::vector> tmp = + this->GetSourceFilesWithoutObjectLibraries(config); + files.reserve(tmp.size()); + for (BT& v : tmp) { + files.push_back(v.Value); + } +} + +std::vector> +cmGeneratorTarget::GetSourceFilesWithoutObjectLibraries( + std::string const& config) const +{ + std::vector> files; KindedSources const& kinded = this->GetKindedSources(config); files.reserve(kinded.Sources.size()); for (SourceAndKind const& si : kinded.Sources) { - if (si.Source->GetObjectLibrary().empty()) { + if (si.Source.Value->GetObjectLibrary().empty()) { files.push_back(si.Source); } } + return files; } cmGeneratorTarget::KindedSources const& cmGeneratorTarget::GetKindedSources( @@ -1089,16 +1117,15 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files, std::string const& config) const { // Get the source file paths by string. - std::vector srcs; - this->GetSourceFiles(srcs, config); + std::vector> srcs = this->GetSourceFilePaths(config); cmsys::RegularExpression header_regex(CM_HEADER_REGEX); std::vector badObjLib; std::set emitted; - for (std::string const& s : srcs) { + for (BT const& s : srcs) { // Create each source at most once. - cmSourceFile* sf = this->Makefile->GetOrCreateSource(s); + cmSourceFile* sf = this->Makefile->GetOrCreateSource(s.Value); if (!emitted.insert(sf).second) { continue; } @@ -1161,7 +1188,7 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files, } // Save this classified source file in the result vector. - files.Sources.push_back({ sf, kind }); + files.Sources.push_back({ BT(sf, s.Backtrace), kind }); } if (!badObjLib.empty()) { @@ -1197,14 +1224,14 @@ void cmGeneratorTarget::ComputeAllConfigSources() const KindedSources const& sources = this->GetKindedSources(configs[ci]); for (SourceAndKind const& src : sources.Sources) { std::map::iterator mi = - index.find(src.Source); + index.find(src.Source.Value); if (mi == index.end()) { AllConfigSource acs; - acs.Source = src.Source; + acs.Source = src.Source.Value; acs.Kind = src.Kind; this->AllConfigSources.push_back(std::move(acs)); std::map::value_type entry( - src.Source, this->AllConfigSources.size() - 1); + src.Source.Value, this->AllConfigSources.size() - 1); mi = index.insert(entry).first; } this->AllConfigSources[mi->second].Configs.push_back(ci); @@ -2474,7 +2501,7 @@ std::string cmGeneratorTarget::GetCreateRuleVariable( static void processIncludeDirectories( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& includes, + std::vector>& includes, std::unordered_set& uniqueIncludes, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugIncludes, const std::string& language) @@ -2566,7 +2593,7 @@ static void processIncludeDirectories( std::string inc = entryInclude; if (uniqueIncludes.insert(inc).second) { - includes.push_back(inc); + includes.emplace_back(inc, entry->ge->GetBacktrace()); if (debugIncludes) { usedIncludes += " * " + inc + "\n"; } @@ -2582,10 +2609,10 @@ static void processIncludeDirectories( } } -std::vector cmGeneratorTarget::GetIncludeDirectories( +std::vector> cmGeneratorTarget::GetIncludeDirectories( const std::string& config, const std::string& lang) const { - std::vector includes; + std::vector> includes; std::unordered_set uniqueIncludes; cmGeneratorExpressionDAGChecker dagChecker(this, "INCLUDE_DIRECTORIES", @@ -2655,7 +2682,7 @@ enum class OptionsParse static void processOptionsInternal( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& options, + std::vector>& options, std::unordered_set& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions, const char* logName, std::string const& language, @@ -2672,9 +2699,13 @@ static void processOptionsInternal( if (uniqueOptions.insert(opt).second) { if (parse == OptionsParse::Shell && cmHasLiteralPrefix(opt, "SHELL:")) { - cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, options); + std::vector tmp; + cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, tmp); + for (std::string& o : tmp) { + options.emplace_back(std::move(o), entry->ge->GetBacktrace()); + } } else { - options.push_back(opt); + options.emplace_back(opt, entry->ge->GetBacktrace()); } if (debugOptions) { usedOptions += " * " + opt + "\n"; @@ -2694,7 +2725,7 @@ static void processOptionsInternal( static void processCompileOptions( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& options, + std::vector>& options, std::unordered_set& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions, std::string const& language) @@ -2708,6 +2739,17 @@ void cmGeneratorTarget::GetCompileOptions(std::vector& result, const std::string& config, const std::string& language) const { + std::vector> tmp = this->GetCompileOptions(config, language); + result.reserve(tmp.size()); + for (BT& v : tmp) { + result.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmGeneratorTarget::GetCompileOptions( + std::string const& config, std::string const& language) const +{ + std::vector> result; std::unordered_set uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_OPTIONS", nullptr, @@ -2743,12 +2785,13 @@ void cmGeneratorTarget::GetCompileOptions(std::vector& result, language); cmDeleteAll(linkInterfaceCompileOptionsEntries); + return result; } static void processCompileFeatures( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& options, + std::vector>& options, std::unordered_set& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions) @@ -2761,6 +2804,17 @@ static void processCompileFeatures( void cmGeneratorTarget::GetCompileFeatures(std::vector& result, const std::string& config) const { + std::vector> tmp = this->GetCompileFeatures(config); + result.reserve(tmp.size()); + for (BT& v : tmp) { + result.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmGeneratorTarget::GetCompileFeatures( + std::string const& config) const +{ + std::vector> result; std::unordered_set uniqueFeatures; cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_FEATURES", nullptr, @@ -2793,12 +2847,13 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector& result, uniqueFeatures, &dagChecker, config, debugFeatures); cmDeleteAll(linkInterfaceCompileFeaturesEntries); + return result; } static void processCompileDefinitions( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& options, + std::vector>& options, std::unordered_set& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions, std::string const& language) @@ -2809,9 +2864,21 @@ static void processCompileDefinitions( } void cmGeneratorTarget::GetCompileDefinitions( - std::vector& list, const std::string& config, + std::vector& result, const std::string& config, const std::string& language) const { + std::vector> tmp = + this->GetCompileDefinitions(config, language); + result.reserve(tmp.size()); + for (BT& v : tmp) { + result.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmGeneratorTarget::GetCompileDefinitions( + std::string const& config, std::string const& language) const +{ + std::vector> list; std::unordered_set uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_DEFINITIONS", @@ -2872,13 +2939,14 @@ void cmGeneratorTarget::GetCompileDefinitions( language); cmDeleteAll(linkInterfaceCompileDefinitionsEntries); + return list; } namespace { void processLinkOptions( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& options, + std::vector>& options, std::unordered_set& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions, std::string const& language) @@ -2893,6 +2961,17 @@ void cmGeneratorTarget::GetLinkOptions(std::vector& result, const std::string& config, const std::string& language) const { + std::vector> tmp = this->GetLinkOptions(config, language); + result.reserve(tmp.size()); + for (BT& v : tmp) { + result.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmGeneratorTarget::GetLinkOptions( + std::string const& config, std::string const& language) const +{ + std::vector> result; std::unordered_set uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_OPTIONS", nullptr, @@ -2946,21 +3025,24 @@ void cmGeneratorTarget::GetLinkOptions(std::vector& result, const std::string SHELL{ "SHELL:" }; const std::string LINKER_SHELL = LINKER + SHELL; - std::vector::iterator entry; + std::vector>::iterator entry; while ((entry = std::find_if(result.begin(), result.end(), - [&LINKER](const std::string& item) -> bool { - return item.compare(0, LINKER.length(), - LINKER) == 0; + [&LINKER](BT const& item) -> bool { + return item.Value.compare(0, LINKER.length(), + LINKER) == 0; })) != result.end()) { + std::string value = std::move(entry->Value); + cmListFileBacktrace bt = std::move(entry->Backtrace); + entry = result.erase(entry); + std::vector linkerOptions; - if (entry->compare(0, LINKER_SHELL.length(), LINKER_SHELL) == 0) { + if (value.compare(0, LINKER_SHELL.length(), LINKER_SHELL) == 0) { cmSystemTools::ParseUnixCommandLine( - entry->c_str() + LINKER_SHELL.length(), linkerOptions); + value.c_str() + LINKER_SHELL.length(), linkerOptions); } else { linkerOptions = - cmSystemTools::tokenize(entry->substr(LINKER.length()), ","); + cmSystemTools::tokenize(value.substr(LINKER.length()), ","); } - entry = result.erase(entry); if (linkerOptions.empty() || (linkerOptions.size() == 1 && linkerOptions.front().empty())) { @@ -2976,56 +3058,64 @@ void cmGeneratorTarget::GetLinkOptions(std::vector& result, cmake::FATAL_ERROR, "'SHELL:' prefix is not supported as part of 'LINKER:' arguments.", this->GetBacktrace()); - return; + return result; } + std::vector> options; if (wrapperFlag.empty()) { // nothing specified, insert elements as is - result.insert(entry, linkerOptions.begin(), linkerOptions.end()); + options.reserve(linkerOptions.size()); + for (std::string& o : linkerOptions) { + options.emplace_back(std::move(o), bt); + } } else { - std::vector options; - if (!wrapperSep.empty()) { if (concatFlagAndArgs) { // insert flag elements except last one - options.insert(options.end(), wrapperFlag.begin(), - wrapperFlag.end() - 1); + for (auto i = wrapperFlag.begin(); i != wrapperFlag.end() - 1; ++i) { + options.emplace_back(*i, bt); + } // concatenate last flag element and all LINKER list values // in one option - options.push_back(wrapperFlag.back() + - cmJoin(linkerOptions, wrapperSep)); + options.emplace_back( + wrapperFlag.back() + cmJoin(linkerOptions, wrapperSep), bt); } else { - options.insert(options.end(), wrapperFlag.begin(), - wrapperFlag.end()); + for (std::string const& i : wrapperFlag) { + options.emplace_back(i, bt); + } // concatenate all LINKER list values in one option - options.push_back(cmJoin(linkerOptions, wrapperSep)); + options.emplace_back(cmJoin(linkerOptions, wrapperSep), bt); } } else { // prefix each element of LINKER list with wrapper if (concatFlagAndArgs) { - std::transform( - linkerOptions.begin(), linkerOptions.end(), linkerOptions.begin(), - [&wrapperFlag](const std::string& value) -> std::string { - return wrapperFlag.back() + value; - }); + std::transform(linkerOptions.begin(), linkerOptions.end(), + linkerOptions.begin(), + [&wrapperFlag](std::string const& o) -> std::string { + return wrapperFlag.back() + o; + }); } - for (const auto& value : linkerOptions) { - options.insert(options.end(), wrapperFlag.begin(), - concatFlagAndArgs ? wrapperFlag.end() - 1 - : wrapperFlag.end()); - options.push_back(value); + for (std::string& o : linkerOptions) { + for (auto i = wrapperFlag.begin(), + e = concatFlagAndArgs ? wrapperFlag.end() - 1 + : wrapperFlag.end(); + i != e; ++i) { + options.emplace_back(*i, bt); + } + options.emplace_back(std::move(o), bt); } } - result.insert(entry, options.begin(), options.end()); } + result.insert(entry, options.begin(), options.end()); } + return result; } namespace { void processStaticLibraryLinkOptions( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& options, + std::vector>& options, std::unordered_set& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, std::string const& language) @@ -3040,6 +3130,18 @@ void cmGeneratorTarget::GetStaticLibraryLinkOptions( std::vector& result, const std::string& config, const std::string& language) const { + std::vector> tmp = + this->GetStaticLibraryLinkOptions(config, language); + result.reserve(tmp.size()); + for (BT& v : tmp) { + result.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmGeneratorTarget::GetStaticLibraryLinkOptions( + std::string const& config, std::string const& language) const +{ + std::vector> result; std::vector entries; std::unordered_set uniqueOptions; @@ -3060,13 +3162,14 @@ void cmGeneratorTarget::GetStaticLibraryLinkOptions( &dagChecker, config, language); cmDeleteAll(entries); + return result; } namespace { void processLinkDirectories( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& directories, + std::vector>& directories, std::unordered_set& uniqueDirectories, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugDirectories, std::string const& language) @@ -3145,6 +3248,18 @@ void cmGeneratorTarget::GetLinkDirectories(std::vector& result, const std::string& config, const std::string& language) const { + std::vector> tmp = + this->GetLinkDirectories(config, language); + result.reserve(tmp.size()); + for (BT& v : tmp) { + result.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmGeneratorTarget::GetLinkDirectories( + std::string const& config, std::string const& language) const +{ + std::vector> result; std::unordered_set uniqueDirectories; cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DIRECTORIES", nullptr, @@ -3180,13 +3295,14 @@ void cmGeneratorTarget::GetLinkDirectories(std::vector& result, debugDirectories, language); cmDeleteAll(linkInterfaceLinkDirectoriesEntries); + return result; } namespace { void processLinkDepends( cmGeneratorTarget const* tgt, const std::vector& entries, - std::vector& options, + std::vector>& options, std::unordered_set& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, std::string const& language) @@ -3201,6 +3317,17 @@ void cmGeneratorTarget::GetLinkDepends(std::vector& result, const std::string& config, const std::string& language) const { + std::vector> tmp = this->GetLinkDepends(config, language); + result.reserve(tmp.size()); + for (BT& v : tmp) { + result.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmGeneratorTarget::GetLinkDepends( + std::string const& config, std::string const& language) const +{ + std::vector> result; std::vector linkDependsEntries; std::unordered_set uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DEPENDS", nullptr, @@ -3222,6 +3349,7 @@ void cmGeneratorTarget::GetLinkDepends(std::vector& result, &dagChecker, config, language); cmDeleteAll(linkDependsEntries); + return result; } void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const @@ -3287,10 +3415,9 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const { - std::vector features; - this->GetCompileFeatures(features, config); - for (std::string const& f : features) { - if (!this->Makefile->AddRequiredTargetFeature(this->Target, f)) { + std::vector> features = this->GetCompileFeatures(config); + for (BT const& f : features) { + if (!this->Makefile->AddRequiredTargetFeature(this->Target, f.Value)) { return false; } } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 7de306ef0e8..4c32558c45e 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -75,8 +75,8 @@ class cmGeneratorTarget bool GetPropertyAsBool(const std::string& prop) const; void GetSourceFiles(std::vector& files, const std::string& config) const; - void GetSourceFilesWithoutObjectLibraries(std::vector& files, - const std::string& config) const; + std::vector> GetSourceFiles( + std::string const& config) const; /** Source file kinds (classifications). Generators use this to decide how to treat a source file. */ @@ -99,7 +99,7 @@ class cmGeneratorTarget /** A source file paired with a kind (classification). */ struct SourceAndKind { - cmSourceFile* Source; + BT Source; SourceKind Kind; }; @@ -412,34 +412,49 @@ class cmGeneratorTarget std::string const& config) const; /** Get the include directories for this target. */ - std::vector GetIncludeDirectories( + std::vector> GetIncludeDirectories( const std::string& config, const std::string& lang) const; void GetCompileOptions(std::vector& result, const std::string& config, const std::string& language) const; + std::vector> GetCompileOptions( + std::string const& config, std::string const& language) const; void GetCompileFeatures(std::vector& features, const std::string& config) const; + std::vector> GetCompileFeatures( + std::string const& config) const; void GetCompileDefinitions(std::vector& result, const std::string& config, const std::string& language) const; + std::vector> GetCompileDefinitions( + std::string const& config, std::string const& language) const; void GetLinkOptions(std::vector& result, const std::string& config, const std::string& language) const; + std::vector> GetLinkOptions( + std::string const& config, std::string const& language) const; + void GetStaticLibraryLinkOptions(std::vector& result, const std::string& config, const std::string& language) const; + std::vector> GetStaticLibraryLinkOptions( + std::string const& config, std::string const& language) const; void GetLinkDirectories(std::vector& result, const std::string& config, const std::string& language) const; + std::vector> GetLinkDirectories( + std::string const& config, std::string const& language) const; void GetLinkDepends(std::vector& result, const std::string& config, const std::string& language) const; + std::vector> GetLinkDepends( + std::string const& config, std::string const& language) const; bool IsSystemIncludeDirectory(const std::string& dir, const std::string& config, @@ -841,8 +856,12 @@ class cmGeneratorTarget cmListFileBacktrace const& bt, std::vector& items) const; - void GetSourceFiles(std::vector& files, - const std::string& config) const; + std::vector> GetSourceFilePaths( + std::string const& config) const; + std::vector> GetSourceFilesWithoutObjectLibraries( + std::string const& config) const; + void GetSourceFilesWithoutObjectLibraries(std::vector& files, + const std::string& config) const; struct HeadToLinkImplementationMap : public std::map diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7d922d7c9c5..7beeb7145c7 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -219,6 +219,24 @@ static void MoveSystemIncludesToEnd(std::vector& includeDirs, }); } +static void MoveSystemIncludesToEnd(std::vector>& includeDirs, + const std::string& config, + const std::string& lang, + const cmGeneratorTarget* target) +{ + if (!target) { + return; + } + + std::stable_sort(includeDirs.begin(), includeDirs.end(), + [target, &config, &lang](BT const& a, + BT const& b) { + return !target->IsSystemIncludeDirectory(a.Value, config, + lang) && + target->IsSystemIncludeDirectory(b.Value, config, lang); + }); +} + void cmLocalGenerator::TraceDependencies() { std::vector configs; @@ -869,6 +887,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, bool stripImplicitDirs, bool appendAllImplicitDirs) const { + std::vector> tmp = this->GetIncludeDirectories( + target, lang, config, stripImplicitDirs, appendAllImplicitDirs); + dirs.reserve(tmp.size()); + for (BT& v : tmp) { + dirs.emplace_back(std::move(v.Value)); + } +} + +std::vector> cmLocalGenerator::GetIncludeDirectories( + cmGeneratorTarget const* target, std::string const& lang, + std::string const& config, bool stripImplicitDirs, + bool appendAllImplicitDirs) const +{ + std::vector> result; + // Do not repeat an include path. std::set emitted; @@ -885,7 +918,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, std::string binDir = this->StateSnapshot.GetDirectory().GetCurrentBinary(); if (emitted.insert(binDir).second) { - dirs.push_back(std::move(binDir)); + result.emplace_back(std::move(binDir)); } } // Current source directory @@ -893,13 +926,13 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, std::string srcDir = this->StateSnapshot.GetDirectory().GetCurrentSource(); if (emitted.insert(srcDir).second) { - dirs.push_back(std::move(srcDir)); + result.emplace_back(std::move(srcDir)); } } } if (!target) { - return; + return result; } // Implicit include directories @@ -932,7 +965,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, } // Get the target-specific include directories. - std::vector userDirs = + std::vector> userDirs = target->GetIncludeDirectories(config, lang); // Support putting all the in-project include directories first if @@ -940,44 +973,44 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, if (this->Makefile->IsOn("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE")) { std::string const &topSourceDir = this->GetState()->GetSourceDirectory(), &topBinaryDir = this->GetState()->GetBinaryDirectory(); - for (std::string const& i : userDirs) { + for (BT const& i : userDirs) { // Emit this directory only if it is a subdirectory of the // top-level source or binary tree. - if (cmSystemTools::ComparePath(i, topSourceDir) || - cmSystemTools::ComparePath(i, topBinaryDir) || - cmSystemTools::IsSubDirectory(i, topSourceDir) || - cmSystemTools::IsSubDirectory(i, topBinaryDir)) { - if (emitted.insert(i).second) { - dirs.push_back(i); + if (cmSystemTools::ComparePath(i.Value, topSourceDir) || + cmSystemTools::ComparePath(i.Value, topBinaryDir) || + cmSystemTools::IsSubDirectory(i.Value, topSourceDir) || + cmSystemTools::IsSubDirectory(i.Value, topBinaryDir)) { + if (emitted.insert(i.Value).second) { + result.push_back(i); } } } } // Construct the final ordered include directory list. - for (std::string const& i : userDirs) { - if (emitted.insert(i).second) { - dirs.push_back(i); + for (BT const& i : userDirs) { + if (emitted.insert(i.Value).second) { + result.push_back(i); } } - MoveSystemIncludesToEnd(dirs, config, lang, target); + MoveSystemIncludesToEnd(result, config, lang, target); // Add standard include directories for this language. { - std::vector::size_type const before = userDirs.size(); + std::vector userStandardDirs; { std::string key = "CMAKE_"; key += lang; key += "_STANDARD_INCLUDE_DIRECTORIES"; std::string const value = this->Makefile->GetSafeDefinition(key); - cmSystemTools::ExpandListArgument(value, userDirs); + cmSystemTools::ExpandListArgument(value, userStandardDirs); } - for (std::vector::iterator i = userDirs.begin() + before, - ie = userDirs.end(); - i != ie; ++i) { - cmSystemTools::ConvertToUnixSlashes(*i); - dirs.push_back(*i); + userDirs.reserve(userDirs.size() + userStandardDirs.size()); + for (std::string& d : userStandardDirs) { + cmSystemTools::ConvertToUnixSlashes(d); + result.emplace_back(d); + userDirs.emplace_back(std::move(d)); } } @@ -985,18 +1018,20 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, // Append only implicit directories that were requested by the user for (std::string const& i : implicitDirs) { if (std::find(userDirs.begin(), userDirs.end(), i) != userDirs.end()) { - dirs.push_back(i); + result.emplace_back(i); } } // Append remaining implicit directories on demand if (appendAllImplicitDirs) { for (std::string const& i : implicitDirs) { - if (std::find(dirs.begin(), dirs.end(), i) == dirs.end()) { - dirs.push_back(i); + if (std::find(result.begin(), result.end(), i) == result.end()) { + result.emplace_back(i); } } } } + + return result; } void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags, @@ -1253,15 +1288,29 @@ void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target, std::string const& lang, std::set& defines) const { + std::set> tmp = this->GetTargetDefines(target, config, lang); + for (BT const& v : tmp) { + defines.emplace(v.Value); + } +} + +std::set> cmLocalGenerator::GetTargetDefines( + cmGeneratorTarget const* target, std::string const& config, + std::string const& lang) const +{ + std::set> defines; + // Add the export symbol definition for shared library objects. if (const std::string* exportMacro = target->GetExportMacro()) { this->AppendDefines(defines, *exportMacro); } // Add preprocessor definitions for this target and configuration. - std::vector targetDefines; - target->GetCompileDefinitions(targetDefines, config, lang); + std::vector> targetDefines = + target->GetCompileDefinitions(config, lang); this->AppendDefines(defines, targetDefines); + + return defines; } std::string cmLocalGenerator::GetTargetFortranFlags( @@ -2060,6 +2109,16 @@ void cmLocalGenerator::AppendIncludeDirectories( void cmLocalGenerator::AppendDefines(std::set& defines, const char* defines_list) const +{ + std::set> tmp; + this->AppendDefines(tmp, ExpandListWithBacktrace(defines_list)); + for (BT const& i : tmp) { + defines.emplace(i.Value); + } +} + +void cmLocalGenerator::AppendDefines(std::set>& defines, + const char* defines_list) const { // Short-circuit if there are no definitions. if (!defines_list) { @@ -2067,18 +2126,16 @@ void cmLocalGenerator::AppendDefines(std::set& defines, } // Expand the list of definitions. - std::vector defines_vec; - cmSystemTools::ExpandListArgument(defines_list, defines_vec); - this->AppendDefines(defines, defines_vec); + this->AppendDefines(defines, ExpandListWithBacktrace(defines_list)); } void cmLocalGenerator::AppendDefines( - std::set& defines, - const std::vector& defines_vec) const + std::set>& defines, + const std::vector>& defines_vec) const { - for (std::string const& d : defines_vec) { + for (BT const& d : defines_vec) { // Skip unsupported definitions. - if (!this->CheckDefinition(d)) { + if (!this->CheckDefinition(d.Value)) { continue; } defines.insert(d); diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index acdad64d6a9..95a8a6a9695 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -175,8 +175,15 @@ class cmLocalGenerator : public cmOutputConverter { this->AppendDefines(defines, defines_list.c_str()); } - void AppendDefines(std::set& defines, - const std::vector& defines_vec) const; + void AppendDefines(std::set>& defines, + const char* defines_list) const; + void AppendDefines(std::set>& defines, + std::string const& defines_list) const + { + this->AppendDefines(defines, defines_list.c_str()); + } + void AppendDefines(std::set>& defines, + const std::vector>& defines_vec) const; /** * Encode a list of compile options for the compiler @@ -249,6 +256,10 @@ class cmLocalGenerator : public cmOutputConverter const std::string& config = "", bool stripImplicitDirs = true, bool appendAllImplicitDirs = false) const; + std::vector> GetIncludeDirectories( + cmGeneratorTarget const* target, std::string const& lang = "C", + std::string const& config = "", bool stripImplicitDirs = true, + bool appendAllImplicitDirs = false) const; void AddCompileOptions(std::string& flags, cmGeneratorTarget* target, const std::string& lang, const std::string& config); @@ -332,6 +343,9 @@ class cmLocalGenerator : public cmOutputConverter void GetTargetDefines(cmGeneratorTarget const* target, std::string const& config, std::string const& lang, std::set& defines) const; + std::set> GetTargetDefines(cmGeneratorTarget const* target, + std::string const& config, + std::string const& lang) const; void GetTargetCompileFlags(cmGeneratorTarget* target, std::string const& config, std::string const& lang, std::string& flags); From dd4f8b2a48c7962dfa9cf856c36aa1c235248b2d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Oct 2018 07:25:50 -0400 Subject: [PATCH 059/907] install: Record TARGET mode backtraces internally --- Source/cmInstallCommand.cxx | 58 +++++++++++++++-------------- Source/cmInstallTargetGenerator.cxx | 3 +- Source/cmInstallTargetGenerator.h | 15 +++++--- 3 files changed, 43 insertions(+), 33 deletions(-) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 6e33cf7a308..fbc5278c153 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -20,6 +20,7 @@ #include "cmInstallGenerator.h" #include "cmInstallScriptGenerator.h" #include "cmInstallTargetGenerator.h" +#include "cmListFileCache.h" #include "cmMakefile.h" #include "cmPolicies.h" #include "cmStateTypes.h" @@ -32,7 +33,8 @@ class cmExecutionStatus; static cmInstallTargetGenerator* CreateInstallTargetGenerator( cmTarget& target, const cmInstallCommandArguments& args, bool impLib, - bool forceOpt = false, bool namelink = false) + cmListFileBacktrace const& backtrace, bool forceOpt = false, + bool namelink = false) { cmInstallGenerator::MessageLevel message = cmInstallGenerator::SelectMessageLevel(target.GetMakefile()); @@ -42,7 +44,8 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator( return new cmInstallTargetGenerator( target.GetName(), args.GetDestination().c_str(), impLib, args.GetPermissions().c_str(), args.GetConfigurations(), component, - message, args.GetExcludeFromAll(), args.GetOptional() || forceOpt); + message, args.GetExcludeFromAll(), args.GetOptional() || forceOpt, + backtrace); } static cmInstallFilesGenerator* CreateInstallFilesGenerator( @@ -435,13 +438,13 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // This is a DLL platform. if (!archiveArgs.GetDestination().empty()) { // The import library uses the ARCHIVE properties. - archiveGenerator = - CreateInstallTargetGenerator(target, archiveArgs, true); + archiveGenerator = CreateInstallTargetGenerator( + target, archiveArgs, true, this->Makefile->GetBacktrace()); } if (!runtimeArgs.GetDestination().empty()) { // The DLL uses the RUNTIME properties. - runtimeGenerator = - CreateInstallTargetGenerator(target, runtimeArgs, false); + runtimeGenerator = CreateInstallTargetGenerator( + target, runtimeArgs, false, this->Makefile->GetBacktrace()); } if ((archiveGenerator == nullptr) && (runtimeGenerator == nullptr)) { this->SetError("Library TARGETS given no DESTINATION!"); @@ -459,8 +462,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // Use the FRAMEWORK properties. if (!frameworkArgs.GetDestination().empty()) { - frameworkGenerator = - CreateInstallTargetGenerator(target, frameworkArgs, false); + frameworkGenerator = CreateInstallTargetGenerator( + target, frameworkArgs, false, this->Makefile->GetBacktrace()); } else { std::ostringstream e; e << "TARGETS given no FRAMEWORK DESTINATION for shared library " @@ -473,14 +476,15 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // The shared library uses the LIBRARY properties. if (!libraryArgs.GetDestination().empty()) { if (namelinkMode != cmInstallTargetGenerator::NamelinkModeOnly) { - libraryGenerator = - CreateInstallTargetGenerator(target, libraryArgs, false); + libraryGenerator = CreateInstallTargetGenerator( + target, libraryArgs, false, this->Makefile->GetBacktrace()); libraryGenerator->SetNamelinkMode( cmInstallTargetGenerator::NamelinkModeSkip); } if (namelinkMode != cmInstallTargetGenerator::NamelinkModeSkip) { namelinkGenerator = CreateInstallTargetGenerator( - target, libraryArgs, false, false, true); + target, libraryArgs, false, this->Makefile->GetBacktrace(), + false, true); namelinkGenerator->SetNamelinkMode( cmInstallTargetGenerator::NamelinkModeOnly); } @@ -508,8 +512,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) // Use the FRAMEWORK properties. if (!frameworkArgs.GetDestination().empty()) { - frameworkGenerator = - CreateInstallTargetGenerator(target, frameworkArgs, false); + frameworkGenerator = CreateInstallTargetGenerator( + target, frameworkArgs, false, this->Makefile->GetBacktrace()); } else { std::ostringstream e; e << "TARGETS given no FRAMEWORK DESTINATION for static library " @@ -521,8 +525,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { // Static libraries use ARCHIVE properties. if (!archiveArgs.GetDestination().empty()) { - archiveGenerator = - CreateInstallTargetGenerator(target, archiveArgs, false); + archiveGenerator = CreateInstallTargetGenerator( + target, archiveArgs, false, this->Makefile->GetBacktrace()); } else { std::ostringstream e; e << "TARGETS given no ARCHIVE DESTINATION for static library " @@ -536,8 +540,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) case cmStateEnums::MODULE_LIBRARY: { // Modules use LIBRARY properties. if (!libraryArgs.GetDestination().empty()) { - libraryGenerator = - CreateInstallTargetGenerator(target, libraryArgs, false); + libraryGenerator = CreateInstallTargetGenerator( + target, libraryArgs, false, this->Makefile->GetBacktrace()); libraryGenerator->SetNamelinkMode(namelinkMode); namelinkOnly = (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly); @@ -563,8 +567,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) return false; } - objectGenerator = - CreateInstallTargetGenerator(target, objectArgs, false); + objectGenerator = CreateInstallTargetGenerator( + target, objectArgs, false, this->Makefile->GetBacktrace()); } else { // Installing an OBJECT library without a destination transforms // it to an INTERFACE library. It installs no files but can be @@ -575,15 +579,15 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if (target.IsAppBundleOnApple()) { // Application bundles use the BUNDLE properties. if (!bundleArgs.GetDestination().empty()) { - bundleGenerator = - CreateInstallTargetGenerator(target, bundleArgs, false); + bundleGenerator = CreateInstallTargetGenerator( + target, bundleArgs, false, this->Makefile->GetBacktrace()); } else if (!runtimeArgs.GetDestination().empty()) { bool failure = false; if (this->CheckCMP0006(failure)) { // For CMake 2.4 compatibility fallback to the RUNTIME // properties. - bundleGenerator = - CreateInstallTargetGenerator(target, runtimeArgs, false); + bundleGenerator = CreateInstallTargetGenerator( + target, runtimeArgs, false, this->Makefile->GetBacktrace()); } else if (failure) { return false; } @@ -599,8 +603,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { // Executables use the RUNTIME properties. if (!runtimeArgs.GetDestination().empty()) { - runtimeGenerator = - CreateInstallTargetGenerator(target, runtimeArgs, false); + runtimeGenerator = CreateInstallTargetGenerator( + target, runtimeArgs, false, this->Makefile->GetBacktrace()); } else { std::ostringstream e; e << "TARGETS given no RUNTIME DESTINATION for executable " @@ -617,8 +621,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if (dll_platform && !archiveArgs.GetDestination().empty() && target.IsExecutableWithExports()) { // The import library uses the ARCHIVE properties. - archiveGenerator = - CreateInstallTargetGenerator(target, archiveArgs, true, true); + archiveGenerator = CreateInstallTargetGenerator( + target, archiveArgs, true, this->Makefile->GetBacktrace(), true); } } break; case cmStateEnums::INTERFACE_LIBRARY: diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 8b8f79b98a2..ea3d522341a 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -24,7 +24,7 @@ cmInstallTargetGenerator::cmInstallTargetGenerator( const std::string& targetName, const char* dest, bool implib, const char* file_permissions, std::vector const& configurations, const char* component, MessageLevel message, bool exclude_from_all, - bool optional) + bool optional, cmListFileBacktrace const& backtrace) : cmInstallGenerator(dest, configurations, component, message, exclude_from_all) , TargetName(targetName) @@ -32,6 +32,7 @@ cmInstallTargetGenerator::cmInstallTargetGenerator( , FilePermissions(file_permissions) , ImportLibrary(implib) , Optional(optional) + , Backtrace(backtrace) { this->ActionsPerConfig = true; this->NamelinkMode = NamelinkModeNone; diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index f6bec20b3b1..bf625d18cf9 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmInstallGenerator.h" +#include "cmListFileCache.h" #include "cmScriptGenerator.h" #include @@ -21,11 +22,12 @@ class cmLocalGenerator; class cmInstallTargetGenerator : public cmInstallGenerator { public: - cmInstallTargetGenerator(std::string const& targetName, const char* dest, - bool implib, const char* file_permissions, - std::vector const& configurations, - const char* component, MessageLevel message, - bool exclude_from_all, bool optional); + cmInstallTargetGenerator( + std::string const& targetName, const char* dest, bool implib, + const char* file_permissions, + std::vector const& configurations, const char* component, + MessageLevel message, bool exclude_from_all, bool optional, + cmListFileBacktrace const& backtrace = cmListFileBacktrace()); ~cmInstallTargetGenerator() override; /** Select the policy for installing shared library linkable name @@ -64,6 +66,8 @@ class cmInstallTargetGenerator : public cmInstallGenerator std::string GetDestination(std::string const& config) const; + cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; } + protected: void GenerateScript(std::ostream& os) override; void GenerateScriptForConfig(std::ostream& os, const std::string& config, @@ -108,6 +112,7 @@ class cmInstallTargetGenerator : public cmInstallGenerator NamelinkModeType NamelinkMode; bool ImportLibrary; bool Optional; + cmListFileBacktrace Backtrace; }; #endif From c88fb94978ba666584243d5999a2c55ea0041309 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 18 Oct 2018 17:31:37 +0200 Subject: [PATCH 060/907] FindLibinput: do not set Libinput_VERSION_STRING Libinput_VERSION is enough, this is redundant --- Modules/FindLibinput.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake index 1057c91bf62..c1fe45562e6 100644 --- a/Modules/FindLibinput.cmake +++ b/Modules/FindLibinput.cmake @@ -79,5 +79,4 @@ mark_as_advanced(Libinput_LIBRARY Libinput_INCLUDE_DIR) if(Libinput_FOUND) set(Libinput_LIBRARIES ${Libinput_LIBRARY}) set(Libinput_INCLUDE_DIRS ${Libinput_INCLUDE_DIR}) - set(Libinput_VERSION_STRING ${Libinput_VERSION}) endif() From 84e7920b3ac9241cf73a468120ff0ea83f9a7c86 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 27 Sep 2018 09:42:10 +0200 Subject: [PATCH 061/907] FindFontconfig: Add module to find Fontconfig This module is inspired by one from KDE's KWin. --- Copyright.txt | 1 + Help/manual/cmake-modules.7.rst | 1 + Help/module/FindFontconfig.rst | 1 + Help/release/dev/find_fontconfig.rst | 6 ++ Modules/FindFontconfig.cmake | 101 +++++++++++++++++++++++ Tests/CMakeLists.txt | 4 + Tests/FindFontconfig/CMakeLists.txt | 10 +++ Tests/FindFontconfig/Test/CMakeLists.txt | 16 ++++ Tests/FindFontconfig/Test/main.c | 17 ++++ 9 files changed, 157 insertions(+) create mode 100644 Help/module/FindFontconfig.rst create mode 100644 Help/release/dev/find_fontconfig.rst create mode 100644 Modules/FindFontconfig.cmake create mode 100644 Tests/FindFontconfig/CMakeLists.txt create mode 100644 Tests/FindFontconfig/Test/CMakeLists.txt create mode 100644 Tests/FindFontconfig/Test/main.c diff --git a/Copyright.txt b/Copyright.txt index 0b0fbf1cc8e..c7a81b146dd 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -64,6 +64,7 @@ The following individuals and institutions are among the Contributors: * Insight Software Consortium * Jan Woetzel * Kelly Thompson +* Laurent Montel * Konstantin Podsvirov * Mario Bensi * Martin Gräßlin diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index f9b4afb3806..c0bef081ffb 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -131,6 +131,7 @@ They are normally called through the :command:`find_package` command. /module/FindFLEX /module/FindFLTK2 /module/FindFLTK + /module/FindFontconfig /module/FindFreetype /module/FindGCCXML /module/FindGDAL diff --git a/Help/module/FindFontconfig.rst b/Help/module/FindFontconfig.rst new file mode 100644 index 00000000000..449fe09d0d0 --- /dev/null +++ b/Help/module/FindFontconfig.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/FindFontconfig.cmake diff --git a/Help/release/dev/find_fontconfig.rst b/Help/release/dev/find_fontconfig.rst new file mode 100644 index 00000000000..4ae18c973c7 --- /dev/null +++ b/Help/release/dev/find_fontconfig.rst @@ -0,0 +1,6 @@ +find_fontconfig +--------------- + +* The :module:`FindFontconfig` module was added to find `fontconfig`_. + +.. _`fontconfig`: https://www.freedesktop.org/wiki/Software/fontconfig/ diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake new file mode 100644 index 00000000000..96e1e7608cd --- /dev/null +++ b/Modules/FindFontconfig.cmake @@ -0,0 +1,101 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindFontconfig +-------------- + +Find Fontconfig headers and library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +``Fontconfig::Fontconfig`` + The Fontconfig library, if found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables in your project: + +``FONTCONFIG_FOUND`` + true if (the requested version of) Fontconfig is available. +``FONTCONFIG_VERSION`` + the version of Fontconfig. +``FONTCONFIG_LIBRARIES`` + the libraries to link against to use Fontconfig. +``FONTCONFIG_INCLUDE_DIRS`` + where to find the Fontconfig headers. +``FONTCONFIG_COMPILE_OPTIONS`` + this should be passed to target_compile_options(), if the + target is not used for linking + +#]=======================================================================] + + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig QUIET) +pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig) +set(FONTCONFIG_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER}) +set(FONTCONFIG_VERSION ${PKG_FONTCONFIG_VERSION}) + +find_path( FONTCONFIG_INCLUDE_DIR + NAMES + fontconfig/fontconfig.h + HINTS + ${PKG_FONTCONFIG_INCLUDE_DIRS} + /usr/X11/include +) + +find_library( FONTCONFIG_LIBRARY + NAMES + fontconfig + PATHS + ${PKG_FONTCONFIG_LIBRARY_DIRS} +) + +if (FONTCONFIG_INCLUDE_DIR AND NOT FONTCONFIG_VERSION) + file(STRINGS ${FONTCONFIG_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$") + unset(FONTCONFIG_VERSION) + foreach(VPART MAJOR MINOR REVISION) + foreach(VLINE ${_contents}) + if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$") + set(FONTCONFIG_VERSION_PART "${CMAKE_MATCH_1}") + if(FONTCONFIG_VERSION) + string(APPEND FONTCONFIG_VERSION ".${FONTCONFIG_VERSION_PART}") + else() + set(FONTCONFIG_VERSION "${FONTCONFIG_VERSION_PART}") + endif() + endif() + endforeach() + endforeach() +endif () + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Fontconfig + FOUND_VAR + FONTCONFIG_FOUND + REQUIRED_VARS + FONTCONFIG_LIBRARY + FONTCONFIG_INCLUDE_DIR + VERSION_VAR + FONTCONFIG_VERSION +) + + +if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig) + add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED) + set_target_properties(Fontconfig::Fontconfig PROPERTIES + IMPORTED_LOCATION "${FONTCONFIG_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${FONTCONFIG_COMPILE_OPTIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR) + +if(FONTCONFIG_FOUND) + set(FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY}) + set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR}) +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 9e192be620c..66149330e38 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1376,6 +1376,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindEXPAT) endif() + if(CMake_TEST_FindFontconfig) + add_subdirectory(FindFontconfig) + endif() + if(CMake_TEST_FindFreetype) add_subdirectory(FindFreetype) endif() diff --git a/Tests/FindFontconfig/CMakeLists.txt b/Tests/FindFontconfig/CMakeLists.txt new file mode 100644 index 00000000000..d683d87464d --- /dev/null +++ b/Tests/FindFontconfig/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindFontconfig.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $ + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindFontconfig/Test" + "${CMake_BINARY_DIR}/Tests/FindFontconfig/Test" + ${build_generator_args} + --build-project TestFindFontconfig + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $ + ) diff --git a/Tests/FindFontconfig/Test/CMakeLists.txt b/Tests/FindFontconfig/Test/CMakeLists.txt new file mode 100644 index 00000000000..81db3ba4cde --- /dev/null +++ b/Tests/FindFontconfig/Test/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindFontconfig C) +include(CTest) + +find_package(Fontconfig REQUIRED) + +add_definitions(-DCMAKE_EXPECTED_FONTCONFIG_VERSION="${FONTCONFIG_VERSION}") + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt Fontconfig::Fontconfig) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${FONTCONFIG_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${FONTCONFIG_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindFontconfig/Test/main.c b/Tests/FindFontconfig/Test/main.c new file mode 100644 index 00000000000..c5b596304a9 --- /dev/null +++ b/Tests/FindFontconfig/Test/main.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +int main() +{ + FcInit(); + printf("Found Fontconfig.\n"); + + char fontconfig_version_string[16]; + snprintf(fontconfig_version_string, 16, "%i.%i.%i", FC_MAJOR, FC_MINOR, + FC_REVISION); + assert( + strcmp(fontconfig_version_string, CMAKE_EXPECTED_FONTCONFIG_VERSION) == 0); + return 0; +} From fc7ee1ca459c3b231aa1fb64aeeaee590c019513 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" Date: Wed, 10 Oct 2018 09:39:17 +0200 Subject: [PATCH 062/907] Help: Override pygments CMakeLexer to support <..> and [..] * The code snippets in the docs consist of CMake code mixed with syntax definition punctuation like < > [ ] ... Therefore a pure CMake lexer is inadequate. Here it is replaced by a CMake syntax definition parser. * Fixed syntax definition snippets in FindPkgConfig.cmake to make best use of syntax highlighting. This source file is the hardest to support because it contains comparison operators <= = >=, which need special attention to avoid confusion with the placeholder indicators <...>. * Fixed syntax in execute_process.rst (there were unbalanced brackets). * Disabled syntax highlighting for long string examples in cmake-language.7.rst. * No highlighting of removed syntax in CMP0049 * To inspect the outcome of this patch, see e.g. the pages * manual/cmake-buildsystem.7.html * module/ExternalProject.html * module/FindPkgConfig.html which are particularly rich in complex code snippets. --- Help/command/execute_process.rst | 4 +-- Help/manual/cmake-language.7.rst | 17 +++++----- Help/policy/CMP0049.rst | 8 ++--- Modules/ExternalProject.cmake | 24 +++++++++++---- Modules/FindPkgConfig.cmake | 26 ++++++++++------ Utilities/Sphinx/cmake.py | 53 ++++++++++++++++++++++++++++---- Utilities/Sphinx/colors.py | 29 +++++++++++++++++ Utilities/Sphinx/conf.py.in | 1 + 8 files changed, 127 insertions(+), 35 deletions(-) create mode 100644 Utilities/Sphinx/colors.py diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst index 716f457908c..fc7d1777ea3 100644 --- a/Help/command/execute_process.rst +++ b/Help/command/execute_process.rst @@ -5,8 +5,8 @@ Execute one or more child processes. .. code-block:: cmake - execute_process(COMMAND [args1...]] - [COMMAND [args2...] [...]] + execute_process(COMMAND [] + [COMMAND []]... [WORKING_DIRECTORY ] [TIMEOUT ] [RESULT_VARIABLE ] diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 71649ba3e7a..8740d97a5e7 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -206,9 +206,10 @@ enclosed content, such as `Escape Sequences`_ or `Variable References`_, is performed. A bracket argument is always given to the command invocation as exactly one argument. -For example: +.. No code-block syntax highlighting in the following example + (long string literal not supported by our cmake.py) -.. code-block:: cmake +For example:: message([=[ This is the first line in a bracket argument with bracket length 1. @@ -253,9 +254,10 @@ closing quotes. Both `Escape Sequences`_ and `Variable References`_ are evaluated. A quoted argument is always given to the command invocation as exactly one argument. -For example: +.. No code-block syntax highlighting in the following example + (escape \" not supported by our cmake.py) -:: +For example:: message("This is a quoted argument containing multiple lines. This is always one argument even though it contains a ; character. @@ -264,11 +266,12 @@ For example: It does end in an unescaped double quote. ") +.. No code-block syntax highlighting in the following example + (for conformity with the two above examples) + The final ``\`` on any line ending in an odd number of backslashes is treated as a line continuation and ignored along with the -immediately following newline character. For example: - -.. code-block:: cmake +immediately following newline character. For example:: message("\ This is the first line of a quoted argument. \ diff --git a/Help/policy/CMP0049.rst b/Help/policy/CMP0049.rst index a3ce4b1fa4f..291bf575242 100644 --- a/Help/policy/CMP0049.rst +++ b/Help/policy/CMP0049.rst @@ -3,14 +3,14 @@ CMP0049 Do not expand variables in target source entries. -CMake 2.8.12 and lower performed and extra layer of variable expansion -when evaluating source file names: - -.. code-block:: cmake +CMake 2.8.12 and lower performed an extra layer of variable expansion +when evaluating source file names:: set(a_source foo.c) add_executable(foo \${a_source}) +.. note: no cmake highlighting since this syntax is deprecated + This was undocumented behavior. The OLD behavior for this policy is to expand such variables when processing diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index f987d2d8f1a..eb4f9fa1bec 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -16,7 +16,9 @@ External Project Definition The ``ExternalProject_Add()`` function creates a custom target to drive download, update/patch, configure, build, install and test steps of an - external project:: + external project: + + .. code-block:: cmake ExternalProject_Add( [