Skip to content

Commit

Permalink
Splitting indi-mi to indi-mi driver and libmicam
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaczorek committed Nov 3, 2019
1 parent ad0de24 commit fd4c5d4
Show file tree
Hide file tree
Showing 23 changed files with 167 additions and 40 deletions.
49 changes: 49 additions & 0 deletions cmake_modules/FindMICAM.cmake
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 6 additions & 0 deletions debian/indi-mi/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
indi-mi (1.6) buster; urgency=medium

* Separating from MI libraries

-- Radek Kaczorek <[email protected]> Sun, 3 Nov 2019 14:21:00 +0100

indi-mi (1.5) bionic; urgency=low

* Fix launchpad ARM issue.
Expand Down
4 changes: 2 additions & 2 deletions debian/indi-mi/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Source: indi-mi
Section: science
Priority: extra
Maintainer: Jasem Mutlaq <[email protected]>
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.
Expand Down
1 change: 0 additions & 1 deletion debian/indi-mi/indi-mi.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
usr/bin/
usr/share/indi/
lib/udev/rules.d/
6 changes: 6 additions & 0 deletions debian/libmicam/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
libmicam (1.0) buster; urgency=medium

* Initial release

-- Radek Kaczorek <[email protected]> Sun, 3 Nov 2019 13:33:00 +0100

1 change: 1 addition & 0 deletions debian/libmicam/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
11 changes: 11 additions & 0 deletions debian/libmicam/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Source: libmicam
Section: libs
Priority: extra
Maintainer: Radek Kaczorek <[email protected]>
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
28 changes: 28 additions & 0 deletions debian/libmicam/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: libmicam
Upstream-Contact: Jasem Mutlaq <[email protected]>
Source: https://github.com/indilib/indi-3rdparty/libmicam

Files: CMakeLists.txt
Copyright: 2019, Radek Kaczorek <[email protected]>
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 <http://www.gxccd.com, [email protected]>
License: All rights reserved
6 changes: 6 additions & 0 deletions debian/libmicam/rules
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions debian/libmicam/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
1 change: 1 addition & 0 deletions indi-mi/AUTHORS
Original file line number Diff line number Diff line change
@@ -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)
41 changes: 5 additions & 36 deletions indi-mi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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()
3 changes: 3 additions & 0 deletions indi-mi/README
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion indi-mi/mi_ccd.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#pragma once

#include "gxccd.h"
#include <gxccd.h>

#include <indiccd.h>
#include <indifilterinterface.h>
Expand Down
File renamed without changes.
47 changes: 47 additions & 0 deletions libmicam/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fd4c5d4

Please sign in to comment.