Skip to content
Snippets Groups Projects
Commit b633d40f authored by Laurent Claustre's avatar Laurent Claustre
Browse files

Updated cmake

parent f4348169
No related branches found
No related tags found
1 merge request!4Updated cmake
Pipeline #13110 canceled
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# Copyright (C) : 2009-2019
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
......@@ -26,8 +26,6 @@ cmake_minimum_required(VERSION 3.1)
project(espia)
set(NAME "espia") # This is used by LimaTools
# Include additional modules that are used inconditionnaly
include(GNUInstallDirs)
include(GenerateExportHeader)
......@@ -52,43 +50,23 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
endif()
if (CAMERA_MASTER_PROJECT)
find_package(Lima REQUIRED)
find_package(Lima REQUIRED COMPONENTS devel tools)
endif()
# CMake additional macros
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH})
include(LimaTools)
# Set version
include(project_version)
# Enable python binding code compilation using sip generator
if (CAMERA_MASTER_PROJECT)
option(LIMA_ENABLE_PYTHON "compile python binding code?" OFF)
endif()
if (LIMA_ENABLE_PYTHON)
# Find python interpreter and libs
find_package(PythonInterp)
find_package(PythonLibs)
if(${PYTHONINTERP_FOUND})
# python site-packages folder
execute_process(
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)
if (LIMA_ENABLE_PYTHON)
limatools_find_python_and_sip()
endif()
set(PYTHON_SITE_PACKAGES_DIR ${_PYTHON_SITE_PACKAGES_DIR} CACHE PATH "where should python modules be installed?")
find_package(SIP REQUIRED)
include(SIPMacros)
if(WIN32)
set(SIP_TAGS WIN32_PLATFORM)
elseif(UNIX)
set(SIP_TAGS POSIX_PLATFORM)
endif(WIN32)
set(SIP_EXTRA_OPTIONS -e -g)
find_package(NumPy REQUIRED)
endif()
find_package(Espia REQUIRED)
......@@ -132,7 +110,6 @@ target_link_libraries(espia PUBLIC ${ESPIA_LIBRARIES})
# Binding code for python
if(LIMA_ENABLE_PYTHON)
include(LimaTools)
limatools_run_sip_for_camera(espia)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment