Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Why is one subproject shown but not another?



  • I have a simple Qt 5 project using CMake, which I'm just starting to learn. I'm on a Mac.

    I have a parent project, into which I want to incorporate two libs statically. There's a C lib, and then a C++ lib that wraps it (the Paho MQTT libs). I guess in the end I only need the C++ one...

    Yes those are directory names.

    And yes those are directory names, despite the .c/.cpp extensions. I have the C lib building and linking into the application, and it works. Now I'm trying to build the C++ wrapper for it, and have encountered two problems.

    1. Even though I've added it to the top-level CMakeLists.txt file with add_subdirectory, it doesn't appear in the project tree. But the C lib, added the same way, does. I know it's getting processed, because it issues a build-failure string about problem #2 below.

    2. The C++ wrapper build fails because it can't find the C lib. The top-level Qt project builds into a library outside the source, per its default. The C libs get deposited into that structure. But I don't know how to communicate that to the C++ wrapper build, whose CMakeLists.txt seems to make some incompatible location assumptions. I don't know how anyone would be able to help me on that without my pasting all of the CMakeLists.txt files somewhere, and I don't think it's really Qt-specific. But hey, if anyone is down, I'll post 'em...


  • Lifetime Qt Champion

    @Stokestack Do you have any errors when running cmake?


Log in to reply