Am 08.08.2016 um 19:40 schrieb Brad King:
On 08/06/2016 09:42 AM, Sebastian Holtermann wrote:
Ok, here is a new set of patches based on the current git master branch.

Thanks!

+        outStream << "#include \""
+                  << cmsys::SystemTools::ConvertToOutputPath(it->second)
+                  << "\"\n";

The ConvertToOutputPath method may also add its own double quotes.
It is not just about slash conversion.  Please use another approach
to convert slashes.  I dropped this patch for now.

Ok, I just checked
http://stackoverflow.com/questions/5790161/is-the-backslash-acceptable-in-c-and-c-include-directives
It is even invalid to use backslashes in an #include statements.

The paths are generated with a forward slash
so it should be good to just use them as they are.

Meanwhile I've applied the rest:

 cmFilePathUuid: Add class to generate deterministic unique file names
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecb6df52

 QtAutogen: Use std:: instead of ::std::
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06217388

 QtAutogen: Allow multiple moc files with the same name
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e2cd04b

 QtAutogen: Allow multiple qrc files with the same name
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71d0308a

 Tests/QtAutogen: Test same moc/qrc source names in different directories
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20f0028c

and merged to `next` for testing.

Great, thanks.

One of the problems reported in

  https://gitlab.kitware.com/cmake/cmake/issues/16209

with the previous approach was that the symbol name created by autorcc
changed from what it was in CMake <= 3.5.  Is it now preserved?

It is back to what it was in 3.5 for the all-qrc-names-unique case.
So yes, existing projects get the same symbol name they used to get.

New projects that now can use non unique file names
may get a symbol name based on the checksum extended file name
- but that one is also length limited and should be safe.

But I found another issue.
The checksum string generator may generate a '-' in the file name.
This is allowed for file names but not for symbol names.
I have attached a small patch to fix this.

-Sebastian

>From 35aa83b165fd6b69694c9cfe264b9d18d86de3ab Mon Sep 17 00:00:00 2001
From: Sebastian Holtermann <sebh...@xwmw.org>
Date: Mon, 8 Aug 2016 20:58:21 +0200
Subject: [PATCH] QtAutogen: Replace invalid character for symbol names

---
 Source/cmQtAutoGenerators.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 6a95615..063c355 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1331,6 +1331,10 @@ bool cmQtAutoGenerators::GenerateQrc(const std::string& qrcInputFile,
     // Remove "qrc_" at string begin
     symbolName.erase(0, 4);
   }
+  // Replace '-' with '_'. The former is valid for
+  // file names but not for symbol names.
+  std::replace( symbolName.begin(), symbolName.end(), '-', '_' );
+
   const std::string qrcBuildFile = this->Builddir + qrcOutputFile;
 
   int sourceNewerThanQrc = 0;
-- 
2.8.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to