summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-08-30 11:53:14 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-01 10:00:51 +0000
commita8a3d437167c3f9446feee5f0b04d54c887677a3 (patch)
treeaa229eebd0e932ad0e2c9b7a8106235d5f202bec
parentfc50edecbce8f6db9bb663aa63d970e6f04604c8 (diff)
Use generator expression to get moc path
We used IMPORTED_LOCATION for getting moc path, however this will not work in case of top level builds, since moc is not "imported", we can not use LOCATION due to https://cmake.org/cmake/help/latest/policy/CMP0026.html Use generator expression to set the moc path for gn. Clean up RSP_PREFIX leftover from previous gn version. Note QtPdf does not even need moc setup since we just need pdfium library. Task-number: QTBUG-95590 Change-Id: Ief3dca96f65e198e9693293316b1a90007c56355 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 53e99bd479f74c5399664d26e35e392875da8fb5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--cmake/Functions.cmake3
-rw-r--r--src/core/CMakeLists.txt7
-rw-r--r--src/pdf/CMakeLists.txt6
3 files changed, 4 insertions, 12 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index b7c386fc..68c7657a 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -82,7 +82,8 @@ function(create_cxx_config cmakeTarget arch configFileName)
set(GN_INCLUDES $<TARGET_PROPERTY:INCLUDE_DIRECTORIES>)\n\
set(GN_DEFINES $<TARGET_PROPERTY:COMPILE_DEFINITIONS>)\n\
set(GN_LINK_OPTIONS $<TARGET_PROPERTY:LINK_OPTIONS>)\n\
- set(GN_CXX_COMPILE_OPTIONS $<TARGET_PROPERTY:COMPILE_OPTIONS>)"
+ set(GN_CXX_COMPILE_OPTIONS $<TARGET_PROPERTY:COMPILE_OPTIONS>)\n\
+ set(GN_MOC_PATH $<TARGET_FILE:Qt::moc>)"
# set(GN_LIBS $<TARGET_PROPERTY:LINK_LIBRARIES>)
CONDITION $<COMPILE_LANGUAGE:CXX>
TARGET ${cmakeTarget}
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index ba743b33..d0428b2a 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -40,12 +40,11 @@ foreach(arch ${archs})
set(buildGn core_${config}_${arch})
add_gn_target(${buildGn} ${config} ${arch}
- SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS INCLUDES MOC_PATH RSP_PREFIX
+ SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS INCLUDES MOC_PATH
)
resolve_target_includes(gnIncludes WebEngineCore)
get_forward_declaration_macro(forwardDeclarationMacro)
get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME)
- get_target_property(mocFilePath Qt6::moc IMPORTED_LOCATION)
if(QT_FEATURE_debug_and_release AND ("${config}" STREQUAL "Debug"))
set(qtWebEngineProcessName "${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}")
@@ -64,10 +63,6 @@ foreach(arch ${archs})
endif()
extend_gn_target(${buildGn}
- MOC_PATH
- ${mocFilePath}
- RSP_PREFIX
- src/core/${config}/${arch}
INCLUDES
${gnIncludes}
DEFINES
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index da1aa93f..81ebdce5 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -76,16 +76,12 @@ foreach(arch ${archs})
set(buildGn pdf_${config}_${arch})
add_gn_target(${buildGn} ${config} ${arch}
- SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS INCLUDES MOC_PATH RSP_PREFIX
+ SOURCES DEFINES CXX_COMPILE_OPTIONS C_COMPILE_OPTIONS INCLUDES MOC_PATH
)
resolve_target_includes(gnIncludes Pdf)
get_forward_declaration_macro(forwardDeclarationMacro)
extend_gn_target(${buildGn}
- MOC_PATH
- ${mocFilePath}
- RSP_PREFIX
- src/pdf/${config}/${arch}
INCLUDES
${gnIncludes}
)