summaryrefslogtreecommitdiff
path: root/fuzzylite/build.bat
blob: 11f62f898798e6247b5d89cfa88912b275e9f60a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@echo off
setlocal EnableDelayedExpansion
set argc=0
set valid="no"

for %%a in (%*) do (
	set /A argc+=1
	if /I "%%a"=="help" (
		call:usage
		goto:eof
	)
	if /I "%%a"=="all" set valid="yes"
	if /I "%%a"=="release" set valid="yes"
	if /I "%%a"=="debug" set valid="yes"
	if /I "%%a"=="clean" set valid="yes"
	if /I "%%a"=="documentation" set valid="yes"

	if !valid!=="no" (
		echo Invalid option: %%a
		call:usage
		goto:eof
	)
)

if %argc%==0 echo Building schedule: all
if not %argc%==0 echo Building schedule: %*
echo Starting in 3 seconds...
ping 1.1.1.1 -n 1 -w 3000 > nul
rem sleep 3 ::This function makes command line DOS-esque C:\Archiv~1

if %argc%==0 (call:all)

for %%a in (%*) do (call:%%a)

goto:eof

:debug
	echo.
	echo.
	echo ****************************************
	echo STARTING: debug

	if not exist debug mkdir debug
	cd debug
	cmake .. -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DFL_BACKTRACE=ON -DFL_USE_FLOAT=OFF -DFL_CPP98=OFF -DFL_BUILD_TESTS=ON
	nmake
	cd ..

	echo.
	echo FINISHED: debug
	echo ****************************************
	goto:eof

:release
	echo.
	echo.
	echo ****************************************
	echo STARTING: release

	if not exist release mkdir release
	cd release
	cmake .. -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DFL_BACKTRACE=OFF -DFL_USE_FLOAT=OFF -DFL_CPP98=OFF -DFL_BUILD_TESTS=ON
	nmake
	cd ..

	echo.
	echo FINISHED: release
	echo ****************************************
	goto:eof

:all
	echo.
	echo.
	echo ****************************************
	echo STARTING: all
	call:release
	call:debug
	echo.
	echo FINISHED: all
	echo ****************************************
	goto:eof

:documentation
	echo.
	echo.
	echo ****************************************
	echo STARTING: documentation

	cd ..
	doxygen
	rem TODO: cd back to previous directory. Maybe use: cd /D %~dp0
	echo.
	echo FINISHED: documentation
	echo ****************************************
	goto:eof
:clean
	echo.
	echo.
	echo ****************************************
	echo STARTING: clean
	@echo on
	if exist debug rmdir /S /Q debug
	if exist release rmdir /S /Q release
	if exist CMakeFiles rmdir /S /Q CMakeFiles
	if exist CMakeCache.txt del CMakeCache.txt
	@echo off
	echo.
	echo FINISHED: clean
	echo ****************************************
	goto:eof

:usage
    echo Usage:	build.bat [options]
    echo where	[options] can be any of the following:
    echo ^	all		builds fuzzylite in debug and release mode (default)
    echo ^	debug		builds fuzzylite in debug mode
    echo ^	release		builds fuzzylite in release mode
    echo ^	clean		erases previous builds
    echo ^	help		shows this information
	echo.

ENDLOCAL