好的,我有一个CMake项目,结构如下:
CMakeLists.txt
/libfoo/CMakeLists.txt
/frontend/qt/CMakeLists.txt
libfoo
是我正在编写的库,frontend/qt
是一个小型前端,也是使用示例。问题在于CMake将相对路径传递给链接器而不是-l
选项。Qt GUI目标声明如下:
add_executable(qtgui ${qtgui_sources} ${qtgui_moced} ${qtgui_ui_h})
target_link_libraries(qtgui ${QT_LIBRARIES} foo)
我更希望它只是像其他库一样链接到
-lfoo
,而不是完整的路径。
如何做到这一点?谢谢!