summaryrefslogtreecommitdiffstats
path: root/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2022-02-08 10:56:29 +0100
committerDominik Holland <dominik.holland@qt.io>2022-02-17 16:35:22 +0100
commitc4999abff6e2808169c89d77acf723f859ec6efa (patch)
tree1eebe63523a4a55ccc32ae667a287605a1bbe945 /src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake
parent25393b83629d492e686873f19c5cf29b66f15fb9 (diff)
cmake: Add support for using multiple ifcodegen calls in one CMakeLists.txt
This is done by changing the default value of the OUTPUT_DIR argument to be template specific. Fixes: QTBUG-100410 Pick-to: 6.3 Change-Id: I807d10ce60965b0c1c0a06db8276e22d4658e183 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake')
-rw-r--r--src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake b/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake
index 3a1f86e0..5800dd90 100644
--- a/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake
+++ b/src/interfaceframework/Qt6InterfaceFrameworkMacros.cmake
@@ -97,8 +97,11 @@ function(internal_ifcodegen_import)
set(OUTPUT_DIR ${ARG_OUTPUT_DIR})
if (NOT DEFINED ARG_OUTPUT_DIR)
- set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ get_filename_component(TEMPLATE_NAME "${ARG_TEMPLATE}" NAME)
+ set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${TEMPLATE_NAME})
endif()
+ make_directory(${OUTPUT_DIR})
+
if (NOT DEFINED ARG_IDL_FILES)
message(FATAL_ERROR
"Called without input files. Please specify some using the IDL_FILES argument."
@@ -165,7 +168,7 @@ endmacro()
# searched for. (OPTIONAL)
#
# OUTPUT_DIR: Overwrite the default output path. By default the generated code
-# will be put in ${CMAKE_CURRENT_BINARY_DIR}. Use this argument to provide
+# will be put in ${CMAKE_CURRENT_BINARY_DIR}/<template-name>. Use this argument to provide
# a replacement. (OPTIONAL)
#
# EXTRA_HEADERS_OUTPUT_DIR: An additional location where all headers will be
@@ -207,8 +210,11 @@ function(qt6_ifcodegen_generate)
endif()
set(OUTPUT_DIR ${ARG_OUTPUT_DIR})
if (NOT DEFINED ARG_OUTPUT_DIR)
- set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ get_filename_component(TEMPLATE_NAME "${ARG_TEMPLATE}" NAME)
+ set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${TEMPLATE_NAME})
endif()
+ make_directory(${OUTPUT_DIR})
+
if (NOT DEFINED ARG_IDL_FILES)
message(FATAL_ERROR
"Called without input files. Please specify some using the IDL_FILES argument."
@@ -401,7 +407,7 @@ endif()
# searched for. (OPTIONAL)
#
# OUTPUT_DIR: Overwrite the default output path. By default the generated code
-# will be put in ${CMAKE_CURRENT_BINARY_DIR}. Use this argument to provide
+# will be put in ${CMAKE_CURRENT_BINARY_DIR}/<template-name>. Use this argument to provide
# a replacement. (OPTIONAL)
#
# EXTRA_HEADERS_OUTPUT_DIR: An additional location where all headers will be