diff --git a/cmake_modules/FindMICAM.cmake b/cmake_modules/FindMICAM.cmake new file mode 100644 index 000000000..0d5fa82db --- /dev/null +++ b/cmake_modules/FindMICAM.cmake @@ -0,0 +1,49 @@ +# - Try to find MICAM Camera Library +# Once done this will define +# +# MICAM_FOUND - system has Levenhuk +# MICAM_INCLUDE_DIR - the Levenhuk include directory +# MICAM_LIBRARIES - Link these to use Levenhuk + +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (MICAM_INCLUDE_DIR AND MICAM_LIBRARIES) + + # in cache already + set(MICAM_FOUND TRUE) + message(STATUS "Found libmicam: ${MICAM_LIBRARIES}") + +else (MICAM_INCLUDE_DIR AND MICAM_LIBRARIES) + + find_path(MICAM_INCLUDE_DIR gxccd.h + PATH_SUFFIXES libmicam + ${_obIncDir} + ${GNUWIN32_DIR}/include + ) + + find_library(MICAM_LIBRARIES NAMES gxccd + PATHS + ${_obLinkDir} + ${GNUWIN32_DIR}/lib + ) + + if(MICAM_INCLUDE_DIR AND MICAM_LIBRARIES) + set(MICAM_FOUND TRUE) + else (MICAM_INCLUDE_DIR AND MICAM_LIBRARIES) + set(MICAM_FOUND FALSE) + endif(MICAM_INCLUDE_DIR AND MICAM_LIBRARIES) + + if (MICAM_FOUND) + if (NOT MICAM_FIND_QUIETLY) + message(STATUS "Found MICAM: ${MICAM_LIBRARIES}") + endif (NOT MICAM_FIND_QUIETLY) + else (MICAM_FOUND) + if (MICAM_FIND_REQUIRED) + message(FATAL_ERROR "MICAM not found. Please install MICAM Library http://www.indilib.org") + endif (MICAM_FIND_REQUIRED) + endif (MICAM_FOUND) + + mark_as_advanced(MICAM_INCLUDE_DIR MICAM_LIBRARIES) + +endif (MICAM_INCLUDE_DIR AND MICAM_LIBRARIES) diff --git a/debian/indi-mi/changelog b/debian/indi-mi/changelog index a944a0a5b..808cabced 100644 --- a/debian/indi-mi/changelog +++ b/debian/indi-mi/changelog @@ -1,3 +1,9 @@ +indi-mi (1.6) buster; urgency=medium + + * Separating from MI libraries + + -- Radek Kaczorek Sun, 3 Nov 2019 14:21:00 +0100 + indi-mi (1.5) bionic; urgency=low * Fix launchpad ARM issue. diff --git a/debian/indi-mi/control b/debian/indi-mi/control index aa15c74b7..95ec6ce67 100644 --- a/debian/indi-mi/control +++ b/debian/indi-mi/control @@ -2,12 +2,12 @@ Source: indi-mi Section: science Priority: extra Maintainer: Jasem Mutlaq -Build-Depends: debhelper (>= 6), cdbs, cmake, libindi-dev, zlib1g-dev, libusb-1.0-0-dev, libcfitsio3-dev|libcfitsio-dev +Build-Depends: debhelper (>= 6), cdbs, cmake, libindi-dev, zlib1g-dev, libusb-1.0-0-dev, libcfitsio3-dev|libcfitsio-dev, libmicam Standards-Version: 3.9.2 Package: indi-mi Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libindi1 +Depends: ${shlibs:Depends}, ${misc:Depends}, libindi1, libmicam Description: INDI Moravian CCD Driver. . This driver is compatible with any INDI client such as KStars or Xephem. diff --git a/debian/indi-mi/indi-mi.install b/debian/indi-mi/indi-mi.install index 6cdfd5dd6..4ecb40be8 100644 --- a/debian/indi-mi/indi-mi.install +++ b/debian/indi-mi/indi-mi.install @@ -1,3 +1,2 @@ usr/bin/ usr/share/indi/ -lib/udev/rules.d/ diff --git a/debian/libmicam/changelog b/debian/libmicam/changelog new file mode 100644 index 000000000..93dd09e42 --- /dev/null +++ b/debian/libmicam/changelog @@ -0,0 +1,6 @@ +libmicam (1.0) buster; urgency=medium + + * Initial release + + -- Radek Kaczorek Sun, 3 Nov 2019 13:33:00 +0100 + diff --git a/debian/libmicam/compat b/debian/libmicam/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/debian/libmicam/compat @@ -0,0 +1 @@ +9 diff --git a/debian/libmicam/control b/debian/libmicam/control new file mode 100644 index 000000000..bf75248f9 --- /dev/null +++ b/debian/libmicam/control @@ -0,0 +1,11 @@ +Source: libmicam +Section: libs +Priority: extra +Maintainer: Radek Kaczorek +Build-Depends: debhelper (>= 6), cdbs, cmake +Standards-Version: 3.9.2 + +Package: libmicam +Architecture: i386 amd64 armhf arm64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Library for Moravian Instruments Cameras diff --git a/debian/libmicam/copyright b/debian/libmicam/copyright new file mode 100644 index 000000000..96ad2c1ff --- /dev/null +++ b/debian/libmicam/copyright @@ -0,0 +1,28 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libmicam +Upstream-Contact: Jasem Mutlaq +Source: https://github.com/indilib/indi-3rdparty/libmicam + +Files: CMakeLists.txt +Copyright: 2019, Radek Kaczorek +License: GPL-3 + This package 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 package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-3'. + +Files: *.bin, *.h +Copyright: Copyright 2016, Moravian Instruments +License: All rights reserved diff --git a/debian/libmicam/rules b/debian/libmicam/rules new file mode 100755 index 000000000..d34969d91 --- /dev/null +++ b/debian/libmicam/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/cmake.mk + +DEB_SRCDIR=libmicam diff --git a/debian/libmicam/source/format b/debian/libmicam/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/debian/libmicam/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/indi-mi/AUTHORS b/indi-mi/AUTHORS index dc76ba1cb..01e56758b 100644 --- a/indi-mi/AUTHORS +++ b/indi-mi/AUTHORS @@ -1,2 +1,3 @@ +Radek Kaczorek (rkaczorek AT gmail DOT com) Jasem Mutlaq (mutlaqja AT ikarustech DOT com) Jakub Smutný (linux AT gxccd DOT com) diff --git a/indi-mi/CMakeLists.txt b/indi-mi/CMakeLists.txt index e9b6eb539..eb80fa740 100644 --- a/indi-mi/CMakeLists.txt +++ b/indi-mi/CMakeLists.txt @@ -5,15 +5,14 @@ LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules/") include(GNUInstallDirs) -set(UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules") - +find_package(MICAM REQUIRED) find_package(INDI REQUIRED) find_package(USB1 REQUIRED) find_package(Threads REQUIRED) find_package(CFITSIO REQUIRED) set(INDI_MI_VERSION_MAJOR 1) -set(INDI_MI_VERSION_MINOR 5) +set(INDI_MI_VERSION_MINOR 6) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_miccd.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_miccd.xml) @@ -22,33 +21,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${INDI_INCLUDE_DIR}) include_directories( ${CFITSIO_INCLUDE_DIR}) - -#if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv6l") -# set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv6.bin) -#elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l") -# set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv7.bin) -#elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") -# set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv8.bin) -#elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") -# set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccd64.bin) -#elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "i[3-6]86") -# set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccd32.bin) -#endif () - -# N.B. Launchpad fails with armv6 version. Testing armv7 -if (APPLE) - set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdmac.bin) -elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+") - set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv7.bin) -elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") - set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv8.bin) -elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccd64.bin) -elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "i[3-6]86") - set(MILIB ${CMAKE_CURRENT_SOURCE_DIR}/libgxccd32.bin) -endif () - -include(CMakeCommon) +include_directories( ${MICAM_INCLUDE_DIR}) ########### MI CCD ########### set(indi_miccd_SRCS @@ -57,12 +30,11 @@ set(indi_miccd_SRCS add_executable(indi_mi_ccd ${indi_miccd_SRCS}) if (APPLE) - target_link_libraries(indi_mi_ccd ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${MILIB} ${USB1_LIBRARIES}) + target_link_libraries(indi_mi_ccd ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${MICAM_LIBRARIES} ${USB1_LIBRARIES}) else (APPLE) - target_link_libraries(indi_mi_ccd ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${MILIB} ${USB1_LIBRARIES} rt) + target_link_libraries(indi_mi_ccd ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${MICAM_LIBRARIES} ${USB1_LIBRARIES} rt) endif(APPLE) - if(THREADS_HAVE_PTHREAD_ARG) target_compile_options(indi_mi_ccd "-pthread") endif() @@ -79,6 +51,3 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_mi_ccd_symlink.cmake set_target_properties(indi_mi_ccd PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_mi_ccd_symlink.cmake) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_miccd.xml DESTINATION ${INDI_DATA_DIR}) -if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/99-miccd.rules DESTINATION ${UDEVRULES_INSTALL_DIR}) -endif() diff --git a/indi-mi/README b/indi-mi/README index 5a43ffab7..68d56fd6c 100644 --- a/indi-mi/README +++ b/indi-mi/README @@ -10,6 +10,9 @@ Requirements You need to install both indi and indi-devel to build this package. ++ libmicam + libmicam is required. + + libusb-1 libusb-1 is required. diff --git a/indi-mi/mi_ccd.h b/indi-mi/mi_ccd.h index e3386b4c0..4b9cd53d9 100644 --- a/indi-mi/mi_ccd.h +++ b/indi-mi/mi_ccd.h @@ -21,7 +21,7 @@ #pragma once -#include "gxccd.h" +#include #include #include diff --git a/indi-mi/99-miccd.rules b/libmicam/99-miccd.rules similarity index 100% rename from indi-mi/99-miccd.rules rename to libmicam/99-miccd.rules diff --git a/libmicam/CMakeLists.txt b/libmicam/CMakeLists.txt new file mode 100644 index 000000000..729584aa3 --- /dev/null +++ b/libmicam/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 2.8) +PROJECT(libmicam CXX C) + +set(MICAM_VERSION "1.0") +set(MICAM_SOVERSION "1") + +include(GNUInstallDirs) + +set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + +IF (APPLE) + +exec_program(cp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdmac.bin ${CMAKE_BINARY_DIR}/libgxccd${MICAM_VERSION}.dylib) +install( FILES ${CMAKE_BINARY_DIR}/libgxccd${MICAM_VERSION}.dylib DESTINATION ${LIB_INSTALL_DIR}${LIB_POSTFIX}) +exec_program(ln ARGS -s ${LIB_INSTALL_DIR}/libgxccd${MICAM_VERSION}.dylib ${LIB_INSTALL_DIR}/libgxccd${MICAM_SOVERSION}.dylib) +exec_program(ln ARGS -s ${LIB_INSTALL_DIR}/libgxccd${MICAM_SOVERSION}.dylib ${LIB_INSTALL_DIR}/libgxccd.dylib) + +ELSE (APPLE) + +set(UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules") + +IF(UNIX AND NOT WIN32) + IF (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+") + exec_program(cp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv7.bin ${CMAKE_BINARY_DIR}/libgxccd.so.${MICAM_VERSION}) + ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + exec_program(cp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/libgxccdarmv8.bin ${CMAKE_BINARY_DIR}/libgxccd.so.${MICAM_VERSION}) + ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + exec_program(cp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/libgxccd64.bin ${CMAKE_BINARY_DIR}/libgxccd.so.${MICAM_VERSION}) + ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "i[3-6]86") + exec_program(cp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/libgxccd32.bin ${CMAKE_BINARY_DIR}/libgxccd.so.${MICAM_VERSION}) + ENDIF () +ENDIF(UNIX AND NOT WIN32) + +install( FILES ${CMAKE_BINARY_DIR}/libgxccd.so.${MICAM_VERSION} DESTINATION ${LIB_INSTALL_DIR}${LIB_POSTFIX}) + +install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \"libgxccd.so.${MICAM_VERSION}\" \"libgxccd.so.${MICAM_SOVERSION}\" WORKING_DIRECTORY +\"\$ENV{DESTDIR}/${BUILD_ROOT}${LIB_INSTALL_DIR}${LIB_POSTFIX}\" )" ) +install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \"libgxccd.so.${MICAM_SOVERSION}\" \"libgxccd.so\" WORKING_DIRECTORY +\"\$ENV{DESTDIR}/${BUILD_ROOT}${LIB_INSTALL_DIR}${LIB_POSTFIX}\" )" ) + +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/99-miccd.rules DESTINATION ${UDEVRULES_INSTALL_DIR}) +endif() + +ENDIF(APPLE) + +install( FILES gxccd.h DESTINATION include/libmicam) diff --git a/indi-mi/gxccd.h b/libmicam/gxccd.h similarity index 100% rename from indi-mi/gxccd.h rename to libmicam/gxccd.h diff --git a/indi-mi/libgxccd32.bin b/libmicam/libgxccd32.bin similarity index 100% rename from indi-mi/libgxccd32.bin rename to libmicam/libgxccd32.bin diff --git a/indi-mi/libgxccd64.bin b/libmicam/libgxccd64.bin similarity index 100% rename from indi-mi/libgxccd64.bin rename to libmicam/libgxccd64.bin diff --git a/indi-mi/libgxccdarmv6.bin b/libmicam/libgxccdarmv6.bin similarity index 100% rename from indi-mi/libgxccdarmv6.bin rename to libmicam/libgxccdarmv6.bin diff --git a/indi-mi/libgxccdarmv7.bin b/libmicam/libgxccdarmv7.bin similarity index 100% rename from indi-mi/libgxccdarmv7.bin rename to libmicam/libgxccdarmv7.bin diff --git a/indi-mi/libgxccdarmv8.bin b/libmicam/libgxccdarmv8.bin similarity index 100% rename from indi-mi/libgxccdarmv8.bin rename to libmicam/libgxccdarmv8.bin diff --git a/indi-mi/libgxccdmac.bin b/libmicam/libgxccdmac.bin similarity index 100% rename from indi-mi/libgxccdmac.bin rename to libmicam/libgxccdmac.bin