Skip to content

Commit

Permalink
libmeadecam
Browse files Browse the repository at this point in the history
  • Loading branch information
touptek committed Jul 12, 2024
1 parent b0bf2c2 commit 1050819
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 1,697 deletions.
14 changes: 14 additions & 0 deletions indi-toupbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ find_package(OGMACAM REQUIRED)
find_package(OMEGONPROCAM REQUIRED)
find_package(STARSHOOTG REQUIRED)
find_package(TSCAM REQUIRED)
find_package(MEADECAM REQUIRED)

set(TOUPBASE_VERSION_MAJOR 2)
set(TOUPBASE_VERSION_MINOR 1)
Expand All @@ -42,6 +43,7 @@ include_directories( ${OMEGONPROCAM_INCLUDE_DIR})
include_directories( ${BRESSERCAM_INCLUDE_DIR})
include_directories( ${OGMACAM_INCLUDE_DIR})
include_directories( ${TSCAM_INCLUDE_DIR})
include_directories( $(MEADECAM_INCLUDE_DIR})

include(CMakeCommon)

Expand Down Expand Up @@ -128,6 +130,14 @@ add_executable(indi_tscam_wheel ${indi_wheel_SRCS})
target_compile_definitions(indi_tscam_wheel PRIVATE "-DBUILD_TSCAM")
target_link_libraries(indi_tscam_wheel ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${TSCAM_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})

#####################################

if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
Expand All @@ -140,6 +150,7 @@ target_link_libraries(indi_ogmacam_ccd rt)
target_link_libraries(indi_omegonprocam_ccd rt)
target_link_libraries(indi_starshootg_ccd rt)
target_link_libraries(indi_tscam_ccd rt)
target_link_libraries(indi_meadecam_ccd rt)
target_link_libraries(indi_toupcam_wheel rt)
target_link_libraries(indi_altair_wheel rt)
target_link_libraries(indi_bressercam_wheel rt)
Expand All @@ -149,6 +160,7 @@ target_link_libraries(indi_ogmacam_wheel rt)
target_link_libraries(indi_omegonprocam_wheel rt)
target_link_libraries(indi_starshootg_wheel rt)
target_link_libraries(indi_tscam_wheel rt)
target_link_libraries(indi_meadecam_wheel rt)
endif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")

install(TARGETS
Expand All @@ -162,6 +174,7 @@ install(TARGETS
indi_omegonprocam_ccd
indi_starshootg_ccd
indi_tscam_ccd
indi_meadecam_ccd
indi_toupcam_wheel
indi_altair_wheel
indi_bressercam_wheel
Expand All @@ -171,6 +184,7 @@ install(TARGETS
indi_omegonprocam_wheel
indi_starshootg_wheel
indi_tscam_wheel
indi_meadecam_wheel
RUNTIME DESTINATION bin)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_toupbase.xml DESTINATION ${INDI_DATA_DIR})
2 changes: 2 additions & 0 deletions indi-toupbase/indi-toupbase.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ BuildRequires: libogmacam
BuildRequires: libomegonprocam
BuildRequires: libstarshootg
BuildRequires: libtscam
BuildRequires: libmeadecam


%description
Expand Down Expand Up @@ -86,4 +87,5 @@ make DESTDIR=%{buildroot} install
* Sun Jul 19 2020 Jim Howard <jh.xsnrg+fedora@gmail.com> 1.8.7.git-1
- update to build from git for copr, credit to Sergio Pascual and Christian Dersch for prior work on spec files
- added Omegon SDK based toupcam driver. 2022-05-27
- added Meade SDK based toupcam driver. 2024-07-12

8 changes: 8 additions & 0 deletions indi-toupbase/indi_toupbase.xml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<driver name="Teleskop">indi_tscam_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>
</devGroup>
<devGroup group="Filter Wheels">
<device label="Toupcam EFW" mdpd="true" manufacturer="Toupcam">
Expand Down Expand Up @@ -79,5 +83,9 @@
<driver name="Teleskop">indi_tscam_wheel</driver>
<version>@TOUPBASE_VERSION_MAJOR@.@TOUPBASE_VERSION_MINOR@</version>
</device>
<device label="Meadecam EFW" mdpd="true" manufacturer="Meade">
<driver name="Meade">indi_meadecam_wheel</driver>
<version>@TOUPBASE_VERSION_MAJOR@.@TOUPBASE_VERSION_MINOR@</version>
</device>
</devGroup>
</driversList>
37 changes: 25 additions & 12 deletions libmeadecam/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,44 @@
cmake_minimum_required(VERSION 3.16)
project (libmeadecam)

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

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)

add_library (meadecam SHARED IMPORTED)

set_target_properties (meadecam PROPERTIES VERSION ${LIBMEADECAM_VERSION} SOVERSION ${LIBMEADECAM_SOVERSION})

if (APPLE)

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})
set_property (TARGET meadecam PROPERTY IMPORTED_LOCATION "mac/libmeadecam.bin")

if (UNIX AND NOT APPLE)
FIX_MACOS_LIBRARIES("libmeadecam" "mac/libmeadecam.bin" "MEADECAM")

elseif (UNIX AND NOT WIN32)

if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+")
set_property (TARGET meadecam PROPERTY IMPORTED_LOCATION "armhf/libmeadecam.bin")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set_property (TARGET meadecam PROPERTY IMPORTED_LOCATION "arm64/libmeadecam.bin")
elseif (CMAKE_SIZEOF_VOID_P MATCHES "8")
set_property (TARGET meadecam PROPERTY IMPORTED_LOCATION "x64/libmeadecam.bin")
else ()
message (FATAL_ERROR "unsupported architecture.")
endif ()

# 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})
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/99-meadecam.rules DESTINATION ${UDEVRULES_INSTALL_DIR})

endif ()

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

# Install library
install_imported (TARGETS meadecam DESTINATION ${CMAKE_INSTALL_LIBDIR})
21 changes: 0 additions & 21 deletions libmeadecam/gen_func_table

This file was deleted.

2 changes: 1 addition & 1 deletion libmeadecam/libmeadecam.spec
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ make DESTDIR=%{buildroot} install


%changelog
* initial release 2022-05-27
* Touptek, xiangqianyong@hotmail.com

Loading

0 comments on commit 1050819

Please sign in to comment.