]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - CMakeLists.txt
Cleanup.
[kiibohd-controller.git] / CMakeLists.txt
index 8f51c8accbf572abbf2b554b469cdb5e02f6cc38..a2278584291a8710a729a95d85b6479d4ec735fb 100644 (file)
@@ -1,6 +1,6 @@
 ###| CMAKE Kiibohd Controller |###
 #
-# Jacob Alexander 2011-2013
+# Jacob Alexander 2011-2014
 # Due to this file's usefulness:
 #
 # Released into the Public Domain
@@ -11,9 +11,6 @@
 set( CMAKE_LEGACY_CYGWIN_WIN32 0 )
 set( CMAKE_USE_RELATIVE_PATHS  1 )
 
-#| Add Dependency Macro
-include( AddFileDependencies )
-
 
 
 ###
@@ -27,8 +24,12 @@ include( AddFileDependencies )
 #| "avr"       # Teensy++ 1.0
 #| "avr"       # Teensy++ 2.0
 #| "arm"       # Teensy   3.0
-#set( COMPILER_FAMILY "arm" )
-set( COMPILER_FAMILY "avr" )
+#| "arm"       # Teensy   3.1
+set( COMPILER_FAMILY "arm" )
+#set( COMPILER_FAMILY "avr" )
+
+message( STATUS "Compiler Family:" )
+message( "${COMPILER_FAMILY}" )
 
 
 
@@ -67,10 +68,31 @@ set( SRCS
        ${COMPILER_SRCS}
        ${SCAN_SRCS}
        ${MACRO_SRCS}
-       ${USB_SRCS}
+       ${OUTPUT_SRCS}
        ${DEBUG_SRCS}
 )
 
+#| Directories to include by default
+include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
+
+
+
+###
+# Module Compatibility Check
+#
+
+#| Check for whether the set modules are compatible with the specified compiler family
+ModuleCompatibility( ${ScanModulePath}   ${ScanModuleCompatibility}   )
+ModuleCompatibility( ${MacroModulePath}  ${MacroModuleCompatibility}  )
+ModuleCompatibility( ${OutputModulePath} ${OutputModuleCompatibility} )
+ModuleCompatibility( ${DebugModulePath}  ${DebugModuleCompatibility}  )
+
+
+
+###
+# CMake Module Checking
+#
+find_package( Git REQUIRED )
 
 
 ###
@@ -119,25 +141,19 @@ add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
 #
 
 #| After Changes Size Information
-add_custom_target( SizeAfter ALL ${SIZE} --target=${FORMAT} ${TARGET_HEX} ${TARGET_ELF}
+#| TODO Do lookup on Flash and RAM sizes and do % used
+add_custom_target( SizeAfter ALL
+       COMMAND ${SIZE} --target=${FORMAT} ${TARGET_HEX} ${TARGET_ELF}
        DEPENDS ${TARGET_ELF}
-       COMMENT "Size after generation:"
+       COMMENT "Size after generation\n\tFlash Usage: data (hex)\n\t  RAM Usage: data (elf)"
 )
 
 
 
 ###
-# Setup Loader Script
+# Setup Loader Script and Program
 #
 
 #| Provides the user with the correct teensy-loader-cli command for the built .HEX file
-#| teensy-loader-cli must be in the user's path
-if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
-       configure_file( LoadFile/bash load )
-endif( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
-
-#| TODO Windows
-if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
-       configure_file( LoadFile/bash load )
-endif( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
+configure_file( LoadFile/load load )