Build non-cmake 3rd party library and use pkg-config to get the library info needed for building the main project

102 views Asked by At

I've a CMake project which depends on a 3rd party library - DPDK in this case. The DPDK library is build via Meson and then the include dirs, the CFLAGS, the LDFLAGS, etc. can/should be get via pkg-config. Note that I don't want to use the system installed DPDK because I need some features from the latest version. I also would like to not install the built DPDK library in the system paths but keep it in the project structure. I used ExternalProject_Add to "build" the DPDK and this worked fine. However, I couldn't use pkg_check_modules because it causes the pkg-config to be invoked at the configure time while I need it to happen at build time and after the build of the DPDK library. So, I was wondering what are my options to do the following:

  • make the pkg-config call dependent on the build of the DPDK library
  • set CMake variables from the pkg-config call so that I can use them for the build of the main project.

I guess, I could use ExternalProject_Add_Step but don't see an option to set CMake environment variables from there.

0

There are 0 answers