From 01bbd5fd0af0847ac847c78c7064b3c9810a924a Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Thu, 1 Nov 2018 15:10:51 +0000 Subject: COMPMID-1737: Add support for install_dir Note: Only ComputeLibrary files get copied over (Stub CL / GLES drivers don't, nor are the 3rdparty includes) utils/ files are not copied either (They're not part of the core library) Change-Id: I55e01c0ba4a5f7e649877fcdd11fdb0a51071b18 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/156339 Reviewed-by: Pablo Tello Reviewed-by: Georgios Pinitas Tested-by: bsgcomp --- SConstruct | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 4278e0b679..c1d1f716a8 100644 --- a/SConstruct +++ b/SConstruct @@ -54,6 +54,7 @@ vars.AddVariables( BoolVariable("openmp", "Enable OpenMP backend", False), BoolVariable("cppthreads", "Enable C++11 threads backend", True), PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept), + PathVariable("install_dir", "Specify sub-folder for the install", "", PathVariable.PathAccept), #FIXME Remove before release (And remove all references to INTERNAL_ONLY) BoolVariable("internal_only", "Enable ARM internal only tests", False), ("extra_cxx_flags", "Extra CXX flags to be appended to the build command", ""), @@ -69,10 +70,32 @@ if not env['build_dir'].startswith('/'): else: SConsignFile('%s/.scons' % build_path) +install_path = env['install_dir'] +#If the install_dir is a relative path then assume it's from inside build_dir +if not env['install_dir'].startswith('/') and install_path != "": + install_path = "%s/%s" % (build_path, install_path) + env.Append(LIBPATH = [build_path]) Export('env') Export('vars') +def install_lib( lib ): + # If there is no install folder, then there is nothing to do: + if install_path == "": + return lib + return env.Install( "%s/lib/" % install_path, lib) +def install_bin( bin ): + # If there is no install folder, then there is nothing to do: + if install_path == "": + return bin + return env.Install( "%s/bin/" % install_path, bin) +def install_include( inc ): + if install_path == "": + return inc + return env.Install( "%s/include/" % install_path, inc) + +Export('install_lib') +Export('install_bin') Help(vars.GenerateHelpText(env)) @@ -252,6 +275,8 @@ if env['logging']: env.Append(CPPPATH = ['#/include', "#"]) env.Append(CXXFLAGS = env['extra_cxx_flags']) +Default( install_include("arm_compute")) + Export('version_at_least') if env['opencl']: -- cgit v1.2.1