I am not yet familiar with CMake and was not sure what/where can be done.

For example, afterwards, by testing I could figure out that the CMakeList.txt for (many) modules can be more or less the same, like a template. For acc module, I could get:

set(MODNAME acc)

file(GLOB ${MODNAME}_SRC "*.c")

add_library(${MODNAME} SHARED ${${MODNAME}_SRC})

target_compile_options(${MODNAME} PUBLIC "-ffile-prefix-map=${CMAKE_SOURCE_DIR}/src/modules/${MODNAME}/=")

First line is different per module, setting the module name, but there might be already available a CMake variable with the module name (in your comment you use ${MODULE_NAME}). So, the CMakeList.txt in the module folder can include a common-template file.

On the other hand, I am not sure if using too many variables will slow down compilation, because of too many times expanding the vars.

Anyhow, feel free to update/optimize as you consider to be better. I am mostly trying to figure out solutions for what I see it is different, without adding more load on your shoulders. It might not be the best, so it can be updated. If I get stuck with something I will get it to you.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/commit/28f4089efcc9c2ccf8c79fc9ecc509ae29d873e5/150201533@github.com>