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

Mike Jackson mike.jackson at bluequartz.net
Wed Apr 15 11:53:01 EDT 2009


Ah.. ok. Did you try to use "FindBoost" and then use the
"Boost_PROGRAM_OPTIONS_LIBRARIES" variables?

set(Boost_USE_MULTITHREADED ON) # which is the default
FIND_PACKAGE(Boost 1.36 COMPONENTS program_options)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})  # Include the Boost Headers
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

add_executable(myFoo ${srcs})
target_link_libraries(myFoo ${Boost_PROGRAM_OPTIONS_LIBRARY} )

Mike

On Wed, Apr 15, 2009 at 11:43 AM, David Doria <daviddoria at gmail.com> wrote:
> Tyler - yep, I did try putting it in quotes, and it had no affect.
>
> Mike - I am not trying to compile boost. My naming may have been misleading.
> Boost/ProgramOptions is in my Examples/ folder. I am trying to build an
> example, call it instead "ExampleBoostProgramOptions.cpp", and only link to
> boost_program_options-mt.
>
> Thanks,
>
> David
>
>
> On Wed, Apr 15, 2009 at 11:36 AM, Tyler Roscoe <tyler at cryptio.net> wrote:
>>
>> On Wed, Apr 15, 2009 at 11:09:43AM -0400, David Doria wrote:
>> > TARGET_LINK_LIBRARIES(MultipleLists boost_program_options-mt)
>>
>> Sort of a long shot, but did you try putting quotes around
>> "boost_program_opotions-mt"?
>>
>> tyler
>
>
> _______________________________________________
> 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
>


More information about the CMake mailing list