Generating definitions in wrong file if 2 files of the same name with the same class are present
Hi
I've got a weird problem. Here's my project structure:
I have a root CMakeLists that includes 4 subdirectories.
One is a library linked to another library that is linked to 2 executables.
In that one library used by the executables, I have a class A. That class is a parent class to 2 classes in the executables. Those classes have a generic name since they do generic things. In both of those executables, the class is named B. It is implemented in B.hpp and B.cpp. Both executables have those files and implement their own version of B.
The problem is that if I want to generation definitions in my .cpp file from the signature of the functions in my .hpp file when I implemented the version of B in my second executable, it generated those definitions in the .cpp file of the first executable.
Again, those executables are in their own subdirectory with their own CMakeLists. If I create the definitions for the second B manually, it works just fine. The application compiles and runs just fine. So CMake can handle it. But CLion can't.
I also didn't find any options that sounds like some sort of scoping for subprojects.
I don't know if this makes much sense. I can actually tell you what I'm doing if that's easier to follow than using generic placeholder for my subprojects and classes.
Thanks for your advice in advance
Please sign in to leave a comment.
Hi Robin,
Could you please create a ticket in our tracker with attached simple project with reproducer, so we could investigate the issue?
Of course. Thanks