summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/Functions.cmake20
2 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ecea7f0fe..dabf07b3d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,6 +154,11 @@ externalproject_add(libs
COMMAND ${CMAKE_COMMAND} -E remove_directory ../mkspecs
)
+# Ensure the libs project is reconfigured if the root project is reconfigured, so that the
+# correct CMake and qmake support files are used when building examples, rather than
+# using the incomplete support files created by the root project.
+qt_internal_add_external_project_dependency_to_root_project(libs)
+
if(QT_BUILD_EXAMPLES AND BUILD_SHARED_LIBS)
externalproject_add(qtwebengine_examples
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/examples
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index c61e403be..d29ed7a40 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -328,3 +328,23 @@ function(extend_target_with_gn_objects target config cmakeFile stampFile)
)
endif()
endfunction()
+
+function(qt_internal_add_external_project_dependency_to_root_project name)
+ set(independent_args)
+ cmake_policy(PUSH)
+ if(POLICY CMP0114)
+ set(independent_args INDEPENDENT TRUE)
+ cmake_policy(SET CMP0114 NEW)
+ endif()
+
+ # Force configure step to re-run after we configure the root project
+ set(reconfigure_check_file ${CMAKE_CURRENT_BINARY_DIR}/reconfigure_${name}.stamp)
+ file(TOUCH ${reconfigure_check_file})
+ ExternalProject_Add_Step(${name} reconfigure-check
+ DEPENDERS configure
+ DEPENDS ${reconfigure_check_file}
+ ${independent_args}
+ )
+
+ cmake_policy(POP)
+endfunction()