diff options
author | Dominik Holland <dominik.holland@qt.io> | 2021-09-08 11:09:56 +0200 |
---|---|---|
committer | Dominik Holland <dominik.holland@qt.io> | 2021-09-16 12:38:41 +0200 |
commit | f6706fe69905780661857a80136beed7dbe42785 (patch) | |
tree | 92e134a81f6abdc8af62a0a38fb3b0761f9c7aeb | |
parent | f823c6304f8e321da5849afa332aa40a1173950a (diff) |
cmake: Apply qt6_ prefix to the set_ifcodegen_variable macro
The old macro is still available, but marked deprecated.
Change-Id: Ibb08209dc708ce1d65f12d338df406e0b4cf9ee8
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
(cherry picked from commit 6da2726bb03b2080e056bf9f8d634c036afcf5a2)
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
8 files changed, 36 insertions, 24 deletions
diff --git a/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake b/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake index 61a9a675..187d8c7b 100644 --- a/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake +++ b/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake @@ -129,11 +129,23 @@ endfunction() ## Public API ##################################################################### -macro(set_ifcodegen_variable name) +macro(qt6_set_ifcodegen_variable name) set(${name} ${ARGN}) set(${name} ${ARGN} PARENT_SCOPE) endmacro() +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + macro(qt_set_ifcodegen_variable) + qt6_set_ifcodegen_variable(${ARGV}) + endmacro() +endif() + +macro(set_ifcodegen_variable) + message(AUTHOR_WARNING + "The set_ifcodegen_variable macro is deprecated and will be removed soon. Please use qt6_set_ifcodegen_variable instead.") + qt6_set_ifcodegen_variable(${ARGV}) +endmacro() + # Calls the interfaceframework code generator. # # IDL_FILES: The input IDL file for the generator. (REQUIRED) diff --git a/src/tools/ifcodegen/templates/backend_qtro/CMakeLists.txt.tpl b/src/tools/ifcodegen/templates/backend_qtro/CMakeLists.txt.tpl index 8c9280bb..5b7405cf 100644 --- a/src/tools/ifcodegen/templates/backend_qtro/CMakeLists.txt.tpl +++ b/src/tools/ifcodegen/templates/backend_qtro/CMakeLists.txt.tpl @@ -32,20 +32,20 @@ if (NOT TARGET Qt6::RemoteObjects OR NOT TARGET Qt6::IfRemoteObjectsHelperPrivat find_package(Qt6 COMPONENTS RemoteObjects IfRemoteObjectsHelperPrivate) endif() -set_ifcodegen_variable(${VAR_PREFIX}_SOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES {% for interface in module.interfaces %} {{interface|lower}}robackend.cpp {% endfor %} {{module.module_name|lower}}roplugin.cpp ) -set_ifcodegen_variable(${VAR_PREFIX}_REPLICAS +qt6_set_ifcodegen_variable(${VAR_PREFIX}_REPLICAS {% for interface in module.interfaces %} ${CMAKE_CURRENT_BINARY_DIR}/{{interface|lower}}.rep {% endfor %} ) -set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES Qt6::RemoteObjects Qt6::IfRemoteObjectsHelperPrivate ) diff --git a/src/tools/ifcodegen/templates/backend_simulator/CMakeLists.txt.tpl b/src/tools/ifcodegen/templates/backend_simulator/CMakeLists.txt.tpl index 2554a15c..b9fe97ee 100644 --- a/src/tools/ifcodegen/templates/backend_simulator/CMakeLists.txt.tpl +++ b/src/tools/ifcodegen/templates/backend_simulator/CMakeLists.txt.tpl @@ -28,7 +28,7 @@ ############################################################################# #} -set_ifcodegen_variable(${VAR_PREFIX}_SOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES {% for interface in module.interfaces %} {{interface|lower}}backend.cpp {% endfor %} diff --git a/src/tools/ifcodegen/templates/frontend/CMakeLists.txt.tpl b/src/tools/ifcodegen/templates/frontend/CMakeLists.txt.tpl index 25295908..c7131a58 100644 --- a/src/tools/ifcodegen/templates/frontend/CMakeLists.txt.tpl +++ b/src/tools/ifcodegen/templates/frontend/CMakeLists.txt.tpl @@ -28,7 +28,7 @@ ############################################################################# #} -set_ifcodegen_variable(${VAR_PREFIX}_SOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES {% for interface in module.interfaces %} {{interface|lower}}.cpp {{interface|lower}}backendinterface.cpp @@ -40,20 +40,20 @@ set_ifcodegen_variable(${VAR_PREFIX}_SOURCES {{module.module_name|lower}}factory.cpp ) -set_ifcodegen_variable(${VAR_PREFIX}_DEFINES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_DEFINES QT_BUILD_{{module|upper|replace('.', '_')|strip_QT}}_LIB ) -set_ifcodegen_variable(${VAR_PREFIX}_URI +qt6_set_ifcodegen_variable(${VAR_PREFIX}_URI {{module|qml_type}} ) string(REPLACE "." "/" uri_path "{{module|qml_type}}") -set_ifcodegen_variable(${VAR_PREFIX}_URI_PATH +qt6_set_ifcodegen_variable(${VAR_PREFIX}_URI_PATH ${uri_path} ) -set_ifcodegen_variable(${VAR_PREFIX}_VERSION +qt6_set_ifcodegen_variable(${VAR_PREFIX}_VERSION {{module.majorVersion}}.{{module.minorVersion}} ) diff --git a/src/tools/ifcodegen/templates/qmlplugin/CMakeLists.txt.tpl b/src/tools/ifcodegen/templates/qmlplugin/CMakeLists.txt.tpl index 7cd9a425..c713c3eb 100644 --- a/src/tools/ifcodegen/templates/qmlplugin/CMakeLists.txt.tpl +++ b/src/tools/ifcodegen/templates/qmlplugin/CMakeLists.txt.tpl @@ -28,28 +28,28 @@ ############################################################################# #} -set_ifcodegen_variable(${VAR_PREFIX}_SOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/plugin.cpp ) -set_ifcodegen_variable(${VAR_PREFIX}_URI +qt6_set_ifcodegen_variable(${VAR_PREFIX}_URI {{module|qml_type}} ) string(REPLACE "." "/" uri_path "{{module|qml_type}}") -set_ifcodegen_variable(${VAR_PREFIX}_URI_PATH +qt6_set_ifcodegen_variable(${VAR_PREFIX}_URI_PATH ${uri_path} ) -set_ifcodegen_variable(${VAR_PREFIX}_VERSION +qt6_set_ifcodegen_variable(${VAR_PREFIX}_VERSION {{module.majorVersion}}.{{module.minorVersion}} ) -set_ifcodegen_variable(${VAR_PREFIX}_TYPEINFO +qt6_set_ifcodegen_variable(${VAR_PREFIX}_TYPEINFO ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes ) -set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES Qt6::InterfaceFramework ) diff --git a/src/tools/ifcodegen/templates/server_qtro/CMakeLists.txt.tpl b/src/tools/ifcodegen/templates/server_qtro/CMakeLists.txt.tpl index dafe88ef..91da5e14 100644 --- a/src/tools/ifcodegen/templates/server_qtro/CMakeLists.txt.tpl +++ b/src/tools/ifcodegen/templates/server_qtro/CMakeLists.txt.tpl @@ -32,17 +32,17 @@ if (NOT TARGET Qt6::RemoteObjects OR NOT TARGET Qt6::IfRemoteObjectsHelperPrivat find_package(Qt6 COMPONENTS RemoteObjects IfRemoteObjectsHelperPrivate) endif() -set_ifcodegen_variable(${VAR_PREFIX}_SOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES core.cpp ) -set_ifcodegen_variable(${VAR_PREFIX}_REPLICAS +qt6_set_ifcodegen_variable(${VAR_PREFIX}_REPLICAS {% for interface in module.interfaces %} ${CMAKE_CURRENT_BINARY_DIR}/{{interface|lower}}.rep {% endfor %} ) -set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES Qt6::RemoteObjects Qt6::IfRemoteObjectsHelperPrivate ) diff --git a/src/tools/ifcodegen/templates/server_qtro_simulator/CMakeLists.txt.tpl b/src/tools/ifcodegen/templates/server_qtro_simulator/CMakeLists.txt.tpl index 6457b62c..5a7338a2 100644 --- a/src/tools/ifcodegen/templates/server_qtro_simulator/CMakeLists.txt.tpl +++ b/src/tools/ifcodegen/templates/server_qtro_simulator/CMakeLists.txt.tpl @@ -32,7 +32,7 @@ if (NOT TARGET Qt6::RemoteObjects OR NOT TARGET Qt6::IfRemoteObjectsHelperPrivat find_package(Qt6 COMPONENTS RemoteObjects IfRemoteObjectsHelperPrivate) endif() -set_ifcodegen_variable(${VAR_PREFIX}_SOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES {% for interface in module.interfaces %} {{interface|lower}}backend.cpp {{interface|lower}}adapter.cpp @@ -41,17 +41,17 @@ set_ifcodegen_variable(${VAR_PREFIX}_SOURCES main.cpp ) -set_ifcodegen_variable(${VAR_PREFIX}_RESOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/{{module.module_name|lower}}_simulation.qrc ) -set_ifcodegen_variable(${VAR_PREFIX}_REPLICAS +qt6_set_ifcodegen_variable(${VAR_PREFIX}_REPLICAS {% for interface in module.interfaces %} ${CMAKE_CURRENT_BINARY_DIR}/{{interface|lower}}.rep {% endfor %} ) -set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_LIBRARIES Qt6::RemoteObjects Qt6::IfRemoteObjectsHelperPrivate ) diff --git a/src/tools/ifcodegen/templates/test/CMakeLists.txt.tpl b/src/tools/ifcodegen/templates/test/CMakeLists.txt.tpl index b567e968..d9e6ea6e 100644 --- a/src/tools/ifcodegen/templates/test/CMakeLists.txt.tpl +++ b/src/tools/ifcodegen/templates/test/CMakeLists.txt.tpl @@ -28,7 +28,7 @@ ############################################################################# #} -set_ifcodegen_variable(${VAR_PREFIX}_SOURCES +qt6_set_ifcodegen_variable(${VAR_PREFIX}_SOURCES {% for interface in module.interfaces %} tst_{{interface|lower}}.cpp {% endfor %} |