1 ###| CMAKE Kiibohd Controller Source Configurator |###
3 # Written by Jacob Alexander in 2011 for the Kiibohd Controller
5 # Released into the Public Domain
15 #| Note: This is the only section you probably want to modify
16 #| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
17 #| All of the modules must be specified, as they generate the sources list of files to compile
18 #| Any modifications to this file will cause a complete rebuild of the project
20 #| Please the {Scan,Macro,USB,Debug}/module.txt for information on the modules and how to create new ones
22 ##| Deals with acquiring the keypress information and turning it into a key index
23 set( ScanModule "matrix" )
25 ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code
26 set( MacroModule "basic" )
28 ##| Sends the current list of usb key codes through USB HID
29 set( USBModule "pjrc" )
31 ##| Debugging source to use, each module has it's own set of defines that it sets
32 set( DebugModule "full" )
40 set( ScanModulePath "Scan/${ScanModule}" )
41 set( MacroModulePath "Macro/${MacroModule}" )
42 set( USBModulePath "USB/${USBModule}" )
43 set( DebugModulePath "Debug/${DebugModule}" )
45 #| Top-level directory adjustment
46 set( HEAD_DIR "${PROJECT_SOURCE_DIR}" )
52 # Module Configuration
55 #| Additional options, usually define settings
58 #| Include path for each of the modules
60 -I${HEAD_DIR}/${ScanModulePath}
61 -I${HEAD_DIR}/${MacroModulePath}
62 -I${HEAD_DIR}/${USBModulePath}
63 -I${HEAD_DIR}/${DebugModulePath}
73 #| Go through lists of sources and append paths
75 #| PathPrepend( OutputListOfSources <Prepend Path> <InputListOfSources> )
76 macro( PathPrepend Output SourcesPath )
80 foreach( item ${ARGN} )
81 set( tmpSource ${tmpSource} "${SourcesPath}/${item}" )
84 # Finalize by writing the new list back over the old one
85 set( ${Output} ${tmpSource} )
86 endmacro( PathPrepend )
90 include ( "${ScanModulePath}/setup.cmake" )
91 PathPrepend( SCAN_SRCS ${ScanModulePath} ${SCAN_SRCS} )
94 include ( "${MacroModulePath}/setup.cmake" )
95 PathPrepend( MACRO_SRCS ${MacroModulePath} ${MACRO_SRCS} )
98 include ( "${USBModulePath}/setup.cmake" )
99 PathPrepend( USB_SRCS ${USBModulePath} ${USB_SRCS} )
102 include ( "${DebugModulePath}/setup.cmake" )
103 PathPrepend( DEBUG_SRCS ${DebugModulePath} ${DEBUG_SRCS} )
106 #| Print list of all module sources
107 message( STATUS "Detected Scan Module Source Files: \n${SCAN_SRCS}")
108 message( STATUS "Detected Macro Module Source Files:\n${MACRO_SRCS}")
109 message( STATUS "Detected USB Module Source Files: \n${USB_SRCS}")
110 message( STATUS "Detected Debug Module Source Files:\n${DEBUG_SRCS}")