[CMake] Shared library from ExternalProject

Tino Mettler tino.mettler at alcnetworx.de
Wed Sep 16 09:22:34 EDT 2015


On Tue, 2015-09-15 at 16:32 +0200, Tamás Kenéz wrote:
> > it would be nice to know if the usage of add_library(foo SHARED
> > IMPORTED) is the way to go in this case.
> 
> I wouldn't think this is the way to go. One thing we love CMake for is that
> it separates the concerns of the library and the consumer target so it's
> best to stick to find_package.
> 
> This is the usage pattern of ExternalProject with find_package:
> Create a super project which contains the library and the consumer target
> in 2 separate ExternalProjects so the library can be installed before the
> main target's CMakeLists is configured.

Hi,

thanks for that hint. However, that would still not make externals from
a .tar.gz being rebuilt if their archive was changed. Am I right?

Regards,
Tino




More information about the CMake mailing list