...
 
Commits (5)
......@@ -22,7 +22,7 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)
project (lima)
set(NAME "core")
......@@ -138,7 +138,7 @@ if(LIMA_ENABLE_PYTHON)
if(${PYTHONINTERP_FOUND})
# python site-packages folder
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())"
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(True))"
OUTPUT_VARIABLE _PYTHON_SITE_PACKAGES_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
message(FATAL_ERROR "No python found, please install or disable LIMA_ENABLE_PYTHON")
......@@ -475,14 +475,33 @@ if(WIN32)
target_compile_definitions(limacore PRIVATE LIMACORE_EXPORTS)
set_target_properties(limacore PROPERTIES PREFIX "lib")
endif()
# Tell CMake where to install libs and includes
# For Unix sue GNU standard installation directories to manage linux distro specificities (lib64 or lib/<multiarch-tuple> ....)
if(WIN32)
install(TARGETS limacore
DESTINATION lib
PUBLIC_HEADER DESTINATION include)
else()
include(GNUInstallDirs)
install(TARGETS limacore
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY common/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY control/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY hardware/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY control/software_operation/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY third-party/Processlib/core/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (LIMA_ENABLE_PYTHON)
install(FILES ${CMAKE_BINARY_DIR}/sip/core/limacore.sip DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sip/lima/core)
install(DIRECTORY third-party/Processlib/sip DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sip/lima/Processlib)
install(DIRECTORY third-party/Processlib/tasks/sip DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sip/lima/Processlib/tasks)
install(DIRECTORY common/sip DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sip/lima/common)
install(DIRECTORY hardware/sip DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sip/lima/hardware)
install(DIRECTORY control/sip DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sip/lima/control)
install(DIRECTORY control/software_operation/sip DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/sip/lima/control/software_operation)
endif()
endif()
......@@ -560,6 +579,10 @@ endif()
#--------------------------------------------------------------------------------
# CAMERA list is in cmake/CameraList.cmake file
#--------------------------------------------------------------------------------
set (LIMACAMERA_EXTERNALLY_CONFIGURED ON)
if(LIMA_ENABLE_PYTHON)
set(LIMACAMERA_EXTERNALLY_ENABLE_PYTHON ON)
endif()
include(CameraList)
#--------------------------------------------------------------------------------
......
......@@ -39,13 +39,9 @@ endif()
if(WIN32)
set_target_properties(lima${NAME} PROPERTIES PREFIX "lib")
endif()
if(WIN32)
install(TARGETS lima${NAME}
DESTINATION lib)
else()
install(TARGETS lima${NAME}
LIBRARY DESTINATION lib)
endif()
# Tell CMake where to install libs
limatools_set_install_dirs(lima${NAME})
if (LIMA_ENABLE_PYTHON)
limatools_run_sip_for_camera(${NAME})
......
......@@ -22,6 +22,19 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
function(limatools_set_install_dirs lib_name)
# Tell CMake where to install libs
# For Unix sue GNU standard installation directories to manage linux distro specificities (lib64 or lib/<multiarch-tuple> ....)
if(WIN32)
install(TARGETS ${lib_name}
DESTINATION lib)
else()
include(GNUInstallDirs)
install(TARGETS ${lib_name}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endfunction()
function(limatools_set_library_soversion lib_name version_file)
file(STRINGS ${version_file} version)
......