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

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <x...@gilawa.com>
Date: 2024-12-10T14:39:03Z

cmake: Use evaluated full paths from cmake for correct handling of special cases

---

Modified: cmake/defs.cmake

---

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

---

diff --git a/cmake/defs.cmake b/cmake/defs.cmake
index 4214ef57121..bb9a0b680a7 100644
--- a/cmake/defs.cmake
+++ b/cmake/defs.cmake
@@ -6,8 +6,6 @@ cmake_minimum_required(VERSION 3.10)
 
 add_library(common INTERFACE)
 
-message(STATUS "CMAKE_C_COMPILER_VERSION: ${CMAKE_C_COMPILER_VERSION}")
-
 set(OS ${CMAKE_SYSTEM_NAME})
 message(STATUS "OS: ${OS}")
 
@@ -109,6 +107,10 @@ if(NOT ${LIBSSL_SET_MUTEX_SHARED})
     STATUS
       "Checking if can enable workaround for libssl 1.1+ to set shared mutex 
attribute"
   )
+
+  # TODO: This can probably be reduced to a just a find_package(OpenSSL) call
+  # and then check the version
+  # If we are cross-compiling, cmake should search for library on the target 
or both target/host
   if(NOT DEFINED CMAKE_CROSSCOMPILING OR NOT ${CMAKE_CROSSCOMPILING})
     message(STATUS "Checking for OpenSSL 1.1.0")
     find_package(OpenSSL 1.1.0)
@@ -306,11 +308,11 @@ target_compile_definitions(
     ${TARGET_ARCH}
     __OS_${OS_LOWER}
     VERSIONVAL=${VERSIONVAL}
-    CFG_DIR="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}/${CFG_NAME}/"
-    SHARE_DIR="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${MAIN_NAME}/"
+    CFG_DIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}/${CFG_NAME}/"
+    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_LOCALSTATEDIR}/run/${MAIN_NAME}"
+    RUN_DIR="${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run/${MAIN_NAME}"
     ${LOCK_METHOD}
     # Module stuff?
     PIC

_______________________________________________
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