Merge topic 'lcc-updates'

22a2b9c49f Tests: Fix Java tests on multi-config generators
b05d297964 Tests: handle a case when hg executable is broken
2faabab644 Tests: don't fail tests on broken E2K Java RVM
1462a1e15d Tests: check for shlibdeps symbols/shlibs before testing it
070e217399 Tests: enable Java tests if javac is a recurse symlink
7545d1ca9f Tests: don't use broken makensis
f11c12f9c8 Source: Suppress some warnings on LCC 1.23.x
de16db0f64 curl: make libcmcurl buildable with old LibreSSL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7418
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index c4c3a93..df40c85 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -1178,7 +1178,11 @@
 
   # Always check this even if we won't save these details.
   # This helps projects catch errors earlier.
-  if("OVERRIDE_FIND_PACKAGE" IN_LIST ARGN AND "FIND_PACKAGE_ARGS" IN_LIST ARGN)
+  # Avoid using if(... IN_LIST ...) so we don't have to alter policy settings
+  list(FIND ARGN OVERRIDE_FIND_PACKAGE index_OVERRIDE_FIND_PACKAGE)
+  list(FIND ARGN FIND_PACKAGE_ARGS index_FIND_PACKAGE_ARGS)
+  if(index_OVERRIDE_FIND_PACKAGE GREATER_EQUAL 0 AND
+     index_FIND_PACKAGE_ARGS GREATER_EQUAL 0)
     message(FATAL_ERROR
       "Cannot specify both OVERRIDE_FIND_PACKAGE and FIND_PACKAGE_ARGS "
       "when declaring details for ${contentName}"
@@ -1750,7 +1754,9 @@
     DEFINED
   )
 
-  if(NOT wantFindPackage AND NOT OVERRIDE_FIND_PACKAGE IN_LIST contentDetails)
+  # Avoid using if(... IN_LIST ...) so we don't have to alter policy settings
+  list(FIND contentDetails OVERRIDE_FIND_PACKAGE indexResult)
+  if(NOT wantFindPackage AND indexResult EQUAL -1)
     # No find_package() redirection allowed
     return()
   endif()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 026b303..b6e2e80 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 20220628)
+set(CMake_VERSION_PATCH 20220629)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 40f3ab5..1514a8a 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -909,6 +909,7 @@
   // The reason is that their file names might be discovered from source files
   // at generation time.
   if (this->MocOrUicEnabled()) {
+    std::unordered_set<std::string> addedFiles;
     for (const auto& sf : this->Makefile->GetSourceFiles()) {
       // sf->GetExtension() is only valid after sf->ResolveFullPath() ...
       // Since we're iterating over source files that might be not in the
@@ -950,25 +951,28 @@
                                                       cmExpandedList(uicOpts));
           }
 
-          auto uiHeaderRelativePath = cmSystemTools::RelativePath(
-            this->LocalGen->GetCurrentSourceDirectory(),
-            cmSystemTools::GetFilenamePath(fullPath));
+          auto uiHeaderFileName = cmStrCat(
+            "ui_"_s, cmSystemTools::GetFilenameWithoutLastExtension(fullPath),
+            ".h"_s);
 
-          // Avoid creating a path containing adjacent slashes
-          if (!uiHeaderRelativePath.empty() &&
-              uiHeaderRelativePath.back() != '/') {
-            uiHeaderRelativePath += '/';
+          // .ui files with the same base name will conflict. Yield an error.
+          {
+            auto insertResult = addedFiles.insert(uiHeaderFileName);
+            if (!insertResult.second) {
+              this->Makefile->IssueMessage(
+                MessageType::FATAL_ERROR,
+                cmStrCat("More than one .ui file with the name "_s,
+                         cmSystemTools::GetFilenameName(fullPath),
+                         " was found in the sources for target "_s,
+                         this->GenTarget->GetName(), "."));
+            }
           }
 
-          auto uiHeaderFilePath = cmStrCat(
-            '/', uiHeaderRelativePath, "ui_"_s,
-            cmSystemTools::GetFilenameWithoutLastExtension(fullPath), ".h"_s);
-
           ConfigString uiHeader;
           std::string uiHeaderGenex;
           this->ConfigFileNamesAndGenex(
             uiHeader, uiHeaderGenex, cmStrCat(this->Dir.Build, "/include"_s),
-            uiHeaderFilePath);
+            cmStrCat("/"_s, uiHeaderFileName));
 
           this->Uic.UiHeaders.emplace_back(
             std::make_pair(uiHeader, uiHeaderGenex));