CMake has an easy way to get access to libraries headers and source: target_link_libraries(your_lib, some_lib). Where your_lib is the library you are developing, and some_lib is a library you depend on. Ideal if you are using a library, and you want to include everything inside your own library.
But sometimes you only want a library's headers during development.
Example: you are developing a Raspberry Pico library that uses SPI. With the default target_link_libraries(your_lib, hardware_spi)you have access to the SPI headers (needed to make your code compile). But the library will include Pico's SPI code. You may not want that, because it's usually already linked in the firmware project.
There are ways in CMake to just make the library headers availalbe. But not as easy as just listing the library in target_link_libraries(). It needed some fiddling.
That changed in CMake 3.27. There's now a $<COMPILE_ONLY:library> decorator.
If in the past you'd write:
target_link_libraries(your_lib, hardware_spi)
and that added compiled code of hardware_spi to you library),
You can now write:
target_link_libraries(your_lib, $<COMPILE_ONLY:hardware_spi>)
Compilation will succeed, because your build now has access to the hardware_spi header files. But the source of hardware_spi will not be linked into your_lib.
Some small changes in the toolchain can be a really good help