summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPackOptions.cmake.in8
-rw-r--r--Help/command/cmake_host_system_information.rst2
-rw-r--r--Help/command/get_filename_component.rst10
-rw-r--r--Help/command/if.rst5
-rw-r--r--Help/cpack_gen/packagemaker.rst88
-rw-r--r--Help/cpack_gen/wix.rst9
-rw-r--r--Help/manual/cmake-language.7.rst10
-rw-r--r--Help/manual/cmake-modules.7.rst1
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/manual/cmake.1.rst2
-rw-r--r--Help/module/CPackPackageMaker.rst4
-rw-r--r--Help/policy/CMP0135.rst29
-rw-r--r--Help/release/3.17.rst2
-rw-r--r--Help/release/3.23.rst2
-rw-r--r--Help/release/dev/ExternalProject-no-extract-timestamp.rst8
-rw-r--r--Help/release/dev/cpack-wix-arch.rst6
-rw-r--r--Help/release/dev/remove-PackageMaker-generator.rst5
-rw-r--r--Help/variable/ENV.rst5
-rw-r--r--Modules/CMakeTestCUDACompiler.cmake1
-rw-r--r--Modules/CPack.cmake3
-rw-r--r--Modules/CUDA/architectures.cmake11
-rw-r--r--Modules/ExternalProject.cmake60
-rw-r--r--Modules/ExternalProject/extractfile.cmake.in2
-rw-r--r--Modules/FindPython/Support.cmake2
-rw-r--r--Modules/FindThreads.cmake52
-rw-r--r--Modules/Internal/CPack/NSIS.template.in44
-rw-r--r--Source/CMakeLists.txt1
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx13
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.cxx5
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx577
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.h50
-rw-r--r--Source/cmCommonTargetGenerator.cxx30
-rw-r--r--Source/cmCommonTargetGenerator.h4
-rw-r--r--Source/cmMakefileTargetGenerator.cxx14
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
-rw-r--r--Source/cmPolicies.h4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx62
-rw-r--r--Tests/CMakeLists.txt11
-rw-r--r--Tests/CPackComponents/VerifyResult.cmake4
-rw-r--r--Tests/CPackComponentsForAll/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/ArchSpecial/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-Common.cmake18
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt1
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-NEW.cmake2
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt1
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-OLD.cmake2
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt1
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0135/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0135/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt6
-rw-r--r--Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt6
-rw-r--r--Tests/RunCMake/CUDA_architectures/architectures-native-stdout.txt6
-rw-r--r--Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt6
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake1
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake1
-rw-r--r--Tests/RunCMake/ExternalProject/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake1
-rw-r--r--Tests/RunCMake/cmake_host_system_information/Registry_Query.cmake368
-rw-r--r--Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake20
-rw-r--r--Tests/RunCMake/cmake_host_system_information/registry_host32bit.regbin0 -> 1574 bytes
-rw-r--r--Tests/RunCMake/cmake_host_system_information/registry_host64bit.reg (renamed from Tests/RunCMake/cmake_host_system_information/registry_data.reg)bin2322 -> 2322 bytes
-rw-r--r--Tests/RunCMake/project/LanguagesUsedButNotEnabled-result.txt1
-rw-r--r--Tests/RunCMake/project/LanguagesUsedButNotEnabled-stderr.txt4
-rw-r--r--Tests/RunCMake/project/LanguagesUsedButNotEnabled.cmake3
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake3
-rw-r--r--Tests/X11/CMakeLists.txt1
70 files changed, 599 insertions, 1037 deletions
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 2a4bcc5..81dfeee 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -198,14 +198,6 @@ if(CPACK_GENERATOR MATCHES "IFW")
endif()
-if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
- if(CMAKE_PACKAGE_QTGUI)
- set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
- else()
- set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
- endif()
-endif()
-
if("${CPACK_GENERATOR}" STREQUAL "DragNDrop")
set(CPACK_DMG_BACKGROUND_IMAGE
"@CMake_SOURCE_DIR@/Packaging/CMakeDMGBackground.tif")
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index f47615a..c84c5b5 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -261,6 +261,8 @@ Example:
.. _man 5 os-release: https://www.freedesktop.org/software/systemd/man/os-release.html
.. _various distribution-specific files: http://linuxmafia.com/faq/Admin/release-files.html
+.. _Query Windows registry:
+
Query Windows registry
^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst
index 4bdd388..4bfe087 100644
--- a/Help/command/get_filename_component.rst
+++ b/Help/command/get_filename_component.rst
@@ -4,10 +4,16 @@ get_filename_component
Get a specific component of a full filename.
.. versionchanged:: 3.20
- This command been superseded by :command:`cmake_path` command, except
- ``REALPATH`` now offered by :ref:`file(REAL_PATH) <REAL_PATH>` command and
+ This command has been superseded by :command:`cmake_path` command, except
+ ``REALPATH`` now offered by :ref:`file(REAL_PATH)<REAL_PATH>` command and
``PROGRAM`` now available in :command:`separate_arguments(PROGRAM)` command.
+.. versionchanged:: 3.24
+ The undocumented feature offering the capability to query the ``Windows``
+ registry is superseded by
+ :ref:`cmake_host_system_information(QUERY WINDOWS_REGISTRY)<Query Windows registry>`
+ command.
+
.. code-block:: cmake
get_filename_component(<var> <FileName> <mode> [CACHE])
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 4f955db..64f1c35 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -71,8 +71,9 @@ Basic Expressions
True if given a variable that is defined to a value that is not a false
constant. False otherwise, including if the variable is undefined.
Note that macro arguments are not variables.
- Environment variables also cannot be tested this way, e.g.
- ``if(ENV{some_var})`` will always evaluate to false.
+ :ref:`Environment Variables <CMake Language Environment Variables>` also
+ cannot be tested this way, e.g. ``if(ENV{some_var})`` will always evaluate
+ to false.
``if(<string>)``
A quoted string always evaluates to false unless:
diff --git a/Help/cpack_gen/packagemaker.rst b/Help/cpack_gen/packagemaker.rst
index 256446d..6614f31 100644
--- a/Help/cpack_gen/packagemaker.rst
+++ b/Help/cpack_gen/packagemaker.rst
@@ -1,87 +1,7 @@
CPack PackageMaker Generator
----------------------------
-PackageMaker CPack generator (macOS).
-
-.. deprecated:: 3.17
-
- Xcode no longer distributes the PackageMaker tools.
- This CPack generator will be removed in a future version of CPack.
-
-Variables specific to CPack PackageMaker generator
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The following variable is specific to installers built on Mac
-macOS using PackageMaker:
-
-.. variable:: CPACK_OSX_PACKAGE_VERSION
-
- The version of macOS that the resulting PackageMaker archive should be
- compatible with. Different versions of macOS support different
- features. For example, CPack can only build component-based installers for
- macOS 10.4 or newer, and can only build installers that download
- components on-the-fly for macOS 10.5 or newer. If left blank, this value
- will be set to the minimum version of macOS that supports the requested
- features. Set this variable to some value (e.g., 10.4) only if you want to
- guarantee that your installer will work on that version of macOS, and
- don't mind missing extra features available in the installer shipping with
- later versions of macOS.
-
-Background Image
-""""""""""""""""
-
-.. versionadded:: 3.17
-
-This group of variables controls the background image of the generated
-installer.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND
-
- Adds a background to Distribution XML if specified. The value contains the
- path to image in ``Resources`` directory.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT
-
- Adds an ``alignment`` attribute to the background in Distribution XML.
- Refer to Apple documentation for valid values.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_SCALING
-
- Adds a ``scaling`` attribute to the background in Distribution XML.
- Refer to Apple documentation for valid values.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE
-
- Adds a ``mime-type`` attribute to the background in Distribution XML.
- The option contains MIME type of an image.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_UTI
-
- Adds an ``uti`` attribute to the background in Distribution XML.
- The option contains UTI type of an image.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA
-
- Adds a background for the Dark Aqua theme to Distribution XML if
- specified. The value contains the path to image in ``Resources``
- directory.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_ALIGNMENT
-
- Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT` option,
- but for the dark theme.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_SCALING
-
- Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_SCALING` option,
- but for the dark theme.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_MIME_TYPE
-
- Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE` option,
- but for the dark theme.
-
-.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_UTI
-
- Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_UTI` option,
- but for the dark theme.
+Removed. This once generated PackageMaker installers, but the
+generator has been removed since CMake 3.24. Xcode no longer distributes
+the PackageMaker tools. Use the :cpack_gen:`CPack productbuild Generator`
+instead.
diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst
index e9d5af6..a3d43fc 100644
--- a/Help/cpack_gen/wix.rst
+++ b/Help/cpack_gen/wix.rst
@@ -328,3 +328,12 @@ Windows using WiX.
If this variable is set then the inclusion of WixUIExtensions is skipped,
i.e. the ``-ext "WixUIExtension"`` command line is not included during
the execution of the WiX light tool.
+
+.. variable:: CPACK_WIX_ARCHITECTURE
+
+ .. versionadded:: 3.24
+
+ This variable can be optionally set to specify the target architecture
+ of the installer. May for example be set to ``x64`` or ``arm64``.
+
+ When unspecified, CPack will default to ``x64`` or ``x86``.
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index e7d2694..02cfa7e 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -582,7 +582,8 @@ Scope
They are never cached.
References
- `Variable References`_ have the form ``$ENV{<variable>}``.
+ `Variable References`_ have the form ``$ENV{<variable>}``, using the
+ :variable:`ENV` operator.
Initialization
Initial values of the CMake environment variables are those of
@@ -594,6 +595,13 @@ Initialization
Changed values are not written back to the calling process,
and they are not seen by subsequent build or test processes.
+ See the :ref:`cmake -E env <Run a Command-Line Tool>` command-line
+ tool to run a command in a modified environment.
+
+Inspection
+ See the :ref:`cmake -E environment <Run a Command-Line Tool>` command-line
+ tool to display all current environment variables.
+
The :manual:`cmake-env-variables(7)` manual documents environment
variables that have special meaning to CMake.
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 141eeaa..93beea9 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -317,7 +317,6 @@ used directly.
/module/CPackFreeBSD
/module/CPackNSIS
/module/CPackNuGet
- /module/CPackPackageMaker
/module/CPackProductBuild
/module/CPackRPM
/module/CPackWIX
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index d1fafb5..b3091fa 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -58,6 +58,7 @@ Policies Introduced by CMake 3.24
.. toctree::
:maxdepth: 1
+ CMP0135: ExternalProject ignores timestamps in archives by default for the URL download method. </policy/CMP0135>
CMP0134: Fallback to \"HOST\" Windows registry view when \"TARGET\" view is not usable. </policy/CMP0134>
CMP0133: The CPack module disables SLA by default in the CPack DragNDrop Generator. </policy/CMP0133>
CMP0132: Do not set compiler environment variables on first run. </policy/CMP0132>
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 5ac21c8..e0cb708 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -619,6 +619,8 @@ in the set of :variable:`CMAKE_ARGV<n> <CMAKE_ARGV0>` variables passed to the
script (including the ``--`` itself).
+.. _`Run a Command-Line Tool`:
+
Run a Command-Line Tool
=======================
diff --git a/Help/module/CPackPackageMaker.rst b/Help/module/CPackPackageMaker.rst
deleted file mode 100644
index 226b6fd..0000000
--- a/Help/module/CPackPackageMaker.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-CPackPackageMaker
------------------
-
-The documentation for the CPack PackageMaker generator has moved here: :cpack_gen:`CPack PackageMaker Generator`
diff --git a/Help/policy/CMP0135.rst b/Help/policy/CMP0135.rst
new file mode 100644
index 0000000..1c0c134
--- /dev/null
+++ b/Help/policy/CMP0135.rst
@@ -0,0 +1,29 @@
+CMP0135
+-------
+
+.. versionadded:: 3.24
+
+When using the ``URL`` download method with the :command:`ExternalProject_Add`
+command, CMake 3.23 and below sets the timestamps of the extracted contents
+to the same as the timestamps in the archive. When the ``URL`` changes, the
+new archive is downloaded and extracted, but the timestamps of the extracted
+contents might not be newer than the previous contents. Anything that depends
+on the extracted contents might not be rebuilt, even though the contents may
+change.
+
+CMake 3.24 and above prefers to set the timestamps of all extracted contents
+to the time of the extraction. This ensures that anything that depends on the
+extracted contents will be rebuilt whenever the ``URL`` changes.
+
+The ``DOWNLOAD_EXTRACT_TIMESTAMP`` option to the
+:command:`ExternalProject_Add` command can be used to explicitly specify how
+timestamps should be handled. When ``DOWNLOAD_EXTRACT_TIMESTAMP`` is not
+given, this policy controls the default behavior. The ``OLD`` behavior for
+this policy is to restore the timestamps from the archive. The ``NEW``
+behavior sets the timestamps of extracted contents to the time of extraction.
+
+This policy was introduced in CMake version 3.24. CMake version |release|
+warns when the policy is not set and uses ``OLD`` behavior. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/3.17.rst b/Help/release/3.17.rst
index abd7463..1aa475f 100644
--- a/Help/release/3.17.rst
+++ b/Help/release/3.17.rst
@@ -272,7 +272,7 @@ Deprecated and Removed Features
of all policies are deprecated and that projects should port to the
NEW behaviors.
-* The :cpack_gen:`CPack PackageMaker Generator` generator has been
+* The CPack ``PackageMaker`` generator has been
deprecated because Xcode no longer distributes the PackageMaker tools.
The undocumented ``OSXX11`` generator has also been deprecated.
diff --git a/Help/release/3.23.rst b/Help/release/3.23.rst
index 47c4243..70a6175 100644
--- a/Help/release/3.23.rst
+++ b/Help/release/3.23.rst
@@ -187,7 +187,7 @@ CPack
* The ``CPack.distribution.dist.in`` template used by the
:cpack_gen:`CPack productbuild Generator` and
- :cpack_gen:`CPack PackageMaker Generator` was updated to use a new
+ CPack ``PackageMaker`` generator was updated to use a new
``CPACK_APPLE_PKG_INSTALLER_CONTENT`` variable for its main content.
This replaced the previously undocumented and now deprecated
``CPACK_PACKAGEMAKER_CHOICES`` variable.
diff --git a/Help/release/dev/ExternalProject-no-extract-timestamp.rst b/Help/release/dev/ExternalProject-no-extract-timestamp.rst
new file mode 100644
index 0000000..0e8c01e
--- /dev/null
+++ b/Help/release/dev/ExternalProject-no-extract-timestamp.rst
@@ -0,0 +1,8 @@
+ExternalProject-no-extract-timestamp
+------------------------------------
+
+* The :command:`ExternalProject_Add` command gained a new
+ ``DOWNLOAD_EXTRACT_TIMESTAMP`` option for controlling whether the timestamps
+ of extracted contents are set to match those in the archive when the ``URL``
+ download method is used. A new policy :policy:`CMP0135` was added to control
+ the default behavior when the new option is not used.
diff --git a/Help/release/dev/cpack-wix-arch.rst b/Help/release/dev/cpack-wix-arch.rst
new file mode 100644
index 0000000..e7fd1ad
--- /dev/null
+++ b/Help/release/dev/cpack-wix-arch.rst
@@ -0,0 +1,6 @@
+cpack-wix-arch
+--------------
+
+* The :cpack_gen:`CPack WIX Generator` gained a new variable,
+ :variable:`CPACK_WIX_ARCHITECTURE`, to specify the installer architecture
+ in order to support computers running Windows for ARM.
diff --git a/Help/release/dev/remove-PackageMaker-generator.rst b/Help/release/dev/remove-PackageMaker-generator.rst
new file mode 100644
index 0000000..f20a08c
--- /dev/null
+++ b/Help/release/dev/remove-PackageMaker-generator.rst
@@ -0,0 +1,5 @@
+remove-PackageMaker-generator
+-----------------------------
+
+* The deprecated ``PackageMaker`` :manual:`cpack(1)` generator has
+ been removed.
diff --git a/Help/variable/ENV.rst b/Help/variable/ENV.rst
index 2b43934..6791853 100644
--- a/Help/variable/ENV.rst
+++ b/Help/variable/ENV.rst
@@ -8,5 +8,6 @@ Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``.
To test whether an environment variable is defined, use the signature
``if(DEFINED ENV{<name>})`` of the :command:`if` command.
-See the :command:`set` and :command:`unset` commands to see how to
-write or remove environment variables.
+For general information on environment variables, see the
+:ref:`Environment Variables <CMake Language Environment Variables>`
+section in the :manual:`cmake-language(7)` manual.
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index ea07482..853d655 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -52,6 +52,7 @@ if(CMAKE_CUDA_ABI_COMPILED)
set(CMAKE_CUDA_ARCHITECTURES_NATIVE "${_CUDA_ARCHS_OUTPUT}")
endif()
list(REMOVE_DUPLICATES CMAKE_CUDA_ARCHITECTURES_NATIVE)
+ list(TRANSFORM CMAKE_CUDA_ARCHITECTURES_NATIVE APPEND "-real")
else()
if(NOT _CUDA_ARCHS_RESULT MATCHES "[0-9]+")
set(_CUDA_ARCHS_STATUS " (${_CUDA_ARCHS_RESULT})")
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 40cfde4..4934934 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -669,12 +669,10 @@ if(NOT CPACK_GENERATOR)
if(APPLE)
option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
- option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages (deprecated)" OFF)
option(CPACK_BINARY_PRODUCTBUILD "Enable to build productbuild packages" OFF)
mark_as_advanced(
CPACK_BINARY_BUNDLE
CPACK_BINARY_DRAGNDROP
- CPACK_BINARY_PACKAGEMAKER
CPACK_BINARY_PRODUCTBUILD
)
else()
@@ -726,7 +724,6 @@ if(NOT CPACK_GENERATOR)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_IFW IFW)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NUGET NuGet)
- cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PRODUCTBUILD productbuild)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_RPM RPM)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_STGZ STGZ)
diff --git a/Modules/CUDA/architectures.cmake b/Modules/CUDA/architectures.cmake
index fa3a5a1..79c1252 100644
--- a/Modules/CUDA/architectures.cmake
+++ b/Modules/CUDA/architectures.cmake
@@ -44,3 +44,14 @@ if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.4
AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang"))
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 87)
endif()
+
+# only generate jit code for the newest arch for all/all-major
+list(POP_BACK CMAKE_CUDA_ARCHITECTURES_ALL _latest_arch)
+list(TRANSFORM CMAKE_CUDA_ARCHITECTURES_ALL APPEND "-real")
+list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL ${_latest_arch})
+
+list(POP_BACK CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR _latest_arch)
+list(TRANSFORM CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR APPEND "-real")
+list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR ${_latest_arch})
+
+unset(_latest_arch)
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 42cb7a0..5c37be2 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -170,6 +170,19 @@ External Project Definition
the default name is generally suitable and is not normally used outside
of code internal to the ``ExternalProject`` module.
+ ``DOWNLOAD_EXTRACT_TIMESTAMP <bool>``
+ .. versionadded:: 3.24
+
+ When specified with a true value, the timestamps of the extracted
+ files will match those in the archive. When false, the timestamps of
+ the extracted files will reflect the time at which the extraction
+ was performed. If the download URL changes, timestamps based off
+ those in the archive can result in dependent targets not being rebuilt
+ when they potentially should have been. Therefore, unless the file
+ timestamps are significant to the project in some way, use a false
+ value for this option. If ``DOWNLOAD_EXTRACT_TIMESTAMP`` is not given,
+ the default is false. See policy :policy:`CMP0135`.
+
``DOWNLOAD_NO_EXTRACT <bool>``
.. versionadded:: 3.6
@@ -1534,7 +1547,7 @@ function(_ep_write_verifyfile_script script_filename LOCAL hash)
endfunction()
-function(_ep_write_extractfile_script script_filename name filename directory)
+function(_ep_write_extractfile_script script_filename name filename directory options)
set(args "")
if(filename MATCHES "(\\.|=)(7z|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$")
@@ -2761,16 +2774,51 @@ hash=${hash}
)
endif()
list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake)
- if (NOT no_extract)
+ get_target_property(extract_timestamp ${name} _EP_DOWNLOAD_EXTRACT_TIMESTAMP)
+ if(no_extract)
+ if(NOT extract_timestamp STREQUAL "extract_timestamp-NOTFOUND")
+ message(FATAL_ERROR
+ "Cannot specify DOWNLOAD_EXTRACT_TIMESTAMP when using "
+ "DOWNLOAD_NO_EXTRACT TRUE"
+ )
+ endif()
+ set_property(TARGET ${name} PROPERTY _EP_DOWNLOADED_FILE ${file})
+ else()
+ if(extract_timestamp STREQUAL "extract_timestamp-NOTFOUND")
+ # Default depends on policy CMP0135
+ if(_EP_CMP0135 STREQUAL "")
+ message(AUTHOR_WARNING
+ "The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy "
+ "CMP0135 is not set. The policy's OLD behavior will be used. "
+ "When using a URL download, the timestamps of extracted files "
+ "should preferably be that of the time of extraction, otherwise "
+ "code that depends on the extracted contents might not be "
+ "rebuilt if the URL changes. The OLD behavior preserves the "
+ "timestamps from the archive instead, but this is usually not "
+ "what you want. Update your project to the NEW behavior or "
+ "specify the DOWNLOAD_EXTRACT_TIMESTAMP option with a value of "
+ "true to avoid this robustness issue."
+ )
+ set(extract_timestamp TRUE)
+ elseif(_EP_CMP0135 STREQUAL "NEW")
+ set(extract_timestamp FALSE)
+ else()
+ set(extract_timestamp TRUE)
+ endif()
+ endif()
+ if(extract_timestamp)
+ set(options "")
+ else()
+ set(options "--touch")
+ endif()
_ep_write_extractfile_script(
"${stamp_dir}/extract-${name}.cmake"
"${name}"
"${file}"
"${source_dir}"
+ "${options}"
)
list(APPEND cmd COMMAND ${CMAKE_COMMAND} -P ${stamp_dir}/extract-${name}.cmake)
- else ()
- set_property(TARGET ${name} PROPERTY _EP_DOWNLOADED_FILE ${file})
endif ()
endif()
else()
@@ -3438,6 +3486,9 @@ function(ExternalProject_Add name)
)
set(cmp0114 "NEW")
endif()
+ cmake_policy(GET CMP0135 _EP_CMP0135
+ PARENT_SCOPE # undocumented, do not use outside of CMake
+ )
_ep_get_configuration_subdir_suffix(cfgdir)
@@ -3483,6 +3534,7 @@ function(ExternalProject_Add name)
URL_HASH
URL_MD5
DOWNLOAD_NAME
+ DOWNLOAD_EXTRACT_TIMESTAMP
DOWNLOAD_NO_EXTRACT
DOWNLOAD_NO_PROGRESS
TIMEOUT
diff --git a/Modules/ExternalProject/extractfile.cmake.in b/Modules/ExternalProject/extractfile.cmake.in
index d7f5756..984565b 100644
--- a/Modules/ExternalProject/extractfile.cmake.in
+++ b/Modules/ExternalProject/extractfile.cmake.in
@@ -29,7 +29,7 @@ file(MAKE_DIRECTORY "${ut_dir}")
# Extract it:
#
message(STATUS "extracting... [tar @args@]")
-execute_process(COMMAND ${CMAKE_COMMAND} -E tar @args@ ${filename}
+execute_process(COMMAND ${CMAKE_COMMAND} -E tar @args@ ${filename} @options@
WORKING_DIRECTORY ${ut_dir}
RESULT_VARIABLE rv
)
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 8391f16..6edfbea 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -674,7 +674,7 @@ endfunction()
function (_PYTHON_GET_LAUNCHER _PYTHON_PGL_NAME)
cmake_parse_arguments (PARSE_ARGV 1 _PGL "INTERPRETER;COMPILER" "" "")
- unset ({_PYTHON_PGL_NAME} PARENT_SCOPE)
+ unset (${_PYTHON_PGL_NAME} PARENT_SCOPE)
if ((_PGL_INTERPRETER AND NOT _${_PYTHON_PREFIX}_EXECUTABLE)
OR (_PGL_COMPILER AND NOT _${_PYTHON_PREFIX}_COMPILER))
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index c1531a4..a2304c2 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -156,41 +156,27 @@ macro(_threads_check_flag_pthread)
endif()
endmacro()
-# Do we have pthreads?
-if(CMAKE_C_COMPILER_LOADED)
- CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
-else()
- CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H)
+# Check if pthread functions are in normal C library.
+# We list some pthread functions in PTHREAD_C_CXX_TEST_SOURCE test code.
+# If the pthread functions already exist in C library, we could just use
+# them instead of linking to the additional pthread library.
+_threads_check_libc()
+
+# Check for -pthread first if enabled. This is the recommended
+# way, but not backwards compatible as one must also pass -pthread
+# as compiler flag then.
+if (THREADS_PREFER_PTHREAD_FLAG)
+ _threads_check_flag_pthread()
+endif ()
+
+if(CMAKE_SYSTEM MATCHES "GHS-MULTI")
+ _threads_check_lib(posix pthread_create CMAKE_HAVE_PTHREADS_CREATE)
endif()
+_threads_check_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE)
+_threads_check_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE)
-if(CMAKE_HAVE_PTHREAD_H)
- #
- # We have pthread.h
- # Let's check for the library now.
- #
-
- # Check if pthread functions are in normal C library.
- # We list some pthread functions in PTHREAD_C_CXX_TEST_SOURCE test code.
- # If the pthread functions already exist in C library, we could just use
- # them instead of linking to the additional pthread library.
- _threads_check_libc()
-
- # Check for -pthread first if enabled. This is the recommended
- # way, but not backwards compatible as one must also pass -pthread
- # as compiler flag then.
- if (THREADS_PREFER_PTHREAD_FLAG)
- _threads_check_flag_pthread()
- endif ()
-
- if(CMAKE_SYSTEM MATCHES "GHS-MULTI")
- _threads_check_lib(posix pthread_create CMAKE_HAVE_PTHREADS_CREATE)
- endif()
- _threads_check_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE)
- _threads_check_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE)
-
- if (NOT THREADS_PREFER_PTHREAD_FLAG)
- _threads_check_flag_pthread()
- endif()
+if (NOT THREADS_PREFER_PTHREAD_FLAG)
+ _threads_check_flag_pthread()
endif()
if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_PTHREAD)
diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in
index 23c45c7..42a44d9 100644
--- a/Modules/Internal/CPack/NSIS.template.in
+++ b/Modules/Internal/CPack/NSIS.template.in
@@ -48,7 +48,7 @@
;--- Component support macros: ---
; The code for the add/remove functionality is from:
-; http://nsis.sourceforge.net/Add/Remove_Functionality
+; https://nsis.sourceforge.io/Add/Remove_Functionality
; It has been modified slightly and extended to provide
; inter-component dependencies.
Var AR_SecFlags
@@ -383,7 +383,7 @@ Function un.RemoveFromPath
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Uninstall sutff
+; Uninstall stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
###########################################
@@ -487,15 +487,15 @@ Done:
Exch $R1
FunctionEnd
-Function ConditionalAddToRegisty
+Function ConditionalAddToRegistry
Pop $0
Pop $1
- StrCmp "$0" "" ConditionalAddToRegisty_EmptyString
+ StrCmp "$0" "" ConditionalAddToRegistry_EmptyString
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" \
"$1" "$0"
;MessageBox MB_OK "Set Registry: '$1' to '$0'"
DetailPrint "Set install registry entry: '$1' to '$0'"
- ConditionalAddToRegisty_EmptyString:
+ ConditionalAddToRegistry_EmptyString:
FunctionEnd
;--------------------------------
@@ -665,44 +665,44 @@ Section "-Core installation"
WriteUninstaller "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe"
Push "DisplayName"
Push "@CPACK_NSIS_DISPLAY_NAME@"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "DisplayVersion"
Push "@CPACK_PACKAGE_VERSION@"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "Publisher"
Push "@CPACK_PACKAGE_VENDOR@"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "UninstallString"
Push "$\"$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe$\""
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "NoRepair"
Push "1"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
!ifdef CPACK_NSIS_ADD_REMOVE
;Create add/remove functionality
Push "ModifyPath"
Push "$INSTDIR\AddRemove.exe"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
!else
Push "NoModify"
Push "1"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
!endif
; Optional registration
Push "DisplayIcon"
Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "HelpLink"
Push "@CPACK_NSIS_HELP_LINK@"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "URLInfoAbout"
Push "@CPACK_NSIS_URL_INFO_ABOUT@"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "Contact"
Push "@CPACK_NSIS_CONTACT@"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
!insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
@@ -720,19 +720,19 @@ Section "-Core installation"
; Write special uninstall registry entries
Push "StartMenu"
Push "$STARTMENU_FOLDER"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "DoNotAddToPath"
Push "$DO_NOT_ADD_TO_PATH"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "AddToPathAllUsers"
Push "$ADD_TO_PATH_ALL_USERS"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "AddToPathCurrentUser"
Push "$ADD_TO_PATH_CURRENT_USER"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
Push "InstallToDesktop"
Push "$INSTALL_DESKTOP"
- Call ConditionalAddToRegisty
+ Call ConditionalAddToRegistry
!insertmacro MUI_STARTMENU_WRITE_END
@@ -880,7 +880,7 @@ Section "Uninstall"
StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:
- ; If the user changed the shortcut, then untinstall may not work. This should
+ ; If the user changed the shortcut, then uninstall may not work. This should
; try to fix it.
StrCpy $MUI_TEMP "$START_MENU"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index a988bf1..2deaaaa 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -1121,7 +1121,6 @@ if(APPLE)
CPack/cmCPackBundleGenerator.cxx
CPack/cmCPackDragNDropGenerator.cxx
CPack/cmCPackPKGGenerator.cxx
- CPack/cmCPackPackageMakerGenerator.cxx
CPack/cmCPackProductBuildGenerator.cxx
)
endif()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ebd2423..121322c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 23)
-set(CMake_VERSION_PATCH 20220504)
+set(CMake_VERSION_PATCH 20220505)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 6a0095b..594f408 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -89,10 +89,21 @@ bool cmCPackWIXGenerator::RunCandleCommand(std::string const& sourceFile,
return false;
}
+ std::string arch;
+ if (cmValue archOpt = GetOption("CPACK_WIX_ARCHITECTURE")) {
+ arch = *archOpt;
+ } else {
+ arch = GetArchitecture();
+ cmCPackLogger(
+ cmCPackLog::LOG_VERBOSE,
+ "CPACK_WIX_ARCHITECTURE was not set. Invoking WiX with architecture "
+ << arch << " . " << std::endl);
+ }
+
std::ostringstream command;
command << QuotePath(executable);
command << " -nologo";
- command << " -arch " << GetArchitecture();
+ command << " -arch " << arch;
command << " -out " << QuotePath(objectFile);
for (std::string const& ext : CandleExtensions) {
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index 0b2acca..725ea8a 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -21,7 +21,6 @@
#ifdef __APPLE__
# include "cmCPackBundleGenerator.h"
# include "cmCPackDragNDropGenerator.h"
-# include "cmCPackPackageMakerGenerator.h"
# include "cmCPackProductBuildGenerator.h"
#endif
@@ -108,10 +107,6 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
this->RegisterGenerator("Bundle", "Mac OSX bundle",
cmCPackBundleGenerator::CreateGenerator);
}
- if (cmCPackPackageMakerGenerator::CanGenerate()) {
- this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker installer",
- cmCPackPackageMakerGenerator::CreateGenerator);
- }
if (cmCPackProductBuildGenerator::CanGenerate()) {
this->RegisterGenerator("productbuild", "Mac OSX pkg",
cmCPackProductBuildGenerator::CreateGenerator);
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
deleted file mode 100644
index a8cf1fa..0000000
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ /dev/null
@@ -1,577 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmCPackPackageMakerGenerator.h"
-
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <map>
-#include <sstream>
-#include <string>
-
-#include "cmsys/FStream.hxx"
-#include "cmsys/RegularExpression.hxx"
-
-#include "cmCPackComponentGroup.h"
-#include "cmCPackLog.h"
-#include "cmDuration.h"
-#include "cmGeneratedFileStream.h"
-#include "cmStringAlgorithms.h"
-#include "cmSystemTools.h"
-#include "cmValue.h"
-#include "cmXMLWriter.h"
-
-static inline unsigned int getVersion(unsigned int major, unsigned int minor)
-{
- assert(major < 256 && minor < 256);
- return ((major & 0xFF) << 16 | minor);
-}
-
-cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator()
-{
- this->PackageMakerVersion = 0.0;
- this->PackageCompatibilityVersion = getVersion(10, 4);
-}
-
-cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator() = default;
-
-bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const
-{
- return this->PackageCompatibilityVersion >= getVersion(10, 4);
-}
-
-int cmCPackPackageMakerGenerator::PackageFiles()
-{
- // TODO: Use toplevel
- // It is used! Is this an obsolete comment?
-
- std::string resDir; // Where this package's resources will go.
- std::string packageDirFileName =
- this->GetOption("CPACK_TEMPORARY_DIRECTORY");
- if (this->Components.empty()) {
- packageDirFileName += ".pkg";
- resDir =
- cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/Resources");
- } else {
- packageDirFileName += ".mpkg";
- if (!cmsys::SystemTools::MakeDirectory(packageDirFileName.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "unable to create package directory " << packageDirFileName
- << std::endl);
- return 0;
- }
-
- resDir = cmStrCat(packageDirFileName, "/Contents");
- if (!cmsys::SystemTools::MakeDirectory(resDir.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "unable to create package subdirectory " << resDir
- << std::endl);
- return 0;
- }
-
- resDir += "/Resources";
- if (!cmsys::SystemTools::MakeDirectory(resDir.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "unable to create package subdirectory " << resDir
- << std::endl);
- return 0;
- }
-
- resDir += "/en.lproj";
- }
-
- cmValue preflight = this->GetOption("CPACK_PREFLIGHT_SCRIPT");
- cmValue postflight = this->GetOption("CPACK_POSTFLIGHT_SCRIPT");
- cmValue postupgrade = this->GetOption("CPACK_POSTUPGRADE_SCRIPT");
-
- if (this->Components.empty()) {
- // Create directory structure
- std::string preflightDirName = resDir + "/PreFlight";
- std::string postflightDirName = resDir + "/PostFlight";
- // if preflight or postflight scripts not there create directories
- // of the same name, I think this makes it work
- if (!preflight) {
- if (!cmsys::SystemTools::MakeDirectory(preflightDirName.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating installer directory: "
- << preflightDirName << std::endl);
- return 0;
- }
- }
- if (!postflight) {
- if (!cmsys::SystemTools::MakeDirectory(postflightDirName.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating installer directory: "
- << postflightDirName << std::endl);
- return 0;
- }
- }
- // if preflight, postflight, or postupgrade are set
- // then copy them into the resource directory and make
- // them executable
- if (preflight) {
- this->CopyInstallScript(resDir, preflight, "preflight");
- }
- if (postflight) {
- this->CopyInstallScript(resDir, postflight, "postflight");
- }
- if (postupgrade) {
- this->CopyInstallScript(resDir, postupgrade, "postupgrade");
- }
- } else if (postflight) {
- // create a postflight component to house the script
- this->PostFlightComponent.Name = "PostFlight";
- this->PostFlightComponent.DisplayName = "PostFlight";
- this->PostFlightComponent.Description = "PostFlight";
- this->PostFlightComponent.IsHidden = true;
-
- // empty directory for pkg contents
- std::string packageDir = toplevel + "/" + PostFlightComponent.Name;
- if (!cmsys::SystemTools::MakeDirectory(packageDir.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating component packages directory: "
- << packageDir << std::endl);
- return 0;
- }
-
- // create package
- std::string packageFileDir = packageDirFileName + "/Contents/Packages/";
- if (!cmsys::SystemTools::MakeDirectory(packageFileDir.c_str())) {
- cmCPackLogger(
- cmCPackLog::LOG_ERROR,
- "Problem creating component PostFlight Packages directory: "
- << packageFileDir << std::endl);
- return 0;
- }
- std::string packageFile =
- packageFileDir + this->GetPackageName(PostFlightComponent);
- if (!this->GenerateComponentPackage(
- packageFile.c_str(), packageDir.c_str(), PostFlightComponent)) {
- return 0;
- }
-
- // copy postflight script into resource directory of .pkg
- std::string resourceDir = packageFile + "/Contents/Resources";
- this->CopyInstallScript(resourceDir, postflight, "postflight");
- }
-
- if (!this->Components.empty()) {
- // Create the directory where component packages will be built.
- std::string basePackageDir =
- cmStrCat(packageDirFileName, "/Contents/Packages");
- if (!cmsys::SystemTools::MakeDirectory(basePackageDir.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating component packages directory: "
- << basePackageDir << std::endl);
- return 0;
- }
-
- // Create the directory where downloaded component packages will
- // be placed.
- cmValue userUploadDirectory = this->GetOption("CPACK_UPLOAD_DIRECTORY");
- std::string uploadDirectory;
- if (userUploadDirectory && !userUploadDirectory->empty()) {
- uploadDirectory = userUploadDirectory;
- } else {
- uploadDirectory =
- cmStrCat(this->GetOption("CPACK_PACKAGE_DIRECTORY"), "/CPackUploads");
- }
-
- // Create packages for each component
- bool warnedAboutDownloadCompatibility = false;
-
- std::map<std::string, cmCPackComponent>::iterator compIt;
- for (compIt = this->Components.begin(); compIt != this->Components.end();
- ++compIt) {
- std::string packageFile;
- if (compIt->second.IsDownloaded) {
- if (this->PackageCompatibilityVersion >= getVersion(10, 5) &&
- this->PackageMakerVersion >= 3.0) {
- // Build this package within the upload directory.
- packageFile = uploadDirectory;
-
- if (!cmSystemTools::FileExists(uploadDirectory.c_str())) {
- if (!cmSystemTools::MakeDirectory(uploadDirectory.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Unable to create package upload directory "
- << uploadDirectory << std::endl);
- return 0;
- }
- }
- } else if (!warnedAboutDownloadCompatibility) {
- if (this->PackageCompatibilityVersion < getVersion(10, 5)) {
- cmCPackLogger(
- cmCPackLog::LOG_WARNING,
- "CPack warning: please set CPACK_OSX_PACKAGE_VERSION to 10.5 "
- "or greater enable downloaded packages. CPack will build a "
- "non-downloaded package."
- << std::endl);
- }
-
- if (this->PackageMakerVersion < 3) {
- cmCPackLogger(cmCPackLog::LOG_WARNING,
- "CPack warning: unable to build downloaded "
- "packages with PackageMaker versions prior "
- "to 3.0. CPack will build a non-downloaded package."
- << std::endl);
- }
-
- warnedAboutDownloadCompatibility = true;
- }
- }
-
- if (packageFile.empty()) {
- // Build this package within the overall distribution
- // metapackage.
- packageFile = basePackageDir;
-
- // We're not downloading this component, even if the user
- // requested it.
- compIt->second.IsDownloaded = false;
- }
-
- packageFile += '/';
- packageFile += GetPackageName(compIt->second);
-
- std::string packageDir = cmStrCat(toplevel, '/', compIt->first);
- if (!this->GenerateComponentPackage(
- packageFile.c_str(), packageDir.c_str(), compIt->second)) {
- return 0;
- }
- }
- }
- this->SetOption("CPACK_MODULE_VERSION_SUFFIX", "");
-
- // Copy or create all of the resource files we need.
- if (!this->CopyCreateResourceFile("License", resDir) ||
- !this->CopyCreateResourceFile("ReadMe", resDir) ||
- !this->CopyCreateResourceFile("Welcome", resDir) ||
- !this->CopyResourcePlistFile("Info.plist") ||
- !this->CopyResourcePlistFile("Description.plist")) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem copying the resource files" << std::endl);
- return 0;
- }
-
- if (this->Components.empty()) {
- // Use PackageMaker to build the package.
- std::ostringstream pkgCmd;
- pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
- << "\" -build -p \"" << packageDirFileName << "\"";
- if (this->Components.empty()) {
- pkgCmd << " -f \"" << this->GetOption("CPACK_TEMPORARY_DIRECTORY");
- } else {
- pkgCmd << " -mi \"" << this->GetOption("CPACK_TEMPORARY_DIRECTORY")
- << "/packages/";
- }
- pkgCmd << "\" -r \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
- << "/Resources\" -i \""
- << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
- << "/Info.plist\" -d \""
- << this->GetOption("CPACK_TOPLEVEL_DIRECTORY")
- << "/Description.plist\"";
- if (this->PackageMakerVersion > 2.0) {
- pkgCmd << " -v";
- }
- if (!RunPackageMaker(pkgCmd.str().c_str(), packageDirFileName.c_str())) {
- return 0;
- }
- } else {
- // We have built the package in place. Generate the
- // distribution.dist file to describe it for the installer.
- WriteDistributionFile(packageDirFileName.c_str(), "PACKAGEMAKER");
- }
-
- std::string tmpFile = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
- "/hdiutilOutput.log");
- std::ostringstream dmgCmd;
- dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
- << "\" create -ov -fs HFS+ -format UDZO -srcfolder \""
- << packageDirFileName << "\" \"" << packageFileNames[0] << "\"";
- std::string output;
- int retVal = 1;
- int numTries = 10;
- bool res = false;
- while (numTries > 0) {
- res = cmSystemTools::RunSingleCommand(
- dmgCmd.str(), &output, &output, &retVal, nullptr, this->GeneratorVerbose,
- cmDuration::zero());
- if (res && !retVal) {
- numTries = -1;
- break;
- }
- cmSystemTools::Delay(500);
- numTries--;
- }
- if (!res || retVal) {
- cmGeneratedFileStream ofs(tmpFile);
- ofs << "# Run command: " << dmgCmd.str() << std::endl
- << "# Output:" << std::endl
- << output << std::endl;
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem running hdiutil command: "
- << dmgCmd.str() << std::endl
- << "Please check " << tmpFile << " for errors"
- << std::endl);
- return 0;
- }
-
- return 1;
-}
-
-int cmCPackPackageMakerGenerator::InitializeInternal()
-{
- cmCPackLogger(cmCPackLog::LOG_WARNING,
- "The PackageMaker generator is deprecated "
- "and will be removed in a future version.\n");
- this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
-
- // Starting with Xcode 4.3, PackageMaker is a separate app, and you
- // can put it anywhere you want. So... use a variable for its location.
- // People who put it in unexpected places can use the variable to tell
- // us where it is.
- //
- // Use the following locations, in "most recent installation" order,
- // to search for the PackageMaker app. Assume people who copy it into
- // the new Xcode 4.3 app in "/Applications" will copy it into the nested
- // Applications folder inside the Xcode bundle itself. Or directly in
- // the "/Applications" directory.
- //
- // If found, save result in the CPACK_INSTALLER_PROGRAM variable.
-
- std::vector<std::string> paths;
- paths.emplace_back("/Applications/Xcode.app/Contents/Applications"
- "/PackageMaker.app/Contents/MacOS");
- paths.emplace_back("/Applications/Utilities"
- "/PackageMaker.app/Contents/MacOS");
- paths.emplace_back("/Applications"
- "/PackageMaker.app/Contents/MacOS");
- paths.emplace_back("/Developer/Applications/Utilities"
- "/PackageMaker.app/Contents/MacOS");
- paths.emplace_back("/Developer/Applications"
- "/PackageMaker.app/Contents/MacOS");
-
- std::string pkgPath;
- cmValue inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM");
- if (inst_program && !inst_program->empty()) {
- pkgPath = inst_program;
- } else {
- pkgPath = cmSystemTools::FindProgram("PackageMaker", paths, false);
- if (pkgPath.empty()) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot find PackageMaker compiler" << std::endl);
- return 0;
- }
- this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", pkgPath);
- }
-
- // Get path to the real PackageMaker, not a symlink:
- pkgPath = cmSystemTools::GetRealPath(pkgPath);
- // Up from there to find the version.plist file in the "Contents" dir:
- std::string contents_dir;
- contents_dir = cmSystemTools::GetFilenamePath(pkgPath);
- contents_dir = cmSystemTools::GetFilenamePath(contents_dir);
-
- std::string versionFile = contents_dir + "/version.plist";
-
- if (!cmSystemTools::FileExists(versionFile.c_str())) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot find PackageMaker compiler version file: "
- << versionFile << std::endl);
- return 0;
- }
-
- cmsys::ifstream ifs(versionFile.c_str());
- if (!ifs) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot open PackageMaker compiler version file"
- << std::endl);
- return 0;
- }
-
- // Check the PackageMaker version
- cmsys::RegularExpression rexKey("<key>CFBundleShortVersionString</key>");
- cmsys::RegularExpression rexVersion("<string>([0-9]+.[0-9.]+)</string>");
- std::string line;
- bool foundKey = false;
- while (cmSystemTools::GetLineFromStream(ifs, line)) {
- if (rexKey.find(line)) {
- foundKey = true;
- break;
- }
- }
- if (!foundKey) {
- cmCPackLogger(
- cmCPackLog::LOG_ERROR,
- "Cannot find CFBundleShortVersionString in the PackageMaker compiler "
- "version file"
- << std::endl);
- return 0;
- }
- if (!cmSystemTools::GetLineFromStream(ifs, line) || !rexVersion.find(line)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem reading the PackageMaker compiler version file: "
- << versionFile << std::endl);
- return 0;
- }
- this->PackageMakerVersion = atof(rexVersion.match(1).c_str());
- if (this->PackageMakerVersion < 1.0) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Require PackageMaker 1.0 or higher" << std::endl);
- return 0;
- }
- cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "PackageMaker version is: " << this->PackageMakerVersion
- << std::endl);
-
- // Determine the package compatibility version. If it wasn't
- // specified by the user, we define it based on which features the
- // user requested.
- cmValue packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION");
- if (packageCompat && !packageCompat->empty()) {
- unsigned int majorVersion = 10;
- unsigned int minorVersion = 5;
- int res =
- sscanf(packageCompat->c_str(), "%u.%u", &majorVersion, &minorVersion);
- if (res == 2) {
- this->PackageCompatibilityVersion =
- getVersion(majorVersion, minorVersion);
- }
- } else if (this->GetOption("CPACK_DOWNLOAD_SITE")) {
- this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.5");
- this->PackageCompatibilityVersion = getVersion(10, 5);
- } else if (this->GetOption("CPACK_COMPONENTS_ALL")) {
- this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.4");
- this->PackageCompatibilityVersion = getVersion(10, 4);
- } else {
- this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.3");
- this->PackageCompatibilityVersion = getVersion(10, 3);
- }
-
- std::vector<std::string> no_paths;
- pkgPath = cmSystemTools::FindProgram("hdiutil", no_paths, false);
- if (pkgPath.empty()) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot find hdiutil compiler" << std::endl);
- return 0;
- }
- this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM_DISK_IMAGE", pkgPath);
-
- return this->Superclass::InitializeInternal();
-}
-
-bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command,
- const char* packageFile)
-{
- std::string tmpFile = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
- "/PackageMakerOutput.log");
-
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl);
- std::string output;
- int retVal = 1;
- bool res = cmSystemTools::RunSingleCommand(
- command, &output, &output, &retVal, nullptr, this->GeneratorVerbose,
- cmDuration::zero());
- cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "Done running package maker" << std::endl);
- if (!res || retVal) {
- cmGeneratedFileStream ofs(tmpFile);
- ofs << "# Run command: " << command << std::endl
- << "# Output:" << std::endl
- << output << std::endl;
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem running PackageMaker command: "
- << command << std::endl
- << "Please check " << tmpFile << " for errors"
- << std::endl);
- return false;
- }
- // sometimes the command finishes but the directory is not yet
- // created, so try 10 times to see if it shows up
- int tries = 10;
- while (tries > 0 && !cmSystemTools::FileExists(packageFile)) {
- cmSystemTools::Delay(500);
- tries--;
- }
- if (!cmSystemTools::FileExists(packageFile)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem running PackageMaker command: "
- << command << std::endl
- << "Package not created: " << packageFile << std::endl);
- return false;
- }
-
- return true;
-}
-
-bool cmCPackPackageMakerGenerator::GenerateComponentPackage(
- const char* packageFile, const char* packageDir,
- const cmCPackComponent& component)
-{
- cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- Building component package: " << packageFile
- << std::endl);
-
- // The command that will be used to run PackageMaker
- std::ostringstream pkgCmd;
-
- if (this->PackageCompatibilityVersion < getVersion(10, 5) ||
- this->PackageMakerVersion < 3.0) {
- // Create Description.plist and Info.plist files for normal Mac OS
- // X packages, which work on Mac OS X 10.3 and newer.
- std::string descriptionFile =
- cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
- component.Name, "-Description.plist");
- cmsys::ofstream out(descriptionFile.c_str());
- cmXMLWriter xout(out);
- xout.StartDocument();
- xout.Doctype("plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\""
- "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"");
- xout.StartElement("plist");
- xout.Attribute("version", "1.4");
- xout.StartElement("dict");
- xout.Element("key", "IFPkgDescriptionTitle");
- xout.Element("string", component.DisplayName);
- xout.Element("key", "IFPkgDescriptionVersion");
- xout.Element("string", this->GetOption("CPACK_PACKAGE_VERSION"));
- xout.Element("key", "IFPkgDescriptionDescription");
- xout.Element("string", component.Description);
- xout.EndElement(); // dict
- xout.EndElement(); // plist
- xout.EndDocument();
- out.close();
-
- // Create the Info.plist file for this component
- std::string moduleVersionSuffix = cmStrCat('.', component.Name);
- this->SetOption("CPACK_MODULE_VERSION_SUFFIX", moduleVersionSuffix);
- std::string infoFileName = cmStrCat(component.Name, "-Info.plist");
- if (!this->CopyResourcePlistFile("Info.plist", infoFileName.c_str())) {
- return false;
- }
-
- pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
- << "\" -build -p \"" << packageFile << "\""
- << " -f \"" << packageDir << "\""
- << " -i \"" << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/"
- << infoFileName << "\""
- << " -d \"" << descriptionFile << "\"";
- } else {
- // Create a "flat" package on Mac OS X 10.5 and newer. Flat
- // packages are stored in a single file, rather than a directory
- // like normal packages, and can be downloaded by the installer
- // on-the-fly in Mac OS X 10.5 or newer. Thus, we need to create
- // flat packages when the packages will be downloaded on the fly.
- std::string pkgId =
- cmStrCat("com.", this->GetOption("CPACK_PACKAGE_VENDOR"), '.',
- this->GetOption("CPACK_PACKAGE_NAME"), '.', component.Name);
-
- pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
- << "\" --root \"" << packageDir << "\""
- << " --id " << pkgId << " --target "
- << this->GetOption("CPACK_OSX_PACKAGE_VERSION") << " --out \""
- << packageFile << "\"";
- }
-
- // Run PackageMaker
- return RunPackageMaker(pkgCmd.str().c_str(), packageFile);
-}
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
deleted file mode 100644
index cda9277..0000000
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include "cmCPackGenerator.h"
-#include "cmCPackPKGGenerator.h"
-
-class cmCPackComponent;
-
-/** \class cmCPackPackageMakerGenerator
- * \brief A generator for PackageMaker files
- *
- * http://developer.apple.com/documentation/Darwin
- * /Reference/ManPages/man1/packagemaker.1.html
- */
-class cmCPackPackageMakerGenerator : public cmCPackPKGGenerator
-{
-public:
- cmCPackTypeMacro(cmCPackPackageMakerGenerator, cmCPackPKGGenerator);
-
- /**
- * Construct generator
- */
- cmCPackPackageMakerGenerator();
- ~cmCPackPackageMakerGenerator() override;
- bool SupportsComponentInstallation() const override;
-
-protected:
- int InitializeInternal() override;
- int PackageFiles() override;
- const char* GetOutputExtension() override { return ".dmg"; }
-
- // Run PackageMaker with the given command line, which will (if
- // successful) produce the given package file. Returns true if
- // PackageMaker succeeds, false otherwise.
- bool RunPackageMaker(const char* command, const char* packageFile);
-
- // Generate a package in the file packageFile for the given
- // component. All of the files within this component are stored in
- // the directory packageDir. Returns true if successful, false
- // otherwise.
- bool GenerateComponentPackage(const char* packageFile,
- const char* packageDir,
- const cmCPackComponent& component);
-
- double PackageMakerVersion;
- unsigned int PackageCompatibilityVersion;
-};
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 129ef4b..b172c20 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCommonTargetGenerator.h"
-#include <set>
+#include <algorithm>
#include <sstream>
#include <utility>
@@ -13,9 +13,11 @@
#include "cmLocalCommonGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmRange.h"
#include "cmSourceFile.h"
+#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
@@ -321,3 +323,29 @@ std::string cmCommonTargetGenerator::GetLinkerLauncher(
}
return std::string();
}
+
+bool cmCommonTargetGenerator::HaveRequiredLanguages(
+ const std::vector<cmSourceFile const*>& sources,
+ std::set<std::string>& languagesNeeded) const
+{
+ for (cmSourceFile const* sf : sources) {
+ languagesNeeded.insert(sf->GetLanguage());
+ }
+
+ auto* makefile = this->Makefile;
+ auto* state = makefile->GetState();
+ auto unary = [&state, &makefile](const std::string& lang) -> bool {
+ const bool valid = state->GetLanguageEnabled(lang);
+ if (!valid) {
+ makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("The language ", lang,
+ " was requested for compilation but was not enabled."
+ " To enable a language it needs to be specified in a"
+ " 'project' or 'enable_language' command in the root"
+ " CMakeLists.txt"));
+ }
+ return valid;
+ };
+ return std::all_of(languagesNeeded.cbegin(), languagesNeeded.cend(), unary);
+}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 5aba1c6..1b804b4 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <map>
+#include <set>
#include <string>
#include <vector>
@@ -74,6 +75,9 @@ protected:
std::string GetLinkerLauncher(const std::string& config);
+ bool HaveRequiredLanguages(const std::vector<cmSourceFile const*>& sources,
+ std::set<std::string>& languagesNeeded) const;
+
private:
using ByLanguageMap = std::map<std::string, std::string>;
struct ByConfig
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1c92c7f..aec6577 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -305,9 +305,14 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
std::vector<cmSourceFile const*> objectSources;
this->GeneratorTarget->GetObjectSources(objectSources,
this->GetConfigName());
- for (cmSourceFile const* sf : objectSources) {
- // Generate this object file's rule file.
- this->WriteObjectRuleFiles(*sf);
+
+ // validate that all languages requested are enabled.
+ std::set<std::string> requiredLangs;
+ if (this->HaveRequiredLanguages(objectSources, requiredLangs)) {
+ for (cmSourceFile const* sf : objectSources) {
+ // Generate this object file's rule file.
+ this->WriteObjectRuleFiles(*sf);
+ }
}
}
@@ -532,8 +537,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
cmSourceFile const& source)
{
// Identify the language of the source file.
- const std::string& lang =
- this->LocalGenerator->GetSourceFileLanguage(source);
+ const std::string& lang = source.GetLanguage();
if (lang.empty()) {
// don't know anything about this file so skip it
return;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 1c5bac8..4f6da0e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -126,15 +126,11 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules(
std::set<std::string> languages;
std::vector<cmSourceFile const*> sourceFiles;
this->GetGeneratorTarget()->GetObjectSources(sourceFiles, config);
- for (cmSourceFile const* sf : sourceFiles) {
- std::string const lang = sf->GetLanguage();
- if (!lang.empty()) {
- languages.insert(lang);
+ if (this->HaveRequiredLanguages(sourceFiles, languages)) {
+ for (std::string const& language : languages) {
+ this->WriteLanguageRules(language, config);
}
}
- for (std::string const& language : languages) {
- this->WriteLanguageRules(language, config);
- }
}
const char* cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 8739c55..7d06607 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -404,6 +404,10 @@ class cmMakefile;
SELECT(POLICY, CMP0134, \
"Fallback to \"HOST\" Windows registry view when \"TARGET\" view " \
"is not usable.", \
+ 3, 24, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0135, \
+ "ExternalProject ignores timestamps in archives by default for the " \
+ "URL download method", \
3, 24, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index cf0cb17..1739b5a 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3832,63 +3832,15 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions(
return false;
}
- // Would like to use:
- // cmLinkLineDeviceComputer computer(this->LocalGenerator,
- // this->LocalGenerator->GetStateSnapshot().GetDirectory());
- // std::string computed_libs = computer.ComputeLinkLibraries(cli,
- // std::string{}); but it outputs in "<libA> <libB>" format instead of
- // "<libA>;<libB>"
- // Note:
- // Any modification of this algorithm should be reflected also in
- // cmLinkLineDeviceComputer
cmComputeLinkInformation& cli = *pcli;
+ cmLinkLineDeviceComputer computer(
+ this->LocalGenerator,
+ this->LocalGenerator->GetStateSnapshot().GetDirectory());
+ std::vector<BT<std::string>> btLibVec;
+ computer.ComputeLinkLibraries(cli, std::string{}, btLibVec);
std::vector<std::string> libVec;
- const auto& libs = cli.GetItems();
- for (cmComputeLinkInformation::Item const& l : libs) {
-
- if (l.Target) {
- auto managedType = l.Target->GetManagedType(configName);
- // Do not allow C# targets to be added to the LIB listing. LIB files
- // are used for linking C++ dependencies. C# libraries do not have lib
- // files. Instead, they compile down to C# reference libraries (DLL
- // files). The
- // `<ProjectReference>` elements added to the vcxproj are enough for
- // the IDE to deduce the DLL file required by other C# projects that
- // need its reference library.
- if (managedType == cmGeneratorTarget::ManagedType::Managed) {
- continue;
- }
- const auto type = l.Target->GetType();
-
- bool skip = false;
- switch (type) {
- case cmStateEnums::SHARED_LIBRARY:
- case cmStateEnums::MODULE_LIBRARY:
- case cmStateEnums::INTERFACE_LIBRARY:
- skip = true;
- break;
- case cmStateEnums::STATIC_LIBRARY:
- skip = l.Target->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
- break;
- default:
- break;
- }
- if (skip) {
- continue;
- }
- }
-
- if (l.IsPath == cmComputeLinkInformation::ItemIsPath::Yes) {
- std::string path =
- this->LocalGenerator->MaybeRelativeToCurBinDir(l.Value.Value);
- ConvertToWindowsSlash(path);
- if (!cmVS10IsTargetsFile(l.Value.Value)) {
- libVec.push_back(l.HasFeature() ? l.GetFormattedItem(path).Value
- : path);
- }
- } else {
- libVec.push_back(l.Value.Value);
- }
+ for (auto const& item : btLibVec) {
+ libVec.emplace_back(item.Value);
}
cudaLinkOptions.AddFlag("AdditionalDependencies", libVec);
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9a4910f..9a1cf69 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -294,17 +294,6 @@ if(BUILD_TESTING)
mark_as_advanced(CTEST_TEST_CTEST)
endif ()
- # Should CPack tests be run? By default, yes, but...
- #
- # Disable packaging test on Apple 10.3 and below. PackageMaker starts
- # DiskManagementTool as root and disowns it
- # (http://lists.apple.com/archives/installer-dev/2005/Jul/msg00005.html).
- # It is left holding open pipe handles and preventing ProcessUNIX from
- # detecting end-of-data even after its immediate child exits. Then
- # the test hangs until it times out and is killed. This is a
- # well-known bug in kwsys process execution that I would love to get
- # time to fix.
- #
option(CTEST_TEST_CPACK
"Should the tests that use '--build-target package' be run?"
ON)
diff --git a/Tests/CPackComponents/VerifyResult.cmake b/Tests/CPackComponents/VerifyResult.cmake
index c7c24fd..5e08e60 100644
--- a/Tests/CPackComponents/VerifyResult.cmake
+++ b/Tests/CPackComponents/VerifyResult.cmake
@@ -22,9 +22,7 @@ if(WIN32)
endif()
if(APPLE)
- # Always expect the *.dmg installer - PackageMaker should always
- # be installed on a development Mac:
- #
+ # Always expect the *.dmg installer
set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.dmg")
endif()
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index e49138a..a1a9709 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -5,7 +5,7 @@
# which supports CPack components.
#
# Depending on the CPack generator and on some CPACK_xxx var values
-# the generator may produce a single (NSIS, PackageMaker)
+# the generator may produce a single (NSIS, productbuild)
# or several package files (Archive Generators, RPM, DEB)
cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR)
project(CPackComponentsForAll)
diff --git a/Tests/CudaOnly/ArchSpecial/CMakeLists.txt b/Tests/CudaOnly/ArchSpecial/CMakeLists.txt
index 46f4ada..88eff8a 100644
--- a/Tests/CudaOnly/ArchSpecial/CMakeLists.txt
+++ b/Tests/CudaOnly/ArchSpecial/CMakeLists.txt
@@ -10,6 +10,7 @@ function(verify_output flag)
string(REPLACE "-" "_" architectures "${flag}")
string(TOUPPER "${architectures}" architectures)
set(architectures "${CMAKE_CUDA_ARCHITECTURES_${architectures}}")
+ list(TRANSFORM architectures REPLACE "-real" "")
if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
set(match_regex "-target-cpu sm_([0-9]+)")
diff --git a/Tests/RunCMake/CMP0135/CMP0135-Common.cmake b/Tests/RunCMake/CMP0135/CMP0135-Common.cmake
new file mode 100644
index 0000000..4b7cce5
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-Common.cmake
@@ -0,0 +1,18 @@
+include(ExternalProject)
+
+set(stamp_dir "${CMAKE_CURRENT_BINARY_DIR}/stamps")
+
+ExternalProject_Add(fake_ext_proj
+ # We don't actually do a build, so we never try to download from this URL
+ URL https://example.com/something.zip
+ STAMP_DIR ${stamp_dir}
+)
+
+# Report whether the --touch option was added to the extraction script
+set(extraction_script "${stamp_dir}/extract-fake_ext_proj.cmake")
+file(STRINGS "${extraction_script}" results REGEX "--touch")
+if("${results}" STREQUAL "")
+ message(STATUS "Using timestamps from archive")
+else()
+ message(STATUS "Using extraction time for the timestamps")
+endif()
diff --git a/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt
new file mode 100644
index 0000000..bf53c0b
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt
@@ -0,0 +1 @@
+Using extraction time for the timestamps
diff --git a/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake b/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake
new file mode 100644
index 0000000..1fd6354
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0135 NEW)
+include(CMP0135-Common.cmake)
diff --git a/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt
new file mode 100644
index 0000000..ee57beb
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt
@@ -0,0 +1 @@
+Using timestamps from archive
diff --git a/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake b/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake
new file mode 100644
index 0000000..80d58a7
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0135 OLD)
+include(CMP0135-Common.cmake)
diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt b/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt
new file mode 100644
index 0000000..8ba0027
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
+ The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
+ not set\. The policy's OLD behavior will be used\. When using a URL
+ download, the timestamps of extracted files should preferably be that of
+ the time of extraction, otherwise code that depends on the extracted
+ contents might not be rebuilt if the URL changes\. The OLD behavior
+ preserves the timestamps from the archive instead, but this is usually not
+ what you want\. Update your project to the NEW behavior or specify the
+ DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
+ robustness issue\.
diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt
new file mode 100644
index 0000000..ee57beb
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt
@@ -0,0 +1 @@
+Using timestamps from archive
diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake b/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake
new file mode 100644
index 0000000..ab71c40
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake
@@ -0,0 +1,2 @@
+
+include(CMP0135-Common.cmake)
diff --git a/Tests/RunCMake/CMP0135/CMakeLists.txt b/Tests/RunCMake/CMP0135/CMakeLists.txt
new file mode 100644
index 0000000..5ff8d3e
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.23)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0135/RunCMakeTest.cmake b/Tests/RunCMake/CMP0135/RunCMakeTest.cmake
new file mode 100644
index 0000000..da92391
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0135-WARN)
+run_cmake(CMP0135-OLD)
+run_cmake(CMP0135-NEW)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c2677a0..515c6d8 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -149,6 +149,7 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "LCC" OR
endif()
add_RunCMake_test(CMP0132)
+add_RunCMake_test(CMP0135)
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
diff --git a/Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt b/Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt
index ee0a5f7..4153699 100644
--- a/Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt
+++ b/Tests/RunCMake/CUDA_architectures/architectures-all-major-stdout.txt
@@ -1,4 +1,4 @@
-- CMAKE_CUDA_ARCHITECTURES='all-major'
--- CMAKE_CUDA_ARCHITECTURES_ALL='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_NATIVE='[0-9;]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_NATIVE='([0-9]+-real;)*[0-9]+-real'
diff --git a/Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt b/Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt
index fd738e4..32c61de0 100644
--- a/Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt
+++ b/Tests/RunCMake/CUDA_architectures/architectures-all-stdout.txt
@@ -1,4 +1,4 @@
-- CMAKE_CUDA_ARCHITECTURES='all'
--- CMAKE_CUDA_ARCHITECTURES_ALL='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_NATIVE='[0-9;]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_NATIVE='([0-9]+-real;)*[0-9]+-real'
diff --git a/Tests/RunCMake/CUDA_architectures/architectures-native-stdout.txt b/Tests/RunCMake/CUDA_architectures/architectures-native-stdout.txt
index af49e00..7f6f19e 100644
--- a/Tests/RunCMake/CUDA_architectures/architectures-native-stdout.txt
+++ b/Tests/RunCMake/CUDA_architectures/architectures-native-stdout.txt
@@ -1,4 +1,4 @@
-- CMAKE_CUDA_ARCHITECTURES='native'
--- CMAKE_CUDA_ARCHITECTURES_ALL='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_NATIVE='[0-9;]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_NATIVE='([0-9]+-real;)*[0-9]+-real'
diff --git a/Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt b/Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt
index 22ed7f6..90b3552 100644
--- a/Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt
+++ b/Tests/RunCMake/CUDA_architectures/architectures-suffix-stdout.txt
@@ -1,4 +1,4 @@
-- CMAKE_CUDA_ARCHITECTURES='[0-9]+-real;[0-9]+-virtual;'
--- CMAKE_CUDA_ARCHITECTURES_ALL='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='[0-9;]+'
--- CMAKE_CUDA_ARCHITECTURES_NATIVE='[0-9;]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR='([0-9]+-real;)+[0-9]+'
+-- CMAKE_CUDA_ARCHITECTURES_NATIVE='([0-9]+-real;)*[0-9]+-real'
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake b/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake
index bfed4fa..364bf9e 100644
--- a/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake
@@ -4,6 +4,7 @@ if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12)
else()
cmake_policy(SET CMP0114 OLD) # Test deprecated behavior.
endif()
+cmake_policy(SET CMP0135 NEW)
include(ExternalProject)
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake b/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake
index 039dec6..da823cd 100644
--- a/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake
@@ -4,6 +4,7 @@ if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12)
else()
cmake_policy(SET CMP0114 OLD) # Test deprecated behavior.
endif()
+cmake_policy(SET CMP0135 NEW)
include(ExternalProject)
diff --git a/Tests/RunCMake/ExternalProject/CMakeLists.txt b/Tests/RunCMake/ExternalProject/CMakeLists.txt
index 933a57a..b94f825 100644
--- a/Tests/RunCMake/ExternalProject/CMakeLists.txt
+++ b/Tests/RunCMake/ExternalProject/CMakeLists.txt
@@ -3,4 +3,5 @@ project(${RunCMake_TEST} NONE)
if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12 AND NOT RunCMake_TEST STREQUAL "Xcode-CMP0114")
cmake_policy(SET CMP0114 NEW)
endif()
+cmake_policy(SET CMP0135 NEW)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake b/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake
index 7ec1a00..e257425 100644
--- a/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake
+++ b/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake
@@ -1,4 +1,5 @@
cmake_policy(SET CMP0114 NEW)
+cmake_policy(SET CMP0135 NEW)
include(ExternalProject)
ExternalProject_Add(BAR SOURCE_DIR . TEST_COMMAND echo test)
ExternalProject_Add_StepTargets(BAR NO_DEPENDS test)
diff --git a/Tests/RunCMake/cmake_host_system_information/Registry_Query.cmake b/Tests/RunCMake/cmake_host_system_information/Registry_Query.cmake
index 9f9fb14..97a4ecc 100644
--- a/Tests/RunCMake/cmake_host_system_information/Registry_Query.cmake
+++ b/Tests/RunCMake/cmake_host_system_information/Registry_Query.cmake
@@ -1,12 +1,4 @@
-# check Windows architecture
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "HKCU" SUBKEYS VIEW 64 ERROR_VARIABLE status)
-if (status STREQUAL "")
- set(HOST_64BIT TRUE)
-else()
- set(HOST_64BIT FALSE)
-endif()
-
# helper function for test validation
function(CHECK key result status expression)
if(status STREQUAL "")
@@ -25,33 +17,51 @@ set(KEY "HKCU/Software/Classes/CLSID/CMake-Tests/chsi-registry")
cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" ERROR_VARIABLE status)
check("${KEY}" "${result}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"default 64bit\")
- OR (NOT HOST_64BIT AND result STREQUAL \"default 32bit\")")
+ "result STREQUAL \"default ${ARCH}\"")
# query value using special name should be identical to default value
cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE "(default)" ERROR_VARIABLE status)
check("${KEY}{(default)}" "${result2}" "${status}" "result2 STREQUAL result")
cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW HOST ERROR_VARIABLE status)
check("${KEY}" "${result}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"default 64bit\")
- OR (NOT HOST_64BIT AND result STREQUAL \"default 32bit\")")
+ "result STREQUAL \"default ${ARCH}\"")
# VIEW TARGET should have same value as VIEW HOST
cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VIEW TARGET ERROR_VARIABLE status)
check("${KEY}" "${result2}" "${status}" "result2 STREQUAL result")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 64 ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 64bit\"")
+if (ARCH STREQUAL "64bit")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 64bit\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
+
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 64bit\"")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 32 ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
+ # reg 32bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
-# reg 64bit is read first
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 64_32 ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 64bit\"")
+else() #32bit
-# reg 32bit is read first
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 32_64 ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
+
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
+
+ # reg 32bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
+
+endif()
# HKCU/Software/CMake-Tests/chsi-registry: Query named value
@@ -60,37 +70,58 @@ set(KEY "HKCU/Software/Classes/CLSID/CMake-Tests/chsi-registry")
cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
ERROR_VARIABLE status)
check("${KEY}{BYTE_SIZE}" "${result}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"64bit\")
- OR (NOT HOST_64BIT AND result STREQUAL \"32bit\")")
+ "result STREQUAL \"${ARCH}\"")
cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
VIEW HOST ERROR_VARIABLE status)
check("${KEY}{BYTE_SIZE}" "${result}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"64bit\")
- OR (NOT HOST_64BIT AND result STREQUAL \"32bit\")")
+ "result STREQUAL \"${ARCH}\"")
# VIEW TARGET should have same value as VIEW HOST
cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
VIEW TARGET ERROR_VARIABLE status)
check("${KEY}{BYTE_SIZE}" "${result2}" "${status}" "result2 STREQUAL result")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
- VIEW 64 ERROR_VARIABLE status)
-check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"64bit\"")
+if (ARCH STREQUAL "64bit")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
- VIEW 32 ERROR_VARIABLE status)
-check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"64bit\"")
-# reg 64bit is read first
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
- VIEW 64_32 ERROR_VARIABLE status)
-check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"64bit\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"32bit\"")
-# reg 32bit is read first
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
- VIEW 32_64 ERROR_VARIABLE status)
-check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"64bit\"")
+
+ # reg 32bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+
+else() # 32bit
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+
+ # reg 32bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}{BYTE_SIZE}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+
+endif()
# HKCU/Software/CMake-Tests/chsi-registry: check retrieval of various types
cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE VALUE_SZ ERROR_VARIABLE status)
@@ -114,119 +145,192 @@ check("${KEY}{VALUE_QWORD}" "${result}" "${status}" "result EQUAL \"513\"")
# HKCU/Software/CMake-Tests/chsi-registry: check retrieval of value names
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE2_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
-# VIEW BOTH should have same result as default view
-cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW BOTH ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE2_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+if (ARCH STREQUAL "64bit")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE2_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+ # VIEW BOTH should have same result as default view
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW BOTH ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result2 STREQUAL result")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW HOST ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
+ "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+ # VIEW TARGET should have same result as VIEW HOST
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result2 STREQUAL result")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
+ "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_SZ\"")
+
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
+ "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE2_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+
+ # reg 32bit is read first. Result is the same as with view 64_32
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result2 STREQUAL result")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW HOST ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\")
- OR (NOT HOST_64BIT AND result STREQUAL \"(default);BYTE_SIZE;VALUE2_SZ\")")
-# VIEW TARGET should have same result as VIEW HOST
-cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result2}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\")
- OR (NOT HOST_64BIT AND result STREQUAL \"(default);BYTE_SIZE;VALUE2_SZ\")")
+else()
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW 64 ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
- "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+ # VIEW BOTH should have same result as default view
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW BOTH ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result STREQUAL result2")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW HOST ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
+ "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ")
+ # VIEW TARGET should have same result as VIEW HOST
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result2 STREQUAL result")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}" "result STREQUAL \"\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
+ "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+
+ # reg 32bit is read first. Result is the same as with view 64_32
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result2 STREQUAL result")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW 32 ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_SZ\"")
+endif()
-# reg 64bit is read first
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW 64_32 ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result}" "${status}"
- "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE2_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
-# reg 32bit is read first. Result is the same as with view 64_32
-cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW 32_64 ERROR_VARIABLE status)
-check("${KEY}[VALUE_NAMES]" "${result2}" "${status}" "result2 STREQUAL result")
+# HKCU/Software/CMake-Tests/chsi-registry: check retrieval of sub keys
+if (ARCH STREQUAL "64bit")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2;subkey3\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW HOST ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
+ # VIEW TARGET should have same result as VIEW HOST
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result2 STREQUAL result")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey3\"")
+
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}[SUBLEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2;subkey3\"")
+
+ # reg 32bit is read first. Result is the same as with view 64_32
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result2}" "${status}" "result2 STREQUAL result")
+else()
-# HKCU/Software/CMake-Tests/chsi-registry: check retrieval of sub keys
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- ERROR_VARIABLE status)
-check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2;subkey3\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW HOST ERROR_VARIABLE status)
-check("${KEY}[SUBKEYS]" "${result}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"subkey1;subkey2\")
- OR (NOT HOST_64BIT AND result STREQUAL \"subkey1;subkey3\")")
-# VIEW TARGET should have same result as VIEW HOST
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}[SUBKEYS]" "${result}" "${status}"
- "(HOST_64BIT AND result STREQUAL \"subkey1;subkey2\")
- OR (NOT HOST_64BIT AND result STREQUAL \"subkey1;subkey3\")")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW HOST ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
+ # VIEW TARGET should have same result as VIEW HOST
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result2 STREQUAL result")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW 64 ERROR_VARIABLE status)
-check("${KEY}[SUBKEYS]" "${result}" "${status}"
- "result STREQUAL \"subkey1;subkey2\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 64 ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"\"")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW 32 ERROR_VARIABLE status)
-check("${KEY}[SUBKEYS]" "${result}" "${status}"
- "result STREQUAL \"subkey1;subkey3\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 32 ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
-# reg 64bit is read first
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW 64_32 ERROR_VARIABLE status)
-check("${KEY}[SUBLEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2;subkey3\"")
+ # reg 64bit is read first
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 64_32 ERROR_VARIABLE status)
+ check("${KEY}[SUBLEYS]" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
-# reg 32bit is read first. Result is the same as with view 64_32
-cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW 32_64 ERROR_VARIABLE status)
-check("${KEY}[SUBKEYS]" "${result2}" "${status}" "result2 STREQUAL result")
+ # reg 32bit is read first. Result is the same as with view 64_32
+ cmake_host_system_information(RESULT result2 QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW 32_64 ERROR_VARIABLE status)
+ check("${KEY}[SUBKEYS]" "${result2}" "${status}" "result2 STREQUAL result")
+endif()
-# Check influence of variable CMAKE_SIZEOF_VOID_P
-set(CMAKE_SIZEOF_VOID_P 8)
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}"
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 64bit\"")
+if (ARCH STREQUAL "64bit")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"64bit\"")
+ # Check influence of variable CMAKE_SIZEOF_VOID_P
+ set(CMAKE_SIZEOF_VOID_P 8)
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}"
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 64bit\"")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"64bit\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_MULTI_SZ;VALUE_DWORD;VALUE_EXPAND_SZ;VALUE_MULTI_SZ;VALUE_QWORD;VALUE_SZ\"")
-set(CMAKE_SIZEOF_VOID_P 4)
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"subkey1;subkey2\"")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}"
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+ set(CMAKE_SIZEOF_VOID_P 4)
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_SZ\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}"
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"default 32bit\"")
-cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
- VIEW TARGET ERROR_VARIABLE status)
-check("${KEY}" "${result}" "${status}" "result STREQUAL \"subkey1;subkey3\"")
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE BYTE_SIZE
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"32bit\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" VALUE_NAMES
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"(default);BYTE_SIZE;VALUE2_SZ\"")
+
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "${KEY}" SUBKEYS
+ VIEW TARGET ERROR_VARIABLE status)
+ check("${KEY}" "${result}" "${status}" "result STREQUAL \"subkey1;subkey3\"")
+
+endif()
diff --git a/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake b/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake
index d857bee..9122470 100644
--- a/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_host_system_information/RunCMakeTest.cmake
@@ -36,12 +36,24 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
# Tests using the Windows registry
find_program(REG NAMES "reg.exe" NO_CACHE)
if (REG)
+ ## check host architecture
+ cmake_host_system_information(RESULT result QUERY WINDOWS_REGISTRY "HKCU" SUBKEYS VIEW 64 ERROR_VARIABLE status)
+ if (status STREQUAL "")
+ set(ARCH "64bit")
+ else()
+ set(ARCH "32bit")
+ endif()
+
# crete some entries in the registry
- cmake_path(CONVERT "${RunCMake_SOURCE_DIR}/registry_data.reg" TO_NATIVE_PATH_LIST registry_data)
+ cmake_path(CONVERT "${RunCMake_SOURCE_DIR}/registry_host${ARCH}.reg" TO_NATIVE_PATH_LIST registry_data)
execute_process(COMMAND "${REG}" import "${registry_data}" OUTPUT_QUIET ERROR_QUIET)
- run_cmake(Registry_Query)
+
+ run_cmake_with_options(Registry_Query -DARCH=${ARCH})
+
# clean-up registry
- execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\CLSID\\CMake-Tests" /f OUTPUT_QUIET ERROR_QUIET)
- execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\WOW6432Node\\CLSID\\CMake-Tests" /f OUTPUT_QUIET ERROR_QUIET)
+ execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\CLSID\\CMake-Tests\\chsi-registry" /f OUTPUT_QUIET ERROR_QUIET)
+ if (ARCH STREQUAL "64bit")
+ execute_process(COMMAND "${REG}" delete "HKCU\\SOFTWARE\\Classes\\WOW6432Node\\CLSID\\CMake-Tests\\chsi-registry" /f OUTPUT_QUIET ERROR_QUIET)
+ endif()
endif()
endif()
diff --git a/Tests/RunCMake/cmake_host_system_information/registry_host32bit.reg b/Tests/RunCMake/cmake_host_system_information/registry_host32bit.reg
new file mode 100644
index 0000000..2bbd6a2
--- /dev/null
+++ b/Tests/RunCMake/cmake_host_system_information/registry_host32bit.reg
Binary files differ
diff --git a/Tests/RunCMake/cmake_host_system_information/registry_data.reg b/Tests/RunCMake/cmake_host_system_information/registry_host64bit.reg
index 8596648..8596648 100644
--- a/Tests/RunCMake/cmake_host_system_information/registry_data.reg
+++ b/Tests/RunCMake/cmake_host_system_information/registry_host64bit.reg
Binary files differ
diff --git a/Tests/RunCMake/project/LanguagesUsedButNotEnabled-result.txt b/Tests/RunCMake/project/LanguagesUsedButNotEnabled-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesUsedButNotEnabled-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/project/LanguagesUsedButNotEnabled-stderr.txt b/Tests/RunCMake/project/LanguagesUsedButNotEnabled-stderr.txt
new file mode 100644
index 0000000..bf9157b
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesUsedButNotEnabled-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error in CMakeLists.txt:
+ The language CXX was requested for compilation but was not enabled. To
+ enable a language it needs to be specified in a 'project' or
+ 'enable_language' command in the root CMakeLists.txt
diff --git a/Tests/RunCMake/project/LanguagesUsedButNotEnabled.cmake b/Tests/RunCMake/project/LanguagesUsedButNotEnabled.cmake
new file mode 100644
index 0000000..caab687
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesUsedButNotEnabled.cmake
@@ -0,0 +1,3 @@
+
+add_executable(UsesCXXLang empty.cxx)
+set_source_files_properties(empty.cxx PROPERTIES GENERATED TRUE LANGUAGE CXX )
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
index 349e8ac..d7dab12 100644
--- a/Tests/RunCMake/project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -8,6 +8,9 @@ run_cmake(LanguagesEmpty)
run_cmake(LanguagesNONE)
run_cmake(LanguagesTwice)
run_cmake(LanguagesUnordered)
+if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ run_cmake(LanguagesUsedButNotEnabled)
+endif()
run_cmake(ProjectDescription)
run_cmake(ProjectDescription2)
run_cmake(ProjectDescriptionNoArg)
diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt
index ba45e96..b190de2 100644
--- a/Tests/X11/CMakeLists.txt
+++ b/Tests/X11/CMakeLists.txt
@@ -29,7 +29,6 @@ if(X11_FOUND)
target_link_libraries(HelloWorldX11 ${X11_LIBRARIES})
install(TARGETS HelloWorldX11 DESTINATION bin)
- set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE )
set(CPACK_PACKAGE_NAME HelloWorldX11Package)
set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11)
endif()