mirror of
https://github.com/allankoechke/slint-cpp-template.git
synced 2026-11-30 10:58:21 +00:00
20 lines
628 B
CMake
20 lines
628 B
CMake
cmake_minimum_required(VERSION 3.19)
|
|
project(my_application 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
|
|
GIT_TAG v0.2.0
|
|
SOURCE_SUBDIR api/cpp
|
|
)
|
|
FetchContent_MakeAvailable(Slint)
|
|
endif (NOT Slint_FOUND)
|
|
|
|
add_executable(my_application src/main.cpp)
|
|
target_link_libraries(my_application PRIVATE Slint::Slint)
|
|
slint_target_sources(my_application ui/appwindow.slint)
|