From f3ea7f12a326071144a042ef0e060693e9b9ea4c Mon Sep 17 00:00:00 2001 From: Keith Smith Date: Tue, 8 Sep 2026 08:27:50 -0600 Subject: [PATCH] Windows: deploy sqlite3.dll and mark orbithub as a GUI (WIN32) executable Two more Windows launch issues found alongside the Qt plugin deployment: vcpkg's qtbase[sql-sqlite] links the QSQLITE driver plugin against vcpkg's own shared sqlite3 port rather than bundling it, so the plugin was found but failed to load without sqlite3.dll alongside the executable. Separately, plain add_executable() defaults to the console subsystem on Windows, so a command-prompt window appeared behind the GUI on every launch; add_executable needs the WIN32 keyword to mark it as a GUI app (a no-op on other platforms). Co-Authored-By: Claude Sonnet 5 --- CMakeLists.txt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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()