[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-1010-g47344e2

Clinton Stimpson clinton at elemtech.com
Fri Mar 14 00:04:54 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  47344e2137ab8b5059ed017baf3dbdbcad95a5a0 (commit)
       via  98692fd2c23c1eab242f89c133c12d05ee33b084 (commit)
      from  bd029affc891808ace5c3602d0c2223163f65d38 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47344e2137ab8b5059ed017baf3dbdbcad95a5a0
commit 47344e2137ab8b5059ed017baf3dbdbcad95a5a0
Merge: bd029af 98692fd
Author:     Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Fri Mar 14 00:04:53 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Mar 14 00:04:53 2014 -0400

    Merge topic 'unicode-vs-projects' into next
    
    98692fd2 Encoding: If configured, write Visual Studio project files as UTF-8.

diff --cc Source/QtDialog/CMakeSetup.cxx
index 1b04a00,e37bd9d..82fa3a3
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@@ -79,9 -79,11 +79,9 @@@ int main(int argc, char** argv
  
    QApplication app(argc, argv);
  
- #if defined(KWSYS_CP_UTF8)
+ #if defined(CMAKE_ENCODING_UTF8)
    QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
 -  QTextCodec::setCodecForCStrings(utf8_codec);
    QTextCodec::setCodecForLocale(utf8_codec);
 -  QTextCodec::setCodecForTr(utf8_codec);
  #endif
  
    // clean out standard Qt paths for plugins, which we don't use anyway

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98692fd2c23c1eab242f89c133c12d05ee33b084
commit 98692fd2c23c1eab242f89c133c12d05ee33b084
Author:     Clinton Stimpson <clinton at elemtech.com>
AuthorDate: Thu Mar 13 06:59:49 2014 -0600
Commit:     Clinton Stimpson <clinton at elemtech.com>
CommitDate: Thu Mar 13 21:57:16 2014 -0600

    Encoding: If configured, write Visual Studio project files as UTF-8.

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 966e0f6..106cffc 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -24,6 +24,17 @@ endif()
 
 set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
 
+# for windows, we can use the utf-8 code page for conversions
+# between wide and narrow strings
+if(WIN32 AND KWSYS_ENCODING_DEFAULT_CODEPAGE MATCHES CP_UTF8)
+  set(CMAKE_ENCODING_UTF8 1)
+endif()
+
+# ensure Unicode friendly APIs are used on Windows
+if(WIN32)
+  add_definitions(-DUNICODE -D_UNICODE)
+endif()
+
 # configure the .h file
 configure_file(
   "${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 0dd01d8..4308a4d 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -55,11 +55,6 @@ else()
   endif()
 endif()
 
-
-if(WIN32 AND KWSYS_ENCODING_DEFAULT_CODEPAGE MATCHES CP_UTF8)
-  add_definitions(-DKWSYS_CP_UTF8)
-endif()
-
 set(SRCS
   AddCacheEntry.cxx
   AddCacheEntry.h
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 995929e..e37bd9d 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -79,7 +79,7 @@ int main(int argc, char** argv)
 
   QApplication app(argc, argv);
 
-#if defined(KWSYS_CP_UTF8)
+#if defined(CMAKE_ENCODING_UTF8)
   QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
   QTextCodec::setCodecForCStrings(utf8_codec);
   QTextCodec::setCodecForLocale(utf8_codec);
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index c5e95d0..2b0280d 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -16,4 +16,5 @@
 #cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE
 #cmakedefine HAVE_UNSETENV
 #cmakedefine CMAKE_USE_ELF_PARSER
+#cmakedefine CMAKE_ENCODING_UTF8
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 320b440..42033c5 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -873,7 +873,8 @@ cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget const* target)
   std::string guid = this->GetGUID(pname.c_str());
 
   fout <<
-    "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
+    "<?xml version=\"1.0\" encoding = \""
+    << this->Encoding() << "\"?>\n"
     "<VisualStudioProject\n"
     "\tProjectType=\"Visual C++\"\n"
     "\tVersion=\"" << this->GetIDEVersion() << "0\"\n"
@@ -1038,3 +1039,14 @@ cmIDEFlagTable const* cmGlobalVisualStudio7Generator::GetExtraFlagTableVS7()
 {
   return cmVS7ExtraFlagTable;
 }
+
+std::string cmGlobalVisualStudio7Generator::Encoding()
+{
+  std::ostringstream encoding;
+#ifdef CMAKE_ENCODING_UTF8
+  encoding << "UTF-8";
+#else
+  encoding << "Windows-1252";
+#endif
+  return encoding.str();
+}
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 0d2e410..1dc709d 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -109,6 +109,9 @@ public:
 
   virtual void FindMakeProgram(cmMakefile*);
 
+  // Encoding for Visual Studio files
+  virtual std::string Encoding();
+
 protected:
   virtual const char* GetIDEVersion() { return "7.0"; }
 
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 69c893c..2b2a471 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -1,3 +1,4 @@
+
 /*============================================================================
   CMake - Cross Platform Makefile Generator
   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
@@ -918,4 +919,4 @@ std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir(
     i += config.size();
     }
   return tmp;
-}
+}
\ No newline at end of file
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 14ad567..52524aa 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1975,7 +1975,8 @@ cmLocalVisualStudio7Generator
 
   cmGlobalVisualStudio7Generator* gg =
     static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
-  fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
+  fout << "<?xml version=\"1.0\" encoding = \""
+       << gg->Encoding() << "\"?>\n"
        << "<VisualStudioProject\n"
        << "\tProjectCreator=\"Intel Fortran\"\n"
        << "\tVersion=\"" << gg->GetIntelProjectVersion() << "\"\n";
@@ -2038,7 +2039,12 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
     this->WriteProjectStartFortran(fout, libName, target);
     return;
     }
-  fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
+
+  cmGlobalVisualStudio7Generator* gg =
+    static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
+
+  fout << "<?xml version=\"1.0\" encoding = \""
+       << gg->Encoding() << "\"?>\n"
        << "<VisualStudioProject\n"
        << "\tProjectType=\"Visual C++\"\n";
   if(this->Version == VS71)
@@ -2059,8 +2065,6 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
     {
     keyword = "Win32Proj";
     }
-  cmGlobalVisualStudio7Generator* gg =
-    static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
   fout << "\tName=\"" << projLabel << "\"\n";
   if(this->Version >= VS8)
     {
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7c55f64..8e8968d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -222,7 +222,8 @@ void cmVisualStudio10TargetGenerator::Generate()
   //get the tools version to use
   const std::string toolsVer(this->GlobalGenerator->GetToolsVersion());
   std::string project_defaults=
-    "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n";
+    "<?xml version=\"1.0\" encoding=\"" +
+    this->GlobalGenerator->Encoding() + "\"?>\n";
   project_defaults.append("<Project DefaultTargets=\"Build\" ToolsVersion=\"");
   project_defaults.append(toolsVer +"\" ");
   project_defaults.append(
@@ -732,7 +733,8 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
   //get the tools version to use
   const std::string toolsVer(this->GlobalGenerator->GetToolsVersion());
   std::string project_defaults=
-    "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n";
+    "<?xml version=\"1.0\" encoding=\"" +
+    this->GlobalGenerator->Encoding() + "\"?>\n";
   project_defaults.append("<Project ToolsVersion=\"");
   project_defaults.append(toolsVer +"\" ");
   project_defaults.append(

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeLists.txt                      |   11 +++++++++++
 Source/QtDialog/CMakeLists.txt             |    5 -----
 Source/QtDialog/CMakeSetup.cxx             |    2 +-
 Source/cmConfigure.cmake.h.in              |    1 +
 Source/cmGlobalVisualStudio7Generator.cxx  |   14 +++++++++++++-
 Source/cmGlobalVisualStudio7Generator.h    |    3 +++
 Source/cmGlobalVisualStudioGenerator.cxx   |    1 +
 Source/cmLocalVisualStudio7Generator.cxx   |   12 ++++++++----
 Source/cmVisualStudio10TargetGenerator.cxx |    6 ++++--
 9 files changed, 42 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list