[salome-med-fichier] Tolerate spaces in paths. - #51901
Conversation
Other changes: * Merge the HDF5 patches together. * Change "comment out" patch changes into deletions to reduce the patch size. * Rename "other fixes" patch to describe what it does.
| INSTALL(PROGRAMS ${PROJECT_BINARY_DIR}/xmdump2 ${PROJECT_BINARY_DIR}/xmdump3 ${PROJECT_BINARY_DIR}/xmdump4 DESTINATION bin) | ||
| -INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink mdump4 mdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") | ||
| -INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink xmdump4 xmdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") | ||
| +INSTALL(CODE "FILE(INSTALL \"${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/mdump4${CMAKE_EXECUTABLE_SUFFIX}\" DESTINATION \"${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin\" RENAME \"mdump${CMAKE_EXECUTABLE_SUFFIX}\")") |
There was a problem hiding this comment.
I considered COPY_FILE which would have been clearer but that needs CMake 3.21+ and we support 3.18 (for now)
There was a problem hiding this comment.
AFAIU you can safely assume a recent version of CMake when INSTALL happens during port build (with vcpkg controlled CMake). Using exported or cached binary artifacts is where the low end matters. (And then there is upstreaming...)
There was a problem hiding this comment.
I wasn't positive in which context INSTALL(CODE ran so I decided to be paranoid.
There was a problem hiding this comment.
Pull request overview
This PR updates the salome-med-fichier port to better tolerate tool paths containing spaces (notably during CMake install-time scripting), while also consolidating/renaming patching to reduce patch size and complexity.
Changes:
- Bump
salome-med-fichiertoport-version: 4and update the versions database entries accordingly. - Replace install-time symlink creation / unquoted tool invocations with more robust quoting and install-time copy/rename logic.
- Consolidate HDF5-related patching (merge prior patches) and add Windows
<io.h>includes where needed.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| versions/s-/salome-med-fichier.json | Adds the new port-version: 4 git-tree entry for salome-med-fichier. |
| versions/baseline.json | Updates the baseline for salome-med-fichier to port-version: 4. |
| ports/salome-med-fichier/vcpkg.json | Bumps the port’s port-version to 4. |
| ports/salome-med-fichier/portfile.cmake | Switches to the new patch set (merged/renamed) and applies the new install-path quoting patch. |
| ports/salome-med-fichier/quote-paths-in-install-code.diff | Quotes PYTHON_EXECUTABLE during install-time execution and replaces symlink creation with FILE(INSTALL ... RENAME ...). |
| ports/salome-med-fichier/include-io.patch | Adds <io.h> includes for Windows builds. |
| ports/salome-med-fichier/hdf5.patch | Consolidates HDF5 adjustments and updates multiple HDF5 API calls/types for compatibility. |
| ports/salome-med-fichier/hdf5-2.patch | Removes the now-redundant second HDF5 patch after consolidation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Other changes:
file(INSTALLrather thanexecute_process(${CMAKE_COMMAND} -E copy. (This made getting logs for what happened easier because it's only 1 level of stacking rather than 2.)