Skip to content

Commit

Permalink
Add libmeadecam
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilsrud committed Oct 12, 2023
1 parent 4056c20 commit 2fb4a41
Show file tree
Hide file tree
Showing 20 changed files with 4,192 additions and 4 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,10 @@ find_package(STARSHOOTG)
find_package(NNCAM)
find_package(MALLINCAM)
find_package(OMEGONPROCAM)
if (TOUPCAM_FOUND AND ALTAIRCAM_FOUND AND BRESSERCAM_FOUND AND OGMACAM_FOUND AND TSCAM_FOUND AND STARSHOOTG_FOUND AND NNCAM_FOUND AND MALLINCAM_FOUND AND OMEGONPROCAM_FOUND)
find_package(MEADECAM)
if (TOUPCAM_FOUND AND ALTAIRCAM_FOUND AND BRESSERCAM_FOUND AND OGMACAM_FOUND AND TSCAM_FOUND AND STARSHOOTG_FOUND AND NNCAM_FOUND AND MALLINCAM_FOUND AND OMEGONPROCAM_FOUND AND MEADECAM_FOUND)
add_subdirectory(indi-toupbase)
else (TOUPCAM_FOUND AND ALTAIRCAM_FOUND AND BRESSERCAM_FOUND AND OGMACAM_FOUND AND TSCAM_FOUND AND STARSHOOTG_FOUND AND NNCAM_FOUND AND MALLINCAM_FOUND AND OMEGONPROCAM_FOUND)
else (TOUPCAM_FOUND AND ALTAIRCAM_FOUND AND BRESSERCAM_FOUND AND OGMACAM_FOUND AND TSCAM_FOUND AND STARSHOOTG_FOUND AND NNCAM_FOUND AND MALLINCAM_FOUND AND OMEGONPROCAM_FOUND AND MEADECAM_FOUND)
if (NOT TOUPCAM_FOUND)
add_subdirectory(libtoupcam)
endif()
Expand Down Expand Up @@ -525,8 +526,11 @@ endif()
if (NOT OMEGONPROCAM_FOUND)
add_subdirectory(libomegonprocam)
endif()
if (NOT MEADECAM_FOUND)
add_subdirectory(libmeadecam)
endif()
SET(LIBRARIES_FOUND FALSE)
endif (TOUPCAM_FOUND AND ALTAIRCAM_FOUND AND BRESSERCAM_FOUND AND OGMACAM_FOUND AND TSCAM_FOUND AND STARSHOOTG_FOUND AND NNCAM_FOUND AND MALLINCAM_FOUND AND OMEGONPROCAM_FOUND)
endif (TOUPCAM_FOUND AND ALTAIRCAM_FOUND AND BRESSERCAM_FOUND AND OGMACAM_FOUND AND TSCAM_FOUND AND STARSHOOTG_FOUND AND NNCAM_FOUND AND MALLINCAM_FOUND AND OMEGONPROCAM_FOUND AND MEADECAM_FOUND)
endif (WITH_TOUPBASE)

## Bee Focuser
Expand Down Expand Up @@ -830,6 +834,10 @@ if (WITH_TOUPBASE AND NOT OMEGONPROCAM_FOUND)
message(STATUS "libomegonprocam was not found and will now be built. Please install libomegonprocam first before running cmake again to install indi-toupbase.")
endif (WITH_TOUPBASE AND NOT OMEGONPROCAM_FOUND)

if (WITH_TOUPBASE AND NOT MEADECAM_FOUND)
message(STATUS "libmeadecam was not found and will now be built. Please install libmeadecam first before running cmake again to install indi-toupbase.")
endif (WITH_TOUPBASE AND NOT MEADECAM_FOUND)

if (WITH_INOVAPLX AND NOT INOVASDK_FOUND)
message(STATUS "libinovasdk was not found and will now be built. Please install libinovasdk first before running cmake again to install indi-inovaplx.")
endif (WITH_INOVAPLX AND NOT INOVASDK_FOUND)
Expand Down
50 changes: 50 additions & 0 deletions cmake_modules/FindMEADECAM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# - Try to find Meade Cam Camera Library
# Once done this will define
#
# MEADECAM_FOUND - system has Meade Cam
# MEADECAM_INCLUDE_DIR - the Meade Cam include directory
# MEADECAM_LIBRARIES - Link these to use Meade Cam

# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (MEADECAM_INCLUDE_DIR AND MEADECAM_LIBRARIES)

# in cache already
set(MEADECAM_FOUND TRUE)
message(STATUS "Found libmeadecam: ${MEADECAM_LIBRARIES}")

else (MEADECAM_INCLUDE_DIR AND MEADECAM_LIBRARIES)

find_path(MEADECAM_INCLUDE_DIR meadecam.h
PATH_SUFFIXES libmeadecam
${_obIncDir}
${GNUWIN32_DIR}/include
)

find_library(MEADECAM_LIBRARIES NAMES meadecam
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)

if(MEADECAM_INCLUDE_DIR AND MEADECAM_LIBRARIES)
set(MEADECAM_FOUND TRUE)
else (MEADECAM_INCLUDE_DIR AND MEADECAM_LIBRARIES)
set(MEADECAM_FOUND FALSE)
endif(MEADECAM_INCLUDE_DIR AND MEADECAM_LIBRARIES)


if (MEADECAM_FOUND)
if (NOT MEADECAM_FIND_QUIETLY)
message(STATUS "Found MeadeCam: ${MEADECAM_LIBRARIES}")
endif (NOT MEADECAM_FIND_QUIETLY)
else (MEADECAM_FOUND)
if (MEADECAM_FIND_REQUIRED)
message(FATAL_ERROR "MeadeCam not found. Please install MeadeCam Library http://www.indilib.org")
endif (MEADECAM_FIND_REQUIRED)
endif (MEADECAM_FOUND)

mark_as_advanced(MEADECAM_INCLUDE_DIR MEADECAM_LIBRARIES)

endif (MEADECAM_INCLUDE_DIR AND MEADECAM_LIBRARIES)
5 changes: 5 additions & 0 deletions debian/libmeadecam/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
libmeadecam (1.54.2) jammy; urgency=medium

* Upstream release

-- Ben Gilsrud <[email protected]> Mon, 09 Oct 2023 15:00:00 +0300
1 change: 1 addition & 0 deletions debian/libmeadecam/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
13 changes: 13 additions & 0 deletions debian/libmeadecam/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: libmeadecam
Section: libs
Priority: extra
Maintainer: Ben Gilsrud <[email protected]>
Build-Depends: debhelper (>= 6), cdbs, cmake
Standards-Version: 3.9.1

Package: libmeadecam
Architecture: amd64 armhf arm64
Depends: ${shlibs:Depends}, ${misc:Depends}, libtoupcam
Description: Library for Meade Touptek Cameras.


298 changes: 298 additions & 0 deletions debian/libmeadecam/copyright

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions debian/libmeadecam/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk

DEB_SRCDIR=libmeadecam
DEB_DH_SHLIBDEPS_ARGS=-u--ignore-missing-info
1 change: 1 addition & 0 deletions debian/libmeadecam/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
11 changes: 11 additions & 0 deletions indi-toupbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ find_package(TOUPCAM REQUIRED)
find_package(ALTAIRCAM REQUIRED)
find_package(BRESSERCAM REQUIRED)
find_package(MALLINCAM REQUIRED)
find_package(MEADECAM REQUIRED)
find_package(NNCAM REQUIRED)
find_package(OGMACAM REQUIRED)
find_package(OMEGONPROCAM REQUIRED)
Expand All @@ -36,6 +37,7 @@ include_directories( ${ALTAIRCAM_INCLUDE_DIR})
include_directories( ${STARSHOOTG_INCLUDE_DIR})
include_directories( ${NNCAM_INCLUDE_DIR})
include_directories( ${MALLINCAM_INCLUDE_DIR})
include_directories( ${MEADECAM_INCLUDE_DIR})
include_directories( ${OMEGONPROCAM_INCLUDE_DIR})
include_directories( ${BRESSERCAM_INCLUDE_DIR})
include_directories( ${OGMACAM_INCLUDE_DIR})
Expand Down Expand Up @@ -78,6 +80,14 @@ add_executable(indi_mallincam_wheel ${indi_wheel_SRCS})
target_compile_definitions(indi_mallincam_wheel PRIVATE "-DBUILD_MALLINCAM")
target_link_libraries(indi_mallincam_wheel ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${MALLINCAM_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})

########### indi_meadecam_* ###########
add_executable(indi_meadecam_ccd ${indi_toupbase_SRCS})
target_compile_definitions(indi_meadecam_ccd PRIVATE "-DBUILD_MEADECAM")
target_link_libraries(indi_meadecam_ccd ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${MEADECAM_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
add_executable(indi_meadecam_wheel ${indi_wheel_SRCS})
target_compile_definitions(indi_meadecam_wheel PRIVATE "-DBUILD_MEADECAM")
target_link_libraries(indi_meadecam_wheel ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${MEADECAM_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})

########### indi_nncam_* ###########
add_executable(indi_nncam_ccd ${indi_toupbase_SRCS})
target_compile_definitions(indi_nncam_ccd PRIVATE "-DBUILD_NNCAM")
Expand Down Expand Up @@ -146,6 +156,7 @@ install(TARGETS
indi_altair_ccd
indi_bressercam_ccd
indi_mallincam_ccd
indi_meadecam_ccd
indi_nncam_ccd
indi_ogmacam_ccd
indi_omegonprocam_ccd
Expand Down
1 change: 1 addition & 0 deletions indi-toupbase/indi-toupbase.spec
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ BuildRequires: libtoupcam
BuildRequires: libaltaircam
BuildRequires: libbressercam
BuildRequires: libmallincam
BuildRequires: libmeadecam
BuildRequires: libnncam
BuildRequires: libogmacam
BuildRequires: libomegonprocam
Expand Down
4 changes: 4 additions & 0 deletions indi-toupbase/indi_toupbase.xml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<driver name="MALLINCAM">indi_mallincam_ccd</driver>
<version>@TOUPBASE_VERSION_MAJOR@.@TOUPBASE_VERSION_MINOR@</version>
</device>
<device label="Meadecam" mdpd="true" manufacturer="Meade">
<driver name="Meade">indi_meadecam_ccd</driver>
<version>@TOUPBASE_VERSION_MAJOR@.@TOUPBASE_VERSION_MINOR@</version>
</device>
<device label="Nncam" mdpd="true" manufacturer="Nn">
<driver name="Nn">indi_nncam_ccd</driver>
<version>@TOUPBASE_VERSION_MAJOR@.@TOUPBASE_VERSION_MINOR@</version>
Expand Down
9 changes: 8 additions & 1 deletion indi-toupbase/libtoupbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@
#define XP(x) Tscam##x
#define THAND HTscam
#define DNAME "Teleskop"
#elif BUILD_MEADECAM
#include <meadecam.h>
#define FP(x) Toupcam_##x
#define CP(x) TOUPCAM_##x
#define XP(x) Toupcam##x
#define THAND HToupcam
#define DNAME "Meade"
#endif

extern std::string errorCodes(HRESULT rc);
extern std::string errorCodes(HRESULT rc);
11 changes: 11 additions & 0 deletions libmeadecam/99-meadecam.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copy this file to /etc/udev/rules.d

# Once done, unplug and re-plug your device. This is all that is
# necessary to see the new permissions. Udev does not have to be restarted.

# If you think permissions of 0666 are too loose, then see:
# http://reactivated.net/writing_udev_rules.html for more information on finer
# grained permission setting.

SUBSYSTEM=="usb", ATTRS{idVendor}=="0547", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0549", MODE="0666"
31 changes: 31 additions & 0 deletions libmeadecam/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmake_minimum_required (VERSION 3.0)
project (libmeadecam)

set (LIBMEADECAM_VERSION "1.0")
set (LIBMEADECAM_SOVERSION "1")

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules/")
find_package(USB1 REQUIRED)

include (GNUInstallDirs)
include (InstallImported)
include(CMakeCommon)


set(meadecam_LIB_SRCS meadecam.c)
add_library(meadecam SHARED ${meadecam_LIB_SRCS})
set_target_properties(meadecam PROPERTIES VERSION ${LIBMEADECAM_VERSION} SOVERSION ${LIBMEADECAM_SOVERSION})
target_link_libraries(meadecam ${USB1_LIBRARIES})
install(TARGETS meadecam LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

if (UNIX AND NOT APPLE)

# Install udev rules
set (UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")
install (FILES 99-meadecam.rules DESTINATION ${UDEVRULES_INSTALL_DIR})

endif ()

# Install header files
install (FILES meadecam.h DESTINATION include/libmeadecam)
Loading

0 comments on commit 2fb4a41

Please sign in to comment.