summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-07-25 00:13:40 -0400
committerPete Johanson <peter@peterjohanson.com>2020-07-25 00:13:42 -0400
commit7a5946742086ab66dfc197f5925d9533cd9b3c4b (patch)
treefcc67e3aa56d4d2121cd51b61f64054d96541c9b
parent25d0664b58b1f4f1bc09a4a0b6c67ac9f9736126 (diff)
Properly add overlay/conf files for base shield dir name as well.
* Needed so when building with `kyria_left` shield, then config dir containing `kyria.conf` and `kyria.overlay` will also be applied as configs/overlays.
-rw-r--r--app/cmake/zmk_config.cmake16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/cmake/zmk_config.cmake b/app/cmake/zmk_config.cmake
index 8ecf710..e4d2632 100644
--- a/app/cmake/zmk_config.cmake
+++ b/app/cmake/zmk_config.cmake
@@ -44,13 +44,13 @@ endif()
set(CACHED_ZMK_CONFIG ${ZMK_CONFIG} CACHE STRING "Selected user ZMK config")
if (ZMK_CONFIG)
- if(EXISTS "${ZMK_CONFIG}/boards")
+ if(EXISTS ${ZMK_CONFIG}/boards)
message(STATUS "Adding ZMK config directory as board root: ${ZMK_CONFIG}")
- list(APPEND BOARD_ROOT "${ZMK_CONFIG}")
+ list(APPEND BOARD_ROOT ${ZMK_CONFIG})
endif()
- if(EXISTS "${ZMK_CONFIG}/dts")
+ if(EXISTS ${ZMK_CONFIG}/dts)
message(STATUS "Adding ZMK config directory as DTS root: ${ZMK_CONFIG}")
- list(APPEND DTS_ROOT "${ZMK_CONFIG}")
+ list(APPEND DTS_ROOT ${ZMK_CONFIG})
endif()
endif()
@@ -76,6 +76,7 @@ foreach(root ${BOARD_ROOT})
NO_DEFAULT_PATH
)
foreach(shield_path ${shields_refs_list})
+ get_filename_component(SHIELD_DIR ${shield_path} NAME)
if (EXISTS "${shield_path}/keymap")
list(APPEND KEYMAP_DIRS ${shield_path}/keymap)
endif()
@@ -101,7 +102,7 @@ if (BASE_KEYMAPS_DIR)
endif()
if (ZMK_CONFIG)
- if (EXISTS "${ZMK_CONFIG}")
+ if (EXISTS ${ZMK_CONFIG})
message(STATUS "ZMK Config directory: ${ZMK_CONFIG}")
list(APPEND DTS_ROOT ${ZMK_CONFIG})
if (EXISTS "${ZMK_CONFIG}/include")
@@ -109,8 +110,13 @@ if (ZMK_CONFIG)
endif()
if (SHIELD)
+ message(STATUS "Board: ${BOARD}, ${BOARD_DIR}, ${SHIELD}, ${SHIELD_DIR}")
+ list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD_DIR}.overlay")
+ list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD_DIR}_${BOARD}.overlay")
list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD}_${BOARD}.overlay")
list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD}.overlay")
+ list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD_DIR}.conf")
+ list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD_DIR}_${BOARD}.conf")
list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD}_${BOARD}.conf")
list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD}.conf")
endif()