[CMake] Autotools sub project, static lib in a shared lib

Leif Walsh leif.walsh at gmail.com
Tue Apr 24 02:07:28 EDT 2012


Thanks, this worked perfectly.

On Apr 23, 2012, at 11:45 AM, Nicolas Desprès wrote:

> Hi,
> 
> You can have a look at the ExternalProject module:
> $ cmake --help-module ExternalProject
> 
> Cheers,
> -Nico
> 
> On Mon, Apr 23, 2012 at 5:10 PM, Leif Walsh <leif.walsh at gmail.com> wrote:
>> Hi,
>> 
>> I have a cmake project with some weird requirements:
>> 
>> It uses an external project that uses autotools. I have the other project's source tree unpacked in a subdirectory. During a build of my project, I want to run configure with some options, make, and make install in the subdirectory, then copy a static library out of the install dir, and link that into a shared library my project builds.
>> 
>> In make, I'd write rules roughly like this:
>> 
>> lib/libext.a: ext/configure
>>    (cd ext; ./configure --prefix=$(PWD)/extbuild; make; make install; install extbuild/lib/libext.a lib)
>> 
>> lib/libproj.so: $(objs) lib/libext.a
>>    cc -o $@ -shared $^
>> 
>> How should I do this in cmake?
>> 
>> Does the IMPORTED property of add_library help me at all?
>> 
>> Sent from my iPhone
>> --
>> 
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
> 
> 
> 
> -- 
> Nicolas Desprès

-- 
Cheers,
Leif



More information about the CMake mailing list