-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
executable file
·125 lines (104 loc) · 2.96 KB
/
Rakefile
File metadata and controls
executable file
·125 lines (104 loc) · 2.96 KB
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
123
124
125
require_relative "./cmake_utils/Rakefile_common.rb"
CLEAN.include ["./**/*.o", "./**/*.obj", "./bin/**/example*", "./build"]
CLEAN.clear_exclude.exclude { |fn| fn.pathmap("%f").downcase == "core" }
CLOBBER.include []
desc "default task --> build"
task :default => :build
desc "compile for Visual Studio"
task :build_win do
# check architecture
case `where cl.exe`.chop
when /x64\\cl\.exe/
VS_ARCH = 'x64'
when /amd64\\cl\.exe/
VS_ARCH = 'x64'
when /bin\\cl\.exe/
VS_ARCH = 'x86'
else
raise RuntimeError, "Cannot determine architecture for Visual Studio".red
end
FileUtils.rm_rf "build"
FileUtils.mkdir_p "build"
FileUtils.cd "build"
puts "run CMAKE for CLOTHOIDS".yellow
sh "cmake -G Ninja -DBITS:VAR=#{VS_ARCH} " + cmd_cmake_build() + ' ..'
puts "compile with CMAKE for CLOTHOIDS".yellow
if COMPILE_DEBUG then
sh 'cmake --build . --config Debug --target install '+PARALLEL
else
sh 'cmake --build . --config Release --target install '+PARALLEL
end
FileUtils.cd '..'
end
desc "compile for OSX/LINUX/MINGW"
task :build_osx_linux_mingw do
dir = "build"
FileUtils.rm_rf dir
FileUtils.mkdir_p dir
FileUtils.cd dir
puts "run CMAKE for CLOTHOIDS".yellow
sh "cmake -G Ninja " + cmd_cmake_build + ' ..'
puts "compile with CMAKE for CLOTHOIDS".yellow
if COMPILE_DEBUG then
sh 'cmake --build . --config Debug --target install '+PARALLEL
else
sh 'cmake --build . --config Release --target install '+PARALLEL
end
FileUtils.cd '..'
end
task :clean_osx_linux_mingw do
FileUtils.rm_rf 'build'
FileUtils.rm_rf 'lib'
FileUtils.rm_rf 'lib3rd'
end
task :build_osx => :build_osx_linux_mingw do end
task :build_linux => :build_osx_linux_mingw do end
task :build_mingw => :build_osx_linux_mingw do end
task :clean_osx => :clean_osx_linux_mingw do end
task :clean_linux => :clean_osx_linux_mingw do end
task :clean_mingw => :clean_osx_linux_mingw do end
task :clean_win => :clean_osx_linux_mingw do end
desc 'pack for OSX/LINUX/MINGW/WINDOWS'
task :cpack do
FileUtils.cd "build"
puts "run CPACK for CLOTHOIDS".yellow
sh 'cpack -C CPackConfig.cmake'
sh 'cpack -C CPackSourceConfig.cmake'
FileUtils.cd ".."
end
desc 'compile without rebuild the proj'
task :compile do
FileUtils.cd "build"
puts "run compile for MPL".yellow
sh 'cmake --build . --config Release --target install '+PARALLEL
FileUtils.cd ".."
end
desc 'compile without rebuild the proj'
task :run_tests do
FileUtils.cd "bin"
puts "run tests for MPL".yellow
Dir.glob('./*.exe') do |filename|
puts "run test: #{filename}".blue
sh "./"+filename + " &"
end
FileUtils.cd ".."
end
desc 'documentation'
task :doc do
FileUtils.rm_rf "doc"
FileUtils.mkdir_p "doc"
sh "doxygen"
FileUtils.cd "latex"
sh "make"
FileUtils.cd ".."
end
desc 'doc'
task :doc2 do
FileUtils.rm_rf "doc"
FileUtils.mkdir_p "doc"
sh "doxygen"
FileUtils.cd "latex"
sh "make"
FileUtils.cd ".."
sh "open docs/index.html"
end