-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
26 lines (24 loc) · 1.06 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
cmake_minimum_required(VERSION 3.21)
project(todo-app LANGUAGES CXX)
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
SOURCE_SUBDIR api/cpp
)
FetchContent_MakeAvailable(Slint)
endif (NOT Slint_FOUND)
add_executable(todo-app src/main.cpp)
target_link_libraries(todo-app PRIVATE Slint::Slint)
target_include_directories(todo-app PUBLIC build)
slint_target_sources(todo-app ui/app_window.slint)
# On Windows, copy the Slint DLL next to the application binary so that it's found.
if (WIN32)
add_custom_command(TARGET todo-app POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:todo-app> $<TARGET_FILE_DIR:todo-app> COMMAND_EXPAND_LISTS)
endif()