Merge topic 'ep-svn-user-pass' into release-3.30

e16f65be15 ExternalProject: Don't add SVN auth args if not set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9678
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 671a0b6..4a75e25 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -99,7 +99,7 @@
     # Load the resulting information strings.
     if(CMAKE_${lang}_ABI_COMPILED)
       message(CHECK_PASS "done")
-      if(CMAKE_HOST_APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      if(CMAKE_HOST_APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES "\\$")
         file(READ_MACHO "${BIN}" ARCHITECTURES archs CAPTURE_ERROR macho_error) # undocumented file() subcommand
         if (NOT macho_error)
           # sort and prune the list of found architectures
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 52eacaa..76cb876 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -15,6 +15,7 @@
 
 #include "cmCPackComponentGroup.h"
 #include "cmCPackLog.h"
+#include "cmGeneratedFileStream.h"
 #include "cmList.h"
 #include "cmMakefile.h"
 #include "cmSystemTools.h"
@@ -48,17 +49,19 @@
     filename = this->packageFileNames[0];
   }
 
-  cmsys::ofstream fout(filename.c_str());
-  std::unique_ptr<Json::StreamWriter> jout(builder.newStreamWriter());
+  {
+    cmGeneratedFileStream fout(filename);
+    std::unique_ptr<Json::StreamWriter> jout(builder.newStreamWriter());
 
-  Json::Value root(Json::objectValue);
+    Json::Value root(Json::objectValue);
 
-  if (!this->Generator->WriteToJSON(root)) {
-    return 0;
-  }
+    if (!this->Generator->WriteToJSON(root)) {
+      return 0;
+    }
 
-  if (jout->write(root, &fout)) {
-    return 0;
+    if (jout->write(root, &fout)) {
+      return 0;
+    }
   }
 
   cmValue packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT");
diff --git a/Tests/RunCMake/XcodeProject/ArchsStandard-stdout.txt b/Tests/RunCMake/XcodeProject/ArchsStandard-stdout.txt
new file mode 100644
index 0000000..460b33c
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ArchsStandard-stdout.txt
@@ -0,0 +1 @@
+-- Detecting C compiler ABI info - done
diff --git a/Tests/RunCMake/XcodeProject/ArchsStandard.cmake b/Tests/RunCMake/XcodeProject/ArchsStandard.cmake
new file mode 100644
index 0000000..56d9e64
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ArchsStandard.cmake
@@ -0,0 +1,4 @@
+if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "$(ARCHS_STANDARD)")
+  message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES is not $(ARCHS_STANDARD)")
+endif()
+enable_language(C)
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index c124950..5e22666 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -9,6 +9,8 @@
 endfunction()
 RunClean()
 
+run_cmake_with_options(ArchsStandard "-DCMAKE_OSX_ARCHITECTURES=$(ARCHS_STANDARD)")
+
 run_cmake(ExplicitCMakeLists)
 run_cmake(ImplicitCMakeLists)
 run_cmake(InterfaceLibSources)
diff --git a/bootstrap b/bootstrap
index 49b91d5..88878fe 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1811,7 +1811,7 @@
     cmake_c_flags="${cmake_c_flags} ${use_uv_flags}"
     cmake_cxx_flags="${cmake_cxx_flags} ${use_uv_flags}"
   else
-    use_librhash_ldflags="-luv"
+    use_uv_ldflags="-luv"
   fi
   libs="${libs} ${use_uv_ldflags}"
 fi
@@ -1838,7 +1838,7 @@
     use_jsoncpp_ldflags="`pkg-config --libs jsoncpp`"
     cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}"
   else
-    use_librhash_ldflags="-ljsoncpp"
+    use_jsoncpp_ldflags="-ljsoncpp"
   fi
   libs="${libs} ${use_jsoncpp_ldflags}"
 fi