[CMake] Linking with an external project also built with CMake

Saad Khattak saadrustam at gmail.com
Thu Sep 17 12:25:51 EDT 2015


Hello,

I have a project *ExternalLib* that uses CMake to build its libraries. I
then have my own project (separate from the external library) that needs to
include ExternalLib's headers and link with its libraries. ExternalLib does
not have a find_package module.

Since ExternalLib is also built using CMake, is there no 'automatic' way to
have CMake figure out where the source files and library files are (since
CMake built them in the first place)? That is, I want to avoid writing a
find_package module for ExternalLib and since I have to build it using
CMake anyway, I was hoping there would be some way to automatically fill in
the correct paths for the libraries and source file directories in
MyProject which also uses CMake.

Thanks,
Saad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150917/d72acaba/attachment.html>


More information about the CMake mailing list