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]

在這裏插入圖片描述

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