Merge branch 'cpack_rpm_mulit_prefix_fixup' into release
diff --git a/Help/prop_test/TIMEOUT.rst b/Help/prop_test/TIMEOUT.rst
index 0b247b8..d1cb90d 100644
--- a/Help/prop_test/TIMEOUT.rst
+++ b/Help/prop_test/TIMEOUT.rst
@@ -6,4 +6,4 @@
 This property if set will limit a test to not take more than the
 specified number of seconds to run.  If it exceeds that the test
 process will be killed and ctest will move to the next test.  This
-setting takes precedence over CTEST_TESTING_TIMEOUT.
+setting takes precedence over :variable:`CTEST_TEST_TIMEOUT`.
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index b5c3a96..f90860c 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -5,8 +5,7 @@
 # Find Coin3D (Open Inventor)
 #
 # Coin3D is an implementation of the Open Inventor API.  It provides
-# data structures and algorithms for 3D visualization
-# http://www.coin3d.org/
+# data structures and algorithms for 3D visualization.
 #
 # This module defines the following variables
 #
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 07839f3..8a83c3e 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -277,6 +277,7 @@
   cmLocalGenerator.cxx
   cmLocalGenerator.h
   cmLocalUnixMakefileGenerator3.cxx
+  cmLocale.h
   ${MACH_SRCS}
   cmMakeDepend.cxx
   cmMakeDepend.h
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 00bfe5b..6106472 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -26,7 +26,6 @@
 #include <cmsys/CommandLineArguments.hxx>
 #include <cmsys/SystemTools.hxx>
 #include <cmsys/Encoding.hxx>
-#include <locale.h>
 
 //----------------------------------------------------------------------------
 static const char * cmDocumentationName[][2] =
@@ -101,7 +100,6 @@
 // this is CPack.
 int main (int argc, char const* const* argv)
 {
-  setlocale(LC_CTYPE, "");
   cmsys::Encoding::CommandLineArguments args =
     cmsys::Encoding::CommandLineArguments::Main(argc, argv);
   argc = args.argc();
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 28f3d9b..3d92a2d 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -16,7 +16,6 @@
 
 #include <signal.h>
 #include <sys/ioctl.h>
-#include <locale.h>
 
 #include "cmCursesMainForm.h"
 #include "cmCursesStandardIncludes.h"
@@ -95,8 +94,6 @@
 
 int main(int argc, char const* const* argv)
 {
-  setlocale(LC_CTYPE, "");
-
   cmsys::Encoding::CommandLineArguments encoding_args =
     cmsys::Encoding::CommandLineArguments::Main(argc, argv);
   argc = encoding_args.argc();
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index c24c68e..cf2fe82 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -12,6 +12,7 @@
 #include "cmArchiveWrite.h"
 
 #include "cmSystemTools.h"
+#include "cmLocale.h"
 #include <cmsys/ios/iostream>
 #include <cmsys/Directory.hxx>
 #include <cmsys/FStream.hxx>
@@ -260,6 +261,9 @@
     }
   const char* out = file + skip;
 
+  cmLocaleRAII localeRAII;
+  static_cast<void>(localeRAII);
+
   // Meta-data.
   std::string dest = prefix? prefix : "";
   dest += out;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index fbf2140..dfa6cc9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1132,7 +1132,7 @@
   if(echo_comment)
     {
     const char* comment = ccg.GetComment();
-    if(comment && !*comment)
+    if(comment && *comment)
       {
       this->AppendEcho(commands, comment,
                        cmLocalUnixMakefileGenerator3::EchoGenerate);
diff --git a/Source/cmLocale.h b/Source/cmLocale.h
new file mode 100644
index 0000000..727f0f5
--- /dev/null
+++ b/Source/cmLocale.h
@@ -0,0 +1,31 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+#ifndef cmLocale_h
+#define cmLocale_h
+
+#include <locale.h>
+
+class cmLocaleRAII
+{
+  const char* OldLocale;
+public:
+  cmLocaleRAII(): OldLocale(setlocale(LC_CTYPE, 0))
+    {
+    setlocale(LC_CTYPE, "");
+    }
+  ~cmLocaleRAII()
+    {
+    setlocale(LC_CTYPE, this->OldLocale);
+    }
+};
+
+#endif
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index e9735ed..6a7467f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -26,6 +26,7 @@
 #include <cmsys/Encoding.hxx>
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 # include "cmArchiveWrite.h"
+# include "cmLocale.h"
 # include <cm_libarchive.h>
 # include <cmsys/Terminal.h>
 #endif
@@ -1690,6 +1691,8 @@
 bool extract_tar(const char* outFileName, bool verbose,
                  bool extract)
 {
+  cmLocaleRAII localeRAII;
+  static_cast<void>(localeRAII);
   struct archive* a = archive_read_new();
   struct archive *ext = archive_write_disk_new();
   archive_read_support_compression_all(a);
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 6d25b70..e0bd55b 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -25,7 +25,6 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include <cmsys/Encoding.hxx>
-#include <locale.h>
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
 //----------------------------------------------------------------------------
@@ -173,7 +172,6 @@
 
 int main(int ac, char const* const* av)
 {
-  setlocale(LC_CTYPE, "");
   cmsys::Encoding::CommandLineArguments args =
     cmsys::Encoding::CommandLineArguments::Main(ac, av);
   ac = args.argc();
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index b77c231..c0eb8ac 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -19,7 +19,6 @@
 #include "CTest/cmCTestScriptHandler.h"
 #include "CTest/cmCTestLaunch.h"
 #include "cmsys/Encoding.hxx"
-#include <locale.h>
 
 //----------------------------------------------------------------------------
 static const char * cmDocumentationName[][2] =
@@ -117,8 +116,6 @@
 // this is a test driver program for cmCTest.
 int main (int argc, char const* const* argv)
 {
-  setlocale(LC_CTYPE, "");
-
   cmsys::Encoding::CommandLineArguments encoding_args =
     cmsys::Encoding::CommandLineArguments::Main(argc, argv);
   argc = encoding_args.argc();
diff --git a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
index 43c0ba7..c018e08 100644
--- a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
+++ b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
@@ -1,14 +1,12 @@
 #include <cmSystemTools.h>
 #include <cmsys/Encoding.hxx>
 #include <string>
-#include <locale.h>
 
 #define RETVAL @_retval@
 
 int
 main(int ac, char **av)
 {
-  setlocale(LC_CTYPE, "");
   cmsys::Encoding::CommandLineArguments args =
     cmsys::Encoding::CommandLineArguments::Main(ac, av);
   int argc = args.argc();
diff --git a/bootstrap b/bootstrap
index a88eb6a..e7d0496 100755
--- a/bootstrap
+++ b/bootstrap
@@ -72,6 +72,7 @@
 cmake_bootstrap_qt_qmake=""
 cmake_sphinx_man=""
 cmake_sphinx_html=""
+cmake_sphinx_qthelp=""
 cmake_sphinx_build=""
 
 # Determine whether this is a Cygwin environment.
@@ -410,6 +411,7 @@
 
   --sphinx-man            build man pages with Sphinx
   --sphinx-html           build html help with Sphinx
+  --sphinx-qthelp         build qch help with Sphinx
   --sphinx-build=<sb>     use <sb> as the sphinx-build executable
 
 Directory and file names:
@@ -646,6 +648,7 @@
   --qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
   --sphinx-man) cmake_sphinx_man="1" ;;
   --sphinx-html) cmake_sphinx_html="1" ;;
+  --sphinx-qthelp) cmake_sphinx_qthelp="1" ;;
   --sphinx-build=*) cmake_sphinx_build=`cmake_arg "$1"` ;;
   --help) cmake_usage ;;
   --version) cmake_version_display ; exit 2 ;;
@@ -1661,6 +1664,11 @@
 set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE FILEPATH "Build html help with Sphinx" FORCE)
 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
 fi
+if [ "x${cmake_sphinx_qthelp}" != "x" ]; then
+  echo '
+set (SPHINX_QTHELP "'"${cmake_sphinx_qthelp}"'" CACHE FILEPATH "Build qch help with Sphinx" FORCE)
+' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
+fi
 if [ "x${cmake_sphinx_build}" != "x" ]; then
   echo '
 set (SPHINX_EXECUTABLE "'"${cmake_sphinx_build}"'" CACHE FILEPATH "Location of Qt sphinx-build" FORCE)