mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-22 16:07:49 +08:00
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
This commit is contained in:

committed by
Brad King

parent
9d439e235c
commit
b3d1797508
@@ -690,11 +690,14 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_AUTOMOC_MOC_OPTIONS
|
\ CMAKE_AUTOMOC_MOC_OPTIONS
|
||||||
\ CMAKE_AUTOMOC_PATH_PREFIX
|
\ CMAKE_AUTOMOC_PATH_PREFIX
|
||||||
\ CMAKE_AUTOMOC_RELAXED_MODE
|
\ CMAKE_AUTOMOC_RELAXED_MODE
|
||||||
|
\ CMAKE_AUTOMOC_EXECUTABLE
|
||||||
\ CMAKE_AUTORCC
|
\ CMAKE_AUTORCC
|
||||||
\ CMAKE_AUTORCC_OPTIONS
|
\ CMAKE_AUTORCC_OPTIONS
|
||||||
|
\ CMAKE_AUTORCC_EXECUTABLE
|
||||||
\ CMAKE_AUTOUIC
|
\ CMAKE_AUTOUIC
|
||||||
\ CMAKE_AUTOUIC_OPTIONS
|
\ CMAKE_AUTOUIC_OPTIONS
|
||||||
\ CMAKE_AUTOUIC_SEARCH_PATHS
|
\ CMAKE_AUTOUIC_SEARCH_PATHS
|
||||||
|
\ CMAKE_AUTOUIC_EXECUTABLE
|
||||||
\ CMAKE_BACKWARDS_COMPATIBILITY
|
\ CMAKE_BACKWARDS_COMPATIBILITY
|
||||||
\ CMAKE_BINARY_DIR
|
\ CMAKE_BINARY_DIR
|
||||||
\ CMAKE_BUILD_RPATH
|
\ CMAKE_BUILD_RPATH
|
||||||
|
@@ -403,11 +403,14 @@ Variables that Control the Build
|
|||||||
/variable/CMAKE_AUTOMOC_MACRO_NAMES
|
/variable/CMAKE_AUTOMOC_MACRO_NAMES
|
||||||
/variable/CMAKE_AUTOMOC_MOC_OPTIONS
|
/variable/CMAKE_AUTOMOC_MOC_OPTIONS
|
||||||
/variable/CMAKE_AUTOMOC_PATH_PREFIX
|
/variable/CMAKE_AUTOMOC_PATH_PREFIX
|
||||||
|
/variable/CMAKE_AUTOMOC_EXECUTABLE
|
||||||
/variable/CMAKE_AUTORCC
|
/variable/CMAKE_AUTORCC
|
||||||
/variable/CMAKE_AUTORCC_OPTIONS
|
/variable/CMAKE_AUTORCC_OPTIONS
|
||||||
|
/variable/CMAKE_AUTORCC_EXECUTABLE
|
||||||
/variable/CMAKE_AUTOUIC
|
/variable/CMAKE_AUTOUIC
|
||||||
/variable/CMAKE_AUTOUIC_OPTIONS
|
/variable/CMAKE_AUTOUIC_OPTIONS
|
||||||
/variable/CMAKE_AUTOUIC_SEARCH_PATHS
|
/variable/CMAKE_AUTOUIC_SEARCH_PATHS
|
||||||
|
/variable/CMAKE_AUTOUIC_EXECUTABLE
|
||||||
/variable/CMAKE_BUILD_RPATH
|
/variable/CMAKE_BUILD_RPATH
|
||||||
/variable/CMAKE_BUILD_RPATH_USE_ORIGIN
|
/variable/CMAKE_BUILD_RPATH_USE_ORIGIN
|
||||||
/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR
|
/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR
|
||||||
|
7
Help/release/dev/autogen-exe-vars.rst
Normal file
7
Help/release/dev/autogen-exe-vars.rst
Normal file
@@ -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.
|
10
Help/variable/CMAKE_AUTOMOC_EXECUTABLE.rst
Normal file
10
Help/variable/CMAKE_AUTOMOC_EXECUTABLE.rst
Normal file
@@ -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.
|
10
Help/variable/CMAKE_AUTORCC_EXECUTABLE.rst
Normal file
10
Help/variable/CMAKE_AUTORCC_EXECUTABLE.rst
Normal file
@@ -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.
|
10
Help/variable/CMAKE_AUTOUIC_EXECUTABLE.rst
Normal file
10
Help/variable/CMAKE_AUTOUIC_EXECUTABLE.rst
Normal file
@@ -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.
|
@@ -438,13 +438,16 @@ TargetProperty const StaticTargetProperties[] = {
|
|||||||
{ "AUTOMOC_MACRO_NAMES"_s, IC::CanCompileSources },
|
{ "AUTOMOC_MACRO_NAMES"_s, IC::CanCompileSources },
|
||||||
{ "AUTOMOC_MOC_OPTIONS"_s, IC::CanCompileSources },
|
{ "AUTOMOC_MOC_OPTIONS"_s, IC::CanCompileSources },
|
||||||
{ "AUTOMOC_PATH_PREFIX"_s, IC::CanCompileSources },
|
{ "AUTOMOC_PATH_PREFIX"_s, IC::CanCompileSources },
|
||||||
|
{ "AUTOMOC_EXECUTABLE"_s, IC::CanCompileSources },
|
||||||
// ---- uic
|
// ---- uic
|
||||||
{ "AUTOUIC"_s, IC::CanCompileSources },
|
{ "AUTOUIC"_s, IC::CanCompileSources },
|
||||||
{ "AUTOUIC_OPTIONS"_s, IC::CanCompileSources },
|
{ "AUTOUIC_OPTIONS"_s, IC::CanCompileSources },
|
||||||
{ "AUTOUIC_SEARCH_PATHS"_s, IC::CanCompileSources },
|
{ "AUTOUIC_SEARCH_PATHS"_s, IC::CanCompileSources },
|
||||||
|
{ "AUTOUIC_EXECUTABLE"_s, IC::CanCompileSources },
|
||||||
// ---- rcc
|
// ---- rcc
|
||||||
{ "AUTORCC"_s, IC::CanCompileSources },
|
{ "AUTORCC"_s, IC::CanCompileSources },
|
||||||
{ "AUTORCC_OPTIONS"_s, IC::CanCompileSources },
|
{ "AUTORCC_OPTIONS"_s, IC::CanCompileSources },
|
||||||
|
{ "AUTORCC_EXECUTABLE"_s, IC::CanCompileSources },
|
||||||
|
|
||||||
// Linking properties
|
// Linking properties
|
||||||
{ "ENABLE_EXPORTS"_s, IC::TargetWithSymbolExports },
|
{ "ENABLE_EXPORTS"_s, IC::TargetWithSymbolExports },
|
||||||
|
30
Tests/QtAutogen/GlobalAutogenExecutable/CMakeLists.txt
Normal file
30
Tests/QtAutogen/GlobalAutogenExecutable/CMakeLists.txt
Normal file
@@ -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()
|
4
Tests/QtAutogen/GlobalAutogenExecutable/main.cpp
Normal file
4
Tests/QtAutogen/GlobalAutogenExecutable/main.cpp
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
@@ -4,6 +4,7 @@ ADD_AUTOGEN_TEST(AutogenOriginDependsOn)
|
|||||||
ADD_AUTOGEN_TEST(AutogenTargetDepends)
|
ADD_AUTOGEN_TEST(AutogenTargetDepends)
|
||||||
ADD_AUTOGEN_TEST(Complex QtAutogen)
|
ADD_AUTOGEN_TEST(Complex QtAutogen)
|
||||||
ADD_AUTOGEN_TEST(GlobalAutogenTarget)
|
ADD_AUTOGEN_TEST(GlobalAutogenTarget)
|
||||||
|
ADD_AUTOGEN_TEST(GlobalAutogenExecutable)
|
||||||
ADD_AUTOGEN_TEST(LowMinimumVersion lowMinimumVersion)
|
ADD_AUTOGEN_TEST(LowMinimumVersion lowMinimumVersion)
|
||||||
ADD_AUTOGEN_TEST(ManySources manySources)
|
ADD_AUTOGEN_TEST(ManySources manySources)
|
||||||
ADD_AUTOGEN_TEST(MocOnly mocOnly)
|
ADD_AUTOGEN_TEST(MocOnly mocOnly)
|
||||||
|
Reference in New Issue
Block a user