refinements for path manipulation
I would love to write more portable shell command cmake targets. However, cmake's current primitives appear to vendor lock many things to UNIX environments.
EXPAND_TILDE
forces cmake-style paths with forward slashes, which break common CLI tools like Snyk. This matters when in terms of automating SCA and other linter-like commands.
Ideally, I would be able to run my build steps identically on remote CI/CD pipelines and locally, using simple cmake ... --target <target>
commands to invoke the steps. Unfortunately, things quickly break down when involving Windows components (physical Windows machines, VM's, Vagrant boxes, WSL, MSVC, cl, PowerShell, Command Prompt, Git Bash, Cygwin, etc.)
cmake_path()
forces cmake-style paths with forward sla>shes, which also breaks common CLI tools.
Also, a dedicated function to query the home directory in a portable way would be a fabulous convenience.
As a workaround, I am writing most of my cmake shell targets in another build system, rez, which wraps cmake. Ideally, I could ditch this wrapper and just use 100% cmake to define all my build steps in a portable way.