CMake Error: Unknown argument --clean-first

Viewed 2310

When running the follow CMake command, I am receiving an error. I am working with CMake version 3.20.5.

cmake --clean-first ./src/basis_universal/CMakeLists.txt

CMake Error: Unknown argument --clean-first

However, --clean-first appears to be supported.

1 Answers

Just to make it abundantly clear to you... typically there are 2 steps you take in any cmake project... configuration and building.

In the configuration step, CMake looks for the files on your system, the compiler, etc. and prepares everything for building.

The building step of actually turning your code into an executable is a second, separate step.

When you run

cmake --clean-first ./src/basis_universal/CMakeLists.txt

you are just configuring your project. The --clean-first command is not available during configuration.

After configuration, you need to build your project. In that step, you can use the --clean-first option.

Related