A unified front end for the CMake ecosystem.
- User preferences are stored in
~/.config/cx/config.<ext>. Supported formats include JSON,TOML, YAML. - The project root is determined by looking for
CMakeLists.txtfiles in parent directories and picking the one that is closest to the filesystem root (that is not the nearest parent). - Build directory located at
~/.cache/cx/<md5 of project root>. cx configureinvokes CMake to create a build system.cx buildfrom anywhere in the source project invokescx configureifCMakeCache.txtdoes not exist and then builds thealltarget of the current directory. That may becmake --build <build_dir> --target <subdir>/allorcmake --build <build_dir>/<subdir>depending on the generator.cx testfrom anywhere in the source project invokescx buildunconditionally and then executes tests that are defined in the current directory and below withctest --test-dir <build_dir>/<subdir>.cx installfrom anywhere in the source project invokescx buildunconditionally and then installs targets that are defined in the current directory and below withcmake --install <build_dir>/<subdir>.cx openinvokescx configureifCMakeCache.txtdoes not exist and then opens the associated IDE of the generator if supported, like Xcode.cx cleandeletes the build directory.
Options are still limited. Contributions are welcome.
To install cx, run the following command:
go install github.com/purpleKarrot/cx@latestConfigure your shell to use cx completion:
# bash
source <(cx completion bash)
# fish
cx completion fish | source
# powershell
cx completion powershell | Out-String | Invoke-Expression
# zsh
source <(cx completion zsh)Create a configuration file to $XDG_CONFIG_HOME/cx/config.yaml:
generator: Ninja Multi-Config
config: Release