@xkaraman commented on this pull request.
@@ -1,3 +1,9 @@
file(GLOB MODULE_SOURCES "*.c")
add_library(${module_name} SHARED ${MODULE_SOURCES}) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(PCRE2 REQUIRED IMPORTED_TARGET libpcre2-8)
Since we are using `IMPORTED_TARGET`, let's use it properly in the `target_link_libraries` call. This will make sure all necessary includes, links and other options are used!
See https://github.com/xkaraman/kamailio/blob/cmake/src/modules/regex/CMakeLists... as a reference.