Switch from QT to Slint
This commit is contained in:
parent
85be9fea57
commit
c7bb9f1f29
45 changed files with 10680 additions and 2815 deletions
|
@ -1,7 +1,44 @@
|
|||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(lali VERSION 0.1 LANGUAGES CXX)
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
project(lali LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(SLINT_FEATURE_RENDERER_SKIA ON)
|
||||
set(SLINT_FEATURE_RENDERER_SOFTWARE ON)
|
||||
|
||||
add_subdirectory(src)
|
||||
find_package(Slint QUIET)
|
||||
if (NOT Slint_FOUND)
|
||||
message("Slint could not be located in the CMake module search path. Downloading it from Git and building it locally")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
Slint
|
||||
GIT_REPOSITORY https://github.com/slint-ui/slint.git
|
||||
# `release/1` will auto-upgrade to the latest Slint >= 1.0.0 and < 2.0.0
|
||||
# `release/1.0` will auto-upgrade to the latest Slint >= 1.0.0 and < 1.1.0
|
||||
GIT_TAG release/1.8
|
||||
SOURCE_SUBDIR api/cpp
|
||||
)
|
||||
FetchContent_MakeAvailable(Slint)
|
||||
endif (NOT Slint_FOUND)
|
||||
|
||||
add_executable(lali src/main.cpp)
|
||||
target_include_directories(lali PRIVATE "external")
|
||||
target_link_libraries(lali PRIVATE Slint::Slint)
|
||||
slint_target_sources(
|
||||
lali ui/app-window.slint
|
||||
NAMESPACE ui
|
||||
LIBRARY_PATHS selenite=${CMAKE_CURRENT_SOURCE_DIR}/external/selenite/index.slint
|
||||
)
|
||||
|
||||
add_subdirectory(external/rei-json)
|
||||
|
||||
target_include_directories(lali PRIVATE "external/rei-json/include")
|
||||
target_link_libraries(lali PRIVATE rei-json)
|
||||
|
||||
target_link_libraries(lali PRIVATE crypto)
|
||||
target_link_libraries(lali PRIVATE ssl)
|
||||
|
||||
# On Windows, copy the Slint DLL next to the application binary so that it's found.
|
||||
if (WIN32)
|
||||
add_custom_command(TARGET lali POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:lali> $<TARGET_FILE_DIR:lali> COMMAND_EXPAND_LISTS)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue