Kiibohd Controller
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

setup.cmake 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ###| CMAKE Kiibohd Controller Source Configurator |###
  2. #
  3. # Written by Jacob Alexander in 2011 for the Kiibohd Controller
  4. #
  5. # Released into the Public Domain
  6. #
  7. ###
  8. ###
  9. # Project Modules
  10. #
  11. #| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
  12. #| All of the modules must be specified, as they generate the sources list of files to compile
  13. #| Any modifications to this file will cause a complete rebuild of the project
  14. #| Please the {Scan,Macro,USB,Debug}/module.txt for information on the modules and how to create new ones
  15. ##| Deals with acquiring the keypress information and turning it into a key index
  16. set( ScanModule "matrix" )
  17. ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code
  18. set( MacroModule "basic" )
  19. ##| Sends the current list of usb key codes through USB HID
  20. set( USBModule "pjrc" )
  21. ##| Debugging source to use, each module has it's own set of defines that it sets
  22. set( DebugModule "basic" )
  23. ###
  24. # Path Setup
  25. #
  26. set( ScanModulePath "Scan/${ScanModule}" )
  27. set( MacroModulePath "Macro/${MacroModule}" )
  28. set( USBModulePath "USB/${USBModule}" )
  29. set( DebugModulePath "Debug/${DebugModule}" )
  30. ###
  31. # Module Configuration
  32. #
  33. #| Additional options, usually define settings
  34. add_definitions()
  35. #| Include path for each of the modules TODO Fixme!! (../)
  36. add_definitions("
  37. -I../${ScanModulePath}
  38. -I../${MacroModulePath}
  39. -I../${USBModulePath}
  40. -I../${DebugModulePath}
  41. ")
  42. ###
  43. # Module Processing
  44. #
  45. #| Go through lists of sources and append paths
  46. #| Usage:
  47. #| PathPrepend( OutputListOfSources <Prepend Path> <InputListOfSources> )
  48. macro( PathPrepend Output SourcesPath )
  49. unset( tmpSource )
  50. # Loop through items
  51. foreach( item ${ARGN} )
  52. set( tmpSource ${tmpSource} "${SourcesPath}/${item}" )
  53. endforeach( item )
  54. # Finalize by writing the new list back over the old one
  55. set( ${Output} ${tmpSource} )
  56. endmacro( PathPrepend )
  57. #| Scan Module
  58. include( "${ScanModulePath}/setup.cmake" )
  59. PathPrepend( SCAN_SRCS ${ScanModulePath} ${SCAN_SRCS} )
  60. #| Macro Module
  61. include( "${MacroModulePath}/setup.cmake" )
  62. PathPrepend( MACRO_SRCS ${MacroModulePath} ${MACRO_SRCS} )
  63. #| USB Module
  64. include( "${USBModulePath}/setup.cmake" )
  65. PathPrepend( USB_SRCS ${USBModulePath} ${USB_SRCS} )
  66. #| Debugging Module
  67. include( "${DebugModulePath}/setup.cmake" )
  68. PathPrepend( DEBUG_SRCS ${DebugModulePath} ${DEBUG_SRCS} )
  69. #| Print list of all module sources
  70. message( STATUS "Detected Scan Module Source Files:
  71. ${SCAN_SRCS}")
  72. message( STATUS "Detected Macro Module Source Files:
  73. ${MACRO_SRCS}")
  74. message( STATUS "Detected USB Module Source Files:
  75. ${USB_SRCS}")
  76. message( STATUS "Detected Debug Module Source Files:
  77. ${DEBUG_SRCS}")