Big thanks to @Tsyvarev for the comment:
You are specifying
${brt_SOURCE_DIR}/include
as include directory. Assuming the full path to the headerSourceModelBase.hpp
is${brt_SOURCE_DIR}/include/SourceModels/SourceModelBase.hpp
, that header should be included by relative path#include <SourceModels/SourceModelBase.hpp>
. If you want to include the header with plain#include "SourceModelBase.hpp"
, then you should add${brt_SOURCE_DIR}/include/SourceModels
to the list of include directories. (This can be done either viatarget_include_directories
command, or by additional parameter forBASE_DIRS
).
This was my problem. I failed to assess the compiler errors and focused too much on what the IDE (not the compiler) was reporting. The build stopped failing as soon as I added ${brt_SOURCE_DIR}/include/SourceModels
and ${brt_SOURCE_DIR}/include/ListenerModels
(which had the same issue) to the target_include_directories command. The IDE is still complaining, but the build works fine.