Commit 13e5262d authored by Laurent Claustre's avatar Laurent Claustre Committed by Sebastien Petitdemange

* Split camera list activation into a separated cmake file

* updated gpl header for postal address
* added a path for sip file for cameras.
Put commands in lower case, new header.
updating with limagroup/lima
CBF: fixed variable name error.
parent 920e1c53
This diff is collapsed.
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2015
// Copyright (C) : 2009-2017
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// 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
......
###########################################################################
This file is part of LImA, a Library for Image Acquisition
Copyright (C) : 2009-2015
Copyright (C) : 2009-2017
European Synchrotron Radiation Facility
BP 220, Grenoble 38043
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
......
......@@ -19,36 +19,36 @@
# 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(simu_srcs src/SimulatorFrameBuilder.cpp src/SimulatorCamera.cpp src/SimulatorInterface.cpp
set(simu_srcs src/SimulatorFrameBuilder.cpp src/SimulatorCamera.cpp src/SimulatorInterface.cpp
src/SimulatorSyncCtrlObj.cpp src/SimulatorDetInfoCtrlObj.cpp src/SimulatorShutterCtrlObj.cpp)
FILE(STRINGS "VERSION" simu_ver)
ADD_LIBRARY(limasimulator SHARED ${simu_srcs})
file(STRINGS "VERSION" simu_ver)
add_library(limasimulator SHARED ${simu_srcs})
TARGET_INCLUDE_DIRECTORIES(limasimulator PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
TARGET_INCLUDE_DIRECTORIES(limasimulator PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../common/include")
TARGET_INCLUDE_DIRECTORIES(limasimulator PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../hardware/include")
TARGET_LINK_LIBRARIES(limasimulator limacore)
target_include_directories(limasimulator PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(limasimulator PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../common/include")
target_include_directories(limasimulator PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../hardware/include")
target_link_libraries(limasimulator limacore)
if(WIN32)
TARGET_COMPILE_DEFINITIONS(limasimulator PRIVATE LIBSIMULATOR_EXPORTS)
target_compile_definitions(limasimulator PRIVATE LIBSIMULATOR_EXPORTS)
endif()
SET_TARGET_PROPERTIES(limasimulator PROPERTIES VERSION ${simu_ver} SOVERSION "1")
set_target_properties(limasimulator PROPERTIES VERSION ${simu_ver} SOVERSION "1")
if(WIN32)
SET_TARGET_PROPERTIES(limasimulator PROPERTIES PREFIX "lib")
set_target_properties(limasimulator PROPERTIES PREFIX "lib")
endif()
if(WIN32)
INSTALL(TARGETS limasimulator
install(TARGETS limasimulator
DESTINATION lib)
else()
INSTALL(TARGETS limasimulator
install(TARGETS limasimulator
LIBRARY DESTINATION lib)
endif()
IF (COMPILE_SIP)
SET(NAME "simulator")
if (COMPILE_SIP)
set(NAME "simulator")
include(CameraRunSIP)
INSTALL(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Simulator")
ENDIF()
install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Simulator")
endif()
if(COMPILE_TEST)
add_subdirectory(test/)
......
This diff is collapsed.
SET(INCLUDES)
FILE(GLOB sipfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/sip" "${CMAKE_CURRENT_SOURCE_DIR}/sip/*.sip")
FOREACH(sipfile ${sipfiles})
SET(INCLUDES
set(INCLUDES)
file(GLOB sipfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/sip" "${CMAKE_CURRENT_SOURCE_DIR}/sip/*.sip")
foreach(sipfile ${sipfiles})
set(INCLUDES
"${INCLUDES}
%Include ${sipfile}")
ENDFOREACH()
endforeach()
SET(IMPORTS
set(IMPORTS
"${IMPORTS}
%Import limacore.sip")
if(SIP_VERSION_STR VERSION_LESS "4.12")
configure_file(${CMAKE_SOURCE_DIR}/sip/limamodules_before_4_12.sip.in sip/lima${NAME}.sip)
else()
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sip/limamodules.sip.in sip/lima${NAME}.sip)
configure_file(${CMAKE_SOURCE_DIR}/sip/limamodules.sip.in sip/lima${NAME}.sip)
endif()
SET(SIP_CONCAT_PARTS 1)
SET(SIP_INCLUDES ${SIP_INCLUDES}
set(SIP_CONCAT_PARTS 1)
set(SIP_INCLUDES ${SIP_INCLUDES}
"${CMAKE_SOURCE_DIR}/third-party/Processlib/sip"
"${CMAKE_BINARY_DIR}/sip/core"
"${CMAKE_SOURCE_DIR}/third-party/Processlib/tasks/sip"
......@@ -28,8 +28,9 @@ SET(SIP_INCLUDES ${SIP_INCLUDES}
set(SIP_DISABLE_FEATURES WITH_CONFIG)
set(SIP_CHECK_EXC ON)
ADD_SIP_PYTHON_MODULE(lima${NAME} ${CMAKE_CURRENT_BINARY_DIR}/sip/lima${NAME}.sip)
TARGET_INCLUDE_DIRECTORIES(python_module_lima${NAME} PRIVATE
target_include_directories(python_module_lima${NAME} PRIVATE
${PYTHON_INCLUDE_DIRS}
"${CMAKE_SOURCE_DIR}/sip"
"${CMAKE_SOURCE_DIR}/sip/core")
TARGET_LINK_LIBRARIES(python_module_lima${NAME} lima${NAME})
"${CMAKE_SOURCE_DIR}/sip/core"
"${CMAKE_SOURCE_DIR}/third-party/Processlib/sip")
target_link_libraries(python_module_lima${NAME} lima${NAME})
###########################################################################
# 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/>.
############################################################################
file(STRINGS "VERSION" ${NAME}_vers)
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" ${NAME}_sovers "${${NAME}_vers}")
set_target_properties(lima${NAME} PROPERTIES VERSION "${${NAME}_vers}" SOVERSION "${${NAME}_sovers}")
......@@ -26,31 +26,31 @@
IF(SIP_VERSION)
if(SIP_VERSION)
# Already in cache, be silent
SET(SIP_FOUND TRUE)
ELSE(SIP_VERSION)
FIND_FILE(_find_sip_py FindSIP.py PATHS ${CMAKE_MODULE_PATH})
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config)
IF(sip_config)
STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config})
STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_EXECUTABLE ${sip_config})
STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config})
SET(SIP_FOUND TRUE)
ENDIF(sip_config)
IF(SIP_FOUND)
IF(NOT SIP_FIND_QUIETLY)
MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}")
ENDIF(NOT SIP_FIND_QUIETLY)
ELSE(SIP_FOUND)
IF(SIP_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find SIP")
ENDIF(SIP_FIND_REQUIRED)
ENDIF(SIP_FOUND)
ENDIF(SIP_VERSION)
set(SIP_FOUND TRUE)
else(SIP_VERSION)
find_file(_find_sip_py FindSIP.py PATHS ${CMAKE_MODULE_PATH})
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config)
if(sip_config)
string(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config})
string(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config})
string(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_EXECUTABLE ${sip_config})
string(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config})
string(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config})
set(SIP_FOUND TRUE)
endif(sip_config)
if(SIP_FOUND)
if(NOT SIP_FIND_QUIETLY)
message(STATUS "Found SIP version: ${SIP_VERSION_STR}")
endif(NOT SIP_FIND_QUIETLY)
else(SIP_FOUND)
if(SIP_FIND_REQUIRED)
message(FATAL_ERROR "Could not find SIP")
endif(SIP_FIND_REQUIRED)
endif(SIP_FOUND)
endif(SIP_VERSION)
......@@ -35,67 +35,67 @@
# SIP_EXTRA_OPTIONS - Extra command line options which should be passed on to
# SIP.
SET(SIP_INCLUDES)
SET(SIP_TAGS)
SET(SIP_CONCAT_PARTS 8)
SET(SIP_DISABLE_FEATURES)
SET(SIP_EXTRA_OPTIONS)
set(SIP_INCLUDES)
set(SIP_TAGS)
set(SIP_CONCAT_PARTS 8)
set(SIP_DISABLE_FEATURES)
set(SIP_EXTRA_OPTIONS)
MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
macro(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
SET(EXTRA_LINK_LIBRARIES ${ARGN})
set(EXTRA_LINK_LIBRARIES ${ARGN})
STRING(REPLACE "." "/" _x ${MODULE_NAME})
GET_FILENAME_COMPONENT(_parent_module_path ${_x} PATH)
GET_FILENAME_COMPONENT(_child_module_name ${_x} NAME)
string(REPLACE "." "/" _x ${MODULE_NAME})
get_filename_component(_parent_module_path ${_x} PATH)
get_filename_component(_child_module_name ${_x} NAME)
GET_FILENAME_COMPONENT(_module_path ${MODULE_SIP} PATH)
GET_FILENAME_COMPONENT(_abs_module_sip ${MODULE_SIP} ABSOLUTE)
get_filename_component(_module_path ${MODULE_SIP} PATH)
get_filename_component(_abs_module_sip ${MODULE_SIP} ABSOLUTE)
# We give this target a long logical target name.
# (This is to avoid having the library name clash with any already
# install library names. If that happens then cmake dependancy
# tracking get confused.)
STRING(REPLACE "." "_" _logical_name ${MODULE_NAME})
SET(_logical_name "python_module_${_logical_name}")
string(REPLACE "." "_" _logical_name ${MODULE_NAME})
set(_logical_name "python_module_${_logical_name}")
FILE(MAKE_DIRECTORY ${_module_path}) # Output goes in this dir.
file(MAKE_DIRECTORY ${_module_path}) # Output goes in this dir.
SET(_sip_includes)
FOREACH (_inc ${SIP_INCLUDES})
GET_FILENAME_COMPONENT(_abs_inc ${_inc} ABSOLUTE)
LIST(APPEND _sip_includes -I ${_abs_inc})
ENDFOREACH (_inc )
set(_sip_includes)
foreach (_inc ${SIP_INCLUDES})
get_filename_component(_abs_inc ${_inc} ABSOLUTE)
list(APPEND _sip_includes -I ${_abs_inc})
endforeach (_inc )
SET(_sip_tags)
FOREACH (_tag ${SIP_TAGS})
LIST(APPEND _sip_tags -t ${_tag})
ENDFOREACH (_tag)
set(_sip_tags)
foreach (_tag ${SIP_TAGS})
list(APPEND _sip_tags -t ${_tag})
endforeach (_tag)
SET(_sip_x)
FOREACH (_x ${SIP_DISABLE_FEATURES})
LIST(APPEND _sip_x -x ${_x})
ENDFOREACH (_x ${SIP_DISABLE_FEATURES})
set(_sip_x)
foreach (_x ${SIP_DISABLE_FEATURES})
list(APPEND _sip_x -x ${_x})
endforeach (_x ${SIP_DISABLE_FEATURES})
SET(_message "-DMESSAGE=Generating CPP code for module ${MODULE_NAME}")
SET(_sip_output_files)
FOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )
IF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
SET(_sip_output_files ${_sip_output_files} ${_module_path}/sip${_child_module_name}part${CONCAT_NUM}.cpp )
ENDIF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
ENDFOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )
set(_message "-DMESSAGE=Generating CPP code for module ${MODULE_NAME}")
set(_sip_output_files)
foreach(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )
if( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
set(_sip_output_files ${_sip_output_files} ${_module_path}/sip${_child_module_name}part${CONCAT_NUM}.cpp )
endif( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
endforeach(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )
IF(NOT WIN32)
SET(TOUCH_COMMAND touch)
ELSE(NOT WIN32)
SET(TOUCH_COMMAND echo)
if(NOT WIN32)
set(TOUCH_COMMAND touch)
else(NOT WIN32)
set(TOUCH_COMMAND echo)
# instead of a touch command, give out the name and append to the files
# this is basically what the touch command does.
FOREACH(filename ${_sip_output_files})
FILE(APPEND filename "")
ENDFOREACH(filename ${_sip_output_files})
ENDIF(NOT WIN32)
ADD_CUSTOM_COMMAND(
foreach(filename ${_sip_output_files})
file(APPEND filename "")
endforeach(filename ${_sip_output_files})
endif(NOT WIN32)
add_custom_command(
OUTPUT ${_sip_output_files}
COMMAND ${CMAKE_COMMAND} -E echo ${message}
COMMAND ${TOUCH_COMMAND} ${_sip_output_files}
......@@ -104,20 +104,20 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
DEPENDS ${_abs_module_sip} ${SIP_EXTRA_FILES_DEPEND}
)
# not sure if type MODULE could be uses anywhere, limit to cygwin for now
IF (CYGWIN)
ADD_LIBRARY(${_logical_name} MODULE ${_sip_output_files} )
ELSE (CYGWIN)
ADD_LIBRARY(${_logical_name} SHARED ${_sip_output_files} )
ENDIF (CYGWIN)
TARGET_LINK_LIBRARIES(${_logical_name} ${PYTHON_LIBRARY})
TARGET_LINK_LIBRARIES(${_logical_name} ${EXTRA_LINK_LIBRARIES})
SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES PREFIX "" OUTPUT_NAME ${_child_module_name})
if (CYGWIN)
add_library(${_logical_name} MODULE ${_sip_output_files} )
else (CYGWIN)
add_library(${_logical_name} SHARED ${_sip_output_files} )
endif (CYGWIN)
target_link_libraries(${_logical_name} ${PYTHON_LIBRARY})
target_link_libraries(${_logical_name} ${EXTRA_LINK_LIBRARIES})
set_target_properties(${_logical_name} PROPERTIES PREFIX "" OUTPUT_NAME ${_child_module_name})
IF (WIN32)
SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES SUFFIX ".pyd")
SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES IMPORT_SUFFIX ".dll")
ENDIF (WIN32)
if (WIN32)
set_target_properties(${_logical_name} PROPERTIES SUFFIX ".pyd")
set_target_properties(${_logical_name} PROPERTIES IMPORT_SUFFIX ".dll")
endif (WIN32)
INSTALL(TARGETS ${_logical_name} DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/${_parent_module_path}")
install(TARGETS ${_logical_name} DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/${_parent_module_path}")
ENDMACRO(ADD_SIP_PYTHON_MODULE)
endmacro(ADD_SIP_PYTHON_MODULE)
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