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

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <x...@gilawa.com>
Date: 2025-05-23T10:56:50Z

cmake: Move prefix/suffix calculation back.

- Prefix depends on each table name..
- Fix postgress with correct install folder.....

---

Modified: cmake/dbschema.cmake

---

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

---

diff --git a/cmake/dbschema.cmake b/cmake/dbschema.cmake
index 17528d83ed0..dcd7bb0645b 100644
--- a/cmake/dbschema.cmake
+++ b/cmake/dbschema.cmake
@@ -50,26 +50,13 @@ function(add_db_target db_name xsl_file)
   # For consistency, we are now using the new names.
   # For compatibility with tools, we are still using the old names for install 
folder
 
-  # Determine the prefix/suffix
-  if(db_name STREQUAL "db_berkeley"
-     OR db_name STREQUAL "db_redis"
-     OR db_name STREQUAL "db_text"
-     OR db_name STREQUAL "db_mongodb"
-  )
-    set(prefix '')
-    set(folder_suffix "${MAIN_NAME}")
-  else()
-    set(prefix "${table}-")
-    set(folder_suffix '')
-  endif()
-
   # install folder based on db_name
   if(db_name STREQUAL "db_mongodb")
     set(install_folder "mongodb")
   elseif(db_name STREQUAL "db_mysql")
     set(install_folder "mysql")
   elseif(db_name STREQUAL "db_postgres")
-    set(install_folder "mysql")
+    set(install_folder "postgres")
   elseif(db_name STREQUAL "db_text")
     set(install_folder "dbtext")
   else()
@@ -79,6 +66,19 @@ function(add_db_target db_name xsl_file)
   # Loop through each table and add a command for xsltproc
   foreach(table ${EXTRACTED_TABLES})
 
+    # Determine the prefix/suffix
+    if(db_name STREQUAL "db_berkeley"
+       OR db_name STREQUAL "db_redis"
+       OR db_name STREQUAL "db_text"
+       OR db_name STREQUAL "db_mongodb"
+    )
+      set(prefix '')
+      set(folder_suffix "${MAIN_NAME}")
+    else()
+      set(prefix "${table}-")
+      set(folder_suffix '')
+    endif()
+
     # Stringparam db is the db_* module name
     add_custom_command(
       TARGET dbschema_${db_name}

_______________________________________________
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