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)
|
|
|
|
|
2022-10-14 10:53:04 +00:00
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.14)
|
|
|
|
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
|
|
|
endif()
|
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
find_package(
|
|
|
|
Qt5
|
2022-12-06 12:15:15 +00:00
|
|
|
COMPONENTS Core Quick QuickControls2 Test QuickTest Qml
|
2022-10-04 20:25:14 +00:00
|
|
|
REQUIRED)
|
|
|
|
|
2023-02-06 16:45:18 +00:00
|
|
|
include (../ui/StatusQ/StatusQSources.cmake)
|
|
|
|
|
2022-12-06 12:15:15 +00:00
|
|
|
file(GLOB_RECURSE CORE_QML_FILES "../ui/StatusQ/*.qml" "../ui/app/*.qml" "../ui/imports/*.qml")
|
|
|
|
file(GLOB_RECURSE CORE_JS_FILES "../ui/StatusQ/*.js" "../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")
|
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
|
|
|
|
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
|
2023-02-06 09:09:14 +00:00
|
|
|
${STATUSQ_HEADERS} ${STATUSQ_SOURCES}
|
2022-11-25 10:05:20 +00:00
|
|
|
)
|
|
|
|
|
2023-02-06 09:09:14 +00:00
|
|
|
target_include_directories(${PROJECT_LIB} PUBLIC ${STATUSQ_DIR}/include)
|
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
add_executable(
|
|
|
|
${PROJECT_NAME}
|
2022-10-13 14:25:15 +00:00
|
|
|
main.cpp
|
2022-11-25 10:05:20 +00:00
|
|
|
main.qml PagesModel.qml
|
2022-12-06 12:15:15 +00:00
|
|
|
${CORE_QML_FILES}
|
|
|
|
${CORE_JS_FILES}
|
|
|
|
${STORYBOOK_QML_FILES}
|
2022-11-25 15:41:50 +00:00
|
|
|
figma.json
|
2022-10-04 20:25:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(${PROJECT_NAME}
|
2022-11-17 06:17:03 +00:00
|
|
|
PRIVATE QML_IMPORT_ROOT="${CMAKE_CURRENT_LIST_DIR}")
|
2022-11-25 15:41:50 +00:00
|
|
|
|
2022-10-04 20:25:14 +00:00
|
|
|
target_link_libraries(
|
2022-11-25 10:05:20 +00:00
|
|
|
${PROJECT_LIB} PUBLIC Qt5::Core Qt5::Quick Qt5::QuickControls2)
|
|
|
|
target_link_libraries(
|
|
|
|
${PROJECT_NAME} PRIVATE ${PROJECT_LIB} SortFilterProxyModel)
|
2022-10-04 20:25:14 +00:00
|
|
|
|
2022-11-16 13:37:23 +00:00
|
|
|
enable_testing()
|
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)
|
|
|
|
|
2022-11-25 10:05:20 +00:00
|
|
|
add_executable(FigmaDecoratorModelTest tests/tst_FigmaDecoratorModel.cpp)
|
|
|
|
target_link_libraries(FigmaDecoratorModelTest PRIVATE Qt5::Test ${PROJECT_LIB})
|
2022-11-25 15:41:50 +00:00
|
|
|
add_test(NAME FigmaModelTest COMMAND FigmaModelTest)
|
|
|
|
|
2022-12-06 12:15:15 +00:00
|
|
|
add_executable(QmlTests
|
|
|
|
qmlTests/main.cpp
|
2022-12-13 16:18:02 +00:00
|
|
|
qmlTests/src/TextUtils.cpp qmlTests/src/TextUtils.h
|
2022-12-06 12:15:15 +00:00
|
|
|
${TEST_QML_FILES})
|
|
|
|
target_compile_definitions(QmlTests
|
|
|
|
PRIVATE QML_IMPORT_ROOT="${CMAKE_CURRENT_LIST_DIR}"
|
|
|
|
PRIVATE -DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/qmlTests")
|
|
|
|
target_link_libraries(QmlTests PRIVATE Qt5::QuickTest Qt5::Qml)
|
|
|
|
add_test(NAME QmlTests COMMAND QmlTests)
|
|
|
|
|
2022-11-10 20:32:36 +00:00
|
|
|
list(APPEND QML_DIRS "${CMAKE_SOURCE_DIR}/../ui/StatusQ/src")
|
|
|
|
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)
|
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()
|
|
|
|
|
|
|
|
add_subdirectory(../ui/StatusQ/vendor/SortFilterProxyModel ./SortFilterProxyModel)
|