Questions tagged «pkg-config»

6
从`cmake`使用`pkg-config`的正确方法是什么?
在网上环顾四周,我看到了很多这样的代码: include(FindPkgConfig) pkg_search_module(SDL2 REQUIRED sdl2) target_include_directories(app SYSTEM PUBLIC ${SDL2_INCLUDE_DIRS} target_link_libraries(app ${SDL2_LIBRARIES}) 但是,这样做似乎是错误的方法,因为它仅使用include目录和库,但忽略了定义,库路径和可能由返回的其他标志pkg-config。 做到这一点并确保编译pkg-config器使用返回的所有编译和链接标志的正确方法是什么app?是否有单个命令来完成此操作,即类似target_use(app SDL2)? 参考: include() FindPkgConfig
81 cmake  pkg-config 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.