-
进入工作空间/catkin_ws
-
打开终端,配置环境
source devel/setup.bash
-
在该终端运行clion.sh(clion.sh在clion安装目录下)
-
此时clion已打开,
File/Open
, 选择功能包的CMakeLists.txt,Open as Project
即可。 -
(可选)修改编译目录。
File/Settings.../Build,Execution,Deployment
-
令CMake options为
-DCATKIN_DEVEL_PREFIX:PATH=../devel
(编译生成的库文件目录); -
令Generation path为
../build
(编译过程中产生的文件目录)
-
出现的问题:
- 当打开某一功能包出现 Please either delete it manually or select another generation directory的提示,表明此包之前编译过,需要清除CMake缓存:
Tools-->CMake-->Reset cache and Reload project
详情参考官方文档