Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
1585940b80 | |||
ccfe28a1d7 | |||
0ffd873978 |
2 changed files with 71 additions and 65 deletions
|
@ -22,9 +22,9 @@ set( CHIP
|
||||||
# "at90usb646" # Teensy++ 1.0 (avr)
|
# "at90usb646" # Teensy++ 1.0 (avr)
|
||||||
# "at90usb1286" # Teensy++ 2.0 (avr)
|
# "at90usb1286" # Teensy++ 2.0 (avr)
|
||||||
# "mk20dx128" # Teensy 3.0 (arm)
|
# "mk20dx128" # Teensy 3.0 (arm)
|
||||||
"mk20dx128vlf5" # McHCK mk20dx128vlf5
|
# "mk20dx128vlf5" # McHCK mk20dx128vlf5
|
||||||
# "mk20dx256" # Teensy 3.1,3.2 (arm)
|
# "mk20dx256" # Teensy 3.1,3.2 (arm)
|
||||||
# "mk20dx256vlh7" # Kiibohd-dfu mk20dx256vlh7
|
"mk20dx256vlh7" # Kiibohd-dfu mk20dx256vlh7
|
||||||
CACHE STRING "Microcontroller Chip"
|
CACHE STRING "Microcontroller Chip"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ include( initialize )
|
||||||
#| Please look at the {Scan,Macro,Output,Debug} for information on the modules and how to create new ones
|
#| Please look at the {Scan,Macro,Output,Debug} for information on the modules and how to create new ones
|
||||||
|
|
||||||
##| Deals with acquiring the keypress information and turning it into a key index
|
##| Deals with acquiring the keypress information and turning it into a key index
|
||||||
set( ScanModule "MD1"
|
set( ScanModule "MDErgo1"
|
||||||
CACHE STRING "Scan Module" )
|
CACHE STRING "Scan Module" )
|
||||||
|
|
||||||
##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule
|
##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule
|
||||||
|
|
|
@ -20,22 +20,22 @@ if ( "${MacroModule}" STREQUAL "PartialMap" )
|
||||||
#
|
#
|
||||||
|
|
||||||
if ( NOT EXISTS "${PROJECT_SOURCE_DIR}/kll/kll.py" )
|
if ( NOT EXISTS "${PROJECT_SOURCE_DIR}/kll/kll.py" )
|
||||||
message ( STATUS "Downloading latest kll version:" )
|
message ( STATUS "Downloading latest kll version:" )
|
||||||
|
|
||||||
# Make sure git is available
|
# Make sure git is available
|
||||||
find_package ( Git REQUIRED )
|
find_package ( Git REQUIRED )
|
||||||
|
|
||||||
# Clone kll git repo
|
# Clone kll git repo
|
||||||
execute_process ( COMMAND ${GIT_EXECUTABLE} clone https://github.com/kiibohd/kll.git
|
execute_process ( COMMAND ${GIT_EXECUTABLE} clone https://github.com/kiibohd/kll.git
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
elseif ( REFRESH_KLL ) # Otherwise attempt to update the repo
|
elseif ( REFRESH_KLL ) # Otherwise attempt to update the repo
|
||||||
message ( STATUS "Checking for latest kll version:" )
|
message ( STATUS "Checking for latest kll version:" )
|
||||||
|
|
||||||
# Clone kll git repo
|
# Clone kll git repo
|
||||||
execute_process ( COMMAND ${GIT_EXECUTABLE} pull --rebase
|
execute_process ( COMMAND ${GIT_EXECUTABLE} pull --rebase
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/kll
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/kll
|
||||||
)
|
)
|
||||||
endif () # kll/kll.py exists
|
endif () # kll/kll.py exists
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ endif () # kll/kll.py exists
|
||||||
|
|
||||||
#| Add each of the detected capabilities.kll
|
#| Add each of the detected capabilities.kll
|
||||||
foreach ( filename ${ScanModule_KLL} ${MacroModule_KLL} ${OutputModule_KLL} ${DebugModule_KLL} )
|
foreach ( filename ${ScanModule_KLL} ${MacroModule_KLL} ${OutputModule_KLL} ${DebugModule_KLL} )
|
||||||
set ( BaseMap_Args ${BaseMap_Args} ${filename} )
|
set ( BaseMap_Args ${BaseMap_Args} ${filename} )
|
||||||
set ( KLL_DEPENDS ${KLL_DEPENDS} ${filename} )
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${filename} )
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
#| If set BaseMap cannot be found, use default map
|
#| If set BaseMap cannot be found, use default map
|
||||||
|
@ -57,65 +57,71 @@ set ( pathname "${PROJECT_SOURCE_DIR}/${ScanModulePath}" )
|
||||||
|
|
||||||
string ( REPLACE " " ";" MAP_LIST ${BaseMap} ) # Change spaces to semicolons
|
string ( REPLACE " " ";" MAP_LIST ${BaseMap} ) # Change spaces to semicolons
|
||||||
foreach ( MAP ${MAP_LIST} )
|
foreach ( MAP ${MAP_LIST} )
|
||||||
# Only check the Scan Module for BaseMap .kll files, default to defaultMap.kll
|
# Only check the Scan Module for BaseMap .kll files, default to defaultMap.kll
|
||||||
if ( NOT EXISTS ${pathname}/${MAP}.kll )
|
if ( NOT EXISTS ${pathname}/${MAP}.kll )
|
||||||
set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll )
|
set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll )
|
||||||
set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll )
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll )
|
||||||
elseif ( EXISTS "${pathname}/${MAP}.kll" )
|
elseif ( EXISTS "${pathname}/${MAP}.kll" )
|
||||||
set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${MAP}.kll )
|
set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${MAP}.kll )
|
||||||
set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${MAP}.kll )
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${MAP}.kll )
|
||||||
else ()
|
else ()
|
||||||
message ( FATAL " Could not find '${MAP}.kll' BaseMap in Scan module directory" )
|
message ( FATAL " Could not find '${MAP}.kll' BaseMap in Scan module directory" )
|
||||||
endif ()
|
endif ()
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
#| Configure DefaultMap if specified
|
#| Configure DefaultMap if specified
|
||||||
if ( NOT "${DefaultMap}" STREQUAL "" )
|
if ( NOT "${DefaultMap}" STREQUAL "" )
|
||||||
set ( DefaultMap_Args -d )
|
set ( DefaultMap_Args -d )
|
||||||
|
|
||||||
string ( REPLACE " " ";" MAP_LIST ${DefaultMap} ) # Change spaces to semicolons
|
string ( REPLACE " " ";" MAP_LIST ${DefaultMap} ) # Change spaces to semicolons
|
||||||
foreach ( MAP ${MAP_LIST} )
|
foreach ( MAP ${MAP_LIST} )
|
||||||
# Check if kll file is in build directory, otherwise default to layout directory
|
# Check if kll file is in build directory, otherwise default to layout directory
|
||||||
if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" )
|
if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" )
|
||||||
set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll )
|
set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll )
|
||||||
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP}.kll )
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP}.kll )
|
||||||
elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll" )
|
elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll" )
|
||||||
set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
|
set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
|
||||||
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
|
||||||
else ()
|
elseif ( EXISTS "${PROJECT_SOURCE_DIR}/Layouts/${MAP}.kll" )
|
||||||
message ( FATAL " Could not find '${MAP}.kll' DefaultMap" )
|
set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/Layouts/${MAP}.kll )
|
||||||
endif ()
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/Layouts/${MAP}.kll )
|
||||||
endforeach ()
|
else ()
|
||||||
|
message ( FATAL " Could not find '${MAP}.kll' DefaultMap" )
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
#| Configure PartialMaps if specified
|
#| Configure PartialMaps if specified
|
||||||
if ( NOT "${PartialMaps}" STREQUAL "" )
|
if ( NOT "${PartialMaps}" STREQUAL "" )
|
||||||
# For each partial layer
|
# For each partial layer
|
||||||
foreach ( MAP ${PartialMaps} )
|
foreach ( MAP ${PartialMaps} )
|
||||||
set ( PartialMap_Args ${PartialMap_Args} -p )
|
set ( PartialMap_Args ${PartialMap_Args} -p )
|
||||||
|
|
||||||
# Combine each layer
|
# Combine each layer
|
||||||
string ( REPLACE " " ";" MAP_LIST ${MAP} ) # Change spaces to semicolons
|
string ( REPLACE " " ";" MAP_LIST ${MAP} ) # Change spaces to semicolons
|
||||||
foreach ( MAP_PART ${MAP_LIST} )
|
foreach ( MAP_PART ${MAP_LIST} )
|
||||||
# Check if kll file is in build directory, otherwise default to layout directory
|
# Check if kll file is in build directory, otherwise default to layout directory
|
||||||
if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP_PART}.kll" )
|
if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP_PART}.kll" )
|
||||||
set ( PartialMap_Args ${PartialMap_Args} ${MAP_PART}.kll )
|
set ( PartialMap_Args ${PartialMap_Args} ${MAP_PART}.kll )
|
||||||
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP_PART}.kll )
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP_PART}.kll )
|
||||||
elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll" )
|
elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll" )
|
||||||
set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
|
set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
|
||||||
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
|
||||||
else ()
|
elseif ( EXISTS "${PROJECT_SOURCE_DIR}/Layouts/${MAP_PART}.kll" )
|
||||||
message ( FATAL " Could not find '${MAP_PART}.kll' PartialMap" )
|
set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/Layouts/${MAP_PART}.kll )
|
||||||
endif ()
|
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/Layouts/${MAP_PART}.kll )
|
||||||
endforeach ()
|
else ()
|
||||||
endforeach ()
|
message ( FATAL " Could not find '${MAP_PART}.kll' PartialMap" )
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endforeach ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
#| Print list of layout sources used
|
#| Print list of layout sources used
|
||||||
message ( STATUS "Detected Layout Files:" )
|
message ( STATUS "Detected Layout Files:" )
|
||||||
foreach ( filename ${KLL_DEPENDS} )
|
foreach ( filename ${KLL_DEPENDS} )
|
||||||
message ( "${filename}" )
|
message ( "${filename}" )
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,15 +139,15 @@ set ( kll_output --outputs ${kll_outputname} )
|
||||||
#| KLL Cmd
|
#| KLL Cmd
|
||||||
set ( kll_cmd ${PROJECT_SOURCE_DIR}/kll/kll.py ${BaseMap_Args} ${DefaultMap_Args} ${PartialMap_Args} ${kll_backend} ${kll_template} ${kll_output} )
|
set ( kll_cmd ${PROJECT_SOURCE_DIR}/kll/kll.py ${BaseMap_Args} ${DefaultMap_Args} ${PartialMap_Args} ${kll_backend} ${kll_template} ${kll_output} )
|
||||||
add_custom_command ( OUTPUT ${kll_outputname}
|
add_custom_command ( OUTPUT ${kll_outputname}
|
||||||
COMMAND ${kll_cmd}
|
COMMAND ${kll_cmd}
|
||||||
DEPENDS ${KLL_DEPENDS}
|
DEPENDS ${KLL_DEPENDS}
|
||||||
COMMENT "Generating KLL Layout"
|
COMMENT "Generating KLL Layout"
|
||||||
)
|
)
|
||||||
|
|
||||||
#| KLL Regen Convenience Target
|
#| KLL Regen Convenience Target
|
||||||
add_custom_target ( kll_regen
|
add_custom_target ( kll_regen
|
||||||
COMMAND ${kll_cmd}
|
COMMAND ${kll_cmd}
|
||||||
COMMENT "Re-generating KLL Layout"
|
COMMENT "Re-generating KLL Layout"
|
||||||
)
|
)
|
||||||
|
|
||||||
#| Append generated file to required sources so it becomes a dependency in the main build
|
#| Append generated file to required sources so it becomes a dependency in the main build
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue