[CMake] Linking to a library with a "-"

David Doria daviddoria at gmail.com
Wed Apr 15 19:26:45 EDT 2009


Mike, good idea, but I was trying to stay away from boost's cmake until they
didn't make set a flag saying " I agree this is experimental" haha.

Andreas, oh no! Wow what a terrible goof on my part! I forgot that I had
added that second target... I'm sure that was the problem but I'll check it
out and the morning and report back if there are any problem - sorry for the
mix up!

Thanks,

David


On Wed, Apr 15, 2009 at 11:49 AM, Andreas Pakulat <apaku at gmx.de> wrote:

> On 15.04.09 11:09:43, David Doria wrote:
> > I'm using Fedora 10. The KDevelop3 and normal makefile generator produce
> the
> > same result.  CMake version: ccmake version 2.6-patch 3
> >
> > My CMakeLists.txt file is:
> > --------------------------------------------------------
> > cmake_minimum_required(VERSION 2.6)
> >
> > Project(BoostProgramOptions)
> >
> > INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} /home/doriad/src/boost)
> >
> > LINK_DIRECTORIES(${LINK_DIRECTORIES} /home/doriad/bin/boost/lib)
> >
> > ADD_EXECUTABLE(BoostProgramOptions BoostProgramOptions.cpp)
> > TARGET_LINK_LIBRARIES(BoostProgramOptions boost_program_options)
>                                            ^^^^^^^^^^^^^^^^^^^^^^
>
> > ADD_EXECUTABLE(MultipleLists MultipleLists.cpp)
> > TARGET_LINK_LIBRARIES(MultipleLists boost_program_options-mt)
>                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Do you notice a difference?
>
> > --------------------------------------------------------
> >
> > and the link.txt that is produced is:
> >
> > --------------------------------------------------------
> > /usr/lib/ccache/c++     -fPIC
> > CMakeFiles/BoostProgramOptions.dir/BoostProgramOpt
> > ions.cpp.o  -o BoostProgramOptions -rdynamic -L/home/doriad/bin/boost/lib
> > -lboos
> > t_program_options -Wl,-rpath,/home/doriad/bin/boost/lib
> > --------------------------------------------------------
>
> This link.txt is for BoostProgramOptions which you specified should link
> against "boost_program_options" not "boost_program_options-mt".
>
> Andreas
>
> --
> Try to value useful qualities in one who loves you.
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090415/2e91ce3f/attachment.htm>


More information about the CMake mailing list