[CMake] fun with Boost - swap absolute library path for -L and -l?
David M. Lee
dlee at digium.com
Wed Nov 10 23:41:09 EST 2010
Adam J Richardson <fatman at ...> writes:
> (That is, if I manually separate
> "C:\Compilers\Libs\libboost_thread-mgw44-mt-1_44.a" into
> "-LC:\Compilers\Libs -lboost_thread-mgw44-mt-1_44".)
>
> Is there a way to have CMake do this by itself and not use absolute
> paths? I've tried setting CMP0003 to OLD but it doesn't seem to do that.
I've run into the same problem recently. It seems to be because the
underlying find_library() call returns full paths instead of just
library names. Linking against libraries as inputs (specifying as
full paths) instead of libraries (specifying name with -l) seems to
lead to inconsistent results on different platforms.
The FindBoost script does set a Boost_LIBRARY_DIRS variable, so you
can use link_directories() to basically add the -L option. But I'm at
a loss as to how to properly set the -l options.
Any help is greatly appreciated!
dave
<><
More information about the CMake
mailing list