]> git.donarmstrong.com Git - kiibohd-controller.git/blob - setup.cmake
Adding Kaypro1 functional support
[kiibohd-controller.git] / setup.cmake
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
10
11 ###
12 # Project Modules
13 #
14
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
19
20 #| Please the {Scan,Macro,USB,Debug}/module.txt for information on the modules and how to create new ones
21
22 ##| Deals with acquiring the keypress information and turning it into a key index
23 set(  ScanModule  "Kaypro1" )
24
25 ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code
26 set( MacroModule  "buffer"  )
27
28 ##| Sends the current list of usb key codes through USB HID
29 set(   USBModule  "pjrc"   )
30
31 ##| Debugging source to use, each module has it's own set of defines that it sets
32 set( DebugModule  "full"   )
33
34
35
36
37 ###
38 # Path Setup
39
40 set(  ScanModulePath  "Scan/${ScanModule}"  )
41 set( MacroModulePath "Macro/${MacroModule}" )
42 set(   USBModulePath   "USB/${USBModule}"   )
43 set( DebugModulePath "Debug/${DebugModule}" )
44
45 #| Top-level directory adjustment
46 set( HEAD_DIR "${PROJECT_SOURCE_DIR}" )
47
48
49
50
51 ###
52 # Module Configuration
53 #
54
55 #| Additional options, usually define settings
56 add_definitions()
57
58 #| Include path for each of the modules
59 add_definitions(
60         -I${HEAD_DIR}/${ScanModulePath}
61         -I${HEAD_DIR}/${MacroModulePath}
62         -I${HEAD_DIR}/${USBModulePath}
63         -I${HEAD_DIR}/${DebugModulePath}
64 )
65
66
67
68
69 ###
70 # Module Processing
71 #
72
73 #| Go through lists of sources and append paths
74 #| Usage:
75 #|  PathPrepend( OutputListOfSources <Prepend Path> <InputListOfSources> )
76 macro( PathPrepend Output SourcesPath )
77         unset( tmpSource )
78
79         # Loop through items
80         foreach( item ${ARGN} )
81                 set( tmpSource ${tmpSource} "${SourcesPath}/${item}" )
82         endforeach( item )
83
84         # Finalize by writing the new list back over the old one
85         set( ${Output} ${tmpSource} )
86 endmacro( PathPrepend )
87
88
89 #| Scan Module
90 include    (            "${ScanModulePath}/setup.cmake"  )
91 PathPrepend(  SCAN_SRCS  ${ScanModulePath} ${SCAN_SRCS}  )
92
93 #| Macro Module
94 include    (           "${MacroModulePath}/setup.cmake"  )
95 PathPrepend( MACRO_SRCS ${MacroModulePath} ${MACRO_SRCS} )
96
97 #| USB Module
98 include    (             "${USBModulePath}/setup.cmake"  )
99 PathPrepend(   USB_SRCS   ${USBModulePath} ${USB_SRCS}   )
100
101 #| Debugging Module
102 include    (           "${DebugModulePath}/setup.cmake"  )
103 PathPrepend( DEBUG_SRCS ${DebugModulePath} ${DEBUG_SRCS} )
104
105
106 #| Print list of all module sources
107 message( STATUS "Detected Scan Module Source Files:" )
108 message( "${SCAN_SRCS}" )
109 message( STATUS "Detected Macro Module Source Files:" )
110 message( "${MACRO_SRCS}" )
111 message( STATUS "Detected USB Module Source Files:" )
112 message( "${USB_SRCS}" )
113 message( STATUS "Detected Debug Module Source Files:" )
114 message( "${DEBUG_SRCS}" )
115