Camkes CMakefiles are quite different to the non-camkes ones that I've learned recently. For starters, I cannot figure out a simple step of adding an include path & a static library to a camkes project. For example, I want to expand projects/camkes/apps to include an extra file that calls functions from libsel4vka. Adding a source file is easy: just expand SOURCES list, e.g.:
DeclareCAmkESComponent(Driver SOURCES components/Driver/src/driver.c components/Driver/src/sel4vka-caller.c)
But sel4vka-caller.c needs the include paths to seL4_libs/libsel4vka/include. And the libsel4vka.a needs to be built and linked to the executable. I don't know how I can achieve it. The CMakefile original (trivial) content is:
project(uart C)
DeclareCAmkESComponent(Client SOURCES components/Client/src/client.c) DeclareCAmkESComponent(Driver SOURCES components/Driver/src/driver.c)
DeclareCAmkESRootserver(uart.camkes)
I try to add the libsel4vka.a to the linker via appending to it:
target_link_libraries( uart PUBLIC sel4vka )
But I get:
/usr/bin/cmake -S/home/chris/camkes_brkwy/projects/camkes -B/home/chris/camkes_brkwy/uart_tqma8xqp-build ninja: error: rebuilding 'build.ninja': subcommand failed chris@ubuntu:~/camkes_brkwy/uart_tqma8xqp-build$ ninja
CMake Error at apps/uart/CMakeLists.txt:35 (target_link_libraries): Cannot specify link libraries for target "uart" which is not built by this project.
I don't understand why "uart" is not a target, given the statement: project(uart C)
So given target_link_libraries() fails me here, what am I doing wrong? what's the proper way of including -I paths and *.a files in Camkes-type CMakefile? Thanks for your help! Chris