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 "SonyNEWS" )
25 ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code
26 set( MacroModule "buffer" )
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} )
82 set( tmpSource ${tmpSource} "${SourcesPath}/${item}" )
85 # Finalize by writing the new list back over the old one
86 set( ${Output} ${tmpSource} )
87 endmacro( PathPrepend )
91 include ( "${ScanModulePath}/setup.cmake" )
92 PathPrepend( SCAN_SRCS ${ScanModulePath} ${SCAN_SRCS} )
95 include ( "${MacroModulePath}/setup.cmake" )
96 PathPrepend( MACRO_SRCS ${MacroModulePath} ${MACRO_SRCS} )
99 include ( "${USBModulePath}/setup.cmake" )
100 PathPrepend( USB_SRCS ${USBModulePath} ${USB_SRCS} )
103 include ( "${DebugModulePath}/setup.cmake" )
104 PathPrepend( DEBUG_SRCS ${DebugModulePath} ${DEBUG_SRCS} )
107 #| Print list of all module sources
108 message( STATUS "Detected Scan Module Source Files:" )
109 message( "${SCAN_SRCS}" )
110 message( STATUS "Detected Macro Module Source Files:" )
111 message( "${MACRO_SRCS}" )
112 message( STATUS "Detected USB Module Source Files:" )
113 message( "${USB_SRCS}" )
114 message( STATUS "Detected Debug Module Source Files:" )
115 message( "${DEBUG_SRCS}" )