status-desktop/storybook/CMakeLists.txt
Stefan 691de11211 fix(Wallet) network selection and unify network implementations
Major changes:

- Don't allow empty network selection. End up using the nim model
  directly instead because of individual row changes issues
  encountered with nim models
- Made the clone model a generic implementation to be used in other
places where we need to clone a model: ReceiveModal,
AddEditSavedAddressPopup
- Use cloned model as alternative to NetworksExtraStoreProxy in
  ReceiveModal
- Added tristate support to our generic checkbox control
- UX improvements as per design
- Fix save address tests naming and zero address issue
- Various fixes

Notes:
- Failed to make NetworkSelectPopup follow ground-truth: show partially
  checked as user intention until the network is selected in the
  source model. Got stuck on nim models not being stable models and
  report wrong entry change when reset. Tried sorting and only updating
  changes without reset but it didn't work.
- Moved grouped property SingleSelectionInfo to its own file from
  an inline component after finding out that it fails to load on Linux
  with error "Cannot assign to property of unknown type: "*".".
  It works on MacOS as expected

Closes: #10119
2023-04-20 19:34:24 +02:00

114 lines
3.5 KiB
CMake

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)
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)
if (APPLE)
set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.14)
endif()
find_package(
Qt5
COMPONENTS Core Gui Quick QuickControls2 Test QuickTest Qml
REQUIRED)
set(STATUSQ_BUILD_SANDBOX OFF)
set(STATUSQ_BUILD_SANITY_CHECKER OFF)
set(STATUSQ_BUILD_TESTS OFF)
add_subdirectory(../ui/StatusQ StatusQ)
file(GLOB_RECURSE CORE_QML_FILES
"../ui/app/*.qml" "../ui/imports/*.qml"
"../ui/app/*/qmldir" "../ui/imports/*/qmldir"
)
file(GLOB_RECURSE CORE_JS_FILES "../ui/app/*.js")
file(GLOB_RECURSE STORYBOOK_QML_FILES "stubs/*.qml" "mocks/*.qml" "pages/*.qml"
"src/*.qml" "src/qmldir")
file(GLOB_RECURSE TEST_QML_FILES "qmlTests/*.qml")
set(PROJECT_LIB "${PROJECT_NAME}Lib")
add_library(${PROJECT_LIB}
cachecleaner.cpp cachecleaner.h
directorieswatcher.cpp directorieswatcher.h
figmadecoratormodel.cpp figmadecoratormodel.h
figmaio.cpp figmaio.h
figmalinks.cpp figmalinks.h
figmalinksmodel.cpp figmalinksmodel.h
figmalinkssource.cpp figmalinkssource.h
modelutils.cpp modelutils.h
sectionsdecoratormodel.cpp sectionsdecoratormodel.h
)
add_executable(
${PROJECT_NAME}
main.cpp
main.qml PagesModel.qml
${CORE_QML_FILES}
${CORE_JS_FILES}
${STORYBOOK_QML_FILES}
figma.json
README.md
)
target_compile_definitions(${PROJECT_NAME} PRIVATE
QML_IMPORT_ROOT="${CMAKE_CURRENT_LIST_DIR}"
STATUSQ_MODULE_IMPORT_PATH="${STATUSQ_MODULE_IMPORT_PATH}")
target_link_libraries(
${PROJECT_LIB} PUBLIC Qt5::Core Qt5::Gui Qt5::Quick Qt5::QuickControls2)
target_link_libraries(
${PROJECT_NAME} PRIVATE ${PROJECT_LIB})
add_dependencies(${PROJECT_NAME} StatusQ)
enable_testing()
add_executable(SectionsDecoratorModelTest tests/tst_SectionsDecoratorModel.cpp)
target_link_libraries(SectionsDecoratorModelTest PRIVATE Qt5::Test ${PROJECT_LIB})
add_test(NAME SectionsDecoratorModelTest COMMAND SectionsDecoratorModelTest)
add_executable(FigmaDecoratorModelTest tests/tst_FigmaDecoratorModel.cpp)
target_link_libraries(FigmaDecoratorModelTest PRIVATE Qt5::Test ${PROJECT_LIB})
add_test(NAME FigmaModelTest COMMAND FigmaModelTest)
add_executable(QmlTests
qmlTests/main.cpp
qmlTests/src/TextUtils.cpp qmlTests/src/TextUtils.h
${TEST_QML_FILES})
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")
target_link_libraries(QmlTests PRIVATE Qt5::QuickTest Qt5::Qml ${PROJECT_LIB} SortFilterProxyModel)
add_test(NAME QmlTests COMMAND QmlTests)
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}/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)
if (APPLE)
find_library(AppKit AppKit)
find_library(Foundation Foundation)
target_link_libraries(${PROJECT_LIB} PRIVATE ${AppKit} ${Foundation})
endif()