Align Windows dev tree with install layout for runtime resource discovery#261
Open
OlafRocket wants to merge 1 commit into
Open
Conversation
Plugin DLLs, fonts, OCIO configs, snippets, Python plugins, and the
QuickFuture/QuickPromise QML modules now land in build/share/xstudio/...
on Windows, matching the install layout that xstudio_root() expects.
Fixes the FreeType crash and the "module could not be found" plugin
load failures when running build/run_xstudio.bat from a fresh build.
- cmake/macros.cmake: Windows branches in add_resource, add_font, and
add_python_plugin. default_plugin_options uses RUNTIME_OUTPUT_DIRECTORY
on Windows so plugin .dlls link directly into share/xstudio/plugin/
(no POST_BUILD copy; .pdb stays next to the .dll for debuggers).
- extern/quickfuture, extern/quickpromise: Windows .dll and QML output
routed to share/xstudio/plugin/qml/...
- share/snippets/CMakeLists.txt: add_snip targets share/xstudio/snippets/
on Windows.
- src/launch/xstudio/src/run_xstudio.bat.in: prepend vcpkg's bin/ to PATH
so plugin transitive dependencies (avcodec, OpenColorIO, etc.) load.
- src/plugin_manager/test/CMakeLists.txt: remove dead
set_target_properties block (the ${name} variable was undefined;
silent no-op).
macOS and Linux branches untouched. install() rules unchanged.
Signed-off-by: Olaf Razzoli <olaf.razzoli@gmail.com>
b7a6f44 to
bcaea97
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[ Align Windows dev tree with install layout for runtime resource discovery ]
Linked issues
None.
Summarize your change.
Aligns the Windows build tree with the install layout for all resources
that xstudio looks up via
xstudio_root()— fonts, OCIO configs,snippets, plugin DLLs, third-party QML modules, and Python plugins.
Adds vcpkg's bin/ to the dev launcher's PATH so plugin DLL dependencies
resolve.
Describe the reason for the change.
Running
build\run_xstudio.batfrom a fresh build on Windows crasheswith exit code 0xC0000005 after FreeType fails to load a font, preceded
by six "module could not be found" warnings from the plugin loader.
Root causes:
xstudio_root()on Windows derives<exe-grandparent>/share/xstudio,matching the install layout. The 1.2.0 build-system changes migrated
plugin DLLs and preferences to that layout in the build tree, but
fonts, OCIO configs, snippets, third-party QML modules, and Python
plugins were left at
build/bin/..., where the runtime no longerlooks.
Plugin DLLs link against vcpkg-built deps (avcodec, OpenColorIO,
OpenImageIO, libtiff). At install time vcpkg's applocal pass copies
these into
<prefix>/bin/. At build time nothing does —build/bin/has only xstudio's own outputs.
This PR completes the migration started by the 1.2.0 build-system
changes and points the dev launcher at vcpkg's bin/ so plugin deps
resolve at load time.
Describe what you have tested and on which operating system.
Tested on Windows 10 Pro x64 with Visual Studio 2022 (MSVC v14.44.x),
Qt 6.5.3 (msvc2019_64), vcpkg, Ninja generator (preset
WinNinjaReleaseLocal):
build/: cmake configure + ninja build succeed.build\run_xstudio.batlaunches xstudio fully; main window opens.LoadLibrary"module could not be found" warnings in the log.ERROR::FREETYPE: Failed to load fontcrash.cmake --build build --target packagesucceeds; the staged installtree at
_CPack_Packages/.../xSTUDIO-1.2.0-win64/and the generatedinstaller
.execontain the same files at the same paths as beforethis PR.
macOS and Linux: not retested as those code paths are unchanged. All
new branches are guarded with
if(WIN32)(or are inside existingif(WIN32)blocks). The macOS bundle assembly and Linuxbuild/bin/layouts are byte-identical to current develop.
Add a list of changes, and note any that might need special attention during the review.
cmake/macros.cmake:add_resource: Windows branch copies toshare/xstudio/${resource_type}/.add_font: Windows branch copies toshare/xstudio/fonts/.default_plugin_options: Windows usesRUNTIME_OUTPUT_DIRECTORYfor the plugin
.dll, landing it directly atshare/xstudio/plugin/. The previous POST_BUILD copy increate_plugin_with_aliasis now redundant and removed.add_python_plugin: Windows branch copies plugin dir toshare/xstudio/plugin-python/.extern/quickfuture/CMakeLists.txt: Windows branches for the.dllRUNTIME_OUTPUT_DIRECTORYand theQML_DEST_DIR, both targetingshare/xstudio/plugin/qml/QuickFuture/. (QuickFuture'sqmldirdeclares
plugin quickfuture, so the.dllmust co-locate withqmldir.)extern/quickpromise/CMakeLists.txt: Windows branch forQML_DEST_DIRtoshare/xstudio/plugin/qml/QuickPromise/. The.dlllocation is left as-is —qmldiris pure-QML with no plugindirective.
share/snippets/CMakeLists.txt:add_snipmacro choosesshare/xstudio/snippets/on Windows.src/launch/xstudio/src/run_xstudio.bat.in: vcpkg's bin/ prependedto PATH (between Qt's bin and
%~dp0bin).src/launch/xstudio/src/CMakeLists.txt: expose_vcpkg_bin_dirtoconfigure_filefor use in the launcher bat.src/plugin_manager/test/CMakeLists.txt: drive-by cleanup — removeda stranded
set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ...)where${name}was undefined inthis file (silent no-op, copy-paste leftover).
if(WIN32)block or anelseif(WIN32)branch.install(...)rules are also unchanged on every platform, so the packaged installer is byte-identical to before (verified via--target packagediff).