summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-11-10 15:31:11 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-11-11 16:34:50 +0100
commit6391c31dec339bcd1a402133c19ac6907ea6fbdd (patch)
tree332918cef6fe43db9995482053f8c3a2e016c45c
parent43aaf74f606de6ec97cb3c06c4e6dcee242c01d7 (diff)
CMake: Potentially use INSTALL_LIBDIR in qt6_extract_metatypes
The INSTALL_LIBDIR value is only set when doing a Qt build. Use it when available, otherwise default to a more 'hardcoded' value. Change-Id: I96b7b8094c699de59ffaff00cd677d8322c474c3 Reviewed-by: Christophe Giboudeaux <christophe@krop.fr> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/corelib/Qt6CoreMacros.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 288c2437cd..cc5f58771f 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -580,7 +580,7 @@ endif()
# the --output-json parameter.
# Params:
# INSTALL_DIR: Location where to install the metatypes file. For public consumption,
-# defaults to a ${CMAKE_INSTALL_PREFIX}/lib/metatypes directory.
+# defaults to a ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBDIR}/metatypes directory.
# Executable metatypes files are never installed.
# COPY_OVER_INSTALL: (Qt Internal) When present will install the file via a post build step
# copy rather than using install.
@@ -614,7 +614,12 @@ function(qt6_extract_metatypes target)
# Automatically fill default install args when not specified.
if (NOT arg_INSTALL_DIR)
- set(arg_INSTALL_DIR "lib/metatypes")
+ # INSTALL_LIBDIR is not set when QtBuildInternals is not loaded (when not doing a Qt build).
+ if(INSTALL_LIBDIR)
+ set(arg_INSTALL_DIR "${INSTALL_LIBDIR}/metatypes")
+ else()
+ set(arg_INSTALL_DIR "lib/metatypes")
+ endif()
endif()
get_target_property(target_binary_dir ${target} BINARY_DIR)