Commit 6aaf5fcd authored by Sebastien Petitdemange's avatar Sebastien Petitdemange

Merge branch 'cmake'

parents eb023c56 a8196a5f
###########################################################################
# 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 "frelon")
set(${NAME}_srcs src/Frelon.cpp src/FrelonSerialLine.cpp
src/FrelonModel.cpp src/FrelonCamera.cpp
src/FrelonTimingCtrl.cpp src/FrelonInterface.cpp src/FrelonCorrection.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 "${CMAKE_CURRENT_SOURCE_DIR}/tools/src")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../common/espia/cmake ${CMAKE_MODULE_PATH})
include(FindEspiaDrv)
#set paths for espia driver and limaespialib and include files
target_include_directories(lima${NAME} PUBLIC "${ESPIA_DRV_INCLUDE_DIR}")
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../common/espia/include")
link_directories("${CMAKE_CURRENT_SOURCE_DIR}/../common/espia")
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} ${ESPIA_DRV_LIB})
target_link_libraries(lima${NAME} limaespia)
limatools_set_library_soversion(lima${NAME} "VERSION")
install(TARGETS lima${NAME} LIBRARY DESTINATION lib)
if(LIMA_ENABLE_PYTHON)
set(IMPORTS
"%Import limaespia.sip")
set(SIP_INCLUDES ${SIP_INCLUDES}
"${CMAKE_CURRENT_SOURCE_DIR}/../common/espia/sip"
"${CMAKE_BINARY_DIR}/camera/common/espia/sip")
limatools_run_sip_for_camera(${NAME})
install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Frelon")
install(FILES python/FrelonAcq.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Frelon")
endif()
if(LIMA_ENABLE_TESTS)
add_subdirectory(test/)
endif()
......@@ -19,24 +19,8 @@
# 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 = 'Espia'
has_dependent = False
cleanup_data = module_helper.load_prepare(mod_path, depends_on, has_dependent)
from Lima import Espia
from limafrelon import Frelon as _F
cleanup_data = module_helper.load_dep_cleanup(cleanup_data)
from Lima.Frelon.limafrelon import *
globals().update(Frelon.__dict__)
globals().update(_F.__dict__)
from Lima.Frelon.FrelonAcq import FrelonAcq
module_helper.load_cleanup(cleanup_data)
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)/../../..
LIMA_ESPIA_DIR := $(LIMA_DIR)/camera/common/espia
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
include $(LIMA_ESPIA_DIR)/include/espia.inc
frelon-objs = FrelonBase.o FrelonSerialLine.o FrelonModel.o FrelonCamera.o \
FrelonTimingCtrl.o FrelonInterface.o FrelonCorrection.o
SRCS = $(frelon-objs:.o=.cpp)
CPPFLAGS = -I../include -I$(LIMA_ESPIA_DIR)/include $(CT_CPPFLAGS) \
-I$(ESPIA_DRV_INCL)
CXXFLAGS = $(CT_CXXFLAGS)
all: Frelon.o
Frelon.o: $(frelon-objs)
$(LD) -o $@ -r $+
FrelonBase.o: Frelon.cpp
$(CXX) $(CPPFLAGS) -c $(CXXFLAGS) -o $@ $<
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,11 @@
# 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_frelon
test_frelon_control
test_frelon_interface
test_frelon_spectroscopy)
INCLUDE(TestCamera)
############################################################################
# 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)/../../..
LIMA_ESPIA_DIR := $(LIMA_DIR)/camera/common/espia
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
include $(LIMA_ESPIA_DIR)/include/espia.inc
SRCS = test_frelon.cpp test_frelon_interface.cpp test_frelon_spectroscopy.cpp \
test_frelon_control.cpp
CPPFLAGS = -I../include -I$(LIMA_ESPIA_DIR)/include $(CT_CPPFLAGS) \
-I$(ESPIA_DRV_INCL)
CXXFLAGS = $(CT_CXXFLAGS)
DEPLIBS = $(CT_DEPLIBS) \
$(LIMA_DIR)/build,limacore \
$(LIMA_DIR)/build,limaespia \
$(LIMA_DIR)/build,limafrelon
LDFLAGS = $(CT_LDFLAGS) $(call lib-depflags,$(DEPLIBS)) -L$(ESPIA_DRV_LIB)
LDLIBS = $(CT_LDLIBS) $(call lib-deplibs,$(DEPLIBS)) -lespia
test-progs = test_frelon test_frelon_interface test_frelon_spectroscopy \
test_frelon_control
old-progs = testfrelon testfreloninterface testfrelonspectroscopy \
testfreloncontrol
all: $(test-progs)
test_frelon: test_frelon.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
test_frelon_interface: test_frelon_interface.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
test_frelon_spectroscopy: test_frelon_spectroscopy.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
test_frelon_control: test_frelon_control.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
clean:
rm -f *.o *.P $(test-progs) $(old-progs)
%.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)
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