Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

CMakeLists.txt 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ###| CMAKE Kiibohd Controller |###
  2. #
  3. # Jacob Alexander 2011-2016
  4. # Due to this file's usefulness:
  5. #
  6. # Released into the Public Domain
  7. #
  8. ###
  9. ###
  10. # Chip Selection
  11. #
  12. #| You _MUST_ set this to match the microcontroller you are trying to compile for
  13. #| You _MUST_ clean the build directory if you change this value
  14. #|
  15. set( CHIP
  16. # "at90usb162" # Teensy 1.0 (avr)
  17. # "atmega32u4" # Teensy 2.0 (avr)
  18. # "at90usb646" # Teensy++ 1.0 (avr)
  19. # "at90usb1286" # Teensy++ 2.0 (avr)
  20. # "mk20dx128" # Teensy 3.0 (arm)
  21. "mk20dx128vlf5" # McHCK mk20dx128vlf5
  22. # "mk20dx256" # Teensy 3.1,3.2 (arm)
  23. # "mk20dx256vlh7" # Kiibohd-dfu mk20dx256vlh7
  24. CACHE STRING "Microcontroller Chip"
  25. )
  26. ###
  27. # Compiler Selection
  28. #
  29. #| gcc has been tested much more (and will likely give smaller binaries)
  30. #| clang does work though
  31. #| Currently only arm is supported with clang
  32. set( COMPILER
  33. "gcc" # arm-none-eabi-gcc / avr-gcc / host-gcc - Default
  34. # "clang" # arm-none-eabi / host
  35. CACHE STRING "Compiler Type"
  36. )
  37. ###
  38. # Compiler Intialization
  39. #
  40. set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/Lib/CMake )
  41. include( initialize )
  42. ###
  43. # Project Modules
  44. #
  45. #| Note: This is the only section you probably want to modify
  46. #| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
  47. #| All of the modules must be specified, as they generate the sources list of files to compile
  48. #| Any modifications to this file will cause a complete rebuild of the project
  49. #| Please look at the {Scan,Macro,Output,Debug} for information on the modules and how to create new ones
  50. ##| Deals with acquiring the keypress information and turning it into a key index
  51. set( ScanModule "MD1"
  52. CACHE STRING "Scan Module" )
  53. ##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule
  54. set( MacroModule "PartialMap"
  55. CACHE STRING "Macro Module" )
  56. ##| Sends the current list of usb key codes through USB HID
  57. set( OutputModule "pjrcUSB"
  58. CACHE STRING "Output Module"
  59. )
  60. ##| Debugging source to use, each module has it's own set of defines that it sets
  61. set( DebugModule "full"
  62. CACHE STRING "Debug Module"
  63. )
  64. ###
  65. # Keymap Configuration (do not include the .kll extension)
  66. #
  67. #| Do not include the .kll extension
  68. #| * BaseMap maps the native keyboard scan codes to USB Codes so the layout is compatible with all other layouts
  69. #| * DefaultMap allows the default keymap to be modified from the BaseMap
  70. #| * PartialMaps is a set of dynamically set layers (there is no limit, but too many may use up too much RAM...)
  71. #| BaseMap generally does not need to be changed from "defaultMap"
  72. #|
  73. #| Syntax:
  74. #| myMap
  75. #| * defines a single .kll layout file, double-quotes are needed to distinguish between layers
  76. #| "myMap specialLayer"
  77. #| * defines myMap to be the main layout, then replace specialLayers on top of it
  78. #|
  79. #| - Only for PartialMaps -
  80. #| "myMap specialLayer" "myMap colemak" dvorak
  81. #| * As before, but also generates a second layer at index 2 and third at index 3
  82. #|
  83. #| NOTE: Remember to add key(s) to enable each Partial Layer
  84. #| NOTE2: Layers are always based up the BaseMap (which should be an ANSI-like mapping)
  85. #| NOTE3: Compiler looks in kll/layouts and the build directory for layout files (precedence on build directory)
  86. ##| Set the base keyboard .kll map, defaults to "defaultMap" if not found
  87. ##| Looks in Scan/<Module Name> for the available BaseMaps
  88. set( BaseMap "defaultMap"
  89. CACHE STRING "KLL BaseMap/Scancode Keymapping" )
  90. ##| Layer additonal .kll maps on the BaseMap, layers are in order from 1st to nth
  91. ##| Can be set to ""
  92. set( DefaultMap "md1Overlay stdFuncMap"
  93. CACHE STRING "KLL DefaultMap" )
  94. ##| ParitalMaps available on top of the BaseMap. See above for syntax on specifying multiple layers vs. layering
  95. ##| Can be set to ""
  96. set( PartialMaps "hhkbpro2"
  97. CACHE STRING "KLL PartialMaps/Layer Definitions" )
  98. ###
  99. # Source Defines (in addition to the selected Modules)
  100. #
  101. set( MAIN_SRCS
  102. main.c
  103. )
  104. ###
  105. # Project Description
  106. #
  107. #| Project
  108. project( kiibohd_controller C )
  109. #| Target Name (output name)
  110. set( TARGET kiibohd )
  111. #| General Settings
  112. cmake_minimum_required( VERSION 2.8 )
  113. ###
  114. # Module Initialization / Compilation / Targets
  115. #
  116. include( modules )
  117. include( kll ) # Generate kll layouts if necessary
  118. include( build )