summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrkun Tokdemir <orkun.tokdemir@qt.io>2023-03-17 17:11:38 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-22 11:31:56 (GMT)
commitb3d17975087a41ad799e8f5566d50212f3f0e0b3 (patch)
treebba957ac8f06d006994ccbb752d9688bf4b27f66
parent9d439e235ce117fb24822e0cb1716c785e38db19 (diff)
downloadCMake-b3d17975087a41ad799e8f5566d50212f3f0e0b3.zip
CMake-b3d17975087a41ad799e8f5566d50212f3f0e0b3.tar.gz
CMake-b3d17975087a41ad799e8f5566d50212f3f0e0b3.tar.bz2
Autogen: Add CMAKE_AUTO*_EXECUTABLE variables
Add the `CMAKE_AUTOMOC_EXECUTABLE`, `CMAKE_AUTOUIC_EXECUTABLE`, and `CMAKE_AUTORCC_EXECUTABLE` variables to initialize the corresponding `AUTO{MOC,UIC,RCC}_EXECUTABLE` target properties. Fixes: #20071
-rw-r--r--Auxiliary/vim/syntax/cmake.vim3
-rw-r--r--Help/manual/cmake-variables.7.rst3
-rw-r--r--Help/release/dev/autogen-exe-vars.rst7
-rw-r--r--Help/variable/CMAKE_AUTOMOC_EXECUTABLE.rst10
-rw-r--r--Help/variable/CMAKE_AUTORCC_EXECUTABLE.rst10
-rw-r--r--Help/variable/CMAKE_AUTOUIC_EXECUTABLE.rst10
-rw-r--r--Source/cmTarget.cxx3
-rw-r--r--Tests/QtAutogen/GlobalAutogenExecutable/CMakeLists.txt30
-rw-r--r--Tests/QtAutogen/GlobalAutogenExecutable/main.cpp4
-rw-r--r--Tests/QtAutogen/Tests.cmake1
10 files changed, 81 insertions, 0 deletions
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index 1a47f67..3a44d7a 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -690,11 +690,14 @@ syn keyword cmakeVariable contained
\ CMAKE_AUTOMOC_MOC_OPTIONS
\ CMAKE_AUTOMOC_PATH_PREFIX
\ CMAKE_AUTOMOC_RELAXED_MODE
+ \ CMAKE_AUTOMOC_EXECUTABLE
\ CMAKE_AUTORCC
\ CMAKE_AUTORCC_OPTIONS
+ \ CMAKE_AUTORCC_EXECUTABLE
\ CMAKE_AUTOUIC
\ CMAKE_AUTOUIC_OPTIONS
\ CMAKE_AUTOUIC_SEARCH_PATHS
+ \ CMAKE_AUTOUIC_EXECUTABLE
\ CMAKE_BACKWARDS_COMPATIBILITY
\ CMAKE_BINARY_DIR
\ CMAKE_BUILD_RPATH
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 99ea564..18e011c 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -403,11 +403,14 @@ Variables that Control the Build
/variable/CMAKE_AUTOMOC_MACRO_NAMES
/variable/CMAKE_AUTOMOC_MOC_OPTIONS
/variable/CMAKE_AUTOMOC_PATH_PREFIX
+ /variable/CMAKE_AUTOMOC_EXECUTABLE
/variable/CMAKE_AUTORCC
/variable/CMAKE_AUTORCC_OPTIONS
+ /variable/CMAKE_AUTORCC_EXECUTABLE
/variable/CMAKE_AUTOUIC
/variable/CMAKE_AUTOUIC_OPTIONS
/variable/CMAKE_AUTOUIC_SEARCH_PATHS
+ /variable/CMAKE_AUTOUIC_EXECUTABLE
/variable/CMAKE_BUILD_RPATH
/variable/CMAKE_BUILD_RPATH_USE_ORIGIN
/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR
diff --git a/Help/release/dev/autogen-exe-vars.rst b/Help/release/dev/autogen-exe-vars.rst
new file mode 100644
index 0000000..a386b4f
--- /dev/null
+++ b/Help/release/dev/autogen-exe-vars.rst
@@ -0,0 +1,7 @@
+autogen-exe-vars
+----------------
+
+* The :variable:`CMAKE_AUTOMOC_EXECUTABLE`,
+ :variable:`CMAKE_AUTORCC_EXECUTABLE`, and
+ :variable:`CMAKE_AUTOUIC_EXECUTABLE` variables were added to initialize the
+ corresponding target properties as targets are created.
diff --git a/Help/variable/CMAKE_AUTOMOC_EXECUTABLE.rst b/Help/variable/CMAKE_AUTOMOC_EXECUTABLE.rst
new file mode 100644
index 0000000..150a73a
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOMOC_EXECUTABLE.rst
@@ -0,0 +1,10 @@
+CMAKE_AUTOMOC_EXECUTABLE
+------------------------
+
+.. versionadded:: 3.27
+
+This variable is used to initialize the :prop_tgt:`AUTOMOC_EXECUTABLE`
+property on all the targets. See that target property for additional
+information.
+
+By default it is empty.
diff --git a/Help/variable/CMAKE_AUTORCC_EXECUTABLE.rst b/Help/variable/CMAKE_AUTORCC_EXECUTABLE.rst
new file mode 100644
index 0000000..52d7faa
--- /dev/null
+++ b/Help/variable/CMAKE_AUTORCC_EXECUTABLE.rst
@@ -0,0 +1,10 @@
+CMAKE_AUTORCC_EXECUTABLE
+------------------------
+
+.. versionadded:: 3.27
+
+This variable is used to initialize the :prop_tgt:`AUTORCC_EXECUTABLE`
+property on all the targets. See that target property for additional
+information.
+
+By default it is empty.
diff --git a/Help/variable/CMAKE_AUTOUIC_EXECUTABLE.rst b/Help/variable/CMAKE_AUTOUIC_EXECUTABLE.rst
new file mode 100644
index 0000000..b2ebd7f
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOUIC_EXECUTABLE.rst
@@ -0,0 +1,10 @@
+CMAKE_AUTOUIC_EXECUTABLE
+------------------------
+
+.. versionadded:: 3.27
+
+This variable is used to initialize the :prop_tgt:`AUTOUIC_EXECUTABLE`
+property on all the targets. See that target property for additional
+information.
+
+By default it is empty.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f06e26b..147aaf0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -438,13 +438,16 @@ TargetProperty const StaticTargetProperties[] = {
{ "AUTOMOC_MACRO_NAMES"_s, IC::CanCompileSources },
{ "AUTOMOC_MOC_OPTIONS"_s, IC::CanCompileSources },
{ "AUTOMOC_PATH_PREFIX"_s, IC::CanCompileSources },
+ { "AUTOMOC_EXECUTABLE"_s, IC::CanCompileSources },
// ---- uic
{ "AUTOUIC"_s, IC::CanCompileSources },
{ "AUTOUIC_OPTIONS"_s, IC::CanCompileSources },
{ "AUTOUIC_SEARCH_PATHS"_s, IC::CanCompileSources },
+ { "AUTOUIC_EXECUTABLE"_s, IC::CanCompileSources },
// ---- rcc
{ "AUTORCC"_s, IC::CanCompileSources },
{ "AUTORCC_OPTIONS"_s, IC::CanCompileSources },
+ { "AUTORCC_EXECUTABLE"_s, IC::CanCompileSources },
// Linking properties
{ "ENABLE_EXPORTS"_s, IC::TargetWithSymbolExports },
diff --git a/Tests/QtAutogen/GlobalAutogenExecutable/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenExecutable/CMakeLists.txt
new file mode 100644
index 0000000..34da744
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenExecutable/CMakeLists.txt
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 3.26)
+project(GlobalAutogenExecutable)
+
+include("../AutogenCoreTest.cmake")
+
+set(test_automoc_path "global_automoc_exe_path")
+set(test_autouic_path "global_autouic_exe_path")
+set(test_autorcc_path "global_autorcc_exe_path")
+
+set(CMAKE_AUTOMOC_EXECUTABLE ${test_automoc_path})
+set(CMAKE_AUTOUIC_EXECUTABLE ${test_autouic_path})
+set(CMAKE_AUTORCC_EXECUTABLE ${test_autorcc_path})
+
+add_executable(autogen_test main.cpp)
+
+get_target_property(target_automoc_path autogen_test AUTOMOC_EXECUTABLE)
+get_target_property(target_autouic_path autogen_test AUTOUIC_EXECUTABLE)
+get_target_property(target_autorcc_path autogen_test AUTORCC_EXECUTABLE)
+
+if(NOT ${target_automoc_path} STREQUAL ${test_automoc_path})
+ message(FATAL_ERROR "CMAKE_AUTOMOC_EXECUTABLE not set")
+endif()
+
+if (NOT ${target_autouic_path} STREQUAL ${test_autouic_path})
+ message(FATAL_ERROR "CMAKE_AUTOUIC_EXECUTABLE not set")
+endif()
+
+if (NOT ${target_autorcc_path} STREQUAL ${test_autorcc_path})
+ message(FATAL_ERROR "CMAKE_AUTORCC_EXECUTABLE not set")
+endif()
diff --git a/Tests/QtAutogen/GlobalAutogenExecutable/main.cpp b/Tests/QtAutogen/GlobalAutogenExecutable/main.cpp
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenExecutable/main.cpp
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake
index a3c57a5..b507ab5 100644
--- a/Tests/QtAutogen/Tests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -4,6 +4,7 @@ ADD_AUTOGEN_TEST(AutogenOriginDependsOn)
ADD_AUTOGEN_TEST(AutogenTargetDepends)
ADD_AUTOGEN_TEST(Complex QtAutogen)
ADD_AUTOGEN_TEST(GlobalAutogenTarget)
+ADD_AUTOGEN_TEST(GlobalAutogenExecutable)
ADD_AUTOGEN_TEST(LowMinimumVersion lowMinimumVersion)
ADD_AUTOGEN_TEST(ManySources manySources)
ADD_AUTOGEN_TEST(MocOnly mocOnly)