1 ###| CMAKE Kiibohd Controller Source Configurator |###
3 # Written by Jacob Alexander in 2011-2013 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 "FACOM6684" )
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" )
38 # Module Overrides (Used in the buildall.bash script)
40 if ( EXISTS ${PROJECT_SOURCE_DIR}/Scan/${ScanModuleOverride} )
41 set( ScanModule ${ScanModuleOverride} )
42 endif ( EXISTS ${PROJECT_SOURCE_DIR}/Scan/${ScanModuleOverride} )
49 set( ScanModulePath "Scan/${ScanModule}" )
50 set( MacroModulePath "Macro/${MacroModule}" )
51 set( USBModulePath "USB/${USBModule}" )
52 set( DebugModulePath "Debug/${DebugModule}" )
54 #| Top-level directory adjustment
55 set( HEAD_DIR "${PROJECT_SOURCE_DIR}" )
61 # Module Configuration
64 #| Additional options, usually define settings
67 #| Include path for each of the modules
69 -I${HEAD_DIR}/${ScanModulePath}
70 -I${HEAD_DIR}/${MacroModulePath}
71 -I${HEAD_DIR}/${USBModulePath}
72 -I${HEAD_DIR}/${DebugModulePath}
82 #| Go through lists of sources and append paths
84 #| PathPrepend( OutputListOfSources <Prepend Path> <InputListOfSources> )
85 macro( PathPrepend Output SourcesPath )
89 foreach( item ${ARGN} )
91 set( tmpSource ${tmpSource} "${SourcesPath}/${item}" )
94 # Finalize by writing the new list back over the old one
95 set( ${Output} ${tmpSource} )
96 endmacro( PathPrepend )
100 include ( "${ScanModulePath}/setup.cmake" )
101 PathPrepend( SCAN_SRCS ${ScanModulePath} ${SCAN_SRCS} )
104 include ( "${MacroModulePath}/setup.cmake" )
105 PathPrepend( MACRO_SRCS ${MacroModulePath} ${MACRO_SRCS} )
108 include ( "${USBModulePath}/setup.cmake" )
109 PathPrepend( USB_SRCS ${USBModulePath} ${USB_SRCS} )
112 include ( "${DebugModulePath}/setup.cmake" )
113 PathPrepend( DEBUG_SRCS ${DebugModulePath} ${DEBUG_SRCS} )
116 #| Print list of all module sources
117 message( STATUS "Detected Scan Module Source Files:" )
118 message( "${SCAN_SRCS}" )
119 message( STATUS "Detected Macro Module Source Files:" )
120 message( "${MACRO_SRCS}" )
121 message( STATUS "Detected USB Module Source Files:" )
122 message( "${USB_SRCS}" )
123 message( STATUS "Detected Debug Module Source Files:" )
124 message( "${DEBUG_SRCS}" )