Is it possible to have cmake build file (CMakeLists.txt) not in root in CLion

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 01:47:22

问题


Is it possible to have cmake build file (CMakeLists.txt) not in root directory in CLion?

I am currently working on project where cmake build file is not in not in the root directory of a CLion project (in out/Debug directory). I want CLion to open root of this project, and use cmake from out/Debug.

Is is possible? EXAMPLE:

|- main.cpp
|- classs.cpp
|- class.h
|- build1
   |- CMakeLists.txt
|- build2
   |- CMakeLists.txt

This is a little bit unusual, but think of situation when cmake file is generated.

Also, it can be possible when two projects want to have separate make files and common sources.


回答1:


Just to clarify, CLION has solution for it.

Please do the following:

 use 'Welcome Screen | Open Project', point to CMakeLists.txt
 use 'Tools | CMake | Change Project Root', and point to the actual project's root.



回答2:


Long story short, I created a bug for that

https://youtrack.jetbrains.com/issue/CPP-2943

you can vote it you think it is useful



来源:https://stackoverflow.com/questions/29494009/is-it-possible-to-have-cmake-build-file-cmakelists-txt-not-in-root-in-clion

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!