From 1f1fa7efc888a7940005592482cf4f5c14c56282 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Thu, 17 Apr 2014 18:49:40 -0700 Subject: [PATCH] More fixes for Windows compilation. --- CMakeLists.txt | 15 +++++++++++---- LoadFile/load | 2 +- README | 12 ++++++++---- setup.cmake | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 503621b..f9078ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,8 @@ set( CMAKE_USE_RELATIVE_PATHS 1 ) #| "avr" # Teensy++ 2.0 #| "arm" # Teensy 3.0 #| "arm" # Teensy 3.1 -#set( COMPILER_FAMILY "arm" ) -set( COMPILER_FAMILY "avr" ) +set( COMPILER_FAMILY "arm" ) +#set( COMPILER_FAMILY "avr" ) message( STATUS "Compiler Family:" ) message( "${COMPILER_FAMILY}" ) @@ -154,6 +154,13 @@ add_custom_target( SizeAfter ALL # Setup Loader Script and Program # -#| Provides the user with the correct teensy-loader-cli command for the built .HEX file -configure_file( LoadFile/load load ) + +#| Provides the user with the correct teensy-loader-cli command for the built .HEX file +#| Windows +if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" ) + configure_file( LoadFile/winload load NEWLINE_STYLE UNIX ) +#| Default +else() + configure_file( LoadFile/load load NEWLINE_STYLE UNIX ) +endif() diff --git a/LoadFile/load b/LoadFile/load index e01357e..da03c8c 100755 --- a/LoadFile/load +++ b/LoadFile/load @@ -5,7 +5,7 @@ if [ ! -e teensy-loader-cli/teensy-loader-cli ]; then # Compile teensy-loader-cli mkdir -p teensy-loader-cli cd teensy-loader-cli - cmake @CMAKE_SOURCE_DIR@/LoadFile + cmake -G "Unix Makefiles" @CMAKE_SOURCE_DIR@/LoadFile make cd - fi diff --git a/README b/README index 4ad1182..93a7866 100644 --- a/README +++ b/README @@ -43,13 +43,17 @@ Compiling on Windows does work, just it's a bunch more work. First make sure Cygwin is installed - http://www.cygwin.com/ - 32bit or 64bit is fine. Make sure the following are installed: - make - git (needed for some compilation info) +- cmake +- gcc-core +- gcc-g++ or gcc-c++ And make sure CMake is *NOT* installed through Cygwin. This is extremely important. If this is not possible, you'll have to play with your paths in Cygwin to prioritize the Windows version of CMake. -Install the latest version of CMake - http://cmake.org/cmake/resources/software.html -Make sure to have CMake add itself to at least your PATH in the installer. -(If this errors out, you'll have to add CMake to your .bashrc path). +Also install the Windows version of CMake - http://cmake.org/cmake/resources/software.html +This is in addition to the Cygwin version. This is an easier alternative to installing another C compiler. +Add the following line to your .bashrc, making sure the CMake path is correct: + alias wincmake="PATH='/cygdrive/c/Program Files (x86)/CMake 2.8'/bin:\"${PATH}\" cmake" Next, install the compiler(s) you want. @@ -304,7 +308,7 @@ Windows Building From this directory. mkdir build cd build -cmake -G "Unix Makefiles" .. +wincmake -G "Unix Makefiles" .. Example output: diff --git a/setup.cmake b/setup.cmake index 4324b0f..93b372e 100644 --- a/setup.cmake +++ b/setup.cmake @@ -20,7 +20,7 @@ #| Please look at the {Scan,Macro,USB,Debug}/module.txt for information on the modules and how to create new ones ##| Deals with acquiring the keypress information and turning it into a key index -set( ScanModule "DPH" ) +set( ScanModule "ADCTest" ) ##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule set( MacroModule "PartialMap" )