CLion and Intellij in the same project

Hi,

Is there a way to run both CLion and Intellij on the same project?  I have a project that has a mix of C++ and Java code.  However, if I try to open both IDEs on the same project I get errors reported by the IDE and lots o annoying notifications to reload project.  Generally on reload much of the project structure gets lost.  It appears that CLion and Intellij stomp over each other's project settings.

Mike.

8
6 comments

Hi Michael.

Yes, there are some problems with simultaneous usage of CLion and IntelliJ IDEA.

We are going to provide CLion functionality as a plugin to IntelliJ IDEA in the future, but not in the nearest future.
Feel free to commant or upote a feature reuqest in the tracker: https://youtrack.jetbrains.com/issue/CPP-4141.
There are some difficult points for the integration CLion as a plugin to IntelliJ IDEA and we need to fully analyse what we can do to solve them.
We appreciate your patience!
2
Avatar
Permanently deleted user

What about compiling CLion to use ".clion" as a project directory instead of ",idea"? Wouldn't it solve the problem once and for all?

2

I need similar functionality for other JetBrains IDEs. I've tried to use AppCode alongside PyCharm, but the IDEs seem to clash over the same ".dea" directory. @Nil has a very good point about different project directory names across your IDEs. 

0
Avatar
Permanently deleted user

I've been struggling with this also. Saying IDEA will have a CLion plugin "one day" really doesn't help me today. Been waiting for that train since about 2004. I can see how Nil's suggestion may break your future plans for integration of the two IDEs but surely a patch to CLion to make the project directory name optionally configurable (with .idea the default) is quick to implement and won't break your future. At least this would allow me today to get back to building my app instead of hacking around not being able to have C++ and Java in the same git repo.

0
Avatar
Permanently deleted user

I have discovered a workaround that will probably suffice for my specific case (both C++ and Java versions of components within a single project) until this is properly fixed.

I had an existing IntelliJ multi-module Java project to which I wanted to add C++ components (lets call it <existing>).

I created a new CLion project (lets call it <temp>) with the same name as <existing>, but outside <existing>'s source tree. I then created a .clion directory within the root of <existing> (along side .idea).

I then moved the entire <temp>/.idea directory into <existing>/.clion (so I now have <existing>/.clion/.idea).

I then edited <existing>/.clion/.idea/misc.xml changing the project dir to reference $PROJECT_DIR$/.. .

<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/.." />

I think this can also be done by opening the CLion project (you have to open it as a new project as it has moved) and selecting Tools -> CMake -> Change Project Root.

If you are on a Mac and can't find <existing>/.clion when opening the project anew use:

CMD+SHIFT+G

 

0
Avatar
Permanently deleted user

I should have a PR for a patch implementing my earlier suggestion (against the IntelliJ Community JPS package) soon.

1

Please sign in to leave a comment.