Module: kamailio
Branch: master
Commit: 001390d802c73e840e57015763a4b6164ae2eb6d
URL: 
https://github.com/kamailio/kamailio/commit/001390d802c73e840e57015763a4b6164ae2eb6d

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <x...@gilawa.com>
Date: 2025-01-10T12:17:00Z

cmake: Don't build all utils unless required by modules

- Build always kamctl and kamcmd
- The rest of utils should be included from the module that requires them or a 
new add_subdirectory in src/CMakelists.txt

---

Modified: CMakeLists.txt
Modified: src/modules/db_berkeley/CMakeLists.txt

---

Diff:  
https://github.com/kamailio/kamailio/commit/001390d802c73e840e57015763a4b6164ae2eb6d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/001390d802c73e840e57015763a4b6164ae2eb6d.patch

---

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3ccd88160d..d8836184b73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,9 @@ include(${CMAKE_SOURCE_DIR}/cmake/defs.cmake)
 add_subdirectory(src)
 
 # Add utils
-add_subdirectory(utils)
+# add_subdirectory(utils)
+add_subdirectory(utils/kamctl)
+add_subdirectory(utils/kamcmd)
 
 # TODO: Packaging stuuf. These should be on different file propably
 set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
diff --git a/src/modules/db_berkeley/CMakeLists.txt 
b/src/modules/db_berkeley/CMakeLists.txt
index 1ff6f84245d..f2884f8e51e 100644
--- a/src/modules/db_berkeley/CMakeLists.txt
+++ b/src/modules/db_berkeley/CMakeLists.txt
@@ -8,4 +8,7 @@ find_package(BerkeleyDB REQUIRED)
 target_link_libraries(${module_name} PRIVATE BerkeleyDB::BerkeleyDB)
 
 # Build also the util function found in utils/db_berkeley/
+# This is needed to build the kamdb_recover utility
+add_subdirectory(${CMAKE_SOURCE_DIR}/utils/db_berkeley
+                 ${CMAKE_BINARY_DIR}/utils/db_berkeley)
 add_dependencies(${module_name} kamdb_recover)

_______________________________________________
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