Including both a subdirectory and its parent in CMake results in headers in parent directory getting omitted

Hello! I am currently developing a CMake project using a Docker container that requires including headers that resides in the following directory structure:

  • includes
    • Header1.hh
    • Header2.hh
    • subdirectory
      • Header3.hh
      • Header4.hh

My CMakeLists.txt include the following statements (paths are actually populated using environment vairables retreived using find_package:


Unfortuantely this results in Header1.hh and Header2.hh not getting picked up. I inspected the local cache copied over located under ~/.cache/JetBrains/CLion2023.3/.docker/2023_3/Docker, all header files in the parent directory is omitted from this cache. 

I have tried altering the order of these two statements, to no avail.