2022-10-04 20:25:14 +00:00
|
|
|
cmake_minimum_required(VERSION 3.19)
|
|
|
|
project(Storybook)
|
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2023-04-14 08:18:56 +00:00
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
2022-10-14 10:53:04 +00:00
|
|
|
if (APPLE)
|
2024-09-03 16:45:59 +00:00
|
|
|
set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=11.0)
|
2022-10-14 10:53:04 +00:00
|
|
|
endif()
|
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
find_package(
|
|
|
|
Qt5
|
2023-10-03 15:43:35 +00:00
|
|
|
COMPONENTS Core Gui Quick QuickControls2 Test QuickTest Qml WebView
|
2022-10-04 20:25:14 +00:00
|
|
|
REQUIRED)
|
|
|
|
|
2023-04-14 08:18:56 +00:00
|
|
|
set(STATUSQ_BUILD_SANDBOX OFF)
|
|
|
|
set(STATUSQ_BUILD_SANITY_CHECKER OFF)
|
|
|
|
set(STATUSQ_BUILD_TESTS OFF)
|
|
|
|
add_subdirectory(../ui/StatusQ StatusQ)
|
2023-02-06 16:45:18 +00:00
|
|
|
|
2023-02-08 17:11:40 +00:00
|
|
|
file(GLOB_RECURSE CORE_QML_FILES
|
2023-04-14 08:18:56 +00:00
|
|
|
"../ui/app/*.qml" "../ui/imports/*.qml"
|
|
|
|
"../ui/app/*/qmldir" "../ui/imports/*/qmldir"
|
2023-02-08 17:11:40 +00:00
|
|
|
)
|
|
|
|
|
2023-04-14 08:18:56 +00:00
|
|
|
file(GLOB_RECURSE CORE_JS_FILES "../ui/app/*.js")
|
2022-12-06 12:15:15 +00:00
|
|
|
|
|
|
|
file(GLOB_RECURSE STORYBOOK_QML_FILES "stubs/*.qml" "mocks/*.qml" "pages/*.qml"
|
|
|
|
"src/*.qml" "src/qmldir")
|
|
|
|
|
|
|
|
file(GLOB_RECURSE TEST_QML_FILES "qmlTests/*.qml")
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-11-25 10:05:20 +00:00
|
|
|
set(PROJECT_LIB "${PROJECT_NAME}Lib")
|
|
|
|
|
|
|
|
add_library(${PROJECT_LIB}
|
|
|
|
cachecleaner.cpp cachecleaner.h
|
|
|
|
directorieswatcher.cpp directorieswatcher.h
|
2023-10-09 20:26:50 +00:00
|
|
|
directoryfileswatcher.cpp directoryfileswatcher.h
|
2022-11-25 10:05:20 +00:00
|
|
|
figmaio.cpp figmaio.h
|
|
|
|
figmalinks.cpp figmalinks.h
|
|
|
|
figmalinksmodel.cpp figmalinksmodel.h
|
|
|
|
modelutils.cpp modelutils.h
|
2023-07-31 12:21:14 +00:00
|
|
|
pagesmodel.h pagesmodel.cpp
|
2022-11-25 10:05:20 +00:00
|
|
|
sectionsdecoratormodel.cpp sectionsdecoratormodel.h
|
2023-10-10 13:42:50 +00:00
|
|
|
testsrunner.h testsrunner.cpp
|
2023-10-03 15:43:35 +00:00
|
|
|
systemutils.cpp systemutils.h
|
2022-11-25 10:05:20 +00:00
|
|
|
)
|
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
add_executable(
|
|
|
|
${PROJECT_NAME}
|
2022-10-13 14:25:15 +00:00
|
|
|
main.cpp
|
2023-07-31 12:21:14 +00:00
|
|
|
main.qml
|
2022-12-06 12:15:15 +00:00
|
|
|
${CORE_QML_FILES}
|
|
|
|
${CORE_JS_FILES}
|
|
|
|
${STORYBOOK_QML_FILES}
|
2023-03-01 12:17:06 +00:00
|
|
|
README.md
|
2024-05-10 14:26:50 +00:00
|
|
|
# Require for loading WalletConnect SDK;
|
|
|
|
# TODO #14696: remove this dependency
|
|
|
|
storybook-resources.qrc
|
2022-10-04 20:25:14 +00:00
|
|
|
)
|
|
|
|
|
2023-04-14 08:18:56 +00:00
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
|
|
QML_IMPORT_ROOT="${CMAKE_CURRENT_LIST_DIR}"
|
2023-05-19 16:07:50 +00:00
|
|
|
STATUSQ_MODULE_IMPORT_PATH="${STATUSQ_MODULE_IMPORT_PATH}"
|
|
|
|
$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>
|
|
|
|
)
|
2022-11-25 15:41:50 +00:00
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
target_link_libraries(
|
2023-10-03 15:43:35 +00:00
|
|
|
${PROJECT_LIB} PUBLIC Qt5::Core Qt5::Gui Qt5::Quick Qt5::QuickControls2 Qt5::WebView)
|
2023-04-14 08:18:56 +00:00
|
|
|
|
2022-11-25 10:05:20 +00:00
|
|
|
target_link_libraries(
|
2023-10-17 19:09:45 +00:00
|
|
|
${PROJECT_NAME} PRIVATE ${PROJECT_LIB})
|
2023-04-14 08:18:56 +00:00
|
|
|
|
|
|
|
add_dependencies(${PROJECT_NAME} StatusQ)
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2023-10-16 08:48:56 +00:00
|
|
|
enable_testing()
|
|
|
|
|
2023-09-28 08:11:47 +00:00
|
|
|
add_executable(
|
|
|
|
PagesValidator
|
|
|
|
validator_main.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(
|
2023-10-03 15:43:35 +00:00
|
|
|
PagesValidator PUBLIC Qt5::Core Qt5::Gui Qt5::Quick Qt5::QuickControls2 Qt5::WebView)
|
2023-09-28 08:11:47 +00:00
|
|
|
|
2023-10-16 08:48:56 +00:00
|
|
|
add_dependencies(PagesValidator StatusQ)
|
|
|
|
|
2023-09-28 08:11:47 +00:00
|
|
|
target_compile_definitions(PagesValidator PRIVATE
|
|
|
|
QML_IMPORT_ROOT="${CMAKE_CURRENT_LIST_DIR}"
|
|
|
|
STATUSQ_MODULE_IMPORT_PATH="${STATUSQ_MODULE_IMPORT_PATH}"
|
|
|
|
)
|
|
|
|
|
2023-10-16 08:48:56 +00:00
|
|
|
add_test(NAME PagesValidator COMMAND PagesValidator)
|
2022-11-25 10:05:20 +00:00
|
|
|
|
|
|
|
add_executable(SectionsDecoratorModelTest tests/tst_SectionsDecoratorModel.cpp)
|
|
|
|
target_link_libraries(SectionsDecoratorModelTest PRIVATE Qt5::Test ${PROJECT_LIB})
|
2022-11-16 13:37:23 +00:00
|
|
|
add_test(NAME SectionsDecoratorModelTest COMMAND SectionsDecoratorModelTest)
|
|
|
|
|
2023-10-09 20:26:50 +00:00
|
|
|
add_executable(DirectoryFilesWatcherTest tests/tst_DirectoryFilesWatcher.cpp)
|
|
|
|
target_link_libraries(DirectoryFilesWatcherTest PRIVATE Qt5::Test ${PROJECT_LIB})
|
|
|
|
add_test(NAME DirectoryFilesWatcherTest COMMAND DirectoryFilesWatcherTest)
|
|
|
|
|
2022-12-06 12:15:15 +00:00
|
|
|
add_executable(QmlTests
|
|
|
|
qmlTests/main.cpp
|
|
|
|
${TEST_QML_FILES})
|
2023-10-10 13:42:50 +00:00
|
|
|
|
|
|
|
add_dependencies(QmlTests StatusQ)
|
|
|
|
|
2023-04-14 08:18:56 +00:00
|
|
|
target_compile_definitions(QmlTests PRIVATE
|
|
|
|
QML_IMPORT_ROOT="${CMAKE_CURRENT_LIST_DIR}"
|
|
|
|
STATUSQ_MODULE_IMPORT_PATH="${STATUSQ_MODULE_IMPORT_PATH}"
|
|
|
|
QUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/qmlTests")
|
2023-04-05 11:10:44 +00:00
|
|
|
target_link_libraries(QmlTests PRIVATE Qt5::QuickTest Qt5::Qml ${PROJECT_LIB} SortFilterProxyModel)
|
2023-10-16 08:48:56 +00:00
|
|
|
add_test(NAME QmlTests COMMAND QmlTests -platform offscreen)
|
2022-12-06 12:15:15 +00:00
|
|
|
|
2022-11-10 20:32:36 +00:00
|
|
|
list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/app")
|
|
|
|
list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/imports")
|
2023-10-17 19:09:45 +00:00
|
|
|
list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/StatusQ/src")
|
2022-11-10 20:32:36 +00:00
|
|
|
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")
|
|
|
|
set(QML_IMPORT_PATH "${QML_DIRS}" CACHE STRING "Qt Creator extra QML import paths" FORCE)
|
2022-10-11 09:26:24 +00:00
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
if (APPLE)
|
|
|
|
find_library(AppKit AppKit)
|
|
|
|
find_library(Foundation Foundation)
|
2023-02-10 10:26:30 +00:00
|
|
|
target_link_libraries(${PROJECT_LIB} PRIVATE ${AppKit} ${Foundation})
|
2022-10-04 20:25:14 +00:00
|
|
|
endif()
|