diff --git a/CMakeLists.txt b/CMakeLists.txt index e076fc0..06e365f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ set(WITH_WINPR_TOOLS OFF CACHE BOOL "" FORCE) add_subdirectory(third_party/FreeRDP EXCLUDE_FROM_ALL) -add_executable(orbithub +add_executable(orbithub WIN32 src/about_dialog.cpp src/about_dialog.h src/app_icon.cpp @@ -162,6 +162,25 @@ if(WIN32) install(FILES "$" DESTINATION "${CMAKE_INSTALL_BINDIR}/sqldrivers" ) + + # vcpkg's qtbase[sql-sqlite] links the plugin against vcpkg's own + # shared sqlite3 port rather than bundling SQLite into the plugin, + # so the plugin fails to load ("can not load requested driver + # 'QSQLITE'") unless sqlite3.dll also ships next to the executable. + find_file(ORBITHUB_SQLITE3_DLL + NAMES sqlite3.dll + PATHS ${CMAKE_PREFIX_PATH} + PATH_SUFFIXES bin + ) + if(ORBITHUB_SQLITE3_DLL) + add_custom_command(TARGET orbithub POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${ORBITHUB_SQLITE3_DLL}" + "$/" + COMMENT "Deploying sqlite3.dll (Qt SQLite plugin dependency)" + ) + install(FILES "${ORBITHUB_SQLITE3_DLL}" DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif() endif() endif()