5

Okay I have a project in CMake structured like this:

CMakeLists.txt
/libfoo/CMakeLists.txt
/frontend/qt/CMakeLists.txt

libfoo is a library I'm writing and frontend/qt is a small frontend and also an example of usage. The problem is that CMake passes the relative path to libfoo.so.x to the linker instead of an -l option. The Qt gui target is declared like this:

add_executable(qtgui ${qtgui_sources} ${qtgui_moced} ${qtgui_ui_h})
target_link_libraries(qtgui ${QT_LIBRARIES} foo)

I'd rather it just linked againts -lfoo like all other libs, not the full path. How to do that?

Thank you!

1 Answer 1

4

Ah, never mind, found it:

http://www.cmake.org/Wiki/CMake_RPATH_handling

I obviously didn't google enough, sorry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.