[Cmake-commits] CMake branch, master, updated. v3.9.1-482-g1e77d0d

Kitware Robot kwrobot at kitware.com
Wed Aug 16 10:45:05 EDT 2017


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, master has been updated
       via  1e77d0dbef67f835d4a736df21069a8d6b43f5b9 (commit)
       via  6c5e03d6d4f974781e71e51116e4ac5d982c7d79 (commit)
       via  fb5db079a7e478c332441c552929f8bf30d55894 (commit)
       via  d8a99dd2eaaa43e765b6ca2061ba8c14432fb909 (commit)
       via  02e6c5481396a841a80e9546c223e7edc041a668 (commit)
      from  131af5d591ac45a6ab49ccb760dd08e15ef36d81 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e77d0dbef67f835d4a736df21069a8d6b43f5b9
commit 1e77d0dbef67f835d4a736df21069a8d6b43f5b9
Merge: 131af5d 6c5e03d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Aug 16 14:43:10 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Aug 16 10:43:17 2017 -0400

    Merge topic 'autogen-autouic-lookup'
    
    6c5e03d6 Merge branch 'backport-autogen-autouic-lookup' into autogen-autouic-lookup
    fb5db079 Autogen: Extend AUTOUIC search paths test
    d8a99dd2 Autogen: Update AUTOUIC documentation for search paths
    02e6c548 Autogen: Restore AUTOUIC lookup paths from 3.8.2
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1140


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c5e03d6d4f974781e71e51116e4ac5d982c7d79
commit 6c5e03d6d4f974781e71e51116e4ac5d982c7d79
Merge: 8ebd590 fb5db07
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 15 13:23:11 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 15 13:23:11 2017 -0400

    Merge branch 'backport-autogen-autouic-lookup' into autogen-autouic-lookup

diff --cc Help/manual/cmake-qt.7.rst
index b3b09d1,b7f16b9..e345cd2
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@@ -70,11 -70,8 +70,12 @@@ be included by the user in the C++ impl
  Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the
  ``<AUTOGEN_BUILD_DIR>/include`` directory which is
  automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
- (This differs from CMake 3.7 and below; see their documentation for details.)
+ 
+ * This differs from CMake 3.7 and below; see their documentation for details.
 +
 +* For multi configuration generators, the include directory is
 +  ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
 +
  * See :prop_tgt:`AUTOGEN_BUILD_DIR`.
  
  Not included ``moc_<basename>.cpp`` files will be generated in custom
@@@ -118,11 -122,8 +126,12 @@@ where ``<source_dir>`` is the director
  The generated generated ``ui_*.h`` files are placed in the
  ``<AUTOGEN_BUILD_DIR>/include`` directory which is
  automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
- (This differs from CMake 3.7 and below; see their documentation for details.)
+ 
+ * This differs from CMake 3.7 and below; see their documentation for details.
 +
 +* For multi configuration generators, the include directory is
 +  ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
 +
  * See :prop_tgt:`AUTOGEN_BUILD_DIR`.
  
  The :prop_tgt:`AUTOUIC` target property may be pre-set for all following

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb5db079a7e478c332441c552929f8bf30d55894
commit fb5db079a7e478c332441c552929f8bf30d55894
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Tue Aug 15 13:22:18 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Tue Aug 15 13:22:18 2017 +0200

    Autogen: Extend AUTOUIC search paths test

diff --git a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui b/Tests/QtAutogen/uicInclude/PageC2.ui
similarity index 87%
copy from Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
copy to Tests/QtAutogen/uicInclude/PageC2.ui
index fa6dfa6..daab868 100644
--- a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
+++ b/Tests/QtAutogen/uicInclude/PageC2.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>PageB</class>
- <widget class="QWidget" name="PageB">
+ <class>PageC2</class>
+ <widget class="QWidget" name="PageC2">
   <property name="geometry">
    <rect>
     <x>0</x>
diff --git a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui b/Tests/QtAutogen/uicInclude/dirB/PageB.ui
similarity index 100%
copy from Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
copy to Tests/QtAutogen/uicInclude/dirB/PageB.ui
diff --git a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui b/Tests/QtAutogen/uicInclude/dirB/PageB2.ui
similarity index 87%
copy from Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
copy to Tests/QtAutogen/uicInclude/dirB/PageB2.ui
index fa6dfa6..2225150 100644
--- a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
+++ b/Tests/QtAutogen/uicInclude/dirB/PageB2.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>PageB</class>
- <widget class="QWidget" name="PageB">
+ <class>PageB2</class>
+ <widget class="QWidget" name="PageB2">
   <property name="geometry">
    <rect>
     <x>0</x>
diff --git a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui b/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui
similarity index 87%
copy from Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
copy to Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui
index fa6dfa6..873016e 100644
--- a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
+++ b/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>PageB</class>
- <widget class="QWidget" name="PageB">
+ <class>PageBsub</class>
+ <widget class="QWidget" name="PageBsub">
   <property name="geometry">
    <rect>
     <x>0</x>
diff --git a/Tests/QtAutogen/uicInclude/main.cpp b/Tests/QtAutogen/uicInclude/main.cpp
index 4ca66a7..c8e7609 100644
--- a/Tests/QtAutogen/uicInclude/main.cpp
+++ b/Tests/QtAutogen/uicInclude/main.cpp
@@ -6,5 +6,13 @@ int main(int argv, char** args)
   return 0;
 }
 
-#include "sub/ui_PageB.h"
+// .ui files in CMAKE_AUTOUIC_SEARCH_PATHS
+#include "ui_PageA.h"
+// .ui files in AUTOUIC_SEARCH_PATHS
+#include "sub/gen/deep/ui_PageB2.h"
+#include "subB/ui_PageBsub.h"
+#include "ui_PageB.h"
+// .ui files in source's vicinity
+#include "sub/gen/deep/ui_PageC2.h"
+#include "subC/ui_PageCsub.h"
 #include "ui_PageC.h"
diff --git a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui b/Tests/QtAutogen/uicInclude/subC/PageCsub.ui
similarity index 87%
rename from Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
rename to Tests/QtAutogen/uicInclude/subC/PageCsub.ui
index fa6dfa6..0268326 100644
--- a/Tests/QtAutogen/uicInclude/dirB/sub/PageB.ui
+++ b/Tests/QtAutogen/uicInclude/subC/PageCsub.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>PageB</class>
- <widget class="QWidget" name="PageB">
+ <class>PageCsub</class>
+ <widget class="QWidget" name="PageCsub">
   <property name="geometry">
    <rect>
     <x>0</x>

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d8a99dd2eaaa43e765b6ca2061ba8c14432fb909
commit d8a99dd2eaaa43e765b6ca2061ba8c14432fb909
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Tue Aug 15 12:57:32 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Tue Aug 15 12:57:32 2017 +0200

    Autogen: Update AUTOUIC documentation for search paths

diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 00d6e6e..b7f16b9 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -70,8 +70,8 @@ be included by the user in the C++ implementation file with a preprocessor
 Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the
 ``<AUTOGEN_BUILD_DIR>/include`` directory which is
 automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
-(This differs from CMake 3.7 and below; see their documentation for details.)
 
+* This differs from CMake 3.7 and below; see their documentation for details.
 * See :prop_tgt:`AUTOGEN_BUILD_DIR`.
 
 Not included ``moc_<basename>.cpp`` files will be generated in custom
@@ -107,16 +107,23 @@ inspects the C++ files in the target to determine if they require ``uic`` to
 be run, and to create rules to execute ``uic`` at the appropriate time.
 
 If a preprocessor ``#include`` directive is found which matches
-``ui_<basename>.h``, and a ``<basename>.ui`` file exists, then ``uic`` will
-be executed to generate the appropriate file. The ``<basename>.ui`` file is
-searched for first in the vicinity of including file and afterwards in the
-optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target.
+``<path>ui_<basename>.h``, and a ``<basename>.ui`` file exists,
+then ``uic`` will be executed to generate the appropriate file.
+The ``<basename>.ui`` file is searched for in the following places
+
+1. ``<source_dir>/<basename>.ui``
+2. ``<source_dir>/<path><basename>.ui``
+3. ``<AUTOUIC_SEARCH_PATHS>/<basename>.ui``
+4. ``<AUTOUIC_SEARCH_PATHS>/<path><basename>.ui``
+
+where ``<source_dir>`` is the directory of the C++ file and
+:prop_tgt:`AUTOUIC_SEARCH_PATHS` is a list of additional search paths.
 
 The generated generated ``ui_*.h`` files are placed in the
 ``<AUTOGEN_BUILD_DIR>/include`` directory which is
 automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
-(This differs from CMake 3.7 and below; see their documentation for details.)
 
+* This differs from CMake 3.7 and below; see their documentation for details.
 * See :prop_tgt:`AUTOGEN_BUILD_DIR`.
 
 The :prop_tgt:`AUTOUIC` target property may be pre-set for all following

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=02e6c5481396a841a80e9546c223e7edc041a668
commit 02e6c5481396a841a80e9546c223e7edc041a668
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Tue Aug 15 12:17:37 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Tue Aug 15 12:17:37 2017 +0200

    Autogen: Restore AUTOUIC lookup paths from 3.8.2
    
    When encountering an `#include "<PATH>ui_<BASE>.h"` statement,
    search for `<BASE>.ui` in
     - <SOURCE_DIR>/<BASE>.ui
     - <SOURCE_DIR>/<PATH><BASE>.ui
     - <AUTOUIC_SEARCH_PATH>/<BASE>.ui
     - <AUTOUIC_SEARCH_PATH>/<PATH><BASE>.ui
    
    In CMake 3.8.2 the lookup list was
      - <SOURCE_DIR>/<BASE>.ui
    
    In CMake 3.9.[01] the lookup list was
     - <SOURCE_DIR>/<PATH><BASE.ui>
     - <AUTOUIC_SEARCH_PATH>/<PATH><BASE>.ui
    
    Closes #17168

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index c79f66d..d12d96d 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1446,31 +1446,62 @@ bool cmQtAutoGenerators::MocGenerateFile(
 
 bool cmQtAutoGenerators::UicFindIncludedFile(std::string& absFile,
                                              const std::string& sourceFile,
-                                             const std::string& includeString)
+                                             const std::string& searchPath,
+                                             const std::string& searchFile)
 {
   bool success = false;
-  // Search in vicinity of the source
+  std::vector<std::string> testFiles;
+  // Collect search paths list
   {
-    std::string testPath = SubDirPrefix(sourceFile);
-    testPath += includeString;
-    if (cmsys::SystemTools::FileExists(testPath.c_str())) {
-      absFile = cmsys::SystemTools::GetRealPath(testPath);
+    const std::string searchFileFull = searchPath + searchFile;
+    // Vicinity of the source
+    {
+      const std::string sourcePath = SubDirPrefix(sourceFile);
+      testFiles.push_back(sourcePath + searchFile);
+      if (!searchPath.empty()) {
+        testFiles.push_back(sourcePath + searchFileFull);
+      }
+    }
+    // AUTOUIC search paths
+    if (!this->UicSearchPaths.empty()) {
+      for (std::vector<std::string>::const_iterator iit =
+             this->UicSearchPaths.begin();
+           iit != this->UicSearchPaths.end(); ++iit) {
+        testFiles.push_back(*iit + "/" + searchFile);
+      }
+      if (!searchPath.empty()) {
+        for (std::vector<std::string>::const_iterator iit =
+               this->UicSearchPaths.begin();
+             iit != this->UicSearchPaths.end(); ++iit) {
+          testFiles.push_back(*iit + "/" + searchFileFull);
+        }
+      }
+    }
+  }
+
+  // Search for the .ui file!
+  for (std::vector<std::string>::const_iterator iit = testFiles.begin();
+       iit != testFiles.end(); ++iit) {
+    const std::string& testFile = *iit;
+    if (cmsys::SystemTools::FileExists(testFile.c_str())) {
+      absFile = cmsys::SystemTools::GetRealPath(testFile);
       success = true;
+      break;
     }
   }
-  // Search in include directories
+
+  // Log error
   if (!success) {
-    for (std::vector<std::string>::const_iterator iit =
-           this->UicSearchPaths.begin();
-         iit != this->UicSearchPaths.end(); ++iit) {
-      const std::string fullPath = ((*iit) + '/' + includeString);
-      if (cmsys::SystemTools::FileExists(fullPath.c_str())) {
-        absFile = cmsys::SystemTools::GetRealPath(fullPath);
-        success = true;
-        break;
-      }
+    std::ostringstream ost;
+    ost << "AutoUic: Error: " << Quoted(sourceFile) << "\n";
+    ost << "Could not find " << Quoted(searchFile) << " in\n";
+    for (std::vector<std::string>::const_iterator iit = testFiles.begin();
+         iit != testFiles.end(); ++iit) {
+      ost << "  " << Quoted(*iit) << "\n";
     }
+    this->LogError(ost.str());
   }
+
   return success;
 }
 
@@ -1500,16 +1531,14 @@ bool cmQtAutoGenerators::UicGenerateAll(
         const std::string uiBasePath = SubDirPrefix(*uit);
         const std::string uiBaseName =
           cmsys::SystemTools::GetFilenameWithoutLastExtension(*uit).substr(3);
-        const std::string searchFileName = uiBasePath + uiBaseName + ".ui";
+        const std::string uiFileName = uiBaseName + ".ui";
         std::string uiInputFile;
-        if (UicFindIncludedFile(uiInputFile, source, searchFileName)) {
+        if (UicFindIncludedFile(uiInputFile, source, uiBasePath, uiFileName)) {
           std::string uiOutputFile = uiBasePath + "ui_" + uiBaseName + ".h";
           cmSystemTools::ReplaceString(uiOutputFile, "..", "__");
           uiGenMap[uiInputFile] = uiOutputFile;
           testMap[uiInputFile] = uiOutputFile;
         } else {
-          this->LogError("AutoUic: Error: " + Quoted(sit->first) +
-                         "\nCould not find " + Quoted(searchFileName));
           return false;
         }
       }
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index b525364..337aa17 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -112,7 +112,8 @@ private:
 
   // -- Uic file generation
   bool UicFindIncludedFile(std::string& absFile, const std::string& sourceFile,
-                           const std::string& includeString);
+                           const std::string& searchPath,
+                           const std::string& searchFile);
   bool UicGenerateAll(
     const std::map<std::string, std::vector<std::string> >& includedUis);
   bool UicGenerateFile(const std::string& realName,

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

Summary of changes:
 Help/manual/cmake-qt.7.rst                         |   21 ++++--
 Source/cmQtAutoGenerators.cxx                      |   69 ++++++++++++++------
 Source/cmQtAutoGenerators.h                        |    3 +-
 .../uicInclude/{dirA/PageA.ui => PageC2.ui}        |    4 +-
 Tests/QtAutogen/uicInclude/dirB/{sub => }/PageB.ui |    0
 .../uicInclude/{dirA/PageA.ui => dirB/PageB2.ui}   |    4 +-
 .../{dirA/PageA.ui => dirB/subB/PageBsub.ui}       |    4 +-
 Tests/QtAutogen/uicInclude/main.cpp                |   10 ++-
 .../uicInclude/{dirA/PageA.ui => subC/PageCsub.ui} |    4 +-
 9 files changed, 83 insertions(+), 36 deletions(-)
 copy Tests/QtAutogen/uicInclude/{dirA/PageA.ui => PageC2.ui} (87%)
 rename Tests/QtAutogen/uicInclude/dirB/{sub => }/PageB.ui (100%)
 copy Tests/QtAutogen/uicInclude/{dirA/PageA.ui => dirB/PageB2.ui} (87%)
 copy Tests/QtAutogen/uicInclude/{dirA/PageA.ui => dirB/subB/PageBsub.ui} (87%)
 copy Tests/QtAutogen/uicInclude/{dirA/PageA.ui => subC/PageCsub.ui} (87%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list