- 1 Prerequisite
- 2 What are the types of The 'CMake' Command?
- 3 How to Use the 'CMake' Command?
- 4 Where are The 'CMake' Commands from?
- 5 General Commands
### install rust
# run the follow command if you install not rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# select 1 and enter
# open new terminal
### end install rust
### install ripgrep
cargo install ripgrep
### end install ripgrep
- From a software perspective, two broad categories of CMake and Generator commands
- From a functional perspective, several general types of commands, such as create generator, build and install program
git clone https://github.com/cnruby/w3h1_cmake.git basic_104
cd basic_104
git checkout basic_104
cmake -GNinja -Bbuild/
cmake --build build/ --verbose
cmake --help | more
# cmake -B build/ -G Ninja
cmake --help | rg '\-B'
cmake --help | rg '\-G'
# cmake --build build/ --verbose
cmake --help | rg '\-\-build'
cmake --help | rg '\-\-verbose'
cmake --help | rg '\-E'
cmake -E
cmake --install
cmake --build
# common command
# cmake --build build/ --verbose
# Build target 'clean' first, then build.
# cmake --build build/ --target clean
# cmake --build build/
cmake --build build/ --clean-first
cmake --build build/ --target clean
## help??
cmake --build build/ --target
# build tasks
cmake --build build/ --target help
# generator usage help
cmake --build build/ --target --help
cmake --build build/
cmake --build build/ -j 4
cmake --build build/ --clean-first -j 4
cmake --build build/ --verbose --clean-first -j 4
cmake --build build/ --target all
cmake --build build/ --clean-first --verbose
# None Debug Release RelWithDebInfo MinSizeRel ...
ccmake build/ -DCMAKE_BUILD_TYPE=MinSizeRel
cmake build/ -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake build/ -DCMAKE_VERBOSE_MAKEFILE=ON