Compiling with "-L /usr/local/lib" option

I've a package that makes use of jaegertracing. For this, my issue is that I get the reports only when the file is compiled with "-L /usr/local/lib" option. I've elaborated that issue at https://stackoverflow.com/questions/6... .

Not finding a solution to that yet, I tried to add_compile_options(-L/usr/local/lib) to the CMakeLists.txt of the corresponding package. However, this does not seem to have an effect. I'm concluding the no-effect from - I have tried adding -ljaegertracing -lopentracing -lyaml-cpp to the compile options, but receive a undefined symbol error during run time. OTOH, I added jaegertracing opentracing yaml-cpp to target_link_libraries, and the runtime error disappears.

I also tried to link_libraries(/usr/local/lib) in the cmake file, but don't think that has an effect either (how do I check?), since no traces are collected or a message about tracer initialization is obtained.

Is there another way to achieve the effect of -L/usr/local/lib or any way to debug why add_compile_options might not be working, or some other place I'm missing out?

Thank you!

PS: I'm using nodelets - not sure if that makes any difference.

edit retag close merge delete