Commit 39e096ec authored by operator for beamline's avatar operator for beamline
Browse files

First version of CMake port

parent de47e9b4
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# 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 "slsdetector")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=format-security")
set(SLS_DETECTORS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/slsDetectorPackage")
set(SLS_DETECTORS_BIN "${SLS_DETECTORS_DIR}/bin")
set(SLS_DETECTORS_SW "${SLS_DETECTORS_DIR}/slsDetectorSoftware")
set(SLS_DETECTORS_RECV "${SLS_DETECTORS_DIR}/slsReceiverSoftware")
link_directories(${SLS_DETECTORS_BIN})
set(${NAME}_srcs src/SlsDetectorDefs.cpp src/SlsDetectorArgs.cpp
src/SlsDetectorCPUAffinity.cpp src/SlsDetectorModel.cpp
src/SlsDetectorCamera.cpp src/SlsDetectorEiger.cpp
src/SlsDetectorInterface.cpp)
add_library(lima${NAME} SHARED ${${NAME}_srcs})
target_include_directories(lima${NAME} PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(lima${NAME} PUBLIC
"${SLS_DETECTORS_SW}/include"
"${SLS_DETECTORS_SW}/commonFiles"
"${SLS_DETECTORS_SW}/slsDetector"
"${SLS_DETECTORS_SW}/multiSlsDetector"
"${SLS_DETECTORS_SW}/slsDetectorServer"
"${SLS_DETECTORS_SW}/slsDetectorAnalysis"
"${SLS_DETECTORS_SW}/slsReceiverInterface"
"${SLS_DETECTORS_RECV}/include")
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} SlsDetector)
target_link_libraries(lima${NAME} SlsReceiver)
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/SlsDetector")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
if(LIMA_ENABLE_TESTS)
add_subdirectory(test/)
endif()
......@@ -19,24 +19,7 @@
# 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.SlsDetector.limaslsdetector import SlsDetector as _S
from limaslsdetector import SlsDetector as _S
globals().update(_S.__dict__)
module_helper.load_cleanup(cleanup_data)
del _S
del mod_path, depends_on, has_dependent, cleanup_data
del module_helper
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# 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/>.
############################################################################
LIMA_DIR := $(shell pwd)/../../..
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
SLS_DETECTORS_DIR = ../slsDetectorPackage
SLS_DETECTORS_BIN = $(SLS_DETECTORS_DIR)/bin
SLS_DETECTORS_SW = $(SLS_DETECTORS_DIR)/slsDetectorSoftware
SLS_DETECTORS_RECV = $(SLS_DETECTORS_DIR)/slsReceiverSoftware
SLS_DETECTORS_INCL_FLAGS = -I$(SLS_DETECTORS_SW)/include \
-I$(SLS_DETECTORS_SW)/commonFiles \
-I$(SLS_DETECTORS_SW)/slsDetector \
-I$(SLS_DETECTORS_SW)/multiSlsDetector \
-I$(SLS_DETECTORS_SW)/slsDetectorServer \
-I$(SLS_DETECTORS_SW)/slsDetectorAnalysis \
-I$(SLS_DETECTORS_SW)/slsReceiverInterface \
-I$(SLS_DETECTORS_RECV)/include
CPPFLAGS = $(CT_CPPFLAGS) $(SLS_DETECTORS_INCL_FLAGS)
CXXFLAGS = -I../include $(CT_CXXFLAGS)
slsdetector-objs = SlsDetectorInterface.o \
SlsDetectorEiger.o \
SlsDetectorCamera.o \
SlsDetectorModel.o \
SlsDetectorCPUAffinity.o \
SlsDetectorArgs.o \
SlsDetectorDefs.o
SRCS = $(slsdetector-objs:.o=.cpp)
all: SlsDetector.o
SlsDetector.o: $(slsdetector-objs)
$(LD) -o $@ -r $+
clean:
rm -f *.o *.P
%.o : %.cpp
$(COMPILE.cpp) $(CPPFLAGS) -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) $(CPPFLAGS) -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES)
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
......@@ -19,7 +19,9 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
src-dirs = src
test-dirs = test
include ../../global.inc
set(test_src test_slsdetector
test_slsdetector_control)
limatools_run_camera_tests("${test_src}" ${NAME})
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# 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/>.
############################################################################
LIMA_DIR := $(shell pwd)/../../..
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
SRCS = test_slsdetector.cpp
SLS_DETECTORS_DIR = ../slsDetectorPackage
SLS_DETECTORS_BIN = $(SLS_DETECTORS_DIR)/bin
SLS_DETECTORS_SW = $(SLS_DETECTORS_DIR)/slsDetectorSoftware
SLS_DETECTORS_RECV = $(SLS_DETECTORS_DIR)/slsReceiverSoftware
SLS_DETECTORS_INCL_FLAGS = -I$(SLS_DETECTORS_SW)/include \
-I$(SLS_DETECTORS_SW)/commonFiles \
-I$(SLS_DETECTORS_SW)/slsDetector \
-I$(SLS_DETECTORS_SW)/multiSlsDetector \
-I$(SLS_DETECTORS_SW)/slsDetectorServer \
-I$(SLS_DETECTORS_SW)/slsDetectorAnalysis \
-I$(SLS_DETECTORS_RECV)/include \
-I$(SLS_DETECTORS_SW)/slsReceiverInterface
CPPFLAGS = -I../include $(CT_CPPFLAGS) $(SLS_DETECTORS_INCL_FLAGS)
DEPLIBS = $(CT_DEPLIBS) \
$(LIMA_DIR)/build,limacore $(LIMA_DIR)/build,limaslsdetector
LDFLAGS = $(CT_LDFLAGS) $(call lib-depflags,$(DEPLIBS))
LDLIBS = $(CT_LDLIBS) $(call lib-deplibs,$(DEPLIBS))
test-progs = test_slsdetector test_slsdetector_control
old-progs =
all: $(test-progs)
test_slsdetector: test_slsdetector.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
test_slsdetector_control: test_slsdetector_control.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
clean:
rm -f *.o *.P $(test-progs) $(old-progs)
test_slsdetector.o: test_slsdetector.cpp test_slsdetector.h
test_slsdetector_control.o: test_slsdetector_control.cpp
%.o : %.cpp
$(COMPILE.cpp) $(CPPFLAGS) -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)
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