Integration of basler camera into makefiles

parent 56791364
......@@ -195,6 +195,38 @@ build_targets += $(maxipix-full)
endif
############################
# LIMA - BASLER
############################
ifneq ($(COMPILE_BASLER),0)
BASLER_LDFLAGS := -L. -L/opt/pylon/lib64
BASLER_LDLIBS := -lpylonbase
name := basler
basler-objs := ../camera/basler/src/Basler.o
version-file := ../camera/basler/VERSION
basler-flags := $(BASLER_LDFLAGS)
basler-deps := $(BASLER_LDLIBS)
full-version := $(shell cat $(version-file))
maj-version := $(shell echo $(full-version) | cut -f1 -d.)
basler-base := liblima$(name).so
basler-full := $(basler-base).$(full-version)
basler-maj := $(basler-base).$(maj-version)
basler-flags += -fPIC -Wl,-soname,$(basler-maj)
$(basler-full): $(basler-objs)
$(CXX) -shared -o $@ $(basler-flags) $+ $(basler-deps)
rm -f $(basler-maj); ln -s $(basler-full) $(basler-maj)
rm -f $(basler-base); ln -s $(basler-maj) $(basler-base)
build_targets += $(basler-full)
endif
src: $(build_targets)
test:
......
......@@ -39,4 +39,14 @@ ifneq ($(COMPILE_MAXIPIX),0)
sub-dirs += maxipix
endif
ifndef COMPILE_BASLER
COMPILE_BASLER = 0
endif
ifneq ($(COMPILE_BASLER),0)
sub-dirs += basler
CXXFLAGS+=-DLESSDEPENDENCY
export CXXFLAGS
endif
include ../global.inc
......@@ -27,8 +27,9 @@ COMPILE_ESPIA=0
COMPILE_FRELON=0
COMPILE_MAXIPIX=0
COMPILE_PILATUS=0
COMPILE_BASLER=0
COMPILE_CBF_SAVING=0
export COMPILE_CORE COMPILE_SPS_IMAGE COMPILE_SIMULATOR \
COMPILE_ESPIA COMPILE_FRELON COMPILE_MAXIPIX COMPILE_PILATUS \
COMPILE_CBF_SAVING
COMPILE_BASLER COMPILE_CBF_SAVING
......@@ -84,6 +84,13 @@ PILATUS_MAJ_VERSION = $(shell echo $(PILATUS_FULL_VERSION) | cut -d. -f1)
INSTALL_PILATUS_VDIR = $(INSTALL_PILATUS_DIR)/v$(PILATUS_FULL_VERSION)
endif
ifneq ($(COMPILE_BASLER), 0)
INSTALL_BASLER_DIR = $(INSTALL_PLAT_DIR)/Basler
BASLER_FULL_VERSION = $(shell cat camera/basler/VERSION)
BASLER_MAJ_VERSION = $(shell echo $(BASLER_FULL_VERSION) | cut -d. -f1)
INSTALL_BASLER_VDIR = $(INSTALL_BASLER_DIR)/v$(BASLER_FULL_VERSION)
endif
.PHONY: install
install:
......@@ -140,3 +147,11 @@ ifneq ($(COMPILE_PILATUS), 0)
cp camera/pilatus/python/__init__.py $(INSTALL_PILATUS_DIR)
cp camera/pilatus/python/*.py $(INSTALL_PILATUS_VDIR)
endif
ifneq ($(COMPILE_BASLER), 0)
mkdir -p $(INSTALL_BASLER_VDIR)
cp camera/basler/python/__init__.py $(INSTALL_BASLER_DIR)
rm -rf $(INSTALL_LIB_DIR)/liblimabasler.so*
cp build/liblimabasler.so.$(BASLER_FULL_VERSION) $(INSTALL_LIB_DIR)
cp -d build/liblimabasler.so.$(BASLER_MAJ_VERSION) $(INSTALL_LIB_DIR)
cp sip/basler/limabasler.so $(INSTALL_BASLER_VDIR)
endif
......@@ -9,6 +9,7 @@ espia/
frelon/
maxipix/
simulator/
basler/
*.obj
lima*.exp
lima*.lib
......
......@@ -41,6 +41,10 @@ ifneq ($(COMPILE_MAXIPIX), 0)
sip-modules += maxipix
endif
ifneq ($(COMPILE_BASLER), 0)
sip-modules += basler
endif
all: src
src:
......
......@@ -31,7 +31,8 @@ modules = [('core', ['common', 'hardware', 'control']),
('simulator', [os.path.join('camera','simulator')]),
('espia', [os.path.join('camera','common','espia')]),
('frelon', [os.path.join('camera','frelon')]),
('maxipix', [os.path.join('camera','maxipix')])]
('maxipix', [os.path.join('camera','maxipix')]),
('basler', [os.path.join('camera','basler')])]
espiaModules = ['espia', 'frelon', 'maxipix']
......@@ -75,6 +76,7 @@ def main():
excludeMods.add(var.split('_')[-1].lower())
for modName, modDirs in modules:
extra_cxxflags = []
if modName in excludeMods:
continue
......@@ -125,7 +127,11 @@ def main():
espia_base = '/segfs/bliss/source/driver/linux-2.6/espia'
espia_incl = os.path.join(espia_base,'src')
extraIncludes += [espia_incl]
if(modName == 'basler') :
extraIncludes += ['/opt/pylon/include','/opt/pylon/include/genicam']
extra_cxxflags += ['-DLESSDEPENDENCY','-DUSE_GIGE']
extraIncludes += findModuleIncludes(modName)
sipFile = open(sipFileName,"a")
......@@ -206,11 +212,11 @@ def main():
makefile.extra_libs = ['liblima%s' % modName,'libprocesslib']
if modName != 'core' :
makefile.extra_libs += ['liblimacore']
makefile.extra_cxxflags = ['/EHsc']
makefile.extra_cxxflags = ['/EHsc'] + extra_cxxflags
makefile.extra_lib_dirs = glob.glob(os.path.join(rootName('build'),'msvc','9.0','*','Release'))
else:
makefile.extra_libs = ['pthread','lima%s' % modName]
makefile.extra_cxxflags = ['-pthread', '-g','-DWITH_SPS_IMAGE']
makefile.extra_cxxflags = ['-pthread', '-g','-DWITH_SPS_IMAGE'] + extra_cxxflags
makefile.extra_lib_dirs = [rootName('build')]
makefile.extra_cxxflags.extend(['-I' + x for x in extraIncludes])
......
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