However this mechanism seems to be only for libraries created within the CMakeLists.txt file and does not work for libraries acquired with pkg_search_module(). ) will cause the include directories to be automatically used in every target that uses mytarget, e.g. A call like target_include_directories(mytarget PUBLIC. These provide more options and choice for the user than a raw call to pkg_search_module().Īs for the mentioned hypothetical target_use() command, CMake already has that built-in in a way with PUBLIC|PRIVATE|INTERFACE. CMake comes with a rich set of package definitions, found in Linux under /usr/share/cmake-3.0/Modules/Find*cmake. Secondly, manually calling pkg-config should be avoid when possible. The find_package() call is more flexible and allows options such as REQUIRED, that do things automatically that one would have to do manually with include(). ![]() ![]() Should be replaced with: find_package(PkgConfig) First of, the call: include(FindPkgConfig)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |