From f9475e38aaf1438db29f4c34bbd948080c6ba505 Mon Sep 17 00:00:00 2001 From: Laurent Claustre Date: Mon, 12 Aug 2019 14:27:13 +0200 Subject: [PATCH 1/2] prepared for 1.9 --- .gitlab-ci.yml | 3 +-- CMakeLists.txt | 44 +++++++++++++----------------------------- conda/camera/meta.yaml | 7 ++++++- conda/tango/bld.bat | 8 +++++++- conda/tango/build.sh | 5 ++++- conda/tango/meta.yaml | 11 ++++++++++- tango/CMakeLists.txt | 38 ++++++++++++++++++++++++++++++++++++ 7 files changed, 79 insertions(+), 37 deletions(-) create mode 100644 tango/CMakeLists.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c02c0d8..58989d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,7 +46,7 @@ deploy-devel: only: - branches except: - - stable + - master when: manual deploy-stable: @@ -65,4 +65,3 @@ deploy-stable: - linux only: - tags - - stable diff --git a/CMakeLists.txt b/CMakeLists.txt index 814d48b..8e929f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ ########################################################################### # This file is part of LImA, a Library for Image Acquisition # -# Copyright (C) : 2009-2017 +# Copyright (C) : 2009-2019 # European Synchrotron Radiation Facility -# BP 220, Grenoble 38043 +# CS40220 38043 Grenoble Cedex 9 # FRANCE # # Contact: lima@esrf.fr @@ -26,8 +26,6 @@ cmake_minimum_required(VERSION 3.1) project(slsdetector) -set(NAME slsdetector) - # Include additional modules that are used inconditionnaly include(GNUInstallDirs) include(GenerateExportHeader) @@ -58,11 +56,13 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) endif() if (CAMERA_MASTER_PROJECT) - find_package(Lima REQUIRED) + find_package(Lima REQUIRED COMPONENTS devel tools) endif() # CMake additional macros -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH}) + +include(LimaTools) # Set version include(project_version) @@ -70,31 +70,11 @@ include(project_version) # Enable python binding code compilation using sip generator if (CAMERA_MASTER_PROJECT) option(LIMA_ENABLE_PYTHON "compile python binding code?" OFF) -endif() + option(LIMA_ENABLE_PYTANGO_SERVER "install python tango server?" OFF) -if (LIMA_ENABLE_PYTHON) - # Find python interpreter and libs - find_package(PythonInterp) - find_package(PythonLibs) - if(${PYTHONINTERP_FOUND}) - # python site-packages folder - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())" - OUTPUT_VARIABLE _PYTHON_SITE_PACKAGES_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) + if (LIMA_ENABLE_PYTHON) + limatools_find_python_and_sip() endif() - - set(PYTHON_SITE_PACKAGES_DIR ${_PYTHON_SITE_PACKAGES_DIR} CACHE PATH "where should python modules be installed?") - - find_package(SIP REQUIRED) - include(SIPMacros) - if(WIN32) - set(SIP_TAGS WIN32_PLATFORM) - elseif(UNIX) - set(SIP_TAGS POSIX_PLATFORM) - endif(WIN32) - set(SIP_EXTRA_OPTIONS -e -g) - - find_package(NumPy REQUIRED) endif() # Additional packages @@ -160,7 +140,6 @@ target_link_libraries(slsdetector # Binding code for python if(LIMA_ENABLE_PYTHON) - include(LimaTools) limatools_run_sip_for_camera(slsdetector) endif() @@ -202,7 +181,10 @@ if(LIMA_ENABLE_PYTHON) install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python/ DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/SlsDetector" - ) + ) + if (LIMA_ENABLE_PYTANGO_SERVER) + add_subdirectory(tango) + endif() endif() ## Tests diff --git a/conda/camera/meta.yaml b/conda/camera/meta.yaml index d6602ad..fcf13b2 100644 --- a/conda/camera/meta.yaml +++ b/conda/camera/meta.yaml @@ -1,4 +1,9 @@ -{% set version = GIT_DESCRIBE_TAG[1:] %} +# Strip the 'v' from the version tag +{% if GIT_DESCRIBE_TAG is defined %} +{% set version = GIT_DESCRIBE_TAG[1:] %} +{% else %} +{% set version = "0.0.0" %} +{% endif %} package: name: lima-camera-slsdetector diff --git a/conda/tango/bld.bat b/conda/tango/bld.bat index adc93a7..74bfc20 100644 --- a/conda/tango/bld.bat +++ b/conda/tango/bld.bat @@ -1 +1,7 @@ -xcopy tango\*.* %SP_DIR%\Lima\Server\camera\ +cd tango + +cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX% +IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL% + +cmake --build build --config Release --target install +IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL% diff --git a/conda/tango/build.sh b/conda/tango/build.sh index 662827a..d02fde0 100644 --- a/conda/tango/build.sh +++ b/conda/tango/build.sh @@ -1 +1,4 @@ -mkdir -p $SP_DIR/Lima/Server/camera && cp tango/*.* $SP_DIR/Lima/Server/camera +#!/bin/bash +cd tango/ +cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX +cmake --build build --target install diff --git a/conda/tango/meta.yaml b/conda/tango/meta.yaml index 2d08d26..939bfa9 100644 --- a/conda/tango/meta.yaml +++ b/conda/tango/meta.yaml @@ -1,4 +1,9 @@ -{% set version = GIT_DESCRIBE_TAG[1:] %} +# Strip the 'v' from the version tag +{% if GIT_DESCRIBE_TAG is defined %} +{% set version = GIT_DESCRIBE_TAG[1:] %} +{% else %} +{% set version = "0.0.0" %} +{% endif %} package: name: lima-camera-slsdetector-tango @@ -12,6 +17,10 @@ build: noarch: python requirements: + build: + - cmake + - git + - lima-core run: - lima-tango-server - lima-camera-slsdetector diff --git a/tango/CMakeLists.txt b/tango/CMakeLists.txt new file mode 100644 index 0000000..f16b461 --- /dev/null +++ b/tango/CMakeLists.txt @@ -0,0 +1,38 @@ +########################################################################### +# This file is part of LImA, a Library for Image Acquisition +# +# Copyright (C) : 2009-2019 +# 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 . +############################################################################ + +cmake_minimum_required(VERSION 3.1) + +project(slsdetector_tango NONE) + +# use lima toolbox function, +# if cmake is ran out of camera mother project, check python environment +if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) + find_package(Lima REQUIRED COMPONENTS tools) + set(CMAKE_MODULE_PATH + ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH}) + include(LimaTools) +endif() + +limatools_install_camera_tango("SlsDetector.py") -- GitLab From dc34ea782c660287820a5c5883bd130d2c6a3ab5 Mon Sep 17 00:00:00 2001 From: Laurent Claustre Date: Fri, 16 Aug 2019 14:06:35 +0200 Subject: [PATCH 2/2] Update conda channel to tango-controls for pytango package --- .gitignore | 3 ++- .gitlab-ci.yml | 2 +- README.md | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2af8740..f3af6fe 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ \#*\# .\#* *.pyc - +build/ +tango/build/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58989d2..5587e13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ build-noarch: <<: *build-conda stage: build-noarch script: - - conda build ./conda/tango --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable + - conda build ./conda/tango --prefix-length=80 --output-folder=dist/ -c tango-controls --channel=http://bcu-ci.esrf.fr/stable dependencies: - build-linux diff --git a/README.md b/README.md index 8d6f44c..734b359 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ conda install -c esrf-bcu lima-camera-slsdetector ### Camera tango device server -conda install -c esrf-bcu lima-camera-slsdetector-tango +conda install -c tango-controls -c esrf-bcu lima-camera-slsdetector-tango # LImA @@ -26,5 +26,6 @@ Lima is a C++ library which can be used with many different cameras. The library ## Documentation -The documentation is available [here](https://lima1.readthedocs.io/) +The documentation is available [here](https://lima.blissgarden.org) + -- GitLab