From 0828787b4ddbdd3ec95caaf5d14606fdfa39c7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Wed, 23 Oct 2024 16:43:50 +0200 Subject: [PATCH] Storybook: switch to determine how to resolve stores' paths in QtCreator Closes: #16582 --- storybook/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storybook/CMakeLists.txt b/storybook/CMakeLists.txt index 621b536b2c..d2e153bdca 100644 --- a/storybook/CMakeLists.txt +++ b/storybook/CMakeLists.txt @@ -117,14 +117,21 @@ target_compile_definitions(QmlTests PRIVATE target_link_libraries(QmlTests PRIVATE Qt5::QuickTest Qt5::Qml ${PROJECT_LIB} SortFilterProxyModel) add_test(NAME QmlTests COMMAND QmlTests -platform offscreen) +set(OVERRIDE_STORE_PATHS_WITH_STUBS_IN_QTCREATOR OFF CACHE BOOL + "Resolve store components as stubs instead of actual ones in QtCreator") + list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/app") list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/imports") list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/StatusQ") list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/StatusQ/src") list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/src") list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/pages") -list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/stubs") list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/mocks") + +if (OVERRIDE_STORE_PATHS_WITH_STUBS_IN_QTCREATOR) + list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/stubs") +endif() + set(QML_IMPORT_PATH "${QML_DIRS}" CACHE STRING "Qt Creator extra QML import paths" FORCE) if (APPLE)