CppLibrary privateHeaders.from used but include file not found

I am new to the CppLibrary (C++ Library) Plugin.
I have added this to a subproject specific section of the top level (and only) build.gradle file.
library {
source.from file(‘codeSubset’)
privateHeaders.from file("$projectDir")

The header files for the cpp files in codeSubset are in the parent directory of codeSubset.
When I try to build, I get errors when g++ tries to find the header files needed by the cpp files in codeSubset. When I checked the option.txt file generated and saw that the correct -I compiler option was added:
I have changed the names to protect the innocent. codeSubset is in /home/user/repository/reponame/codeSubsetParent

Despite this, I could not get it to compile until I added the header files to codeSubset.
I would rather not have the header files in the codeSubset directory. It also doesn’t seem like it should be necessary based on the options.txt file.


If I run g++ to compile a single file with the -I set to what I see in the options.txt file, it compiles fine.
g++ -c -I /home/user/repository/reponame/codeSubsetParent my.cpp