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

Leif Walsh leif.walsh at gmail.com
Mon Apr 23 11:10:54 EDT 2012


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


More information about the CMake mailing list