[CMake] Import/export issue with shared library

Eric Noulard eric.noulard at gmail.com
Sun Jan 8 11:20:40 EST 2012


2012/1/8 Hauke Heibel <hauke.heibel at googlemail.com>:
> Hi again,
>
> I created a little example that shows the problem. It won't actually
> compile anything but it should help in understanding my problem.

I'm not sure how you compile your example.
Should they be built in-source?
Do you create out-of-source build tree for each A,B,SomeProject?

However from your last message it seems like you

export(TARGETS B A ...

statements depends on the fact that A (resp B.) is an imported target or not.
So may be you could add

get_target_property(IA IMPORTED A)

if (NOT IA)
   set(EXPORTEDA "A")
else()
   set(EXPORTEDA "")
endif()

export(TARGETS B ${EXPORTEDA} ...

Would this work for you use case?
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list