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: ...@@ -14,7 +14,7 @@ before_install:
script: script:
- echo "Lima code in Lima/, cloning only processlib sbmodule" - 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." - 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' - docker exec lima-ci-docker /bin/sh -c 'cd /root/Lima/ && ./install.sh python tests'
......
...@@ -154,7 +154,7 @@ if(LIMA_ENABLE_PYTHON) ...@@ -154,7 +154,7 @@ if(LIMA_ENABLE_PYTHON)
elseif(UNIX) elseif(UNIX)
set(SIP_TAGS POSIX_PLATFORM) set(SIP_TAGS POSIX_PLATFORM)
endif(WIN32) endif(WIN32)
set(SIP_EXTRA_OPTIONS -e -g) set(SIP_EXTRA_OPTIONS -e -g)
endif() endif()
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
......
...@@ -56,6 +56,7 @@ fi ...@@ -56,6 +56,7 @@ fi
mkdir python mkdir python
cmake_install_path=$(pwd) cmake_install_path=$(pwd)
cd $script_path cd $script_path
if [ ! -f "config.txt" ]; then if [ ! -f "config.txt" ]; then
cp config.txt_default config.txt cp config.txt_default config.txt
...@@ -70,7 +71,7 @@ cd $cmake_build_path ...@@ -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" 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. #speed of compilation depend on number of processors.
numberpr=$(nproc) numberpr=$(nproc | bc)
numberpr=$(($numberpr + 1)) numberpr=$(($numberpr + 1))
make -j$numberpr make -j$numberpr
......
...@@ -22,37 +22,71 @@ ...@@ -22,37 +22,71 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################ ############################################################################
import sys import sys
import subprocess
import os
configFile = 'scripts/config.txt' configFile = 'scripts/config.txt'
#### DEV ####
def ConfigGitandOptions(options): def ConfigGitandOptions(options):
optionName=[] optionName=[]
config = [] config = []
del options[0] 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: for arg in options:
if "camera/" in str(arg): if "camera/" in str(arg):
optionName.append(str.upper(str(arg)[7:])) optionName.append(str.upper(str(arg)[7:]))
elif "third-party/" in str(arg): elif "third-party/" in str(arg):
optionName.append(str.upper(str(arg)[12:])) optionName.append(str.upper(str(arg)[12:]))
else:
#probably test or python options.
optionName.append(str.upper(str(arg)))
with open(configFile) as f: with open(configFile) as f:
for line in f: for line in f:
line=line[:-1] for fuck in optionName:
for option in optionName: if fuck in line:
if option in line: line=line[:-2]
line=line[:-1]
line=line+str(1) line=line+str(1)
if line.startswith('LIMA'): if line.startswith('LIMA'):
if line[len(line)-1]==str(1): if line[len(line)-1]==str(1):
config.append("-D"+line) config.append("-D"+line)
config= " ".join([str(cmd) for cmd in config]) elif line.startswith('CMAKE') or line.startswith('PYTHON'):
return config config.append("-D"+line)
config= " ".join([str(cmd) for cmd in config])
return config
f.close() 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__': if __name__ == '__main__':
config = ConfigGitandOptions(sys.argv) config = ConfigGitandOptions(sys.argv)
#config = getModuleConfig()
print config 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