I am a novice in CMake,
I would like to use a C++ library A in my CMake project. This library A is included as a git submodule and I include it in my CMakeFile using
add_subdirectory("extern/A")
which works so far.
However, my library A has two other dependencies B and C. They are included in the CMakeFile of library A using find_package().
Now, I would like CMake to build these dependencies B and C, so that library A can use them. I want to include B and C as git submodules as well.
Simply concatenating
add_subdirectory("extern/B")
add_subdirectory("extern/C")
add_subdirectory("extern/A")
obviously doesn't work. I thought using add_dependencies could help here, but I couldn't find a way to make it work yet...
Is it even possible to do what I want to do here? If yes, could someone give me a hint which commands I might have to use?