Load/Reload CMake - Reload CMake Project

Load/Reload CMake - Reload CMake Project

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:
重新加载项目有两种选择:

  1. Reload changes - in this case, you reload the project once, and all the subsequent changes in CMakeLists.txt will also require reloading.
    在这种情况下,您需要重新加载项目一次,并且 CMakeLists.txt 中的所有后续更改也都需要重新加载。

  2. Enable Auto-reload - this option lets CLion silently reload the project on every change in your CMakeLists.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:
要在需要时手动重新加载项目,请使用以下选项之一:

  1. Reset Cache and Reload Project
    在这里插入图片描述

  2. On the main menu, choose File | Reload CMake Project or Tools | CMake | Reload CMake Project

在这里插入图片描述

在这里插入图片描述

  1. 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]

在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章