[CMake] Create libtool file

Pau Garcia i Quiles pgquiles at elpauer.org
Tue Aug 11 13:26:57 EDT 2009


Hello,

I'm converting to CMake a library (
http://sourceforge.net/projects/wvware/ ) which creates a libtool.
While in this, I'm improving the CREATE_LIBTOOL_FILE macro (
http://www.cmake.org/Wiki/CMakeMacroLibtoolFile ). The next thing I'd
like to add is autogeneration of the LT_DEPENDENCY_LIBS variable.
After all, it's essentially the same information we pass to
TARGET_LINK_LIBRARIES.

Currently, I only know to ways to set this variable and both of them
require setting the same information twice:

- Manually, by repeating the information passed to
TARGET_LINK_LIBRARIES. Problem is those "optimized", "debug",
"general" keywords require some parsing to remove them.

- Automatically, by using LINK_INTERFACE_LIBRARIES in
TARGET_LINK_LIBRARIES, then repeating the same information in a
SET_TARGET_PROPERTIES( LINK_INTERFACE_LIBRARIES ... ) and getting it
for LT_DEPENDENCY_LIBS with GET_TARGET_PROPERTY in
MacroCreateLibtoolFile.cmake. Seems like a lot of work and there is
repetition again.

I wonder if there is some way to get the command line CMake passes to
the linker (i. e. -lfoo -lbar). I've looked at the source but I can't
figure how to do this from CMake scripting.

Thanks.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)


More information about the CMake mailing list