Module: kamailio
Branch: master
Commit: 42e1a9c3c5df65cae8a5f559f6fe47a6de5f6fac
URL: 
https://github.com/kamailio/kamailio/commit/42e1a9c3c5df65cae8a5f559f6fe47a6de5f6fac

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <x...@gilawa.com>
Date: 2025-05-19T10:48:51Z

cmake: Remove find_package for ORTP and Mediastreamer2 libraries

- Use pkg-config instead because their cmake configs are not up to standard and 
complicates things

---

Modified: src/modules/rtp_media_server/CMakeLists.txt

---

Diff:  
https://github.com/kamailio/kamailio/commit/42e1a9c3c5df65cae8a5f559f6fe47a6de5f6fac.diff
Patch: 
https://github.com/kamailio/kamailio/commit/42e1a9c3c5df65cae8a5f559f6fe47a6de5f6fac.patch

---

diff --git a/src/modules/rtp_media_server/CMakeLists.txt 
b/src/modules/rtp_media_server/CMakeLists.txt
index 59a1d868d34..15114891902 100644
--- a/src/modules/rtp_media_server/CMakeLists.txt
+++ b/src/modules/rtp_media_server/CMakeLists.txt
@@ -2,18 +2,15 @@ file(GLOB MODULE_SOURCES "*.c")
 
 add_library(${module_name} SHARED ${MODULE_SOURCES})
 
-find_package(ortp QUIET)
-if(NOT ortp_FOUND)
-  find_package(PkgConfig REQUIRED)
-  pkg_check_modules(ortp REQUIRED IMPORTED_TARGET ortp)
-  add_library(ortp ALIAS PkgConfig::ortp)
-endif()
+find_package(PkgConfig REQUIRED)
 
-find_package(mediastreamer2 QUIET)
-if(NOT mediastreamer2_FOUND)
-  find_package(PkgConfig REQUIRED)
-  pkg_check_modules(mediastreamer2 REQUIRED IMPORTED_TARGET mediastreamer)
-  add_library(mediastreamer2 ALIAS PkgConfig::mediastreamer2)
-endif()
+# ortp and mediastreamer2 do have cmake support on newer version but
+# is not up to standard and complicates things.
+# So we use pkg-config to find them.
+pkg_check_modules(ortp REQUIRED IMPORTED_TARGET ortp)
+add_library(ortp ALIAS PkgConfig::ortp)
+
+pkg_check_modules(mediastreamer2 REQUIRED IMPORTED_TARGET mediastreamer)
+add_library(mediastreamer2 ALIAS PkgConfig::mediastreamer2)
 
 target_link_libraries(${module_name} PRIVATE ortp mediastreamer2)

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to