[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7373-g186ac2c

Stephen Kelly steveire at gmail.com
Sun Feb 2 07:27:28 EST 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  186ac2c380c194a64ad1f966d6dab9424e566d8f (commit)
       via  88378694e0777959b4922deaec25764768fd7ea2 (commit)
      from  934d398f100cebe137e4beb390b859b8d12a4d07 (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=186ac2c380c194a64ad1f966d6dab9424e566d8f
commit 186ac2c380c194a64ad1f966d6dab9424e566d8f
Merge: 934d398 8837869
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Feb 2 07:27:27 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Feb 2 07:27:27 2014 -0500

    Merge topic 'fix-Qt-autogen' into next
    
    88378694 QtAutogen: Make uic work even when the source is in a subdir.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88378694e0777959b4922deaec25764768fd7ea2
commit 88378694e0777959b4922deaec25764768fd7ea2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Feb 2 13:19:27 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Feb 2 13:24:57 2014 +0100

    QtAutogen: Make uic work even when the source is in a subdir.
    
    Modify the includedUis to store the path to the file which includes
    the ui file. Reuse that path to generate the output file from the
    uic process.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index cab59fe..3275dbc 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1279,8 +1279,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
   const std::vector<std::string>& headerExtensions =
                                                makefile->GetHeaderExtensions();
 
-  std::vector<std::string> includedUis;
-  std::vector<std::string> skippedUis;
+  std::map<std::string, std::string> includedUis;
+  std::map<std::string, std::string> skippedUis;
   std::vector<std::string> uicSkipped;
   cmSystemTools::ExpandListArgument(this->SkipUic, uicSkipped);
 
@@ -1290,7 +1290,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     {
     const bool skipUic = std::find(uicSkipped.begin(), uicSkipped.end(), *it)
         != uicSkipped.end();
-    std::vector<std::string>& uiFiles = skipUic ? skippedUis : includedUis;
+    std::map<std::string, std::string>& uiFiles = skipUic ? skippedUis : includedUis;
     const std::string &absFilename = *it;
     if (this->Verbose)
       {
@@ -1350,11 +1350,11 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
     {
     this->GenerateMoc(it->first, it->second);
     }
-  for(std::vector<std::string>::const_iterator it = includedUis.begin();
+  for(std::map<std::string, std::string>::const_iterator it = includedUis.begin();
       it != includedUis.end();
       ++it)
     {
-    this->GenerateUi(*it);
+    this->GenerateUi(it->first, it->second);
     }
 
   if(!this->RccExecutable.empty())
@@ -1431,7 +1431,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
 void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::map<std::string, std::string>& includedMocs,
-                              std::vector<std::string> &includedUis)
+                              std::map<std::string, std::string> &includedUis)
 {
   cmsys::RegularExpression mocIncludeRegExp(
               "[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1619,7 +1619,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
 void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::map<std::string, std::string>& includedMocs,
-                              std::vector<std::string>& includedUis)
+                              std::map<std::string, std::string>& includedUis)
 {
   cmsys::RegularExpression mocIncludeRegExp(
               "[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1737,7 +1737,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
 
 
 void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
-                              std::vector<std::string>& includedUis)
+                              std::map<std::string, std::string>& includedUis)
 {
   if (this->UicExecutable.empty())
     {
@@ -1754,9 +1754,9 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
 }
 
 
-void cmQtAutoGenerators::ParseForUic(const std::string&,
+void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
                                      const std::string& contentsString,
-                                     std::vector<std::string>& includedUis)
+                              std::map<std::string, std::string>& includedUis)
 {
   if (this->UicExecutable.empty())
     {
@@ -1768,6 +1768,9 @@ void cmQtAutoGenerators::ParseForUic(const std::string&,
 
   std::string::size_type matchOffset = 0;
 
+  const std::string absPath = cmsys::SystemTools::GetFilenamePath(
+                   cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/';
+
   matchOffset = 0;
   if ((strstr(contentsString.c_str(), "ui_") != NULL)
                                     && (uiIncludeRegExp.find(contentsString)))
@@ -1783,7 +1786,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string&,
       // finding the correct header, so we need to remove the ui_ part
       basename = basename.substr(3);
 
-      includedUis.push_back(basename);
+      includedUis[absPath] = basename;
 
       matchOffset += uiIncludeRegExp.end();
       } while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset));
@@ -1831,7 +1834,7 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
 void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
                         const std::map<std::string, std::string>& includedMocs,
                         std::map<std::string, std::string>& notIncludedMocs,
-                        std::vector<std::string>& includedUis)
+                        std::map<std::string, std::string>& includedUis)
 {
   for(std::set<std::string>::const_iterator hIt=absHeaders.begin();
       hIt!=absHeaders.end();
@@ -1939,7 +1942,8 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
   return false;
 }
 
-bool cmQtAutoGenerators::GenerateUi(const std::string& uiFileName)
+bool cmQtAutoGenerators::GenerateUi(const std::string& path,
+                                    const std::string& uiFileName)
 {
   if (!cmsys::SystemTools::FileExists(this->Builddir.c_str(), false))
     {
@@ -1947,7 +1951,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& uiFileName)
     }
 
   std::string ui_output_file = "ui_" + uiFileName + ".h";
-  std::string ui_input_file = this->Srcdir + uiFileName + ".ui";
+  std::string ui_input_file = path + uiFileName + ".ui";
 
   int sourceNewerThanUi = 0;
   bool success = cmsys::SystemTools::FileTimeCompare(ui_input_file.c_str(),
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index f66d02b..2840fbf 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -48,16 +48,16 @@ private:
   bool RunAutogen(cmMakefile* makefile);
   bool GenerateMoc(const std::string& sourceFile,
                    const std::string& mocFileName);
-  bool GenerateUi(const std::string& uiFileName);
+  bool GenerateUi(const std::string& path, const std::string& uiFileName);
   bool GenerateQrc();
   void ParseCppFile(const std::string& absFilename,
                     const std::vector<std::string>& headerExtensions,
                     std::map<std::string, std::string>& includedMocs,
-                          std::vector<std::string>& includedUis);
+                          std::map<std::string, std::string>& includedUis);
   void StrictParseCppFile(const std::string& absFilename,
                           const std::vector<std::string>& headerExtensions,
                           std::map<std::string, std::string>& includedMocs,
-                          std::vector<std::string>& includedUis);
+                          std::map<std::string, std::string>& includedUis);
   void SearchHeadersForCppFile(const std::string& absFilename,
                               const std::vector<std::string>& headerExtensions,
                               std::set<std::string>& absHeaders);
@@ -65,14 +65,14 @@ private:
   void ParseHeaders(const std::set<std::string>& absHeaders,
                     const std::map<std::string, std::string>& includedMocs,
                     std::map<std::string, std::string>& notIncludedMocs,
-                          std::vector<std::string>& includedUis);
+                          std::map<std::string, std::string>& includedUis);
 
   void ParseForUic(const std::string& fileName,
                    const std::string& contentsString,
-                   std::vector<std::string>& includedUis);
+                   std::map<std::string, std::string>& includedUis);
 
   void ParseForUic(const std::string& fileName,
-                   std::vector<std::string>& includedUis);
+                   std::map<std::string, std::string>& includedUis);
 
   void Init();
 
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 515bf5b..546ed02 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -88,6 +88,6 @@ target_link_libraries(empty no_link_language)
 add_library(no_link_language STATIC empty.h)
 set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE)
 
-qtx_wrap_cpp(uicOnlyMoc uiconly.h)
-add_executable(uiconly uiconly.cpp ${uicOnlyMoc})
+qtx_wrap_cpp(uicOnlyMoc sub/uiconly.h)
+add_executable(uiconly sub/uiconly.cpp ${uicOnlyMoc})
 target_link_libraries(uiconly ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/uiconly.cpp b/Tests/QtAutogen/sub/uiconly.cpp
similarity index 100%
rename from Tests/QtAutogen/uiconly.cpp
rename to Tests/QtAutogen/sub/uiconly.cpp
diff --git a/Tests/QtAutogen/uiconly.h b/Tests/QtAutogen/sub/uiconly.h
similarity index 100%
rename from Tests/QtAutogen/uiconly.h
rename to Tests/QtAutogen/sub/uiconly.h
diff --git a/Tests/QtAutogen/uiconly.ui b/Tests/QtAutogen/sub/uiconly.ui
similarity index 100%
rename from Tests/QtAutogen/uiconly.ui
rename to Tests/QtAutogen/sub/uiconly.ui

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

Summary of changes:
 Source/cmQtAutoGenerators.cxx         |   32 ++++++++++++++++++--------------
 Source/cmQtAutoGenerators.h           |   12 ++++++------
 Tests/QtAutogen/CMakeLists.txt        |    4 ++--
 Tests/QtAutogen/{ => sub}/uiconly.cpp |    0
 Tests/QtAutogen/{ => sub}/uiconly.h   |    0
 Tests/QtAutogen/{ => sub}/uiconly.ui  |    0
 6 files changed, 26 insertions(+), 22 deletions(-)
 rename Tests/QtAutogen/{ => sub}/uiconly.cpp (100%)
 rename Tests/QtAutogen/{ => sub}/uiconly.h (100%)
 rename Tests/QtAutogen/{ => sub}/uiconly.ui (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list