summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-02-05 11:44:04 +0100
committerMichal Klocek <michal.klocek@qt.io>2021-05-19 17:52:21 +0200
commit92dce39f771a75bf889ef780a1f631c43ddc502f (patch)
treef7de73f0b0cda5fe15c8968c3d2acfd04be90152 /cmake
parent85e7fa7f9a002e7c0708af7a99d165a23753ecf4 (diff)
Add QtWebEngineCore module cmake build
Create QtWebEngineCore, QtWebEngineProcess and drive headers sync from the libs project. Main project build should not generate any header files, since the logic in qtbase assumes fixed QT_BUILD_DIR, which is by default CMAKE_BINARY_DIR for prefix builds. Drive all syncqt calls from the libs project and leave the main build just for the feature evolution and the build summary reporting. This fixes header installation issues, however this patch requires also sync.profile update which is done later, to keep the qmake build still functional. Note this patch only adds debug builds for linux. Task-number: QTBUG-91760 Change-Id: I516c26206baa1cf6b966629a694dadce7f79dbec Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Functions.cmake39
1 files changed, 39 insertions, 0 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 89dff400f..6f69bb792 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -56,3 +56,42 @@ function(get_qt_features outList module)
set(${outList} "${${outList}}" "${_featureList}" PARENT_SCOPE)
endif()
endfunction()
+
+function(get_configure_mode configureMode)
+ if (NOT DEFINED WEBENGINE_REPO_BUILD)
+ set(${configureMode} NO_CONFIG_HEADER_FILE NO_SYNC_QT PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(make_config_for_gn target configFileName)
+ if(NOT DEFINED WEBENGINE_REPO_BUILD)
+ file(GENERATE
+ OUTPUT ${configFileName}.cxx.cmake
+ CONTENT [[
+ set(GN_INCLUDES_IN $<TARGET_PROPERTY:INCLUDE_DIRECTORIES>)
+ set(GN_DEFINES_IN $<TARGET_PROPERTY:COMPILE_DEFINITIONS>)
+ set(GN_LIBS_IN $<TARGET_PROPERTY:LINK_LIBRARIES>)
+ set(GN_LINK_OPTIONS_IN $<TARGET_PROPERTY:LINK_OPTIONS>)
+ set(GN_CXX_COMPILE_OPTIONS_IN $<TARGET_PROPERTY:COMPILE_OPTIONS>)]]
+ CONDITION $<COMPILE_LANGUAGE:CXX>
+ TARGET ${target})
+ file(GENERATE
+ OUTPUT ${configFileName}.c.cmake
+ CONTENT [[ set(GN_C_COMPILE_OPTIONS_IN $<TARGET_PROPERTY:COMPILE_OPTIONS>)]]
+ CONDITION $<COMPILE_LANGUAGE:C>
+ TARGET ${target})
+ endif()
+endfunction()
+
+function(make_install_only target)
+ if(NOT DEFINED WEBENGINE_REPO_BUILD)
+ set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL TRUE)
+ endif()
+endfunction()
+
+macro(assertRunAsTopLevelBuild condition)
+ if (NOT DEFINED WEBENGINE_REPO_BUILD AND ${condition})
+ message(FATAL_ERROR "This cmake file should run as top level build.")
+ return()
+ endif()
+endmacro()