SWIG project, Clion does not allow to add classes or files in the target

已回答

I have a project that build a swig library.

In the CMakeLists.txt file, the target is defined with this command :
swig_add_library(myproject
        LANGUAGE python
        TYPE MODULE
        SOURCES ${CXX_SRCS}
)

I can build the project from CLion

When I want to add new files in the project, I want to use the menu on the project pane, right clicking on the project and selecting new C++ class. Unfortunately, the swig target is not available then. (and Clion select by default another target, so if the developper do not notice, the files would be added in the worng WMakeLists…). Now, I need to manually edit the CMakeLists.txt and add the C++ file names in the variable CXX_SRCS.
Is it possible to configure CLion so that the add C++ class with this project.

0

Hello!

Is it possible to configure CLion so that the add C++ class with this project.

There is no way to do that at the moment, unfortunately.

I've created a feature request about swig_add_library() - CPP-42398. Feel free to comment or upvote it. 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

请先登录再写评论。