[Cmake-commits] CMake branch, master, updated. v3.13.0-rc3-391-gc310480

Kitware Robot kwrobot at kitware.com
Mon Nov 12 08:23:48 EST 2018


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  c310480c5dc76ad0c1eb4e842869f92121d5b507 (commit)
       via  a16b24c9ce2bde6503d7580d40e0eab38d279788 (commit)
       via  a63a9363b27aa84d01341484f02897814204c922 (commit)
       via  f52dc4cae14a13185d264540229af87fed23c3a3 (commit)
       via  baf8af10a773a032ff8254a38cfc69da3834fa34 (commit)
       via  7704693e9aa9e278e3fbd1a9de3b6713ea66b2b9 (commit)
       via  0e97ef74d82fa4e18a0701216b1003bd346903b2 (commit)
       via  2ef8fe2222adbc3e76bd60f79d01451f99de16aa (commit)
       via  8c8731b422f30a626d4692cde98558eee65ef063 (commit)
       via  3baa817c34a673025ccfeceb87a7c1f870fbae75 (commit)
       via  3327d3bb20c2a4505648b59d72cfaada38e1ee93 (commit)
       via  4e4551f9f37ab95d70d9226103deb673e8f5cd02 (commit)
       via  abe1a345b255f69b02219f2b893ce00c8ff2e55b (commit)
       via  b71667a395dcbb32046646cf8a6f98ea8d595bba (commit)
       via  51bf23ed74bdebc7a98880cd13af8c5f37ab02ba (commit)
       via  c84fb4812d99978c2608379825b78fe43cda8659 (commit)
       via  1320122d3fda5974f6ed51cef709481efd2d658d (commit)
      from  776fd9b947c58be96485e3b579c51e4df239efb4 (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=c310480c5dc76ad0c1eb4e842869f92121d5b507
commit c310480c5dc76ad0c1eb4e842869f92121d5b507
Merge: a16b24c 0e97ef7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 12 13:22:19 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Nov 12 08:22:39 2018 -0500

    Merge topic 'autogen_global_target'
    
    0e97ef74d8 Autogen: Add release notes for CMAKE_GLOBAL_AUTOGEN/RCC_TARGET
    2ef8fe2222 Autogen: Add documentation for CMAKE_GLOBAL_AUTOGEN/RCC_TARGET
    8c8731b422 Autogen: Add test for CMAKE_GLOBAL_AUTOGEN/RCC_TARGET
    3baa817c34 Autogen: Add support for global ``autogen`` and ``autorcc`` targets
    3327d3bb20 Autogen: Add cmQtAutoGenGlobalInitializer class
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2567


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a16b24c9ce2bde6503d7580d40e0eab38d279788
commit a16b24c9ce2bde6503d7580d40e0eab38d279788
Merge: a63a936 4e4551f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 12 13:19:19 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Nov 12 08:19:32 2018 -0500

    Merge topic 'FindODBC-mingw-avoid-hardcoded-odbc32'
    
    4e4551f9f3 FindODBC: Do not assume odbc32.lib for MinGW
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2585


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a63a9363b27aa84d01341484f02897814204c922
commit a63a9363b27aa84d01341484f02897814204c922
Merge: f52dc4c 1320122
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 12 13:18:40 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Nov 12 08:18:47 2018 -0500

    Merge topic 'FindICU-link-dl'
    
    1320122d3f FindICU: Add libdl to the link libraries for icu-uc
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Acked-by: Francois Budin <francois.budin at kitware.com>
    Merge-request: !2581


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f52dc4cae14a13185d264540229af87fed23c3a3
commit f52dc4cae14a13185d264540229af87fed23c3a3
Merge: baf8af1 abe1a34
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 12 08:17:41 2018 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 12 08:17:41 2018 -0500

    Merge branch 'release-3.13'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baf8af10a773a032ff8254a38cfc69da3834fa34
commit baf8af10a773a032ff8254a38cfc69da3834fa34
Merge: 7704693 c84fb48
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 12 13:13:30 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Nov 12 08:16:28 2018 -0500

    Merge topic 'asm-compiler-id-clang'
    
    c84fb4812d ASM: Detect compiler id for Clang used as Assembler
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2584


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7704693e9aa9e278e3fbd1a9de3b6713ea66b2b9
commit 7704693e9aa9e278e3fbd1a9de3b6713ea66b2b9
Merge: 776fd9b b71667a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 12 13:13:21 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Nov 12 08:14:48 2018 -0500

    Merge topic 'FindBoost-compiler-guess-update'
    
    b71667a395 FindBoost: Improve compiler prefix detection for GCC 5+ and clang 4+
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2579


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e97ef74d82fa4e18a0701216b1003bd346903b2
commit 0e97ef74d82fa4e18a0701216b1003bd346903b2
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Sun Nov 11 14:27:47 2018 +0100
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Sun Nov 11 14:29:38 2018 +0100

    Autogen: Add release notes for CMAKE_GLOBAL_AUTOGEN/RCC_TARGET

diff --git a/Help/release/dev/autogen_global_target.rst b/Help/release/dev/autogen_global_target.rst
new file mode 100644
index 0000000..d555395
--- /dev/null
+++ b/Help/release/dev/autogen_global_target.rst
@@ -0,0 +1,8 @@
+autogen_global_target
+---------------------
+
+* The new variables :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`,
+  :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`,
+  :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` and
+  :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME` control the generation
+  of global ``autogen`` and ``autorcc`` targets.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ef8fe2222adbc3e76bd60f79d01451f99de16aa
commit 2ef8fe2222adbc3e76bd60f79d01451f99de16aa
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Sun Nov 11 13:50:17 2018 +0100
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Sun Nov 11 14:29:38 2018 +0100

    Autogen: Add documentation for CMAKE_GLOBAL_AUTOGEN/RCC_TARGET

diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 0382794..d8d6172 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -236,6 +236,7 @@ when either
   :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN`
   or :policy:`CMP0071`
 - :prop_tgt:`AUTOGEN_TARGET_DEPENDS` lists a source file
+- :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled
 
 qtmain.lib on Windows
 =====================
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 7a7f0b8..d808b1c 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -345,6 +345,10 @@ Variables that Control the Build
    /variable/CMAKE_FOLDER
    /variable/CMAKE_Fortran_FORMAT
    /variable/CMAKE_Fortran_MODULE_DIRECTORY
+   /variable/CMAKE_GLOBAL_AUTOGEN_TARGET
+   /variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
+   /variable/CMAKE_GLOBAL_AUTORCC_TARGET
+   /variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME
    /variable/CMAKE_GNUtoMS
    /variable/CMAKE_INCLUDE_CURRENT_DIR
    /variable/CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 70d89f2..7a3fd48 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -86,5 +86,9 @@ enabling :prop_sf:`SKIP_AUTOMOC` or the broader :prop_sf:`SKIP_AUTOGEN`.
 The number of parallel ``moc`` processes to start can be modified by
 setting :prop_tgt:`AUTOGEN_PARALLEL`.
 
+A global ``autogen`` target that depends on all :prop_tgt:`AUTOMOC` generated
+``<ORIGIN>_autogen`` targets in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`.
+
 See the :manual:`cmake-qt(7)` manual for more information on using CMake
 with Qt.
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index 99c2b0e..27fb149 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -35,5 +35,9 @@ generate unspecified unique names for ``rcc``.  Therefore if
 Source files can be excluded from :prop_tgt:`AUTORCC` processing by
 enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
 
+A global ``autorcc`` target that depends on all :prop_tgt:`AUTORCC` targets
+in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTORCC_TARGET`.
+
 See the :manual:`cmake-qt(7)` manual for more information on using CMake
 with Qt.
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 8cae0a7..4f58b35 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -36,5 +36,9 @@ enabling :prop_sf:`SKIP_AUTOUIC` or the broader :prop_sf:`SKIP_AUTOGEN`.
 The number of parallel ``uic`` processes to start can be modified by
 setting :prop_tgt:`AUTOGEN_PARALLEL`.
 
+A global ``autogen`` target that depends on all :prop_tgt:`AUTOUIC` generated
+``<ORIGIN>_autogen`` targets in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`.
+
 See the :manual:`cmake-qt(7)` manual for more information on using CMake
 with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
new file mode 100644
index 0000000..75903ab
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
@@ -0,0 +1,18 @@
+CMAKE_GLOBAL_AUTOGEN_TARGET
+---------------------------
+
+Switch to enable generation of a global ``autogen`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target
+``autogen`` is generated.  This target depends on all :prop_tgt:`AUTOMOC` and
+:prop_tgt:`AUTOUIC` generated ``<ORIGIN>_autogen`` targets in the project.
+By building the global ``autogen`` target, all :prop_tgt:`AUTOMOC` and
+:prop_tgt:`AUTOUIC` files in the project will be generated.
+
+The name of the global ``autogen`` target can be changed by setting
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
new file mode 100644
index 0000000..c86a5d0
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
@@ -0,0 +1,13 @@
+CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
+--------------------------------
+
+Change the name of the global ``autogen`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled, a global custom target
+named ``autogen`` is created.  :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`
+allows to set a different name for that target.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
new file mode 100644
index 0000000..f92128c
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
@@ -0,0 +1,18 @@
+CMAKE_GLOBAL_AUTORCC_TARGET
+---------------------------
+
+Switch to enable generation of a global ``autorcc`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target
+``autorcc`` is generated. This target depends on all :prop_tgt:`AUTORCC`
+generated ``<ORIGIN>_arcc_<QRC>`` targets in the project.
+By building the global ``autorcc`` target, all :prop_tgt:`AUTORCC`
+files in the project will be generated.
+
+The name of the global ``autorcc`` target can be changed by setting
+:variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME`.
+
+By default :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
new file mode 100644
index 0000000..c6e05de
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
@@ -0,0 +1,13 @@
+CMAKE_GLOBAL_AUTORCC_TARGET_NAME
+--------------------------------
+
+Change the name of the global ``autorcc`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a global custom target
+named ``autorcc`` is created.  :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME`
+allows to set a different name for that target.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c8731b422f30a626d4692cde98558eee65ef063
commit 8c8731b422f30a626d4692cde98558eee65ef063
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Sun Nov 11 12:54:14 2018 +0100
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Sun Nov 11 14:29:38 2018 +0100

    Autogen: Add test for CMAKE_GLOBAL_AUTOGEN/RCC_TARGET

diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake
index 58d9f0b..1cd9e7e 100644
--- a/Tests/QtAutogen/CommonTests.cmake
+++ b/Tests/QtAutogen/CommonTests.cmake
@@ -7,6 +7,7 @@ ADD_AUTOGEN_TEST(UicOnly uicOnly)
 ADD_AUTOGEN_TEST(RccOnly rccOnly)
 ADD_AUTOGEN_TEST(RccEmpty rccEmpty)
 ADD_AUTOGEN_TEST(RccOffMocLibrary)
+ADD_AUTOGEN_TEST(GlobalAutogenTarget)
 if(QT_TEST_ALLOW_QT_MACROS)
   ADD_AUTOGEN_TEST(MocSkipSource)
 endif()
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
new file mode 100644
index 0000000..e020673
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
@@ -0,0 +1,123 @@
+cmake_minimum_required(VERSION 3.12)
+project(GlobalAutogenTarget)
+include("../AutogenTest.cmake")
+
+# This tests
+# CMAKE_GLOBAL_AUTOGEN_TARGET,
+# CMAKE_GLOBAL_AUTORCC_TARGET,
+# CMAKE_GLOBAL_AUTOGEN_TARGET_NAME and
+# CMAKE_GLOBAL_AUTORCC_TARGET_NAME
+# for the latter two with different values in different subdirectories.
+
+# Directories
+set(GAT_SDIR "${CMAKE_CURRENT_SOURCE_DIR}/GAT")
+set(GAT_BDIR "${CMAKE_CURRENT_BINARY_DIR}/GAT")
+# Files
+set(MCA "sda/sda_autogen/mocs_compilation.cpp")
+set(MCB "sdb/sdb_autogen/mocs_compilation.cpp")
+set(MCC "sdc/sdc_autogen/mocs_compilation.cpp")
+set(MCG "gat_autogen/mocs_compilation.cpp")
+
+set(DRA "sda/sda_autogen/*qrc_data.cpp")
+set(DRB "sdb/sdb_autogen/*qrc_data.cpp")
+set(DRC "sdc/sdc_autogen/*qrc_data.cpp")
+set(DRG "gat_autogen/*qrc_data.cpp")
+
+# -- Utility macros
+macro(GAT_FIND_FILES VAR NAME)
+    file(GLOB_RECURSE ${VAR} ${GAT_BDIR}/*${NAME})
+endmacro()
+
+macro(GAT_FIND_FILE NAME)
+    GAT_FIND_FILES(LST ${NAME})
+    if(LST)
+        message("Good find ${LST}")
+    else()
+        message(SEND_ERROR "Expected to find ${GAT_BDIR}/${NAME}")
+    endif()
+    unset(LST)
+endmacro()
+
+macro(GAT_FIND_FILE_NOT NAME)
+    GAT_FIND_FILES(LST ${NAME})
+    if(LST)
+        message(SEND_ERROR "Not expected to find ${GAT_BDIR}/${NAME}")
+    else()
+        message("Good not find ${GAT_BDIR}/${NAME}")
+    endif()
+    unset(LST)
+endmacro()
+
+macro(GAT_BUILD_TARGET NAME)
+    message("___ Building GAT ${NAME} target ___")
+    execute_process(
+        COMMAND "${CMAKE_COMMAND}" --build "${GAT_BDIR}" --target ${NAME}
+        WORKING_DIRECTORY "${GAT_BDIR}"
+        RESULT_VARIABLE result)
+    if (result)
+      message(SEND_ERROR "Building of GAT ${NAME} target failed")
+    endif()
+endmacro()
+
+
+# -- Remove and recreate build directory
+file(REMOVE_RECURSE ${GAT_BDIR})
+file(MAKE_DIRECTORY ${GAT_BDIR})
+
+
+# -- Configure project
+message("___ Configuring GAT project ___")
+execute_process(
+    COMMAND "${CMAKE_COMMAND}" "${GAT_SDIR}"
+        "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+        "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+        "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+    WORKING_DIRECTORY "${GAT_BDIR}"
+    OUTPUT_VARIABLE output
+    RESULT_VARIABLE result)
+if (result)
+  message(SEND_ERROR "Configuring of GAT project failed")
+else()
+  message("Configuring of GAT project succeeded")
+  message("${output}")
+endif()
+
+
+# -- Build autogen subtargets
+GAT_BUILD_TARGET("autogen")
+GAT_FIND_FILE("${MCA}")
+GAT_FIND_FILE_NOT("${MCB}")
+GAT_FIND_FILE_NOT("${MCC}")
+GAT_FIND_FILE("${MCG}")
+
+GAT_BUILD_TARGET("global_autogen_sdb")
+GAT_FIND_FILE("${MCA}")
+GAT_FIND_FILE("${MCB}")
+GAT_FIND_FILE_NOT("${MCC}")
+GAT_FIND_FILE("${MCG}")
+
+GAT_BUILD_TARGET("all_autogen")
+GAT_FIND_FILE("${MCA}")
+GAT_FIND_FILE("${MCB}")
+GAT_FIND_FILE("${MCC}")
+GAT_FIND_FILE("${MCG}")
+
+
+# -- Build autorcc subtargets
+GAT_BUILD_TARGET("autorcc")
+GAT_FIND_FILE("${DRA}")
+GAT_FIND_FILE_NOT("${DRB}")
+GAT_FIND_FILE_NOT("${DRC}")
+GAT_FIND_FILE("${DRG}")
+
+GAT_BUILD_TARGET("global_autorcc_sdb")
+GAT_FIND_FILE("${DRA}")
+GAT_FIND_FILE("${DRB}")
+GAT_FIND_FILE_NOT("${DRC}")
+GAT_FIND_FILE("${DRG}")
+
+GAT_BUILD_TARGET("all_autorcc")
+GAT_FIND_FILE("${DRA}")
+GAT_FIND_FILE("${DRB}")
+GAT_FIND_FILE("${DRC}")
+GAT_FIND_FILE("${DRG}")
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
new file mode 100644
index 0000000..b1008e8
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.12)
+project(GAT)
+include("../../AutogenTest.cmake")
+
+# Include directories
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+# Enable AUTOMOC/UIC/RCC
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+# Disable ORIGN_DEPENDS and enable AUTOGEN global targets
+set(CMAKE_AUTOGEN_ORIGIN_DEPENDS OFF)
+set(CMAKE_GLOBAL_AUTOGEN_TARGET ON)
+set(CMAKE_GLOBAL_AUTORCC_TARGET ON)
+
+add_subdirectory(sda)
+add_subdirectory(sdb)
+add_subdirectory(sdc)
+
+# Add custom target that depends on all autogen/autorcc targets
+add_custom_target(all_autogen DEPENDS autogen global_autogen_sdb global_autogen_sdc)
+add_custom_target(all_autorcc DEPENDS autorcc global_autorcc_sdb global_autorcc_sdc)
+
+# Main target
+add_executable(gat data.qrc item.cpp main.cpp)
+target_link_libraries(gat ${QT_LIBRARIES})
+target_link_libraries(gat sda sdb sdc)
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc b/Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc
new file mode 100644
index 0000000..68d02c9
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+  <file>item.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.cpp
new file mode 100644
index 0000000..3d1fbe7
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.cpp
@@ -0,0 +1,20 @@
+#include "item.hpp"
+// Include ui_view.h in source and header
+#include <ui_view.h>
+
+class MocLocal : public QObject
+{
+  Q_OBJECT;
+
+public:
+  MocLocal() = default;
+  ~MocLocal() = default;
+};
+
+void Item::go()
+{
+  Ui_View ui;
+  MocLocal obj;
+}
+
+#include "item.moc"
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.hpp
new file mode 100644
index 0000000..75e83f4
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.hpp
@@ -0,0 +1,15 @@
+#ifndef ITEM_HPP
+#define ITEM_HPP
+
+#include <QObject>
+// Include ui_view.h in source and header
+#include <ui_view.h>
+
+class Item : public QObject
+{
+  Q_OBJECT
+  Q_SLOT
+  void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp
new file mode 100644
index 0000000..79c00b4
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp
@@ -0,0 +1,15 @@
+#include "item.hpp"
+#include "sda/sda.hpp"
+#include "sdb/sdb.hpp"
+#include "sdc/sdc.hpp"
+
+int main(int argv, char** args)
+{
+  // Object instances
+  Item item;
+  // Library calls
+  sda();
+  sdb();
+  sdc();
+  return 0;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt
new file mode 100644
index 0000000..795e91e
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(sda ../item.cpp ../data.qrc sda.cpp)
+target_link_libraries(sda ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp
new file mode 100644
index 0000000..ec4dec8
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp
@@ -0,0 +1,6 @@
+#include <item.hpp>
+
+void sda()
+{
+  Item item;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp
new file mode 100644
index 0000000..89ac744
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp
@@ -0,0 +1,6 @@
+#ifndef SDA_HPP
+#define SDA_HPP
+
+void sda();
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt
new file mode 100644
index 0000000..5c686fe
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(CMAKE_GLOBAL_AUTOGEN_TARGET_NAME "global_autogen_sdb")
+set(CMAKE_GLOBAL_AUTORCC_TARGET_NAME "global_autorcc_sdb")
+
+add_library(sdb ../item.cpp ../data.qrc sdb.cpp)
+target_link_libraries(sdb ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp
new file mode 100644
index 0000000..e32c467
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp
@@ -0,0 +1,6 @@
+#include <item.hpp>
+
+void sdb()
+{
+  Item item;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp
new file mode 100644
index 0000000..a5b0f62
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp
@@ -0,0 +1,6 @@
+#ifndef SDB_HPP
+#define SDB_HPP
+
+void sdb();
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt
new file mode 100644
index 0000000..2698bda
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(CMAKE_GLOBAL_AUTOGEN_TARGET_NAME "global_autogen_sdc")
+set(CMAKE_GLOBAL_AUTORCC_TARGET_NAME "global_autorcc_sdc")
+
+add_library(sdc ../item.cpp ../data.qrc sdc.cpp)
+target_link_libraries(sdc ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp
new file mode 100644
index 0000000..a97cd42
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp
@@ -0,0 +1,6 @@
+#include <item.hpp>
+
+void sdc()
+{
+  Item item;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp
new file mode 100644
index 0000000..7e92179
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp
@@ -0,0 +1,6 @@
+#ifndef SDC_HPP
+#define SDC_HPP
+
+void sdc();
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/view.ui b/Tests/QtAutogen/GlobalAutogenTarget/GAT/view.ui
new file mode 100644
index 0000000..2ffe734
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/view.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>View</class>
+ <widget class="QWidget" name="Base">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QHBoxLayout" name="horizontalLayout">
+   <item>
+    <widget class="QTreeView" name="treeView"/>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3baa817c34a673025ccfeceb87a7c1f870fbae75
commit 3baa817c34a673025ccfeceb87a7c1f870fbae75
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Tue Nov 6 12:40:48 2018 +0100
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Sun Nov 11 14:28:55 2018 +0100

    Autogen: Add support for global ``autogen`` and ``autorcc`` targets
    
    This teaches CMake the variables
    
    - CMAKE_GLOBAL_AUTOGEN_TARGET
    - CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
    - CMAKE_GLOBAL_AUTORCC_TARGET
    - CMAKE_GLOBAL_AUTORCC_TARGET_NAME
    
    which control the generation of global
    ``autogen`` and ``autorcc`` targets.
    
    Closes #17721

diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index d815a43..5470ec3 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -1,15 +1,56 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmQtAutoGenGlobalInitializer.h"
+#include "cmQtAutoGen.h"
+#include "cmQtAutoGenInitializer.h"
+
 #include "cmAlgorithms.h"
+#include "cmCustomCommandLines.h"
 #include "cmGeneratorTarget.h"
 #include "cmLocalGenerator.h"
-#include "cmQtAutoGenInitializer.h"
+#include "cmMakefile.h"
+#include "cmState.h"
+#include "cmStateTypes.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
+
+#include <memory>
+#include <utility>
 
 cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
   std::vector<cmLocalGenerator*> const& localGenerators)
 {
   for (cmLocalGenerator* localGen : localGenerators) {
+    // Detect global autogen and autorcc target names
+    bool globalAutoGenTarget = false;
+    bool globalAutoRccTarget = false;
+    {
+      cmMakefile* makefile = localGen->GetMakefile();
+      // Detect global autogen target name
+      if (cmSystemTools::IsOn(
+            makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET"))) {
+        std::string targetName =
+          makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET_NAME");
+        if (targetName.empty()) {
+          targetName = "autogen";
+        }
+        GlobalAutoGenTargets_.emplace(localGen, std::move(targetName));
+        globalAutoGenTarget = true;
+      }
+
+      // Detect global autorcc target name
+      if (cmSystemTools::IsOn(
+            makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET"))) {
+        std::string targetName =
+          makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET_NAME");
+        if (targetName.empty()) {
+          targetName = "autorcc";
+        }
+        GlobalAutoRccTargets_.emplace(localGen, std::move(targetName));
+        globalAutoRccTarget = true;
+      }
+    }
+
     // Find targets that require AUTOMOC/UIC/RCC processing
     for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) {
       // Process only certain target types
@@ -39,7 +80,8 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
         if ((qtVersion.Major == 4) || (qtVersion.Major == 5)) {
           // Create autogen target initializer
           Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
-            target, moc, uic, rcc, qtVersion));
+            this, target, qtVersion, moc, uic, rcc, globalAutoGenTarget,
+            globalAutoRccTarget));
         }
       }
     }
@@ -50,6 +92,58 @@ cmQtAutoGenGlobalInitializer::~cmQtAutoGenGlobalInitializer()
 {
 }
 
+void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
+  cmLocalGenerator* localGen, std::string const& name,
+  std::string const& comment)
+{
+  // Test if the target already exists
+  if (localGen->FindGeneratorTargetToUse(name) == nullptr) {
+    cmMakefile* makefile = localGen->GetMakefile();
+
+    // Create utility target
+    cmTarget* target = makefile->AddUtilityCommand(
+      name, cmMakefile::TargetOrigin::Generator, true,
+      makefile->GetHomeOutputDirectory().c_str() /*work dir*/,
+      std::vector<std::string>() /*output*/,
+      std::vector<std::string>() /*depends*/, cmCustomCommandLines(), false,
+      comment.c_str());
+    localGen->AddGeneratorTarget(new cmGeneratorTarget(target, localGen));
+
+    // Set FOLDER property in the target
+    {
+      char const* folder =
+        makefile->GetState()->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
+      if (folder != nullptr) {
+        target->SetProperty("FOLDER", folder);
+      }
+    }
+  }
+}
+
+void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
+  cmLocalGenerator* localGen, std::string const& targetName)
+{
+  auto it = GlobalAutoGenTargets_.find(localGen);
+  if (it != GlobalAutoGenTargets_.end()) {
+    cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+    if (target != nullptr) {
+      target->Target->AddUtility(targetName, localGen->GetMakefile());
+    }
+  }
+}
+
+void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
+  cmLocalGenerator* localGen, std::string const& targetName)
+{
+  auto it = GlobalAutoRccTargets_.find(localGen);
+  if (it != GlobalAutoRccTargets_.end()) {
+    cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+    if (target != nullptr) {
+      target->Target->AddUtility(targetName, localGen->GetMakefile());
+    }
+  }
+}
+
 bool cmQtAutoGenGlobalInitializer::generate()
 {
   return (InitializeCustomTargets() && SetupCustomTargets());
@@ -57,8 +151,23 @@ bool cmQtAutoGenGlobalInitializer::generate()
 
 bool cmQtAutoGenGlobalInitializer::InitializeCustomTargets()
 {
-  for (auto& autoGen : Initializers_) {
-    if (!autoGen->InitCustomTargets()) {
+  // Initialize global autogen targets
+  {
+    std::string const comment = "Global AUTOGEN target";
+    for (auto const& pair : GlobalAutoGenTargets_) {
+      GetOrCreateGlobalTarget(pair.first, pair.second, comment);
+    }
+  }
+  // Initialize global autorcc targets
+  {
+    std::string const comment = "Global AUTORCC target";
+    for (auto const& pair : GlobalAutoRccTargets_) {
+      GetOrCreateGlobalTarget(pair.first, pair.second, comment);
+    }
+  }
+  // Initialize per target autogen targets
+  for (auto& initializer : Initializers_) {
+    if (!initializer->InitCustomTargets()) {
       return false;
     }
   }
@@ -67,8 +176,8 @@ bool cmQtAutoGenGlobalInitializer::InitializeCustomTargets()
 
 bool cmQtAutoGenGlobalInitializer::SetupCustomTargets()
 {
-  for (auto& autoGen : Initializers_) {
-    if (!autoGen->SetupCustomTargets()) {
+  for (auto& initializer : Initializers_) {
+    if (!initializer->SetupCustomTargets()) {
       return false;
     }
   }
diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h
index 42bf62f..9e6bac0 100644
--- a/Source/cmQtAutoGenGlobalInitializer.h
+++ b/Source/cmQtAutoGenGlobalInitializer.h
@@ -5,7 +5,9 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
-#include <memory>
+#include <map>
+#include <memory> // IWYU pragma: keep
+#include <string>
 #include <vector>
 
 class cmLocalGenerator;
@@ -22,11 +24,24 @@ public:
   bool generate();
 
 private:
+  friend class cmQtAutoGenInitializer;
+
   bool InitializeCustomTargets();
   bool SetupCustomTargets();
 
+  void GetOrCreateGlobalTarget(cmLocalGenerator* localGen,
+                               std::string const& name,
+                               std::string const& comment);
+
+  void AddToGlobalAutoGen(cmLocalGenerator* localGen,
+                          std::string const& targetName);
+  void AddToGlobalAutoRcc(cmLocalGenerator* localGen,
+                          std::string const& targetName);
+
 private:
   std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
+  std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
+  std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
 };
 
 #endif
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index a213c84..793c0b2 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmQtAutoGenInitializer.h"
 #include "cmQtAutoGen.h"
+#include "cmQtAutoGenGlobalInitializer.h"
 
 #include "cmAlgorithms.h"
 #include "cmCustomCommand.h"
@@ -174,17 +175,19 @@ static bool StaticLibraryCycle(cmGeneratorTarget const* targetOrigin,
   return cycle;
 }
 
-cmQtAutoGenInitializer::cmQtAutoGenInitializer(cmGeneratorTarget* target,
-                                               bool mocEnabled,
-                                               bool uicEnabled,
-                                               bool rccEnabled,
-                                               IntegerVersion const& qtVersion)
-  : Target(target)
+cmQtAutoGenInitializer::cmQtAutoGenInitializer(
+  cmQtAutoGenGlobalInitializer* globalInitializer, cmGeneratorTarget* target,
+  IntegerVersion const& qtVersion, bool mocEnabled, bool uicEnabled,
+  bool rccEnabled, bool globalAutogenTarget, bool globalAutoRccTarget)
+  : GlobalInitializer(globalInitializer)
+  , Target(target)
   , QtVersion(qtVersion)
 {
+  AutogenTarget.GlobalTarget = globalAutogenTarget;
   Moc.Enabled = mocEnabled;
   Uic.Enabled = uicEnabled;
   Rcc.Enabled = rccEnabled;
+  Rcc.GlobalTarget = globalAutoRccTarget;
 }
 
 bool cmQtAutoGenInitializer::InitCustomTargets()
@@ -882,6 +885,10 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
     if (!this->AutogenTarget.DependFiles.empty()) {
       usePRE_BUILD = false;
     }
+    // Cannot use PRE_BUILD when a global autogen target is in place
+    if (AutogenTarget.GlobalTarget) {
+      usePRE_BUILD = false;
+    }
   }
   // Create the autogen target/command
   if (usePRE_BUILD) {
@@ -961,6 +968,12 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
 
     // Add autogen target to the origin target dependencies
     this->Target->Target->AddUtility(this->AutogenTarget.Name, makefile);
+
+    // Add autogen target to the global autogen target dependencies
+    if (this->AutogenTarget.GlobalTarget) {
+      this->GlobalInitializer->AddToGlobalAutoGen(localGen,
+                                                  this->AutogenTarget.Name);
+    }
   }
 
   return true;
@@ -1004,7 +1017,7 @@ bool cmQtAutoGenInitializer::InitRccTargets()
     std::string ccComment = "Automatic RCC for ";
     ccComment += FileProjectRelativePath(makefile, qrc.QrcFile);
 
-    if (qrc.Generated) {
+    if (qrc.Generated || this->Rcc.GlobalTarget) {
       // Create custom rcc target
       std::string ccName;
       {
@@ -1035,6 +1048,11 @@ bool cmQtAutoGenInitializer::InitRccTargets()
       }
       // Add autogen target to the origin target dependencies
       this->Target->Target->AddUtility(ccName, makefile);
+
+      // Add autogen target to the global autogen target dependencies
+      if (this->Rcc.GlobalTarget) {
+        this->GlobalInitializer->AddToGlobalAutoRcc(localGen, ccName);
+      }
     } else {
       // Create custom rcc command
       {
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index 1d3947b..53ad571 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -13,6 +13,7 @@
 
 class cmGeneratorTarget;
 class cmTarget;
+class cmQtAutoGenGlobalInitializer;
 
 /// @brief Initializes the QtAutoGen generators
 class cmQtAutoGenInitializer : public cmQtAutoGen
@@ -46,9 +47,11 @@ public:
 public:
   static IntegerVersion GetQtVersion(cmGeneratorTarget const* target);
 
-  cmQtAutoGenInitializer(cmGeneratorTarget* target, bool mocEnabled,
+  cmQtAutoGenInitializer(cmQtAutoGenGlobalInitializer* globalInitializer,
+                         cmGeneratorTarget* target,
+                         IntegerVersion const& qtVersion, bool mocEnabled,
                          bool uicEnabled, bool rccEnabled,
-                         IntegerVersion const& qtVersion);
+                         bool globalAutogenTarget, bool globalAutoRccTarget);
 
   bool InitCustomTargets();
   bool SetupCustomTargets();
@@ -76,6 +79,7 @@ private:
                      std::string& errorMessage);
 
 private:
+  cmQtAutoGenGlobalInitializer* GlobalInitializer;
   cmGeneratorTarget* Target;
 
   // Configuration
@@ -100,6 +104,7 @@ private:
   struct
   {
     std::string Name;
+    bool GlobalTarget = false;
     // Settings
     std::string Parallel;
     // Configuration files
@@ -148,6 +153,7 @@ private:
   struct
   {
     bool Enabled = false;
+    bool GlobalTarget = false;
     std::string Executable;
     std::vector<std::string> ListOptions;
     std::vector<Qrc> Qrcs;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3327d3bb20c2a4505648b59d72cfaada38e1ee93
commit 3327d3bb20c2a4505648b59d72cfaada38e1ee93
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Nov 5 11:18:46 2018 +0100
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Sun Nov 11 09:35:28 2018 +0100

    Autogen: Add cmQtAutoGenGlobalInitializer class
    
    This moves the global ``AUTOMOC/UIC/RCC`` targets initializer
    generation code into a separate new ``cmQtAutoGenGlobalInitializer`` class.

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index ded21bc..9aebfa7 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -320,6 +320,8 @@ set(SRCS
   cmQtAutoGen.h
   cmQtAutoGenerator.cxx
   cmQtAutoGenerator.h
+  cmQtAutoGenGlobalInitializer.cxx
+  cmQtAutoGenGlobalInitializer.h
   cmQtAutoGenInitializer.cxx
   cmQtAutoGenInitializer.h
   cmQtAutoGeneratorMocUic.cxx
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index cf85473..2805395 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -34,8 +34,6 @@
 #include "cmMakefile.h"
 #include "cmOutputConverter.h"
 #include "cmPolicies.h"
-#include "cmQtAutoGen.h"
-#include "cmQtAutoGenInitializer.h"
 #include "cmSourceFile.h"
 #include "cmState.h"
 #include "cmStateDirectory.h"
@@ -46,6 +44,7 @@
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 #  include "cmCryptoHash.h"
+#  include "cmQtAutoGenGlobalInitializer.h"
 #  include "cm_jsoncpp_value.h"
 #  include "cm_jsoncpp_writer.h"
 #endif
@@ -1469,64 +1468,11 @@ bool cmGlobalGenerator::ComputeTargetDepends()
 bool cmGlobalGenerator::QtAutoGen()
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
-  std::vector<std::unique_ptr<cmQtAutoGenInitializer>> autogenInits;
-
-  for (cmLocalGenerator* localGen : this->LocalGenerators) {
-    const std::vector<cmGeneratorTarget*>& targets =
-      localGen->GetGeneratorTargets();
-    // Find targets that require AUTOGEN processing
-    for (cmGeneratorTarget* target : targets) {
-      if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
-        continue;
-      }
-      if (target->GetType() != cmStateEnums::EXECUTABLE &&
-          target->GetType() != cmStateEnums::STATIC_LIBRARY &&
-          target->GetType() != cmStateEnums::SHARED_LIBRARY &&
-          target->GetType() != cmStateEnums::MODULE_LIBRARY &&
-          target->GetType() != cmStateEnums::OBJECT_LIBRARY) {
-        continue;
-      }
-      if (target->IsImported()) {
-        continue;
-      }
-
-      const bool mocEnabled = target->GetPropertyAsBool("AUTOMOC");
-      const bool uicEnabled = target->GetPropertyAsBool("AUTOUIC");
-      const bool rccEnabled = target->GetPropertyAsBool("AUTORCC");
-      if (!mocEnabled && !uicEnabled && !rccEnabled) {
-        continue;
-      }
-
-      auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
-      // don't do anything if there is no Qt4 or Qt5Core (which contains moc)
-      if (qtVersion.Major != 4 && qtVersion.Major != 5) {
-        continue;
-      }
-
-      autogenInits.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
-        target, mocEnabled, uicEnabled, rccEnabled, qtVersion));
-    }
-  }
-
-  if (!autogenInits.empty()) {
-    // Initialize custom targets
-    for (auto& autoGen : autogenInits) {
-      if (!autoGen->InitCustomTargets()) {
-        return false;
-      }
-    }
-
-    // Setup custom targets
-    for (auto& autoGen : autogenInits) {
-      if (!autoGen->SetupCustomTargets()) {
-        return false;
-      }
-      autoGen.reset(nullptr);
-    }
-  }
-#endif
-
+  cmQtAutoGenGlobalInitializer initializer(this->LocalGenerators);
+  return initializer.generate();
+#else
   return true;
+#endif
 }
 
 cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer(
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
new file mode 100644
index 0000000..d815a43
--- /dev/null
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -0,0 +1,76 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#include "cmQtAutoGenGlobalInitializer.h"
+#include "cmAlgorithms.h"
+#include "cmGeneratorTarget.h"
+#include "cmLocalGenerator.h"
+#include "cmQtAutoGenInitializer.h"
+
+cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
+  std::vector<cmLocalGenerator*> const& localGenerators)
+{
+  for (cmLocalGenerator* localGen : localGenerators) {
+    // Find targets that require AUTOMOC/UIC/RCC processing
+    for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) {
+      // Process only certain target types
+      switch (target->GetType()) {
+        case cmStateEnums::EXECUTABLE:
+        case cmStateEnums::STATIC_LIBRARY:
+        case cmStateEnums::SHARED_LIBRARY:
+        case cmStateEnums::MODULE_LIBRARY:
+        case cmStateEnums::OBJECT_LIBRARY:
+          // Process target
+          break;
+        default:
+          // Don't process target
+          continue;
+      }
+      if (target->IsImported()) {
+        // Don't process target
+        continue;
+      }
+
+      bool const moc = target->GetPropertyAsBool("AUTOMOC");
+      bool const uic = target->GetPropertyAsBool("AUTOUIC");
+      bool const rcc = target->GetPropertyAsBool("AUTORCC");
+      if (moc || uic || rcc) {
+        // We support Qt4 and Qt5
+        auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
+        if ((qtVersion.Major == 4) || (qtVersion.Major == 5)) {
+          // Create autogen target initializer
+          Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
+            target, moc, uic, rcc, qtVersion));
+        }
+      }
+    }
+  }
+}
+
+cmQtAutoGenGlobalInitializer::~cmQtAutoGenGlobalInitializer()
+{
+}
+
+bool cmQtAutoGenGlobalInitializer::generate()
+{
+  return (InitializeCustomTargets() && SetupCustomTargets());
+}
+
+bool cmQtAutoGenGlobalInitializer::InitializeCustomTargets()
+{
+  for (auto& autoGen : Initializers_) {
+    if (!autoGen->InitCustomTargets()) {
+      return false;
+    }
+  }
+  return true;
+}
+
+bool cmQtAutoGenGlobalInitializer::SetupCustomTargets()
+{
+  for (auto& autoGen : Initializers_) {
+    if (!autoGen->SetupCustomTargets()) {
+      return false;
+    }
+  }
+  return true;
+}
diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h
new file mode 100644
index 0000000..42bf62f
--- /dev/null
+++ b/Source/cmQtAutoGenGlobalInitializer.h
@@ -0,0 +1,32 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cmQtAutoGenGlobalInitializer_h
+#define cmQtAutoGenGlobalInitializer_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <memory>
+#include <vector>
+
+class cmLocalGenerator;
+class cmQtAutoGenInitializer;
+
+/// @brief Initializes the QtAutoGen generators
+class cmQtAutoGenGlobalInitializer
+{
+public:
+  cmQtAutoGenGlobalInitializer(
+    std::vector<cmLocalGenerator*> const& localGenerators);
+  ~cmQtAutoGenGlobalInitializer();
+
+  bool generate();
+
+private:
+  bool InitializeCustomTargets();
+  bool SetupCustomTargets();
+
+private:
+  std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
+};
+
+#endif

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e4551f9f37ab95d70d9226103deb673e8f5cd02
commit 4e4551f9f37ab95d70d9226103deb673e8f5cd02
Author:     Mateusz Łoskot <mateusz at loskot.net>
AuthorDate: Fri Nov 9 18:15:12 2018 +0100
Commit:     Mateusz Łoskot <mateusz at loskot.net>
CommitDate: Fri Nov 9 19:49:05 2018 +0100

    FindODBC: Do not assume odbc32.lib for MinGW
    
    For MinGW, do not look for odbc32.lib but allow search for libodbc32.a.
    
    Fixes: #18539

diff --git a/Modules/FindODBC.cmake b/Modules/FindODBC.cmake
index c8ca477..29d7af9 100644
--- a/Modules/FindODBC.cmake
+++ b/Modules/FindODBC.cmake
@@ -90,7 +90,9 @@ set(_odbc_required_libs_names)
 ### Try Windows Kits ##########################################################
 if(WIN32)
   # List names of ODBC libraries on Windows
-  set(ODBC_LIBRARY odbc32.lib)
+  if(NOT MINGW)
+    set(ODBC_LIBRARY odbc32.lib)
+  endif()
   set(_odbc_lib_names odbc32;)
 
   # List additional libraries required to use ODBC library

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1320122d3fda5974f6ed51cef709481efd2d658d
commit 1320122d3fda5974f6ed51cef709481efd2d658d
Author:     Cameron Cawley <ccawley2011 at gmail.com>
AuthorDate: Thu Nov 8 11:29:27 2018 -0500
Commit:     Cameron Cawley <ccawley2011 at gmail.com>
CommitDate: Thu Nov 8 11:29:27 2018 -0500

    FindICU: Add libdl to the link libraries for icu-uc

diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index 685b10f..70e10f5 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -363,6 +363,10 @@ if(ICU_FOUND)
             IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
             IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
         endif()
+        if(CMAKE_DL_LIBS AND _ICU_component STREQUAL "uc")
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+            INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
+        endif()
       endif()
     endif()
     unset(_ICU_component_upcase)

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

Summary of changes:
 Help/manual/cmake-qt.7.rst                         |   1 +
 Help/manual/cmake-variables.7.rst                  |   4 +
 Help/prop_tgt/AUTOMOC.rst                          |   4 +
 Help/prop_tgt/AUTORCC.rst                          |   4 +
 Help/prop_tgt/AUTOUIC.rst                          |   4 +
 Help/release/dev/autogen_global_target.rst         |   8 +
 Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst      |  18 ++
 Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst |  13 ++
 Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst      |  18 ++
 Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst |  13 ++
 Modules/CMakeDetermineASMCompiler.cmake            |   8 +
 Modules/FindBoost.cmake                            |  33 +++-
 Modules/FindICU.cmake                              |   4 +
 Modules/FindODBC.cmake                             |   4 +-
 Source/CMakeLists.txt                              |   2 +
 Source/cmGlobalGenerator.cxx                       |  64 +------
 Source/cmQtAutoGenGlobalInitializer.cxx            | 185 +++++++++++++++++++++
 Source/cmQtAutoGenGlobalInitializer.h              |  47 ++++++
 Source/cmQtAutoGenInitializer.cxx                  |  32 +++-
 Source/cmQtAutoGenInitializer.h                    |  10 +-
 Tests/QtAutogen/CommonTests.cmake                  |   1 +
 Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt | 123 ++++++++++++++
 .../GlobalAutogenTarget/GAT/CMakeLists.txt         |  28 ++++
 Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc   |   5 +
 .../{SameName => GlobalAutogenTarget/GAT}/item.cpp |   0
 .../{SameName => GlobalAutogenTarget/GAT}/item.hpp |   0
 Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp   |  15 ++
 .../GlobalAutogenTarget/GAT/sda/CMakeLists.txt     |   2 +
 .../QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp  |   6 +
 .../QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp  |   6 +
 .../GlobalAutogenTarget/GAT/sdb/CMakeLists.txt     |   5 +
 .../QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp  |   6 +
 .../QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp  |   6 +
 .../GlobalAutogenTarget/GAT/sdc/CMakeLists.txt     |   5 +
 .../QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp  |   6 +
 .../QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp  |   6 +
 .../{SameName => GlobalAutogenTarget/GAT}/view.ui  |   0
 37 files changed, 620 insertions(+), 76 deletions(-)
 create mode 100644 Help/release/dev/autogen_global_target.rst
 create mode 100644 Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
 create mode 100644 Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
 create mode 100644 Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
 create mode 100644 Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
 create mode 100644 Source/cmQtAutoGenGlobalInitializer.cxx
 create mode 100644 Source/cmQtAutoGenGlobalInitializer.h
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc
 copy Tests/QtAutogen/{SameName => GlobalAutogenTarget/GAT}/item.cpp (100%)
 copy Tests/QtAutogen/{SameName => GlobalAutogenTarget/GAT}/item.hpp (100%)
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp
 create mode 100644 Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp
 copy Tests/QtAutogen/{SameName => GlobalAutogenTarget/GAT}/view.ui (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list