Module: kamailio Branch: master Commit: 9631c04c09fa128718ecd0fa0cb614188625fafd URL: https://github.com/kamailio/kamailio/commit/9631c04c09fa128718ecd0fa0cb614188625fafd
Author: Xenofon Karamanos <[email protected]> Committer: Henning Westerholt <[email protected]> Date: 2026-03-11T10:18:16+01:00 cmake: Update dbschema generation flow - dbschema will build schema files into db files and copy them to source directory - install will copy source tree files (utils/kamctl/db*) to install folder --- Modified: cmake/dbschema.cmake --- Diff: https://github.com/kamailio/kamailio/commit/9631c04c09fa128718ecd0fa0cb614188625fafd.diff Patch: https://github.com/kamailio/kamailio/commit/9631c04c09fa128718ecd0fa0cb614188625fafd.patch --- diff --git a/cmake/dbschema.cmake b/cmake/dbschema.cmake index b557ad5789a..5e2b745a0c6 100644 --- a/cmake/dbschema.cmake +++ b/cmake/dbschema.cmake @@ -28,6 +28,7 @@ function(add_db_target db_name xsl_file) endif() find_group_name(${db_name_folder}) + # message(WARNING "group name is ${group_name}") add_custom_target( dbschema_${db_name} @@ -119,14 +120,25 @@ function(add_db_target db_name xsl_file) add_dependencies(dbschema dbschema_${db_name}) add_dependencies(dbschema_clean dbschema_${db_name}_clean) - # message(WARNING "group name is ${group_name}") - # Before installing, ensure the target is built `dbschema_${db_name}` - # install as previously done in makefile folder. see naming above - # TODO: when tools adopt to new folder structure, replace the install_folder variable - # with ${db_name_folder} + # When a schema file is updated, we should run the `dbschema_${db_name}` + # target to update the generated schema files in the source directory. + # TODO: when tools adopt to new folder structure, replace the install_folder + # variable with ${db_name_folder} + + # Copy the generated schema files to the source directory + add_custom_command( + TARGET dbschema_${db_name} + POST_BUILD + COMMAND + ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_BINARY_DIR}/utils/kamctl/${db_name_folder}/${folder_suffix}" + "${CMAKE_SOURCE_DIR}/utils/kamctl/${install_folder}/${folder_suffix}" + COMMENT "Copying generated schema files for ${db_name} to source directory" + ) + # Install from source tree (should always be up to date) install( - DIRECTORY ${CMAKE_BINARY_DIR}/utils/kamctl/${db_name_folder}/ + DIRECTORY ${CMAKE_SOURCE_DIR}/utils/kamctl/${install_folder}/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${MAIN_NAME}/${install_folder} OPTIONAL COMPONENT ${group_name} _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
