Trying to link my project with Boost.Thread using CMake

Posted by wowus on Stack Overflow See other posts from Stack Overflow or by wowus
Published on 2010-05-23T14:14:58Z Indexed on 2010/05/23 14:20 UTC
Read the original article Hit count: 171

Filed under:
|
|

When I link Boost.Thread to my boost_test executable, it gives me

make[2]: *** No rule to make target `/usr/lib64/libboost_thread-mt.so', needed by `gogo/test/test_boost'.  Stop.

when I make it. Here's the offending CMake code, what am I doing wrong?

add_executable(boost_test boost_test.cpp)
add_test(boost_test boost_test)

# Boost auto-links for MSVC, so we exclude it.
if(CMAKE_COMPILER_IS_GNUCXX)
    target_link_libraries(test_boost #LINK_INTERFACE_LIBRARIES
        ${Boost_THREAD_LIBRARY}
    )
endif()

© Stack Overflow or respective owner

Related posts about c++

Related posts about boost