diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 072d5672912e..cb4b54fe8b27 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -2,8 +2,12 @@ cmake_minimum_required(VERSION 3.13.1) set(CONFIG_APPLICATION_DEFINED_SYSCALL true) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../zmk-config AND NOT DEFINED ZMK_CONFIG_LOCAL_MODULE) + set(ZMK_CONFIG_LOCAL_MODULE ${CMAKE_CURRENT_SOURCE_DIR}/../zmk-config) +endif() + set(ZEPHYR_BOARD_ALIASES "boards/aliases.cmake") -set(ZEPHYR_EXTRA_MODULES "${ZMK_EXTRA_MODULES};${CMAKE_CURRENT_SOURCE_DIR}/module;${CMAKE_CURRENT_SOURCE_DIR}/keymap-module") +set(EXTRA_ZEPHYR_MODULES "${ZMK_EXTRA_MODULES};${CMAKE_CURRENT_SOURCE_DIR}/module;${CMAKE_CURRENT_SOURCE_DIR}/keymap-module;${ZMK_CONFIG_LOCAL_MODULE}") # Find Zephyr. This also loads Zephyr's build system. find_package(Zephyr REQUIRED HINTS ../zephyr) diff --git a/app/keymap-module/modules/modules.cmake b/app/keymap-module/modules/modules.cmake index f513bcc4f5f3..8633881e407d 100644 --- a/app/keymap-module/modules/modules.cmake +++ b/app/keymap-module/modules/modules.cmake @@ -41,6 +41,10 @@ elseif(DEFINED ENV{ZMK_CONFIG}) elseif(user_config_app_cmake_lists) set(ZMK_CONFIG ${user_config_app_cmake_lists}) + +elseif(EXISTS ${APPLICATION_SOURCE_DIR}/../zmk-config/config) + set(ZMK_CONFIG ${APPLICATION_SOURCE_DIR}/../zmk-config/config) + endif() # Store the selected user_config in the cache @@ -50,10 +54,12 @@ if (ZMK_CONFIG) set(ENV{ZMK_CONFIG} "${ZMK_CONFIG}") if(EXISTS ${ZMK_CONFIG}/boards) message(STATUS "Adding ZMK config directory as board root: ${ZMK_CONFIG}") + message(DEPRECATION "Using the config folder as board root is deprecated.") list(APPEND BOARD_ROOT ${ZMK_CONFIG}) endif() if(EXISTS ${ZMK_CONFIG}/dts) message(STATUS "Adding ZMK config directory as DTS root: ${ZMK_CONFIG}") + message(DEPRECATION "Using the config folder as DTS root is deprecated.") list(APPEND DTS_ROOT ${ZMK_CONFIG}) endif() endif() diff --git a/local/config-import.yml b/local/config-import.yml new file mode 100644 index 000000000000..2f768060a538 --- /dev/null +++ b/local/config-import.yml @@ -0,0 +1,6 @@ +manifest: + self: + import: + file: ../zmk-config/config/west.yml + name-blocklist: [zmk] + path-prefix: modules diff --git a/local/west.yml b/local/west.yml new file mode 100644 index 000000000000..5fe30c141363 --- /dev/null +++ b/local/west.yml @@ -0,0 +1,5 @@ +manifest: + self: + import: + - config-import.yml + - ../app/west.yml