|
|
@@ -84,11 +84,25 @@ done |
|
|
|
|
|
|
|
|
|
|
|
# Run CMake commands |
|
|
|
## TODO Check for windows and do windows specific things ## |
|
|
|
mkdir -p "${BuildPath}" |
|
|
|
cd "${BuildPath}" |
|
|
|
cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" |
|
|
|
return_code=$? |
|
|
|
|
|
|
|
# Cygwin |
|
|
|
if [[ $(uname -s) == MINGW32_NT* ]] || [[ $(uname -s) == CYGWIN* ]]; then |
|
|
|
if [[ -z "$wincmake_path" ]]; then |
|
|
|
echo "Error wincmake_path environment variable has not been set, see -> https://github.com/kiibohd/controller/wiki/Windows-Setup" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
PATH="$wincmake_path":"${PATH}" cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" -G 'Unix Makefiles' |
|
|
|
return_code=$? |
|
|
|
|
|
|
|
# Linux / Mac (and everything else) |
|
|
|
else |
|
|
|
cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" |
|
|
|
return_code=$? |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
if [ $return_code != 0 ] ; then |
|
|
|
echo "Error in cmake. Exiting..." |
|
|
|
exit $return_code |