I'm trying to get something simple going with CMake and I'm running into issues.
I have an Application that needs to link to a DLL that itself links to a Static library. Each of these modules resides in its own folder with its own CMakeLists.txt file.
I use add_subdirectory() to build a project hierarchy, so that the DLL add_subdirectory() adds the Static lib (and links to Static) and the App uses add_subdirectory() to add to the DLL project.
Now, the problem is that in the final project, the CMake makes the App link both to the DLL and the Static Library, although I explicitly ask it in the CMakeLists.txt file to only link to the DLL. Obviously, I don't want the App to link to Static if the DLL already does.
I suspect it has something to do with add_subdirectory() but I don't see how to fix this. Can someone please point me to what I'm doing wrong?