Commit e833b264 authored by Aitor Henry's avatar Aitor Henry Committed by Sebastien Petitdemange

changed the script install_lima_submodule in order to use it if Lima/ exist

parent cc42d778
......@@ -14,7 +14,7 @@ before_install:
script:
- echo "Lima code in Lima/, cloning only processlib sbmodule"
- docker exec lima-ci-docker /bin/sh -c 'unset https_proxy && unset http_proxy && cd /root/Lima && git submodule init third-party/Processlib && git submodule update && git submodule foreach 'git fetch && git checkout cmake''
- docker exec lima-ci-docker /bin/sh -c 'unset https_proxy && unset http_proxy && cd /root && ./install_lima_submodule'
- echo "Compilation of limacore with python and tests as options."
- docker exec lima-ci-docker /bin/sh -c 'cd /root/Lima/ && ./install.sh python tests'
......
......@@ -56,6 +56,7 @@ fi
mkdir python
cmake_install_path=$(pwd)
cd $script_path
if [ ! -f "config.txt" ]; then
cp config.txt_default config.txt
......@@ -70,7 +71,7 @@ cd $cmake_build_path
cmake -G"Unix Makefiles" $source_path -DCMAKE_INSTALL_PREFIX="$cmake_install_path" $compileoptions -DPYTHON_SITE_PACKAGES_DIR="$cmake_install_path/python"
#speed of compilation depend on number of processors.
numberpr=$(nproc)
numberpr=$(nproc | bc)
numberpr=$(($numberpr + 1))
make -j$numberpr
......
......@@ -22,37 +22,71 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
import sys
import subprocess
import os
configFile = 'scripts/config.txt'
#### DEV ####
def ConfigGitandOptions(options):
optionName=[]
config = []
del options[0]
"""os.system("git submodule --quiet init third-party/Processlib")
for arg in options:
os.system("git submodule --quiet init " + str(arg))
os.system("git submodule --quiet update")
test="git submodule --quiet foreach './../../scripts/submodules ${path}'"
os.system(test)"""
subprocess.call(["git", "submodule", "--quiet", "init", "third-party/Processlib"])
for arg in options:
subprocess.call(["git", "submodule", "--quiet", "init", str(arg)])
#print str(arg)
subprocess.call(["git", "submodule", "--quiet", "update"])
subprocess.call(["git", "submodule", "--quiet", "foreach", "./../../scripts/submodules ${path}"])
for arg in options:
if "camera/" in str(arg):
optionName.append(str.upper(str(arg)[7:]))
elif "third-party/" in str(arg):
optionName.append(str.upper(str(arg)[12:]))
else:
#probably test or python options.
optionName.append(str.upper(str(arg)))
with open(configFile) as f:
for line in f:
line=line[:-1]
for option in optionName:
if option in line:
line=line[:-1]
for fuck in optionName:
if fuck in line:
line=line[:-2]
line=line+str(1)
if line.startswith('LIMA'):
if line[len(line)-1]==str(1):
config.append("-D"+line)
elif line.startswith('CMAKE') or line.startswith('PYTHON'):
config.append("-D"+line)
config= " ".join([str(cmd) for cmd in config])
return config
f.close()
#### DEV ####
"""
def getModuleConfig():
config = []
try:
with open(configFile) as f:
for line in f:
if line.startswith('LIMA'):
if line[len(line)-2]==str(1):
config.append("-D"+line[:-1])
elif line.startswith('CMAKE') or line.startswith('PYTHON'):
config.append("-D"+line[:-1])
config= " ".join([str(cmd) for cmd in config])
return config
except IOError:
print 'Error'
raise
"""
if __name__ == '__main__':
config = ConfigGitandOptions(sys.argv)
#config = getModuleConfig()
print config
#!/usr/bin/env bash
set -x
substr=camera/
if [[ $1 == ${substr}* ]];then
module=$(echo lima-$1|sed "s!/!-!g")
else
module=$(echo ${1##*/})
module=${module,,}
fi
git remote rm gitlab
git remote add gitlab git@gitlab.esrf.fr:limagroup/${module}.git
git fetch gitlab
git checkout gitlab/cmake
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment