Commit 6c4b4f71 authored by Sebastien Petitdemange's avatar Sebastien Petitdemange
Browse files

Merge branch 'cmake'

parents e7b56a40 ce963b62
stages:
- build
- test
build :
stage: build
script:
- cd ..
- cp -R /root/* .
- ./install_lima_submodule
- cd lima/camera/eiger
- cp -R ../../../lima-camera-eiger/* .
- cd ../..
- ./install.sh camera/eiger python tests cbf fits tiff hdf5 config
- cd ../lima-camera-eiger
- cp -R ../lima .
artifacts:
paths:
- lima/
only:
- cmake
test :
stage: test
dependencies:
- build
script:
- cd ..
- cp -R lima-camera-eiger/lima .
- cd lima/build/
- ctest --timeout 10
only:
- cmake
sudo: required
language: cpp
git:
submodules: false
services:
- docker
before_install:
- docker pull esrfbliss/lima-ci-debian8
- docker run --name lima-ci-docker -v $(pwd):/src-ci/ -dit esrfbliss/lima-ci-debian8
script:
- echo "Unset esrf proxy from docker and cloning GitHub repositories"
- docker exec lima-ci-docker /bin/sh -c 'unset https_proxy && unset http_proxy && cd /root && ./install_lima_submodule'
- echo "copy the camera code from the pull request"
- docker exec lima-ci-docker /bin/sh -c 'cd /root/Lima/camera/eiger && cp -R /src-ci/* .'
- echo "Compiling Lima and camera eiger with options"
- docker exec lima-ci-docker /bin/sh -c 'cd /root/Lima/ && ./install.sh camera/eiger python tests cbf fits tiff hdf5 config'
- echo "Executing tests in build repository"
- docker exec lima-ci-docker /bin/sh -c 'cd /root/Lima/build/ && ctest --timeout 10'
after-script:
- docker stop lima-ci-docker
- docker rm lima-ci-docker
branches:
only:
- cmake
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
#
# Contact: lima@esrf.fr
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
set(NAME "eiger")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--add-needed")
set(EIGER_SDK_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/sdk" CACHE PATH "location of eiger sdk")
#SOURCES
set(${NAME}_srcs src/EigerCamera.cpp src/EigerInterface.cpp
src/EigerDetInfoCtrlObj.cpp src/EigerSyncCtrlObj.cpp
src/EigerDecompress.cpp src/EigerSavingCtrlObj.cpp
src/EigerStream.cpp src/EigerDecompress.h
src/EigerStream.h sdk/linux/EigerAPI/src/CurlLoop.cpp
sdk/linux/EigerAPI/src/Requests.cpp)
add_library(lima${NAME} SHARED ${${NAME}_srcs})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#only possible after cmake 3.1.3
#TARGET_COMPILE_FEATURES(limaeiger PRIVATE -std=c++11)
#INCLUDEs
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(lima${NAME} PUBLIC "${EIGER_SDK_ROOT}/linux/EigerAPI/include")
target_include_directories(lima${NAME} PUBLIC "/usr/include/jsoncpp")
#LIBRARIES
find_library(EIGER_CURL_LIB curl)
find_library(EIGER_LZ4_LIB lz4)
find_library(EIGER_ZMQ_LIB zmq)
find_library(EIGER_JSONCPP_LIB jsoncpp)
if (("${EIGER_CURL_LIB}" STREQUAL "EIGER_CURL_LIB-NOTFOUND"))
message(FATAL_ERROR "${NAME} : libcurl not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
if (("${EIGER_ZMQ_LIB}" STREQUAL "EIGER_ZMQ_LIB-NOTFOUND"))
message(FATAL_ERROR "${NAME} : libzmq not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
if (("${EIGER_JSONCPP_LIB}" STREQUAL "EIGER_JSONCPP_LIB-NOTFOUND"))
message(FATAL_ERROR "${NAME} : libjsoncpp not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
if (("${EIGER_LZ4_LIB}" STREQUAL "EIGER_LZ4_LIB-NOTFOUND"))
message(FATAL_ERROR "${NAME} : liblz4 not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} ${EIGER_CURL_LIB})
target_link_libraries(lima${NAME} ${EIGER_LZ4_LIB})
target_link_libraries(lima${NAME} ${EIGER_ZMQ_LIB})
target_link_libraries(lima${NAME} ${EIGER_JSONCPP_LIB})
limatools_set_library_soversion(lima${NAME} "VERSION")
install(TARGETS lima${NAME} LIBRARY DESTINATION lib)
if(LIMA_ENABLE_PYTHON)
limatools_run_sip_for_camera(${NAME})
install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Eiger")
endif()
src-dirs = src
test-dirs =
include ../../global.inc
......@@ -19,22 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
from Lima import module_helper
mod_path = __path__
depends_on = 'Core'
has_dependent = False
cleanup_data = module_helper.load_prepare(mod_path, depends_on, has_dependent)
from Lima import Core
cleanup_data = module_helper.load_dep_cleanup(cleanup_data)
from Lima.Eiger.limaeiger import Eiger as _B
from limaeiger import Eiger as _B
globals().update(_B.__dict__)
module_helper.load_cleanup(cleanup_data)
del mod_path, depends_on, has_dependent, cleanup_data
del module_helper
sdk-objs = CurlLoop.o Requests.o
SRCS = $(sdk-objs:.o=.cpp)
JSON_INCLUDES = $(shell pkg-config --cflags jsoncpp)
CXXFLAGS += -std=c++11 -I../include -Wall -DCOMPILATION_WITH_CURL \
$(JSON_INCLUDES) \
-pthread -fPIC -g
all: EigerSDK.o
EigerSDK.o: $(sdk-objs)
$(LD) -o $@ -r $+
clean:
rm -f *.o *.P
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
.PHONY: check-syntax
check-syntax:
$(CXX) -Wall -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES)
eiger-objs = EigerCamera.o EigerInterface.o EigerDetInfoCtrlObj.o EigerSyncCtrlObj.o EigerSavingCtrlObj.o EigerStream.o EigerDecompress.o
SRCS = $(eiger-objs:.o=.cpp)
JSON_INCLUDES = $(shell pkg-config --cflags jsoncpp)
CXXFLAGS += -std=c++11 -I../include -I../../../hardware/include -I../../../common/include\
-I../sdk/linux/EigerAPI/include \
-I../../../third-party/Processlib/core/include \
$(JSON_INCLUDES) \
-Wall -pthread -fPIC -g
all: Eiger.o
Eiger.o: ../sdk/linux/EigerAPI/src/EigerSDK.o $(eiger-objs)
$(LD) -o $@ -r $+
../sdk/linux/EigerAPI/src/EigerSDK.o: FORCE
make -C ../sdk/linux/EigerAPI/src EigerSDK.o
FORCE:
clean:
make -C ../sdk/linux/EigerAPI/src clean
rm -f *.o *.P
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
.PHONY: check-syntax
check-syntax:
$(CXX) -Wall -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES)
Supports Markdown
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