[CMake] creating an sdk wrapper and hiding implementation

Michael Toy michael.toy at onlive.com
Tue Jul 17 23:04:54 EDT 2012


we have a number of internally developed libraries which we use together.

i am creating an sdk which wraps all the internal libraries, and presents a single api to customers.

i have built a small test by hand, and it works like this
% cc -c sdk_api.c
% ln -r sdk_api.o libinternal1.a libinternal2.a -o sdk.o -exported_sybmols_list sdk_api_entry.txt
% strip -x sdk.o
% ar r libsdk.a sdk.o

this creates a libsdk.a which ONLY has the api entry points exposed to customers and hides all the globals from the internal libraries.

can't quite wrap my head how to express this in cmake's world of sources, libraries and targets.

best i can think of is a custom target, which then depends on the internal libraries ( which are built in the same project ), and then somehow get the path names to the internal libraries to construct the link line, only i can't even figure out how to do that.

anyone have a clue?  we have ended up have tons of system specific target construction rules, so i don't mind if i have to write the custom target differently for different target OSes.

thanks.

-michael toy


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120718/a55c60f5/attachment.htm>


More information about the CMake mailing list