Skip to content

Commit

Permalink
Fix the template not starting on Windows
Browse files Browse the repository at this point in the history
Apply the changes from slint-ui/slint#2034 also
here.
  • Loading branch information
tronical committed Jan 6, 2023
1 parent b6259cd commit 9d79c80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.21)
project(my_application LANGUAGES CXX)

find_package(Slint QUIET)
Expand All @@ -17,3 +17,7 @@ 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)
# On Windows, copy the Slint DLL next to the application binary so that it's found.
if (WIN32)
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)
endif()

0 comments on commit 9d79c80

Please sign in to comment.