Module: kamailio
Branch: master
Commit: 1860420fea7ed57d25bc7d735b46c11c739aa0c4
URL: 
https://github.com/kamailio/kamailio/commit/1860420fea7ed57d25bc7d735b46c11c739aa0c4

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-12-19T16:34:53+01:00

cmake: set runtime dir based on RUN_PREFIX and RUN_DIR

- it is a different system path than installation prefix, usually is
  either in /run/kamailio or /var/run/kamailio
- follows the same concept as the old-makefiles

---

Modified: cmake/defs.cmake
Modified: cmake/os-specific/darwin.cmake

---

Diff:  
https://github.com/kamailio/kamailio/commit/1860420fea7ed57d25bc7d735b46c11c739aa0c4.diff
Patch: 
https://github.com/kamailio/kamailio/commit/1860420fea7ed57d25bc7d735b46c11c739aa0c4.patch

---

diff --git a/cmake/defs.cmake b/cmake/defs.cmake
index 0509cad4fca..bc08b2ce4ac 100644
--- a/cmake/defs.cmake
+++ b/cmake/defs.cmake
@@ -14,9 +14,9 @@ message(STATUS "OS version: ${OSREL}")
 # set(HOST_ARCH "__CPU_${CMAKE_HOST_SYSTEM_PROCESSOR}")
 
 if(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i486|i586|i686")
-    set(TARGET_ARCH "i386")
+  set(TARGET_ARCH "i386")
 else()
-    set(TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
+  set(TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
 endif()
 
 message(STATUS "Host Processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
@@ -305,7 +305,9 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
 elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
   set(COMPILER_NAME "clang")
 endif()
-
+if(NOT DEFINED RUN_DIR)
+  set(RUN_DIR "run/${MAIN_NAME}")
+endif()
 string(TOLOWER ${OS} OS_LOWER)
 target_compile_definitions(
   common
@@ -324,7 +326,7 @@ target_compile_definitions(
     SHARE_DIR="${CMAKE_INSTALL_FULL_DATADIR}/${MAIN_NAME}/"
     # Absolute path this run is always /var/run/kamailio either for local or
     # system installs
-    RUN_DIR="${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run/${MAIN_NAME}"
+    RUN_DIR="${RUN_PREFIX}/${RUN_DIR}"
     ${LOCK_METHOD}
     # Module stuff?
     PIC
diff --git a/cmake/os-specific/darwin.cmake b/cmake/os-specific/darwin.cmake
index 5af299c2681..b9963a77ef0 100644
--- a/cmake/os-specific/darwin.cmake
+++ b/cmake/os-specific/darwin.cmake
@@ -40,3 +40,7 @@ endif()
 if(NOT DEFINED ${NO_KQUEUE})
   target_compile_definitions(common INTERFACE HAVE_KQUEUE)
 endif()
+
+if(NOT DEFINED RUN_PREFIX)
+  set(RUN_PREFIX "/var")
+endif()

_______________________________________________
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