ESP-IDF Components not included for build

Running Platformio using VSS on MacOS

I have added a component from another dev to a new root level components folder as per the instructions at Espressif IoT Development Framework — PlatformIO latest documentation

By adding a new component to an optional folder called components in the root of your project. This folder will be automatically scanned for valid components.

My project is structured as follows:

.
├── CMakeLists.txt
├── components
│   └── CAN
│       ├── CAN.c
│       ├── Kconfig
│       ├── component.mk
│       └── include
│           ├── CAN.h
│           ├── CAN_config.h
│           └── can_regdef.h
├── include
│   ├── app_config.h
│   └── ...
├── lib
│   ├── id_list
│   │   └── ...
│   └── str_util
│       └── ...
├── platformio.ini
├── sdkconfig
├── src
│   ├── CMakeLists.txt
│   ├── main.c
└── test

When I try to build the app, I get the following error

src/main.c:13:10: fatal error: CAN_config.h: No such file or directory

********************************************************************
* Looking for CAN_config.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:CAN_config.h"
* Web  > https://platformio.org/lib/search?query=header:CAN_config.h
*
********************************************************************

 #include "CAN_config.h"
          ^~~~~~~~~~~~~~
compilation terminated.

It appears that the components directory is not scanned. Do I need to add any extra configuration?

Maybe the components need a CMake style CMakeLists.txt too to work, but yours only has thte Makefile (example)? Does the second way via modifying CMakeLists.txt work better?

list(APPEND EXTRA_COMPONENT_DIRS CAN)

Are you saying that the included component needs its own CMakeLists.txt file (under the CAN folder)?

btw I did try the second way too but that didn’t seem to work either.

At the moment, I have copied the CAN folder under lib and that does work, but then it’s not really an external component anymore!

I will try this again and repot back. Thanks