Creating a custom module placed in the project root

I had a driver made for my project, I now want to transform the driver into a module so I can use Git submodules and implement this driver in multiple projects.

This is my directory, which is placed in the root of my project.



The module.yml contains

build:
  settings:
    dts_root: .
  cmake: .
  kconfig: Kconfig
The CMakeLists.txt

if (CONFIG_WS2812_DRIVER)
  zephyr_include_directories(src)
  add_subdirectory(src)
endif()
The Kconfig

config WS2812_DRIVER
    bool "Enable WS2812 Driver"
    default y
    help
        Enable support for the WS2812 HAL driver.


The CMakeLists.txt of my project root I have added this.

list(APPEND ZEPHYR_MODULES modules/ws2812_driver)

My prj.conf now has the line added

CONFIG_WS2812_DRIVER=y

But when building I get the error 
warning: attempt to assign the value 'y' to the undefined symbol WS2812_DRIVER

So I assume it cannot find the Kconfig file, if it even loads the module at all.
Related