0

Hello I try to link my cmake file with the lib boost, so I installed conan on Windows

project(TestLink)
set(CMAKE_CXX_STANDARD 17)
include(./conanbuildinfo.cmake)
conan_basic_setup()

LINK_DIRECTORIES (
TestLink
    ./lib
)
add_executable(
    TestLink
    ./src/test.cpp
)

set(CMAKE_CXX_FLAGS "-L./lib/  -L/usr/X11R6/lib64 -lGL -lXxf86vm -lXext -lX11 -lXcursor")
set(CMAKE_EXE_LINKER_FLAGS "-L./lib/  -L/usr/X11R6/lib64 -lGL -lXxf86vm -lXext -lX11 -lXcursor")
set_target_properties(TestLink PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}")

target_link_libraries(
TestLink
${CONAN_LIBS}
)

But i got the error message : Cannot specify link libraries for target "boost_wave" which is not built by this project. and i don't know how to solve this error.

Thank you :) !

CharlesRA
  • 375
  • 2
  • 8
  • I think your error is not about Conan, but your target. CMake is saying "boost_wave" because TestLink is no detected as a target in target_link_libraries. boost_wave is the first name in ${CONAN_LIBS}, so CMake identifies boost_waves as the target name, it won't work and results in your error message. – uilianries May 31 '19 at 11:26
  • I just created a gist, where your cmake is rectified, please take a look: https://gist.github.com/uilianries/a5f6f139e02dc953b935819ac2b4d6c0 – uilianries May 31 '19 at 11:36
  • @uilianries Thanks to your help, the link with boost works, but the link with the libs which were in the part "set" and that you changed in the part "target_link_libraries" does not work anymore – CharlesRA May 31 '19 at 13:36
  • please a look again, I added link directories. regards – uilianries May 31 '19 at 14:27

0 Answers0