diff options
-rw-r--r-- | Help/command/cmake_path.rst | 5 | ||||
-rw-r--r-- | Help/command/if.rst | 19 | ||||
-rw-r--r-- | Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst | 14 | ||||
-rw-r--r-- | Help/release/3.24.rst | 4 | ||||
-rw-r--r-- | Modules/FindVulkan.cmake | 32 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 37 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 38 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 8 |
9 files changed, 105 insertions, 54 deletions
diff --git a/Help/command/cmake_path.rst b/Help/command/cmake_path.rst index 6fd3cf6..eb7da07 100644 --- a/Help/command/cmake_path.rst +++ b/Help/command/cmake_path.rst @@ -482,8 +482,9 @@ are :ref:`normalized <Normalization>` before the check. cmake_path(COMPARE <input1> NOT_EQUAL <input2> <out-var>) Compares the lexical representations of two paths provided as string literals. -No normalization is performed on either path. Equality is determined -according to the following pseudo-code logic: +No normalization is performed on either path, except multiple consecutive +directory separators are effectively collapsed into a single separator. +Equality is determined according to the following pseudo-code logic: :: diff --git a/Help/command/if.rst b/Help/command/if.rst index 3908a8c..b72769f 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -320,13 +320,18 @@ Path Comparisons .. _PATH_EQUAL: ``if(<variable|string> PATH_EQUAL <variable|string>)`` - .. versionadded:: 3.24 - Compares the lexical representations of two paths provided as string - literals or variables. No normalization is performed on either path. - - Lexical comparison has the advantage over string comparison to have a - knowledge of the structure of the path. So, the following comparison is - ``TRUE`` using ``PATH_EQUAL`` operator, but ``FALSE`` with ``STREQUAL``: + .. versionadded:: 3.24 + + Compares the two paths component-by-component. Only if every component of + both paths match will the two paths compare equal. Multiple path separators + are effectively collapsed into a single separator, but note that backslashes + are not converted to forward slashes. No other + :ref:`path normalization <Normalization>` is performed. + + Component-wise comparison is superior to string-based comparison due to the + handling of multiple path separators. In the following example, the + expression evaluates to true using ``PATH_EQUAL``, but false with + ``STREQUAL``: .. code-block:: cmake diff --git a/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst b/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst index 30c02f5..1cf4a69 100644 --- a/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst +++ b/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst @@ -7,13 +7,13 @@ Used to verify that all headers in a target's ``PUBLIC`` and ``INTERFACE`` header sets can be included on their own. When this property is set to true, and the target is an object library, static -library, shared library, or executable with exports enabled, and the target -has one or more ``PUBLIC`` or ``INTERFACE`` header sets, an object library -target named ``<target_name>_verify_interface_header_sets`` is created. This -verification target has one source file per header in the ``PUBLIC`` and -``INTERFACE`` header sets. Each source file only includes its associated -header file. The verification target links against the original target to get -all of its usage requirements. The verification target has its +library, shared library, interface library, or executable with exports enabled, +and the target has one or more ``PUBLIC`` or ``INTERFACE`` header sets, an +object library target named ``<target_name>_verify_interface_header_sets`` is +created. This verification target has one source file per header in the +``PUBLIC`` and ``INTERFACE`` header sets. Each source file only includes its +associated header file. The verification target links against the original +target to get all of its usage requirements. The verification target has its :prop_tgt:`EXCLUDE_FROM_ALL` and :prop_tgt:`DISABLE_PRECOMPILE_HEADERS` properties set to true, and its :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTORCC`, :prop_tgt:`AUTOUIC`, and :prop_tgt:`UNITY_BUILD` properties set to false. diff --git a/Help/release/3.24.rst b/Help/release/3.24.rst index f9e66b6..02252e0 100644 --- a/Help/release/3.24.rst +++ b/Help/release/3.24.rst @@ -220,6 +220,10 @@ Modules gained a ``NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES`` option to disable automatic linking of MATLAB libraries. +* The :module:`FindVulkan` module now supports components to select which + VulkanSDK tool and libraries to find in addition to the Vulkan SDK headers + and library. + * The :module:`FindZLIB` gained a new ``ZLIB_USE_STATIC_LIBS`` variable to search only for static libraries. diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 0dcdb31..2f69234 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -15,14 +15,34 @@ Optional COMPONENTS .. versionadded:: 3.24 -This module respects several optional COMPONENTS: ``glslc``, -``glslangValidator``, ``glslang``, ``shaderc_combined`` and ``SPIRV-Tools``. -On macOS, an additional component ``MoltenVK`` is available. -There are corresponding import targets for each of these flags. +This module respects several optional COMPONENTS. +There are corresponding imported targets for each of these. -.. versionadded:: 3.25 +``glslc`` + The SPIR-V compiler. -Added optional COMPONENT ``dxc`` with corresponding targets. +``glslangValidator`` + The ``glslangValidator`` tool. + +``glslang`` + The SPIR-V generator library. + +``shaderc_combined`` + The static library for Vulkan shader compilation. + +``SPIRV-Tools`` + Tools to process SPIR-V modules. + +``MoltenVK`` + On macOS, an additional component ``MoltenVK`` is available. + +``dxc`` + .. versionadded:: 3.25 + + The DirectX Shader Compiler. + +The ``glslc`` and ``glslangValidator`` components are provided even +if not explicitly requested (for backward compatibility). IMPORTED Targets ^^^^^^^^^^^^^^^^ diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c5024a5..9ff81c3 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 24) -set(CMake_VERSION_PATCH 20220725) +set(CMake_VERSION_PATCH 20220726) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 5113a46..ebb12f8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -49,6 +49,7 @@ #include "cmState.h" #include "cmStateDirectory.h" #include "cmStateTypes.h" +#include "cmSystemTools.h" #include "cmValue.h" #include "cmVersion.h" #include "cmWorkingDirectory.h" @@ -62,10 +63,6 @@ # include "cmQtAutoGenGlobalInitializer.h" #endif -#if defined(_MSC_VER) && _MSC_VER >= 1800 -# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx -#endif - const std::string kCMAKE_PLATFORM_INFO_INITIALIZED = "CMAKE_PLATFORM_INFO_INITIALIZED"; @@ -616,34 +613,12 @@ void cmGlobalGenerator::EnableLanguage( // what platform we are running on if (!mf->GetDefinition("CMAKE_SYSTEM")) { #if defined(_WIN32) && !defined(__CYGWIN__) - /* Windows version number data. */ - OSVERSIONINFOEXW osviex; - ZeroMemory(&osviex, sizeof(osviex)); - osviex.dwOSVersionInfoSize = sizeof(osviex); - -# ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -# pragma warning(push) -# ifdef __INTEL_COMPILER -# pragma warning(disable : 1478) -# elif defined __clang__ -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-declarations" -# else -# pragma warning(disable : 4996) -# endif -# endif - GetVersionExW((OSVERSIONINFOW*)&osviex); -# ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx -# ifdef __clang__ -# pragma clang diagnostic pop -# else -# pragma warning(pop) -# endif -# endif + cmSystemTools::WindowsVersion windowsVersion = + cmSystemTools::GetWindowsVersion(); std::ostringstream windowsVersionString; - windowsVersionString << osviex.dwMajorVersion << "." - << osviex.dwMinorVersion << "." - << osviex.dwBuildNumber; + windowsVersionString << windowsVersion.dwMajorVersion << "." + << windowsVersion.dwMinorVersion << "." + << windowsVersion.dwBuildNumber; mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString.str()); #endif // Read the DetermineSystem file diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 3de45bc..93a6f64 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -107,6 +107,10 @@ # include <sys/utsname.h> #endif +#if defined(_MSC_VER) && _MSC_VER >= 1800 +# define CM_WINDOWS_DEPRECATED_GetVersionEx +#endif + namespace { cmSystemTools::InterruptCallback s_InterruptCallback; @@ -904,6 +908,40 @@ cmSystemTools::WindowsFileRetry cmSystemTools::GetWindowsDirectoryRetry() InitWindowsDirectoryRetry().Retry; return retry; } + +cmSystemTools::WindowsVersion cmSystemTools::GetWindowsVersion() +{ + /* Windows version number data. */ + OSVERSIONINFOEXW osviex; + ZeroMemory(&osviex, sizeof(osviex)); + osviex.dwOSVersionInfoSize = sizeof(osviex); + +# ifdef CM_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning(push) +# ifdef __INTEL_COMPILER +# pragma warning(disable : 1478) +# elif defined __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wdeprecated-declarations" +# else +# pragma warning(disable : 4996) +# endif +# endif + GetVersionExW((OSVERSIONINFOW*)&osviex); +# ifdef CM_WINDOWS_DEPRECATED_GetVersionEx +# ifdef __clang__ +# pragma clang diagnostic pop +# else +# pragma warning(pop) +# endif +# endif + + WindowsVersion result; + result.dwMajorVersion = osviex.dwMajorVersion; + result.dwMinorVersion = osviex.dwMinorVersion; + result.dwBuildNumber = osviex.dwBuildNumber; + return result; +} #endif std::string cmSystemTools::GetRealPathResolvingWindowsSubst( diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 5f7a5ec..ec650f7 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -509,6 +509,14 @@ public: }; static WindowsFileRetry GetWindowsFileRetry(); static WindowsFileRetry GetWindowsDirectoryRetry(); + + struct WindowsVersion + { + unsigned int dwMajorVersion; + unsigned int dwMinorVersion; + unsigned int dwBuildNumber; + }; + static WindowsVersion GetWindowsVersion(); #endif /** Get the real path for a given path, removing all symlinks. |