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!
Ah, never mind, found it:
http://www.cmake.org/Wiki/CMake_RPATH_handling
I obviously didn't google enough, sorry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With