Hi.

I started to switch over all my build systems to CMake recently and am
stuck with the following.

I thought of the "C" in CMake ("cross-platform") that it means to that
most basic tasks are handled for most platforms/compilers in a
transparent way, but this seems all but be the case unfortunately.

This starts with commands like add_definitions where one have to use
"-D" as parameter suffix (well eventually there could be compilers which
don't use -D as option for this)... and ends with the following what I
though would really be one of the basics in business.

I'd like to allow users of my build system to specify whether
- everything shall be linked statically (i.e. what gcc's --static does)
- selectively select libraries (for which I allow it) to be linked
statically as shared objects or to be dynamically loaded[0].

Isn't this possible? If it is how?

I mean I've googled obviously and found ugly looking hacks where you set
some magic variables to --static (e.g.)... but this is then absolutely
importable.

Rather I'd have expected some clean interface e.g.
target_link_libraries(foo STATIC lib1 lib2 SHARED lib3 lib4)
where obviously lib1/2 are linked statically and 3/4 as shared objects.


Any ideas?! :-)


Thanks,
Chris.



[0] Obviously handling dynamic loading is out of the scope of CMake, so
the only thing I want here is to set some defines in order to let my
code know that it should dlopen/etc.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

--

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

Reply via email to