[CMake] Find Module, add_library shared and static : standard ?

Stephen Kelly steveire at gmail.com
Mon Apr 13 13:56:26 EDT 2015


r2d2leboss at voila.fr wrote:

> Hi,
> 
> I need to write a FindModule which search static and shared version of my
> lib. 

If it is your library, then you provide a Config.cmake file, not a 
FindModule:

 http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html

> I would like to know what is the standard name, convention to import
> library static and shared ? (MyLib.a and MyLib.so) 
> * Two names ?
> (Foo::MyLib, Foo::MyLibStatic) ? (Foo::MyLib, Foo::Static::MyLib) ? 

I think this is the best solution cmake currently offers.

The bug 

 http://public.kitware.com/Bug/view.php?id=4222

tracks this.

Thanks,

Steve.




More information about the CMake mailing list