Commit 466bafc0 authored by Laurent Claustre's avatar Laurent Claustre
Browse files

Merge branch '16-generate-conda-packages' into 'master'

Resolve "Generate conda packages"

Closes #16

See merge request !65
parents 58d8daaa 734b1935
# image : docker-registry.esrf.fr/bcu/lima-ci-debian8:latest
#before_script :
stages: stages:
- build - build
- test - deploy
build-python2 : build-conda-linux:
stage: build stage: build
script: script:
- update-alternatives --set python /usr/bin/python2.7 - conda build ./conda --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
- ./install.sh --git tests python
- ls -l
artifacts: artifacts:
paths: paths:
- build/ - dist/
tags: tags:
- lima - conda
- linux
build-python3 : build-conda-win:
stage: build stage: build
script: script:
- update-alternatives --set python /usr/bin/python3.4 #- conda build ./conda --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
- ./install.sh --git tests python - docker run --mount type=bind,source="%CD%",target="C:\sources" docker-registry.esrf.fr/bcu/conda-builder-win cmd /K cd C:\sources ^& conda build ./conda --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
- ls -l
artifacts: artifacts:
paths: paths:
- build/ - dist/
tags: tags:
- lima - conda
- win
- shell
test-python2 :
stage: test
dependencies:
- build-python2
script:
- update-alternatives --set python /usr/bin/python2.7
- cd build/
- ctest --timeout 10 --output-on-failure
tags:
- lima
test-python3 : deploy:
stage: test stage: deploy
environment:
name: production
url: http://bcu-ci.esrf.fr/stable
dependencies: dependencies:
- build-python3 - build-conda-linux
- build-conda-win
script: script:
- update-alternatives --set python /usr/bin/python3.4 - mv -Rf dist/* /conda/
- cd build/ - conda index /conda/
- ctest --timeout 10 --output-on-failure
tags: tags:
- lima - conda
- linux
when: manual
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
# European Synchrotron Radiation Facility # European Synchrotron Radiation Facility
# BP 220, Grenoble 38043 # BP 220, Grenoble 38043
# FRANCE # FRANCE
# #
# Contact: lima@esrf.fr # Contact: lima@esrf.fr
# #
# This is free software; you can redistribute it and/or modify # This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or # the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This software is distributed in the hope that it will be useful, # This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################ ############################################################################
...@@ -32,13 +32,18 @@ set(CMAKE_CXX_STANDARD 11) ...@@ -32,13 +32,18 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# cmake/ directory contains tools # cmake/ directory contains tools
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(LimaTools) include(LimaTools)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
if(MSVC AND MSVC_VERSION GREATER 1500)
# Compiler specific (parallel build)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()
if(UNIX) if(UNIX)
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
...@@ -49,7 +54,7 @@ if(UNIX) ...@@ -49,7 +54,7 @@ if(UNIX)
else() else()
option(LIMA_ENABLE_SPS_IMAGE "compile sps_image?" OFF) option(LIMA_ENABLE_SPS_IMAGE "compile sps_image?" OFF)
endif() endif()
# openGL real-time display # openGL real-time display
if(DEFINED ENV{COMPILE_GLDISPLAY}) if(DEFINED ENV{COMPILE_GLDISPLAY})
set(LIMA_ENABLE_GLDISPLAY "$ENV{COMPILE_GLDISPLAY}" CACHE BOOL "compile gldisplay?" FORCE) set(LIMA_ENABLE_GLDISPLAY "$ENV{COMPILE_GLDISPLAY}" CACHE BOOL "compile gldisplay?" FORCE)
...@@ -71,7 +76,7 @@ if(DEFINED ENV{LIMA_ENABLE_CONFIG}) ...@@ -71,7 +76,7 @@ if(DEFINED ENV{LIMA_ENABLE_CONFIG})
else() else()
option(LIMA_ENABLE_CONFIG "compile with libconfig?" OFF) option(LIMA_ENABLE_CONFIG "compile with libconfig?" OFF)
endif() endif()
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Saving formats can be enabled from environment variables using config.inc file # Saving formats can be enabled from environment variables using config.inc file
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
...@@ -95,7 +100,7 @@ if(UNIX) ...@@ -95,7 +100,7 @@ if(UNIX)
if(DEFINED ENV{LIMA_ENABLE_NXS}) if(DEFINED ENV{LIMA_ENABLE_NXS})
set(LIMA_ENABLE_NXS "$ENV{LIMA_ENABLE_NXS}" CACHE BOOL "compile Nexus saving code?" FORCE) set(LIMA_ENABLE_NXS "$ENV{LIMA_ENABLE_NXS}" CACHE BOOL "compile Nexus saving code?" FORCE)
else() else()
option(LIMA_ENABLE_NXS "compile Nexus saving code?" OFF) option(LIMA_ENABLE_NXS "compile Nexus saving code?" OFF)
endif() endif()
if(DEFINED ENV{LIMA_ENABLE_TIFF}) if(DEFINED ENV{LIMA_ENABLE_TIFF})
set(LIMA_ENABLE_TIFF "$ENV{LIMA_ENABLE_TIFF}" CACHE BOOL "compile TIFF saving code?" FORCE) set(LIMA_ENABLE_TIFF "$ENV{LIMA_ENABLE_TIFF}" CACHE BOOL "compile TIFF saving code?" FORCE)
...@@ -142,26 +147,28 @@ if(LIMA_ENABLE_PYTHON) ...@@ -142,26 +147,28 @@ if(LIMA_ENABLE_PYTHON)
if(${PYTHONINTERP_FOUND}) if(${PYTHONINTERP_FOUND})
# python site-packages folder # python site-packages folder
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())" 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) OUTPUT_VARIABLE _PYTHON_SITE_PACKAGES_DIR
else() OUTPUT_STRIP_TRAILING_WHITESPACE)
message(FATAL_ERROR "No python found, please install or disable LIMA_ENABLE_PYTHON") else()
message(FATAL_ERROR "No python found, please install or disable LIMA_ENABLE_PYTHON")
endif() endif()
find_package(SIP)
if(${SIP_FOUND})
include(SIPMacros)
else()
message(FATAL_ERROR "python SIP not installed, please install or disable LIMA_ENABLE_PYTHON")
endif()
set(PYTHON_SITE_PACKAGES_DIR ${_PYTHON_SITE_PACKAGES_DIR} CACHE PATH "where should python modules be installed?") set(PYTHON_SITE_PACKAGES_DIR ${_PYTHON_SITE_PACKAGES_DIR} CACHE PATH "where should python modules be installed?")
set(NUMPY_INCLUDE_DIR "${_PYTHON_SITE_PACKAGES_DIR}/numpy/core/include" CACHE PATH "Path to NumPy include folder") find_package(SIP)
set(NUMPY_LIB_DIR "${_PYTHON_SITE_PACKAGES_DIR}/numpy/core/lib" CACHE PATH "Path to NumPy lib folder") if(${SIP_FOUND})
include_directories(${NUMPY_INCLUDE_DIR}) include(SIPMacros)
link_directories(${NUMPY_LIB_DIR}) else()
if(!${SIP_FOUND}) message(FATAL_ERROR "python SIP not installed, please install or disable LIMA_ENABLE_PYTHON")
message(FATAL_ERROR "sip executable not found, cannot build python extensions") endif()
find_package(NumPy)
if(${NUMPY_FOUND})
include_directories(${NUMPY_INCLUDE_DIRS})
link_directories(${NUMPY_LIBRARIES})
else()
message(FATAL_ERROR "NumPy not found, cannot build python extensions")
endif() endif()
if(WIN32) if(WIN32)
set(SIP_TAGS WIN32_PLATFORM) set(SIP_TAGS WIN32_PLATFORM)
...@@ -240,7 +247,7 @@ if(LIMA_ENABLE_CONFIG) ...@@ -240,7 +247,7 @@ if(LIMA_ENABLE_CONFIG)
endif() endif()
else() else()
message(FATAL_ERROR "This compiler is not supported: " ${CMAKE_GENERATOR}) message(FATAL_ERROR "This compiler is not supported: " ${CMAKE_GENERATOR})
endif() endif()
set(LIB_CONFIG_INCLUDE_DIR "C:/Program Files/LIBCONFIG-windows/${CONFIG_VERSION}/include" CACHE PATH "Path to LIBCONFIG++ includes") set(LIB_CONFIG_INCLUDE_DIR "C:/Program Files/LIBCONFIG-windows/${CONFIG_VERSION}/include" CACHE PATH "Path to LIBCONFIG++ includes")
set(LIB_CONFIG_DIR "C:/Program Files/LIBCONFIG-windows/${CONFIG_VERSION}/lib" CACHE PATH "Path to LIBCONFIG++ lib folder") set(LIB_CONFIG_DIR "C:/Program Files/LIBCONFIG-windows/${CONFIG_VERSION}/lib" CACHE PATH "Path to LIBCONFIG++ lib folder")
find_library(LIB_CONFIG libconfig++ ${LIB_CONFIG_DIR}) find_library(LIB_CONFIG libconfig++ ${LIB_CONFIG_DIR})
...@@ -248,7 +255,7 @@ if(LIMA_ENABLE_CONFIG) ...@@ -248,7 +255,7 @@ if(LIMA_ENABLE_CONFIG)
find_library(LIB_CONFIG config++) find_library(LIB_CONFIG config++)
endif() endif()
find_path(LIB_CONFIG_INCLUDE_DIR libconfig.h++) find_path(LIB_CONFIG_INCLUDE_DIR libconfig.h++)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(config DEFAULT_MSG LIB_CONFIG LIB_CONFIG_INCLUDE_DIR) find_package_handle_standard_args(config DEFAULT_MSG LIB_CONFIG LIB_CONFIG_INCLUDE_DIR)
if(${CONFIG_FOUND}) if(${CONFIG_FOUND})
...@@ -280,150 +287,103 @@ endif() ...@@ -280,150 +287,103 @@ endif()
set(saving_libs) set(saving_libs)
set(saving_includes) set(saving_includes)
if(LIMA_ENABLE_EDFGZ) if(LIMA_ENABLE_EDFGZ)
if(WIN32) find_package(ZLIB)
if (${CMAKE_GENERATOR} MATCHES "Win64$")
set(ZLIB_ARCH "win64")
else()
set(ZLIB_ARCH "win32")
endif()
set(LIB_ZLIB_INCLUDE_DIR "C:/Program Files/zlib-windows/${ZLIB_ARCH}/include" CACHE PATH "Path to zlib includes")
set(LIB_ZLIB_DIR "C:/Program Files/zlib-windows/${ZLIB_ARCH}/lib" CACHE PATH "Path to zlib libs")
link_directories(${LIB_ZLIB_DIR})
find_library(LIB_ZLIB zlibstatic ${LIB_ZLIB_DIR})
add_definitions(-DZLIB_WINAPI)
else()
find_library(LIB_ZLIB z)
endif()
find_path(LIB_ZLIB_INCLUDE_DIR zlib.h)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZLIB DEFAULT_MSG LIB_ZLIB LIB_ZLIB_INCLUDE_DIR)
if(${ZLIB_FOUND}) if(${ZLIB_FOUND})
add_definitions(-DWITH_Z_COMPRESSION) add_definitions(-DWITH_Z_COMPRESSION)
set(saving_libs ${saving_libs} ${LIB_ZLIB}) set(saving_libs ${saving_libs} ${ZLIB_LIBRARIES})
set(saving_includes ${saving_includes} ${LIB_ZLIB_INCLUDE_DIR}) set(saving_includes ${saving_includes} ${ZLIB_INCLUDE_DIRS})
else() else()
message(FATAL_ERROR "ZLIB library not found, please install or disable LIMA_ENABLE_EDFGZ") message(FATAL_ERROR "ZLIB library not found, please install or disable LIMA_ENABLE_EDFGZ")
endif() endif()
endif() endif()
if(LIMA_ENABLE_EDFLZ4) if(LIMA_ENABLE_EDFLZ4)
# look for a lz4 1.7 where lz4frame.h was added find_package(LZ4)
find_path(LIB_LZ4_INCLUDE_DIR lz4frame.h) if (${LZ4_FOUND})
find_library(LIB_LZ4 NAMES lz4)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LZ4 DEFAULT_MSG LIB_LZ4 LIB_LZ4_INCLUDE_DIR)
if (LZ4_FOUND)
add_definitions(-DWITH_LZ4_COMPRESSION) add_definitions(-DWITH_LZ4_COMPRESSION)
set(saving_libs ${saving_libs} ${LIB_LZ4}) set(saving_libs ${saving_libs} ${LZ4_LIBRARIES})
set(saving_includes ${saving_includes} ${LIB_LZ4_INCLUDE_DIR}) set(saving_includes ${saving_includes} ${LZ4_INCLUDE_DIRS})
else() else()
message(FATAL_ERROR "LZ4 library: required version = 1.7.x, please update or switch off LIMA_ENABLE_EDFLZ4") message(FATAL_ERROR "LZ4 library: required version = 1.8.2, please update or switch off LIMA_ENABLE_EDFLZ4")
endif() endif()
endif() endif()
if(LIMA_ENABLE_CBF) if(LIMA_ENABLE_CBF)
find_path(LIB_CBF_INCLUDE_DIR cbf/cbf.h) find_package(CBF)
find_library(LIB_CBF cbf)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CBF DEFAULT_MSG LIB_CBF LIB_CBF_INCLUDE_DIR)
if (${CBF_FOUND}) if (${CBF_FOUND})
add_definitions(-DWITH_CBF_SAVING) add_definitions(-DWITH_CBF_SAVING)
add_definitions(-DPROTOTYPES) add_definitions(-DPROTOTYPES)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Cbf.cpp) set(ct_srcs ${ct_srcs} control/src/CtSaving_Cbf.cpp)
set(saving_libs ${saving_libs} ${LIB_CBF} crypto) set(saving_libs ${saving_libs} ${CBF_LIBRARIES} crypto)
set(saving_includes ${saving_includes} ${LIB_CBF_INCLUDE_DIR}) set(saving_includes ${saving_includes} ${CBF_INCLUDE_DIRS})
else() else()
message(FATAL_ERROR "CBF library not found, please install or disable LIMA_ENABLE_CBF") message(FATAL_ERROR "CBF library not found, please install or disable LIMA_ENABLE_CBF")
endif() endif()
endif() endif()
if(LIMA_ENABLE_FITS) if(LIMA_ENABLE_FITS)
find_path(LIB_FITS_INCLUDE_DIR CCfits/CCfits.h) find_package(CCFits)
find_library(LIB_CFITSIO cfitsio) if(${CCFITS_FOUND})
find_library(LIB_CCFITS CCfits)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FITS DEFAULT_MSG LIB_CCFITS LIB_FITS_INCLUDE_DIR)
if(${FITS_FOUND})
add_definitions(-DWITH_FITS_SAVING) add_definitions(-DWITH_FITS_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Fits.cpp) set(ct_srcs ${ct_srcs} control/src/CtSaving_Fits.cpp)
set(saving_libs ${saving_libs} ${LIB_CFITSIO} ${LIB_CCFITS}) set(saving_libs ${saving_libs} ${CFITSIO_LIBRARY} ${CCFITS_LIBRARY})
set(saving_includes ${saving_includes} ${LIB_FITS_INCLUDE_DIR}) set(saving_includes ${saving_includes} ${CFITSIO_INCLUDE_DIR})
else() else()
message(FATAL_ERROR "CFITSIO and/or CCFITS library not found, please install or disable LIMA_ENABLE_FITS") message(FATAL_ERROR "CFITSIO and/or CCFITS library not found, please install or disable LIMA_ENABLE_FITS")
endif() endif()
endif() endif()
if(LIMA_ENABLE_HDF5) if(LIMA_ENABLE_HDF5)
if(WIN32) #set (HDF5_USE_STATIC_LIBRARIES ON)
if (${CMAKE_GENERATOR} MATCHES "2008") find_package(HDF5 COMPONENTS CXX HL)
set(HDF5_VERSION "1.8.13") if(${HDF5_FOUND})
elseif (${CMAKE_GENERATOR} MATCHES "2015|2017") add_definitions(-DWITH_HDF5_SAVING)
set(HDF5_VERSION "1.8.20") set(ct_srcs ${ct_srcs} control/src/CtSaving_Hdf5.cpp)
else() set(saving_libs ${saving_libs} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${LIB_SZIP} ${LIB_ZLIB})
message(FATAL_ERROR "Unsupported VS version for HDF5 saving format, only vs2008 or vs2015 are supported respectively for hdf5 1.8.13 and 1.8.16") set(saving_includes ${saving_includes} ${HDF5_INCLUDE_DIRS})
endif() set(saving_definitions ${saving_definitions} ${HDF5_DEFINITIONS})
set(LIB_HDF5_INCLUDE_DIR "C:/Program Files/HDF_Group/HDF5/${HDF5_VERSION}/include" CACHE PATH "Path to HDF5 includes") else()
set(LIB_HDF5_DIR "C:/Program Files/HDF_Group/HDF5/${HDF5_VERSION}/lib" CACHE PATH "Path to HDF5 libs") message(FATAL_ERROR "HDF5 library not found, please install or disable LIMA_ENABLE_HDF5")
link_directories(${LIB_HDF5_DIR}) endif()
# we use static libs libhdf5.lib and libhdf5_cpp.lib
find_library(LIB_HDF5_CPP libhdf5_cpp ${LIB_HDF5_DIR})
find_library(LIB_HDF5 libhdf5 ${LIB_HDF5_DIR})
find_library(LIB_HDF5_HL libhdf5_hl ${LIB_HDF5_DIR})
find_library(LIB_ZLIB libzlib ${LIB_HDF5_DIR})
find_library(LIB_SZIP libszip ${LIB_HDF5_DIR})
else()
find_package(HDF5 REQUIRED COMPONENTS C CXX HL )
endif()
if(${HDF5_FOUND})
add_definitions(-DWITH_HDF5_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Hdf5.cpp)
set(saving_libs ${saving_libs} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${LIB_SZIP} ${LIB_ZLIB})
set(saving_includes ${saving_includes} ${HDF5_INCLUDE_DIRS})
else()
message(FATAL_ERROR "HDF5 libraries not found, please install or disable LIMA_ENABLE_HDF5")
endif()
if(LIMA_ENABLE_HDF5_BS) if(LIMA_ENABLE_HDF5_BS)
set(BITSHUFFLE_EXTERNALLY_CONFIGURED ON) set(BITSHUFFLE_EXTERNALLY_CONFIGURED ON)
add_subdirectory(control/bitshuffle) add_subdirectory(control/bitshuffle)
add_definitions(-DWITH_BS_COMPRESSION) add_definitions(-DWITH_BS_COMPRESSION)
set(saving_includes ${saving_includes} ${CMAKE_CURRENT_SOURCE_DIR}/third-party/bitshuffle/src) set(saving_includes ${saving_includes} ${CMAKE_CURRENT_SOURCE_DIR}/third-party/bitshuffle/src)
set(saving_libs ${saving_libs} h5bshuf) set(saving_libs ${saving_libs} h5bshuf)
# set(LIB_BS_INCLUDE_DIR "/usr/local/include/" CACHE PATH "Path to BitShuffle include files") # set(LIB_BS_INCLUDE_DIR "/usr/local/include/" CACHE PATH "Path to BitShuffle include files")
# link_directories(${LIB_HDF5_PLUGIN}) # link_directories(${LIB_HDF5_PLUGIN})
# find_library(LIB_HDF5_BS h5bshuf ${LIB_HDF5_PLUGIN}) # find_library(LIB_HDF5_BS h5bshuf ${LIB_HDF5_PLUGIN})
# find_path(LIB_BS_INCLUDE_DIR bitshuffle.h) # find_path(LIB_BS_INCLUDE_DIR bitshuffle.h)
# set(saving_libs ${saving_libs} ${LIB_HDF5_BS}) # set(saving_libs ${saving_libs} ${LIB_HDF5_BS})
# set(saving_includes ${saving_includes} ${LIB_BS_INCLUDE_DIR}) # set(saving_includes ${saving_includes} ${LIB_BS_INCLUDE_DIR})
endif() endif()
endif() endif()
if(LIMA_ENABLE_NXS) if(LIMA_ENABLE_NXS)
find_path(LIB_NXS_INCLUDE_DIR nexuscpp/nexuscpp.h) find_path(LIB_NXS_INCLUDE_DIR nexuscpp/nexuscpp.h)
find_library(LIB_NXS nexuscpp) find_library(LIB_NXS nexuscpp)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NXS DEFAULT_MSG LIB_NXS LIB_NXS_INCLUDE_DIR) find_package_handle_standard_args(NXS DEFAULT_MSG LIB_NXS LIB_NXS_INCLUDE_DIR)
if(${NXS_FOUND}) if(${NXS_FOUND})
add_definitions(-DWITH_NXS_SAVING) add_definitions(-DWITH_NXS_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_NXS.cpp) set(ct_srcs ${ct_srcs} control/src/CtSaving_NXS.cpp)
set(saving_includes ${saving_includes} ${LIB_NXS_INCLUDE_DIR}) set(saving_includes ${saving_includes} ${LIB_NXS_INCLUDE_DIR})
else() else()
message(FATAL_ERROR "NEXUS cpp library not installed, please install or disable LIMA_ENABLE_NXS") message(FATAL_ERROR "NEXUS cpp library not installed, please install or disable LIMA_ENABLE_NXS")
endif() endif()
endif() endif()
if(LIMA_ENABLE_TIFF) if(LIMA_ENABLE_TIFF)
find_path(LIB_TIFF_INCLUDE_DIR tiffio.h) find_package(TIFF)
find_library(LIB_TIFF tiff)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TIFF DEFAULT_MSG LIB_TIFF LIB_TIFF_INCLUDE_DIR)
if(${TIFF_FOUND}) if(${TIFF_FOUND})
add_definitions(-DWITH_TIFF_SAVING) add_definitions(-DWITH_TIFF_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Tiff.cpp) set(ct_srcs ${ct_srcs} control/src/CtSaving_Tiff.cpp)
set(saving_libs ${saving_libs} tiff) set(saving_libs ${saving_libs} ${TIFF_LIBRARIES})
set(saving_includes ${saving_includes} ${LIB_TIFF_INCLUDE_DIR}) set(saving_includes ${saving_includes} ${TIFF_INCLUDE_DIRS})
else() else()
message(FATAL_ERROR "TIFF library not found, please install or disable LIMA_ENABLE_TIFF") message(FATAL_ERROR "TIFF library not found, please install or disable LIMA_ENABLE_TIFF")
endif() endif()
...@@ -442,8 +402,8 @@ add_library(limacore SHARED ...@@ -442,8 +402,8 @@ add_library(limacore SHARED
${control_incs} ${control_incs}
) )
limatools_set_library_soversion(limacore "common/VERSION") limatools_set_library_soversion(limacore "common/VERSION")
target_include_directories(limacore PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/common/include") target_include_directories(limacore PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/common/include")
target_include_directories(limacore PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/hardware/include") target_include_directories(limacore PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/hardware/include")
target_include_directories(limacore PUBLIC target_include_directories(limacore PUBLIC
...@@ -459,6 +419,9 @@ endif() ...@@ -459,6 +419,9 @@ endif()
# add all include paths coming from saving format options # add all include paths coming from saving format options
target_include_directories(limacore PRIVATE ${extra_includes} ${saving_includes}) target_include_directories(limacore PRIVATE ${extra_includes} ${saving_includes})
# add compiler definitions required by saving libraries
target_compile_definitions(limacore PRIVATE ${saving_definitions})
if(THREADS_HAVE_PTHREAD_ARG) if(THREADS_HAVE_PTHREAD_ARG)
target_compile_options(PUBLIC limacore "-pthread") target_compile_options(PUBLIC limacore "-pthread")
endif() endif()
...@@ -482,12 +445,14 @@ if(WIN32) ...@@ -482,12 +445,14 @@ if(WIN32)
endif() endif()
if(WIN32) if(WIN32)
install(TARGETS limacore install(TARGETS limacore
DESTINATION lib LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include) PUBLIC_HEADER DESTINATION include)
else() else()
include(GNUInstallDirs)
install(TARGETS limacore install(TARGETS limacore
LIBRARY DESTINATION lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION include) PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif() endif()
...@@ -535,7 +500,7 @@ if(LIMA_ENABLE_PYTHON) ...@@ -535,7 +500,7 @@ if(LIMA_ENABLE_PYTHON)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/sip/core/limacore.sip PROPERTIES OBJECT_DEPENDS ${sipfiles} sip/core/HwFrameInfo.sip) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/sip/core/limacore.sip PROPERTIES OBJECT_DEPENDS ${sipfiles} sip/core/HwFrameInfo.sip)
# Run sip now ! # Run sip now !
add_sip_python_module(limacore ${CMAKE_CURRENT_BINARY_DIR}/sip/core/limacore.sip) add_sip_python_module(limacore ${CMAKE_CURRENT_BINARY_DIR}/sip/core/limacore.sip)
target_include_directories(python_module_limacore PRIVATE target_include_directories(python_module_limacore PRIVATE
${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/sip ${CMAKE_CURRENT_SOURCE_DIR}/sip
......
Subproject commit e148a266a6689e9e1e5545a842e2f6ac6cc443c3 Subproject commit 735ba784e07b37fb991b49a00d20e346e7f6ad1a
Subproject commit 019824712a193bf67dac59f54551d8414f794f4c Subproject commit 05fa3370c45bee7c164b16b104d43b13d6eb6e21
Subproject commit 61ddfec995ab3ac369e12d2f20f78912d3b09502 Subproject commit 20d7f4a75ac5b65daf51af314fa18e7432d8af3b
Subproject commit 448222e1f64eb92292407cf7ea5d5d7f79933abf Subproject commit 085e3a547e77490b7490dbf6168bec5754efd71f
Subproject commit 2f3a081b6090bd4633d5bff8209c7f14065c9181 Subproject commit d42cb143f59be0fe1bdd355931b1d057fd3869c8
Subproject commit 491b097a012c29168e3a097f937c42ddd398f88e Subproject commit 861cbc2cbd575a9b23e95b5352ed7474920e4f86
Subproject commit 7d5e257a0f1e706a3b11619877c9ec50381d15ca Subproject commit 9da796236f7ce98add5dd5e28cab016c3076e6ac
Subproject commit 0a26b61f31d41c60a6b45385279f889f7791d2d4 Subproject commit 7688e5cae953891f4f91c5ca17801fd73dd69bdf
Subproject commit dda475da96948630f05bf41d3dcb4c694fbcb869 Subproject commit ce22fdafa85cbebf9da81815e6f68b52a015a25b
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
# European Synchrotron Radiation Facility # European Synchrotron Radiation Facility
# BP 220, Grenoble 38043 # BP 220, Grenoble 38043
# FRANCE # FRANCE
# #
# Contact: lima@esrf.fr # Contact: lima@esrf.fr
# #
# This is free software; you can redistribute it and/or modify # This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or # the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This software is distributed in the hope that it will be useful, # This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.