[CMake] How do you handle recursive dependencies in CMake

Sven Baars s.baars at rug.nl
Thu Jun 30 09:33:34 EDT 2016


Hey again Marcel,

Your reply got me thinking. I just checked again, and found that I just
have to set the LIBRARY_PATH correctly as well. After that everything
seems to work. Apparently this was not done in the right way. Since I
have to use PATH anyway to find the FoobarConfig.cmake files, it is just
as easy to also set LIBRARY_PATH to find the dependencies of the already
compiled libraries. The problem was that PATH was already set in the
right way, so I didn't notice that LIBRARY_PATH was not set correctly.

Anyhow, the thing that ultimately confused me in such a way that I
thought the problem was somewhere else was that

https://cmake.org/cmake/help/v3.0/command/link_directories.html

says that find_package should return *absolute* paths, which it does
not, since it just returns the targets. Maybe that can be cleared up a
bit to prevent further confusion.

Thanks a lot for pointing me in the right direction!

Cheers,
Sven


More information about the CMake mailing list