cmake: Support tilde `~/` paths for `--install-prefix`.
Using the relatively new --install-prefix
, giving a path in the users home using the ~
notation does not work:
❯ cmake -S . -B build --install-prefix=~/.local/catch2
CMake Error: Absolute paths are required for --install-prefix
CMake Error: Run 'cmake --help' for all supported options.
The same works with -DCMAKE_INSTALL_PREFIX
:
❯ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=~/.local/catch2
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FLAG__ffile_prefix_map__home_mnoethe_Downloads_Catch2_3_1_1__
-- Performing Test HAVE_FLAG__ffile_prefix_map__home_mnoethe_Downloads_Catch2_3_1_1__ - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mnoethe/Downloads/Catch2-3.1.1/build
Would be nice if --install-prefix
also supported ~
.