Finding and including/linking external projects generated by CMake
Let's say I have a project I cloned from github which uses CMake to build. What is the best way to link to said dependency assuming the dependency is already built and installed .
So let's say I have LibA that is a dependency to my ProjA. LibA has already been built. What would be the 'correct' way to find and include/link against LibA?
Currently, I inspect the install/ directory of the libraries, then specify the paths for the headers/libraries/DLLs manually.
However, considering the project has been built by CMake and CMake knows where the include/lib/DLL files are, I am hoping that there is a way to get another CMake project to use some auto-generated CMake files to figure out the location of the headers and libraries (and DLLs) so that ultimately, the command boils down to:
# CMake now gives me variables such as LibA_INCLUDE_DIRS, LibA_LIB_DIRS or similar
# so that I can easily include and link to the library
 And in case it matters, for all dependencies I override the CMAKE_INSTALL_PREFIX to be at the root of the dependency. So, if I build LibA located at D:/Deps/LibA, the install folder will be D:/Deps/LibA/install/.