Windows: make run_xstudio.bat work from the build tree#259
Open
bdeluca wants to merge 1 commit into
Open
Conversation
run_xstudio.bat now sets PATH, XSTUDIO_ROOT, XSTUDIO_PLUGIN_PATH, XSTUDIO_PYTHONHOME and PYTHONPATH so xstudio.exe launches from the build tree without a fresh `cmake --install`. Required follow-on fixes to the build-tree staging of several resources: - cmake/macros.cmake: stage preferences to bin/preference on Windows (was share/xstudio/preference). Removes the Win32 special case so Windows now matches Linux, which already staged there. - src/embedded_python/src/embedded_python.cpp: Windows now honors an optional XSTUDIO_PYTHONHOME env var, overriding the install-layout- derived path (xstudio_root/../../bin/python3) which is wrong when XSTUDIO_ROOT points at the build tree. Unset = previous behavior. - python/CMakeLists.txt: Windows uses `cmake -E copy_directory` to merge the source xstudio package with the .pyd in site-packages. `setup.py install --prefix=C:/...` mangles forward-slash absolute paths on Windows (drive letter dropped, rest treated as relative to CWD), leaving site-packages with only the .pyd. New elseif(WIN32) branch; the Linux else() block is the same as before. - extern/quickfuture: add RUNTIME_OUTPUT_DIRECTORY so quickfuture.dll lands next to its qmldir at build time. LIBRARY_OUTPUT_DIRECTORY only controls the .lib on Windows; the DLL was going to extern/quickfuture/ where Qt couldn't find it when loading the QML module. RUNTIME_OUTPUT_DIRECTORY is a no-op for Linux shared libs. - extern/quickpromise: same DLL-next-to-qmldir fix, Win32-gated. All changes are Win32-gated or default to the old behavior when the new env var is unset. Linux and macOS builds unchanged. Install and package behavior unchanged. Signed-off-by: Ben de Luca <bdeluca@gmail.com>
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.
run_xstudio.batis the CMake-generated dev launcher that lets Windows developers runxstudio.exestraight from the build tree without acmake --installcycle. Today it only setsPATHto Qt's bin dir; everything elsexstudio.exeneeds at runtime (XSTUDIO_ROOT, plugin search path, Python home, PYTHONPATH) is missing or pointed at the install-layout locations, so the launcher can only be used after an install has populated${CMAKE_INSTALL_PREFIX}.This PR extends
run_xstudio.batto set the rest of the env soxstudio.exeruns against the build tree directly, plus the supporting fixes the build tree needed for that to work:run_xstudio.bat.in— setXSTUDIO_ROOT,XSTUDIO_PLUGIN_PATH,XSTUDIO_PYTHONHOME,PYTHONPATH; add vcpkg's bin toPATH.cmake/macros.cmake— stage preferences tobin/preferenceon Windows (wasshare/xstudio/preference), matching the Linux layoutXSTUDIO_ROOTexpects. Theinstall(FILES ... DESTINATION share/xstudio/preference)rule sits outside the changed branch, so the install target is unaffected on either platform.embedded_python.cpp— Windows now honours an optionalXSTUDIO_PYTHONHOMEenv var, overriding the install-layout-derived path. Unset = previous behaviour.python/CMakeLists.txt— Windows usescmake -E copy_directoryto populate site-packages.setup.py install --prefix=C:/...mangles the drive letter on Windows; the directory copy sidesteps it. Newelseif(WIN32)branch; the Linuxelse()is unchanged.extern/quickfuture/extern/quickpromise— addRUNTIME_OUTPUT_DIRECTORYso the QML plugin DLLs land next to theirqmldirat build time.LIBRARY_OUTPUT_DIRECTORYonly controls the.libon Windows.Linux / macOS impact
None. Every change is either Win32-gated or no-ops on non-Windows (setting
RUNTIME_OUTPUT_DIRECTORYon a Linux shared lib has no effect; theXSTUDIO_PYTHONHOMEenv var is only consulted on Windows; the preference staging change collapses a redundant Win32 branch into the path Linux already used).