diff options
-rw-r--r-- | Help/command/add_test.rst | 24 | ||||
-rw-r--r-- | Help/command/define_property.rst | 26 | ||||
-rw-r--r-- | Help/command/set_property.rst | 4 | ||||
-rw-r--r-- | Help/command/set_tests_properties.rst | 6 | ||||
-rw-r--r-- | Help/cpack_gen/productbuild.rst | 43 | ||||
-rw-r--r-- | Help/guide/tutorial/Packaging an Installer.rst | 2 | ||||
-rw-r--r-- | Help/release/3.23.rst | 4 | ||||
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 2 | ||||
-rw-r--r-- | Modules/Internal/CPack/CPack.distribution.dist.in | 11 | ||||
-rw-r--r-- | Modules/Internal/CPack/NSIS.template.in | 8 | ||||
-rw-r--r-- | Source/CPack/cmCPackPKGGenerator.cxx | 25 | ||||
-rw-r--r-- | Source/cmDefinePropertyCommand.cxx | 26 | ||||
-rw-r--r-- | Utilities/Release/win/x86/Dockerfile | 4 |
13 files changed, 120 insertions, 65 deletions
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst index 95cd037..53555a4 100644 --- a/Help/command/add_test.rst +++ b/Help/command/add_test.rst @@ -20,6 +20,9 @@ if necessary. See policy :policy:`CMP0110`. The options are: automatically be replaced by the location of the executable created at build time. + The command may be specified using + :manual:`generator expressions <cmake-generator-expressions(7)>`. + ``CONFIGURATIONS`` Restrict execution of the test only to the named configurations. @@ -30,6 +33,9 @@ if necessary. See policy :policy:`CMP0110`. The options are: directory set to the build directory corresponding to the current source directory. + The working directory may be specified using + :manual:`generator expressions <cmake-generator-expressions(7)>`. + ``COMMAND_EXPAND_LISTS`` .. versionadded:: 3.16 @@ -48,9 +54,10 @@ unless the :prop_test:`PASS_REGULAR_EXPRESSION`, .. versionadded:: 3.16 Added :prop_test:`SKIP_REGULAR_EXPRESSION` property. -The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator -expressions" with the syntax ``$<...>``. See the -:manual:`cmake-generator-expressions(7)` manual for available expressions. +Tests added with the ``add_test(NAME)`` signature support using +:manual:`generator expressions <cmake-generator-expressions(7)>` +in test properties set by :command:`set_property(TEST)` or +:command:`set_tests_properties`. Example usage: @@ -73,10 +80,15 @@ file produced by target ``myexe``. --------------------------------------------------------------------- +This command also supports a simpler, but less flexible, signature: + .. code-block:: cmake add_test(<name> <command> [<arg>...]) -Add a test called ``<name>`` with the given command-line. Unlike -the above ``NAME`` signature no transformation is performed on the -command-line to support target names or generator expressions. +Add a test called ``<name>`` with the given command-line. + +Unlike the above ``NAME`` signature, target names are not supported +in the command-line. Furthermore, tests added with this signature do not +support :manual:`generator expressions <cmake-generator-expressions(7)>` +in the command-line or test properties. diff --git a/Help/command/define_property.rst b/Help/command/define_property.rst index cd75dea..c882347 100644 --- a/Help/command/define_property.rst +++ b/Help/command/define_property.rst @@ -13,11 +13,13 @@ Define and document custom properties. [INITIALIZE_FROM_VARIABLE <variable>]) Defines one property in a scope for use with the :command:`set_property` and -:command:`get_property` commands. This is primarily useful to associate -documentation with property names that may be retrieved with the -:command:`get_property` command. The first argument determines the kind of -scope in which the property should be used. It must be one of the -following: +:command:`get_property` commands. It is mainly useful for defining the way +a property is initialized or inherited. Historically, the command also +associated documentation with a property, but that is no longer considered a +primary use case. + +The first argument determines the kind of scope in which the property should +be used. It must be one of the following: :: @@ -56,14 +58,16 @@ out the contents to append to. The ``BRIEF_DOCS`` and ``FULL_DOCS`` options are followed by strings to be associated with the property as its brief and full documentation. -Corresponding options to the :command:`get_property` command will retrieve -the documentation. +CMake does not use this documentation other than making it available to the +project via corresponding options to the :command:`get_property` command. .. versionchanged:: 3.23 The ``BRIEF_DOCS`` and ``FULL_DOCS`` options are optional. -The ``INITIALIZE_FROM_VARIABLE`` option is followed by the name of a variable -from which to initialize the property. The variable name must end with the -property name, must have a prefix before the property name, and must not begin -with ``CMAKE_`` or ``_CMAKE_``. +.. versionadded:: 3.23 + + The ``INITIALIZE_FROM_VARIABLE`` option specifies a variable from which the + property should be initialized. It can only be used with target properties. + The ``<variable>`` name must end with the property name, must have a prefix + before the property name, and must not begin with ``CMAKE_`` or ``_CMAKE_``. diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst index 555520d..b9b12c4 100644 --- a/Help/command/set_property.rst +++ b/Help/command/set_property.rst @@ -85,6 +85,10 @@ It must be one of the following: Scope may name zero or more existing tests. See also the :command:`set_tests_properties` command. + Test property values may be specified using + :manual:`generator expressions <cmake-generator-expressions(7)>` + for tests created by the :command:`add_test(NAME)` signature. + ``CACHE`` Scope must name zero or more cache existing entries. diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index 9bc94ae..eadde33 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -9,8 +9,10 @@ Set a property of the tests. Sets a property for the tests. If the test is not found, CMake will report an error. -:manual:`Generator expressions <cmake-generator-expressions(7)>` will be -expanded the same as supported by the test's :command:`add_test` call. + +Test property values may be specified using +:manual:`generator expressions <cmake-generator-expressions(7)>` +for tests created by the :command:`add_test(NAME)` signature. See also the :command:`set_property(TEST)` command. diff --git a/Help/cpack_gen/productbuild.rst b/Help/cpack_gen/productbuild.rst index dc98c85..26e0782 100644 --- a/Help/cpack_gen/productbuild.rst +++ b/Help/cpack_gen/productbuild.rst @@ -90,14 +90,15 @@ macOS using ProductBuild: .. versionadded:: 3.23 - Adds a domains element to Distribution XML if specified. When set to true, - the productbuild generator creates the following XML element: + This option enables more granular control over where the product may be + installed. When it is set to true, a ``domains`` element of the following + form will be added to the productbuild Distribution XML: .. code-block:: xml <domains enable_anywhere="true" enable_currentUserHome="false" enable_localSystem="true"/> - The default values used for the attributes can be overridden with + The default values are as shown above, but can be overridden with :variable:`CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE`, :variable:`CPACK_PRODUCTBUILD_DOMAINS_USER`, and :variable:`CPACK_PRODUCTBUILD_DOMAINS_ROOT`. @@ -106,25 +107,43 @@ macOS using ProductBuild: .. versionadded:: 3.23 - May be used to override the ``enable_anywhere`` attribute in the domains - element in the Distribution XML when :variable:`CPACK_PRODUCTBUILD_DOMAINS` - is set to ``TRUE``. + May be used to override the ``enable_anywhere`` attribute in the ``domains`` + element of the Distribution XML. When set to true, the product can be + installed at the root of any volume, including non-system volumes. + + :variable:`CPACK_PRODUCTBUILD_DOMAINS` must be set to true for this variable + to have any effect. .. variable:: CPACK_PRODUCTBUILD_DOMAINS_USER .. versionadded:: 3.23 - May be used to override the ``enable_currentUserHome`` attribute in the domains - element in the Distribution XML when :variable:`CPACK_PRODUCTBUILD_DOMAINS` - is set to ``TRUE``. + May be used to override the ``enable_currentUserHome`` attribute in the + ``domains`` element of the Distribution XML. When set to true, the product + can be installed into the current user's home directory. Note that when + installing into the user's home directory, the following additional + requirements will apply: + + * The installer may not write outside the user's home directory. + * The install will be performed as the current user rather than as ``root``. + This may have ramifications for :variable:`CPACK_PREFLIGHT_<COMP>_SCRIPT` + and :variable:`CPACK_POSTFLIGHT_<COMP>_SCRIPT`. + * Administrative privileges will not be needed to perform the install. + + :variable:`CPACK_PRODUCTBUILD_DOMAINS` must be set to true for this variable + to have any effect. .. variable:: CPACK_PRODUCTBUILD_DOMAINS_ROOT .. versionadded:: 3.23 - May be used to override the ``enable_localSystem`` attribute in the domains - element in the Distribution XML when :variable:`CPACK_PRODUCTBUILD_DOMAINS` - is set to ``TRUE``. + May be used to override the ``enable_localSystem`` attribute in the + ``domains`` element of the Distribution XML. When set to true, the product + can be installed in the root directory. This should normally be set to true + unless the product should only be installed to the user's home directory. + + :variable:`CPACK_PRODUCTBUILD_DOMAINS` must be set to true for this variable + to have any effect. Background Image """""""""""""""" diff --git a/Help/guide/tutorial/Packaging an Installer.rst b/Help/guide/tutorial/Packaging an Installer.rst index 55e74e0..0ee5db2 100644 --- a/Help/guide/tutorial/Packaging an Installer.rst +++ b/Help/guide/tutorial/Packaging an Installer.rst @@ -22,7 +22,7 @@ That is all there is to it. We start by including libraries that are needed by the project for the current platform. Next we set some CPack variables to where we have stored the license and version information for this project. The version information was set earlier in this -tutorial and the ``license.txt`` has been included in the top-level source +tutorial and the ``License.txt`` has been included in the top-level source directory for this step. The :variable:`CPACK_SOURCE_GENERATOR` variable selects a file format for the source package. diff --git a/Help/release/3.23.rst b/Help/release/3.23.rst index bacb431..1a3f53e 100644 --- a/Help/release/3.23.rst +++ b/Help/release/3.23.rst @@ -177,7 +177,9 @@ CPack :variable:`CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE`, :variable:`CPACK_PRODUCTBUILD_DOMAINS_USER`, and :variable:`CPACK_PRODUCTBUILD_DOMAINS_ROOT` variables for - adding the domains element to the Distribution XML. + adding the domains element to the Distribution XML. With these variables, + it is now possible to install products to the user's home directory + without requiring administrative privileges. * The :cpack_gen:`CPack productbuild Generator` gained a new variable, :variable:`CPACK_PRODUCTBUILD_IDENTIFIER`, used to customize the unique diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 7ecc9d4..afdd4c4 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -938,7 +938,7 @@ if(CUDAToolkit_FOUND) # cuFFTW depends on cuFFT _CUDAToolkit_find_and_add_import_lib(cufftw DEPS cufft) - _CUDAToolkit_find_and_add_import_lib(cufftw DEPS cufft_static) + _CUDAToolkit_find_and_add_import_lib(cufftw_static DEPS cufft_static) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 9.2) _CUDAToolkit_find_and_add_import_lib(cufft_static_nocallback DEPS culibos) endif() diff --git a/Modules/Internal/CPack/CPack.distribution.dist.in b/Modules/Internal/CPack/CPack.distribution.dist.in index f20e66c..291b24d 100644 --- a/Modules/Internal/CPack/CPack.distribution.dist.in +++ b/Modules/Internal/CPack/CPack.distribution.dist.in @@ -1,9 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <installer-gui-script minSpecVersion="1.0"> - <title>@CPACK_PACKAGE_NAME@</title> - <welcome file="@CPACK_RESOURCE_FILE_WELCOME_NOPATH@"/> - <readme file="@CPACK_RESOURCE_FILE_README_NOPATH@"/> - <license file="@CPACK_RESOURCE_FILE_LICENSE_NOPATH@"/> - <options allow-external-scripts="no" customize="allow" rootVolumeOnly="false"></options> - @CPACK_PACKAGEMAKER_CHOICES@ + <title>@CPACK_PACKAGE_NAME@</title> + <welcome file="@CPACK_RESOURCE_FILE_WELCOME_NOPATH@"/> + <readme file="@CPACK_RESOURCE_FILE_README_NOPATH@"/> + <license file="@CPACK_RESOURCE_FILE_LICENSE_NOPATH@"/> +@CPACK_APPLE_PKG_INSTALLER_CONTENT@ </installer-gui-script> diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in index e3abf22..23c45c7 100644 --- a/Modules/Internal/CPack/NSIS.template.in +++ b/Modules/Internal/CPack/NSIS.template.in @@ -931,9 +931,11 @@ Function .onInit ;Run the uninstaller uninst: ClearErrors - StrLen $2 "\@CPACK_NSIS_UNINSTALL_NAME@.exe" - StrCpy $3 $0 -$2 # remove "\@CPACK_NSIS_UNINSTALL_NAME@.exe" from UninstallString to get path - ExecWait '"$0" /S _?=$3' ;Do not copy the uninstaller to a temp file + StrCpy $2 $0 1 + StrCmp '"' $2 0 +3 ; checks if string is quoted (CPack before v3.20.6 did not quote it) + ExecWait '$0 /S' + Goto +2 + ExecWait '"$0" /S' IfErrors uninst_failed inst uninst_failed: diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index d8095cc..2a14ccf 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -120,10 +120,20 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile, std::string distributionFile = cmStrCat(metapackageFile, "/Contents/distribution.dist"); + std::ostringstream xContents; + cmXMLWriter xout(xContents, 1); + + // Installer-wide options + xout.StartElement("options"); + xout.Attribute("allow-external-scripts", "no"); + xout.Attribute("customize", "allow"); + if (cmIsOff(this->GetOption("CPACK_PRODUCTBUILD_DOMAINS"))) { + xout.Attribute("rootVolumeOnly", "false"); + } + xout.EndElement(); + // Create the choice outline, which provides a tree-based view of // the components in their groups. - std::ostringstream choiceOut; - cmXMLWriter xout(choiceOut, 1); xout.StartElement("choices-outline"); // Emit the outline for the groups @@ -169,7 +179,7 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile, // Dark Aqua this->CreateBackground("darkAqua", metapackageFile, genName, xout); - this->SetOption("CPACK_PACKAGEMAKER_CHOICES", choiceOut.str()); + this->SetOption("CPACK_APPLE_PKG_INSTALLER_CONTENT", xContents.str()); // Create the distribution.dist file in the metapackage to turn it // into a distribution package. @@ -293,8 +303,7 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component, void cmCPackPKGGenerator::CreateDomains(cmXMLWriter& xout) { - std::string opt = "CPACK_PRODUCTBUILD_DOMAINS"; - if (cmIsOff(this->GetOption(opt))) { + if (cmIsOff(this->GetOption("CPACK_PRODUCTBUILD_DOMAINS"))) { return; } @@ -302,19 +311,19 @@ void cmCPackPKGGenerator::CreateDomains(cmXMLWriter& xout) // Product can be installed at the root of any volume by default // unless specified - cmValue param = this->GetOption(cmStrCat(opt, "_ANYWHERE")); + cmValue param = this->GetOption("CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE"); xout.Attribute("enable_anywhere", (param && cmIsOff(param)) ? "false" : "true"); // Product cannot be installed into the current user's home directory // by default unless specified - param = this->GetOption(cmStrCat(opt, "_USER")); + param = this->GetOption("CPACK_PRODUCTBUILD_DOMAINS_USER"); xout.Attribute("enable_currentUserHome", (param && cmIsOn(param)) ? "true" : "false"); // Product can be installed into the root directory by default // unless specified - param = this->GetOption(cmStrCat(opt, "_ROOT")); + param = this->GetOption("CPACK_PRODUCTBUILD_DOMAINS_ROOT"); xout.Attribute("enable_localSystem", (param && cmIsOff(param)) ? "false" : "true"); diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 7a2f34f..15b2652 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -97,20 +97,20 @@ bool cmDefinePropertyCommand(std::vector<std::string> const& args, PropertyName, "\"")); return false; } - } - // Make sure the variable is not reserved. - static constexpr const char* reservedPrefixes[] = { - "CMAKE_", - "_CMAKE_", - }; - if (std::any_of(std::begin(reservedPrefixes), std::end(reservedPrefixes), - [&initializeFromVariable](const char* prefix) { - return cmHasPrefix(initializeFromVariable, prefix); - })) { - status.SetError( - cmStrCat("variable name \"", initializeFromVariable, "\" is reserved")); - return false; + // Make sure the variable is not reserved. + static constexpr const char* reservedPrefixes[] = { + "CMAKE_", + "_CMAKE_", + }; + if (std::any_of(std::begin(reservedPrefixes), std::end(reservedPrefixes), + [&initializeFromVariable](const char* prefix) { + return cmHasPrefix(initializeFromVariable, prefix); + })) { + status.SetError(cmStrCat("variable name \"", initializeFromVariable, + "\" is reserved")); + return false; + } } // Actually define the property. diff --git a/Utilities/Release/win/x86/Dockerfile b/Utilities/Release/win/x86/Dockerfile index a4f7445..d5a036a 100644 --- a/Utilities/Release/win/x86/Dockerfile +++ b/Utilities/Release/win/x86/Dockerfile @@ -11,8 +11,10 @@ ARG FROM_IMAGE_NAME=kitware/cmake:build-win-x86-deps-2020-04-27 ARG FROM_IMAGE_DIGEST=@sha256:04e229c0c0ba2247855d0e8c0fb87c1686f983adbafa4ce413e61b3905edb76b ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST -FROM $FROM_IMAGE as build +FROM $FROM_IMAGE as source COPY . C:\cmake\src\cmake + +FROM source as build ARG ARCH="x86_64" ARG TEST="true" RUN \cmake\src\cmake\Utilities\Release\win\x86\build.bat %ARCH% %TEST% |