1 ###| CMAKE Kiibohd Controller Source Configurator |###
3 # Written by Jacob Alexander in 2011 for the Kiibohd Controller
5 # Released into the Public Domain
15 #| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
16 #| All of the modules must be specified, as they generate the sources list of files to compile
17 #| Any modifications to this file will cause a complete rebuild of the project
19 #| Please the {Scan,Macro,USB,Debug}/module.txt for information on the modules and how to create new ones
21 ##| Deals with acquiring the keypress information and turning it into a key index
22 set( ScanModule "matrix" )
24 ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code
25 set( MacroModule "basic" )
27 ##| Sends the current list of usb key codes through USB HID
28 set( USBModule "pjrc" )
30 ##| Debugging source to use, each module has it's own set of defines that it sets
31 set( DebugModule "basic" )
38 set( ScanModulePath "Scan/${ScanModule}" )
39 set( MacroModulePath "Macro/${MacroModule}" )
40 set( USBModulePath "USB/${USBModule}" )
41 set( DebugModulePath "Debug/${DebugModule}" )
47 # Module Configuration
50 #| Additional options, usually define settings
53 #| Include path for each of the modules TODO Fixme!! (../)
55 -I../${ScanModulePath}
56 -I../${MacroModulePath}
58 -I../${DebugModulePath}
67 #| Go through lists of sources and append paths
69 #| PathPrepend( OutputListOfSources <Prepend Path> <InputListOfSources> )
70 macro( PathPrepend Output SourcesPath )
74 foreach( item ${ARGN} )
75 set( tmpSource ${tmpSource} "${SourcesPath}/${item}" )
78 # Finalize by writing the new list back over the old one
79 set( ${Output} ${tmpSource} )
80 endmacro( PathPrepend )
84 include ( "${ScanModulePath}/setup.cmake" )
85 PathPrepend( SCAN_SRCS ${ScanModulePath} ${SCAN_SRCS} )
88 include ( "${MacroModulePath}/setup.cmake" )
89 PathPrepend( MACRO_SRCS ${MacroModulePath} ${MACRO_SRCS} )
92 include ( "${USBModulePath}/setup.cmake" )
93 PathPrepend( USB_SRCS ${USBModulePath} ${USB_SRCS} )
96 include ( "${DebugModulePath}/setup.cmake" )
97 PathPrepend( DEBUG_SRCS ${DebugModulePath} ${DEBUG_SRCS} )
100 #| Print list of all module sources
101 message( STATUS "Detected Scan Module Source Files:
103 message( STATUS "Detected Macro Module Source Files:
105 message( STATUS "Detected USB Module Source Files:
107 message( STATUS "Detected Debug Module Source Files: