Skip to content

Commit 9d79c80

Browse files
committed
Fix the template not starting on Windows
Apply the changes from slint-ui/slint#2034 also here.
1 parent b6259cd commit 9d79c80

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.19)
1+
cmake_minimum_required(VERSION 3.21)
22
project(my_application LANGUAGES CXX)
33

44
find_package(Slint QUIET)
@@ -17,3 +17,7 @@ endif (NOT Slint_FOUND)
1717
add_executable(my_application src/main.cpp)
1818
target_link_libraries(my_application PRIVATE Slint::Slint)
1919
slint_target_sources(my_application ui/appwindow.slint)
20+
# On Windows, copy the Slint DLL next to the application binary so that it's found.
21+
if (WIN32)
22+
add_custom_command(TARGET my_application POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:my_application> $<TARGET_FILE_DIR:my_application> COMMAND_EXPAND_LISTS)
23+
endif()

0 commit comments

Comments
 (0)