1. Problem
After the content in set() in CMakeLists.txt is changed, click Auto Refresh cmake and it will actually refresh.
2. Solution
1.Method 1
Add FORCE in set(),
for example:
set(cross_compiler FORCE OFF)
2.Method 2
In CLion, click "CMake" on the left or below,
click the settings icon on the left side of the pop-up bar, and
click "Reset Cache and Reload Project"
3. Method three
Compile directly in the terminal
cmake -S . -B build
cmake --build build/