this file does not belong to any project target

Answered

Cannot implement code navigation. My project structure is as follows:

cmakelists.txt is in the build folder, and the source code is in the src folder.

The ExternalProject_Add function is used in the top level build/cmakelists.txt , resulting in no code navigation function.

 

What should I configure so that clion can have the code navigation function.

 

0
3 comments

Hello!

First, when in CLion you open a folder which doesn't contain CMakeLists.txt, you need to select CMakeLists.txt in the Project tool window, right-click and select "Load CMake Project".

Secondly, ExternalProject_Add is not properly supported in CLion for now - https://youtrack.jetbrains.com/issue/CPP-252. The thing is that ExternalProject_Add doesn't provide any information about the project which it loads - we can't even get the information about the source files of the external project. Feel free to comment or upvote the issue in order to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

0

Even if I use local code in ExternalProject_Add .Clion also does not support the code navigation.Thank you!

0

Yes, that's the case now, because ExternalProject_Add is not properly supported.

0

Please sign in to leave a comment.