See the following usage of CMake:
$ cd binary_search
$ cmake --version
cmake version 3.24.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ cmake -B build
-- 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
-- Configuring done
-- Generating done
-- Build files have been written to: /home/.../projects/playground/binary_search/build
By default if -S
isn’t specified it assumes the current working directory. This is reasonable behavior that assists CLI usage.
However the same isn’t true for cmake-gui
when I try cmake-gui -B build
with CMake gui I get the following result:
As you can see it didn’t properly fill out the source/binary directory.
However when I try cmake-gui -S . -B build/
it works as expected:
I think cmake-gui
should be fixed to work like regular cmake
Thoughts?