Commit 5c09d692 authored by Aitor Henry's avatar Aitor Henry

Using functions in new cmake file instead of including differents cmake files.

parent f6fa3890
......@@ -19,58 +19,58 @@
# 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 "maxipix")
set(NAME "maxipix")
SET(${NAME}_srcs src/PriamSerial.cpp src/PriamAcq.cpp
set(${NAME}_srcs src/PriamSerial.cpp src/PriamAcq.cpp
src/PixelArray.cpp src/MaxipixReconstruction.cpp
src/MaxipixCamera.cpp src/MaxipixInterface.cpp
src/MpxDetConfig.cpp src/MpxCommon.cpp src/MpxChipConfig.cpp src/MpxDacs
tools/src/INIReader.cpp tools/ini.c)
ADD_LIBRARY(lima${NAME} SHARED ${${NAME}_srcs})
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")
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")
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")
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)
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} ${ESPIA_DRV_LIB})
target_link_libraries(lima${NAME} limaespia)
include(CameraVERSION)
INSTALL(TARGETS lima${NAME} LIBRARY DESTINATION lib)
limatools_set_library_soversion(lima${NAME} "VERSION")
install(TARGETS lima${NAME} LIBRARY DESTINATION lib)
IF(LIMA_ENABLE_PYTHON)
SET(INCLUDES)
FILE(GLOB sipfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/sip" "${CMAKE_CURRENT_SOURCE_DIR}/sip/*.sip")
FOREACH(sipfile ${sipfiles})
SET(INCLUDES
if(LIMA_ENABLE_PYTHON)
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
"%Import limacore.sip
%Import limaespia.sip"
)
IF(SIP_VERSION_STR VERSION_LESS "4.12")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sip/limamodules_before_4_12.sip.in sip/limamaxipix.sip)
ELSE()
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sip/limamodules.sip.in sip/limamaxipix.sip)
ENDIF()
if(SIP_VERSION_STR VERSION_LESS "4.12")
configure_file(${CMAKE_SOURCE_DIR}/sip/limamodules_before_4_12.sip.in sip/limamaxipix.sip)
else()
configure_file(${CMAKE_SOURCE_DIR}/sip/limamodules.sip.in sip/limamaxipix.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"
......@@ -84,13 +84,13 @@ IF(LIMA_ENABLE_PYTHON)
set(SIP_DISABLE_FEATURES WITH_CONFIG)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/sip/lima${NAME}.sip PROPERTIES OBJECT_DEPENDS ${sipfiles})
set(SIP_CHECK_EXC ON)
ADD_SIP_PYTHON_MODULE(limamaxipix ${CMAKE_CURRENT_BINARY_DIR}/sip/limamaxipix.sip)
TARGET_INCLUDE_DIRECTORIES(python_module_limamaxipix PRIVATE
add_sip_python_module(limamaxipix ${CMAKE_CURRENT_BINARY_DIR}/sip/limamaxipix.sip)
target_include_directories(python_module_limamaxipix PRIVATE
${PYTHON_INCLUDE_DIRS}
"${CMAKE_SOURCE_DIR}/sip"
"${CMAKE_SOURCE_DIR}/sip/core"
"${CMAKE_SOURCE_DIR}/third-party/Processlib/sip")
TARGET_LINK_LIBRARIES(python_module_limamaxipix limamaxipix)
target_link_libraries(python_module_limamaxipix limamaxipix)
INSTALL(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Maxipix")
ENDIF()
install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Maxipix")
endif()
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