Load/Reload CMake - Reload CMake Project
Load/reload CMake
https://www.jetbrains.com/help/clion/reloading-project.html
When you make changes in the CMakeLists.txt
file, CLion prompts you to reload the project.
当您在 CMakeLists.txt
文件中进行更改时,CLion 会提示您重新加载项目。
There are two options for project reload:
重新加载项目有两种选择:
-
Reload changes
- in this case, you reload the project once, and all the subsequent changes inCMakeLists.txt
will also require reloading.
在这种情况下,您需要重新加载项目一次,并且CMakeLists.txt
中的所有后续更改也都需要重新加载。 -
Enable Auto-reload
- this option lets CLion silently reload the project on every change in yourCMakeLists.txt
.
使用此选项,CLion 可以在CMakeLists.txt
中的每次更改时以静默方式重新加载项目。
This is similar to selecting the Automatically reload CMake project on editing
checkbox in Settings / Preferences | Build, Execution, Deployment | CMake:
1. Automatically reload CMake project on editing
File -> Settings -> Build, Execution, Deployment
2. Reload a project
To reload a project manually when needed, use one of the following options:
要在需要时手动重新加载项目,请使用以下选项之一:
- Reset Cache and Reload Project
- On the main menu, choose
File | Reload CMake Project
orTools | CMake | Reload CMake Project
- In CMake tool window, click icons.
3. CMake tool window
View -> Tool Windows -> CMake
/home/yongqiang/software/clion-2019.1.4/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/yongqiang/CLionProjects/yongqiang
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yongqiang/CLionProjects/yongqiang/cmake-build-debug
[Finished]
4. Reload CMake Project
删除 cmake-build-debug
目录,Reload CMake Project
,成功更新主工程 cmake 信息。
/home/yongqiang/software/clion-2019.1.4/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/yongqiang/CLionProjects/yongqiang
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yongqiang/CLionProjects/yongqiang/cmake-build-debug
[Finished]
References
[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/