Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
alta
alta
Commits
cd59417b
Commit
cd59417b
authored
Oct 09, 2013
by
Laurent Belcour
Browse files
Improving scons building system
parent
987c8cf5
Changes
4
Hide whitespace changes
Inline
Side-by-side
external/obtain.py
0 → 100644
View file @
cd59417b
import
urllib
import
os
import
sys
import
shutil
# Check if the build dir exists
if
not
os
.
path
.
exists
(
'build'
):
os
.
mkdir
(
'build'
)
#end
# Download a file
def
download
(
url
,
filename
):
urllib
.
urlretrieve
(
url
,
filename
)
#end
# Uncompress the archive
def
uncompress
(
filename
):
cmd
=
''
;
if
os
.
name
==
'posix'
:
cmd
=
'tar -xf '
elif
os
.
name
==
'nt'
:
cmd
=
'7zip '
cmd
+=
filename
ret
=
os
.
system
(
cmd
)
#end
# Obtain a package and uncompress it
def
obtain
(
name
,
rep
,
url
,
filename
):
if
not
os
.
path
.
exists
(
rep
):
print
'<<INSTALL>> Obtaining '
+
name
download
(
url
,
filename
)
uncompress
(
filename
)
else
:
print
'<<INSTALL>> '
+
name
+
' already available'
#end
#end
def
configure_build
(
rep
):
os
.
chdir
(
rep
)
ret
=
os
.
system
(
'./configure -q --prefix='
+
os
.
getcwd
()
+
os
.
sep
+
os
.
pardir
+
os
.
sep
+
'build'
)
if
ret
!=
0
:
print
'<<ERROR>> unable to configure package'
exit
#end
ret
=
os
.
system
(
'make -s && make -s install'
)
if
ret
!=
0
:
print
'<<ERROR>> unable to build & install package'
exit
#end
os
.
chdir
(
os
.
pardir
)
#end
external/obtain_ceres.py
View file @
cd59417b
import
urllib
import
obtain
import
os
import
sys
import
shutil
# Download a file
def
download
(
url
,
filename
):
urllib
.
urlretrieve
(
url
,
filename
)
#end
# Uncompress the archive
def
uncompress
(
filename
):
cmd
=
''
;
if
os
.
name
==
'posix'
:
cmd
=
'tar -xf '
elif
os
.
name
==
'nt'
:
cmd
=
'7zip '
cmd
+=
filename
ret
=
os
.
system
(
cmd
)
#end
# Obtain a package and uncompress it
def
obtain
(
name
,
rep
,
url
,
filename
):
if
not
os
.
path
.
exists
(
rep
):
print
'<<INSTALL>> Obtaining '
+
name
download
(
url
,
filename
)
uncompress
(
filename
)
else
:
print
'<<INSTALL>> '
+
name
+
' already available'
#end
#end
def
configure_build
(
rep
):
os
.
chdir
(
rep
)
ret
=
os
.
system
(
'./configure -q --prefix='
+
os
.
getcwd
()
+
os
.
sep
+
os
.
pardir
+
os
.
sep
+
'build'
)
if
ret
!=
0
:
print
'<<ERROR>> unable to configure package'
exit
#end
ret
=
os
.
system
(
'make -s && make -s install'
)
if
ret
!=
0
:
print
'<<ERROR>> unable to build & install package'
exit
#end
os
.
chdir
(
os
.
pardir
)
#end
# Check if the build dir exists
if
not
os
.
path
.
exists
(
'build'
):
os
.
mkdir
(
'build'
)
#end
# Download GLOG
obtain
(
'GLOG v0.3.3'
,
'glog-0.3.3'
,
'http://google-glog.googlecode.com/files/glog-0.3.3.tar.gz'
,
'glog-0.3.3.tar.gz'
)
obtain
.
obtain
(
'GLOG v0.3.3'
,
'glog-0.3.3'
,
'http://google-glog.googlecode.com/files/glog-0.3.3.tar.gz'
,
'glog-0.3.3.tar.gz'
)
if
os
.
name
==
'nt'
:
print
'<<WARNING>> no automatic installation for this package'
else
:
print
'<<INSTALL>> configure and build GLOG v0.3.3'
configure_build
(
'glog-0.3.3'
)
obtain
.
configure_build
(
'glog-0.3.3'
)
#end
# Download Eigen3
obtain
(
'Eigen v3.2.1'
,
'eigen-eigen-ffa86ffb5570'
,
'http://bitbucket.org/eigen/eigen/get/3.2.0.tar.gz'
,
'eigen-3.2.1.tar.gz'
)
shutil
.
copytree
(
'eigen-eigen-ffa86ffb5570'
+
os
.
sep
+
'Eigen'
,
'build'
+
os
.
sep
+
'include'
+
os
.
sep
+
'Eigen'
)
execfile
(
'obtain_eigen.py'
)
# Download CERES
obtain
(
'CERES v1.7.0'
,
'ceres-solver-1.7.0'
,
'http://ceres-solver.googlecode.com/files/ceres-solver-1.7.0.tar.gz'
,
'ceres-solver-1.7.0.tar.gz'
)
obtain
.
obtain
(
'CERES v1.7.0'
,
'ceres-solver-1.7.0'
,
'http://ceres-solver.googlecode.com/files/ceres-solver-1.7.0.tar.gz'
,
'ceres-solver-1.7.0.tar.gz'
)
print
'<<WARNING>> CERES installation requires CMake. You need to run it yourself'
external/obtain_eigen.py
0 → 100644
View file @
cd59417b
import
obtain
import
os
import
sys
import
shutil
# Download Eigen3
obtain
.
obtain
(
'Eigen v3.2.1'
,
'eigen-eigen-ffa86ffb5570'
,
'http://bitbucket.org/eigen/eigen/get/3.2.0.tar.gz'
,
'eigen-3.2.1.tar.gz'
)
rep
=
'build'
+
os
.
sep
+
'include'
+
os
.
sep
+
'Eigen'
if
not
os
.
path
.
exists
(
rep
):
shutil
.
copytree
(
'eigen-eigen-ffa86ffb5570'
+
os
.
sep
+
'Eigen'
,
rep
)
#end
sources/core/SConscript
View file @
cd59417b
env
=
Environment
()
env
.
Append
(
CPPPATH
=
'
/home/belcour/Sources/eigen
'
)
env
.
Append
(
CPPPATH
=
'
../../external/eigen-eigen-ffa86ffb5570
'
)
# Library sources
sources
=
[
'common.cpp'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment