Re: Application build from multiple libs.


tomasz.sleboda@...
 

Hi,

I've just followed mentioned example.
Using extensions.cmake functions I was able to fetch needed variables:
zephyr_get_include_directories_for_lang_as_string(       C PROJECT_INCLUDE)
zephyr_get_system_include_directories_for_lang_as_string(C SYSTEM_INCLUDE)
zephyr_get_compile_definitions_for_lang_as_string(       C COMPILE_DEFINITIONS)
zephyr_get_compile_options_for_lang_as_string(           C COMPILE_OPTIONS)

Then applied them into sub-libs CMakeLists.txt :

target_include_directories(${LIB_NAME}
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    PRIVATE
        ${PROJECT_INCLUDE}
    SYSTEM
        ${SYSTEM_INCLUDE}
    )

target_compile_definitions(${LIB_NAME}
    PUBLIC
        ${COMPILE_DEFINITIONS}
    )

target_compile_options(${LIB_NAME}
    PUBLIC
        ${COMPILE_OPTIONS}
    )

Join users@lists.zephyrproject.org to automatically receive all group messages.