indi-sbig-2.1+20221220234924/ 0000755 0001751 0001751 00000000000 14350445005 014027 5 ustar debian debian indi-sbig-2.1+20221220234924/.cproject 0000644 0001751 0001751 00000127301 14174600255 015651 0 ustar debian debian
indi-sbig-2.1+20221220234924/README 0000644 0001751 0001751 00000001672 14174600255 014721 0 ustar debian debian SBIG INDI Driver
================
This package provides the INDI driver for Santa Barbra Instruments Group line of CCDs & Filter Wheels.
Requirements
============
+ INDI >= v0.6 (http://indi.sf.net)
You need to install both indi and indi-devel to build this package.
+ cfitsio
cfitsio-devel is required to compile support for FITS.
+ libusb
libusb is required.
+ SBIG Universal Driver for Linux (http://indi.sf.net)
SBIG Universal driver along with fxload and the CCD firmware is required.
Installation
============
See INSTALL
How to Use
==========
You can use the SBIG INDI Driver in any INDI-compatible client such as KStars or Xephem.
To run the driver from the command line:
$ indiserver indi_sbig_ccd
You can then connect to the driver from any client, the default port is 7624.
If you're using KStars, the driver will be automatically listed in KStars' Device Manager,
no further configuration is necessary.
indi-sbig-2.1+20221220234924/sbig_ccd.cpp 0000644 0001751 0001751 00000257316 14347562502 016316 0 ustar debian debian /*
Driver type: SBIG CCD Camera INDI Driver
Copyright (C) 2022 Tobias Illenseer (tillense AT astrophysik DOT uni-kiel DOT de)
Copyright (C) 2013-2018 Jasem Mutlaq (mutlaqja AT ikarustech DOT com)
Copyright (C) 2017 Peter Polakovic (peter DOT polakovic AT cloudmakers DOT eu)
Copyright (C) 2005-2006 Jan Soldan (jsoldan AT asu DOT cas DOT cz)
Acknowledgement:
Matt Longmire (matto AT sbig DOT com)
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2016-01-07: Added ETH connection (by Simon Holmbo)
2016-01-07: Changed Device port from text to switch (JM)
2017-06-22: Bugfixes and code cleanup (PP)
2018-12-01: Added switch to ignore shutter errors which can affect some cameras (JM)
*/
#include "sbig_ccd.h"
#include
#include
#include
#include
#include
#include
#include
#ifdef __APPLE__
#include
#include "ezusb.h"
#endif
#define TEMPERATURE_POLL_MS 5000 /* Temperature Polling time (ms) */
#define MAX_RESOLUTION 4096 /* Maximum resolution for secondary chip */
#define MAX_DEVICES 20 /* Max device cameraCount */
#define MAX_THREAD_RETRIES 3
#define MAX_THREAD_WAIT 300000
static class Loader
{
std::deque> cameras;
public:
Loader()
{
cameras.push_back(std::unique_ptr(new SBIGCCD()));
}
} loader;
//==========================================================================
void SBIGCCD::loadFirmwareOnOSXifNeeded()
{
// Upload firmware in case of MacOS
#ifdef __APPLE__
//SBIG Universal Driver Check
const std::string name = "/System/Library/Extensions/SBIGUSBEDriver.kext";
struct stat buffer;
if (stat (name.c_str(), &buffer) == 0)
{
LOG_DEBUG("SBIG Universal Driver Detected");
}
else
{
LOGF_WARN("Failed to Detect SBIG Universal Driver, please install this before running the INDI SBIG driver!", __FUNCTION__);
}
int rc = 0;
int i = 0;
int cnt = 0;
libusb_device **list = nullptr;
struct libusb_device_descriptor desc;
std::string bus_name, device_name;
if ((rc = libusb_init(nullptr)))
{
LOGF_WARN("Failed to start libusb", __FUNCTION__, libusb_error_name(rc));
}
//libusb_set_debug(nullptr, verbose); maybe?
cnt = libusb_get_device_list(nullptr, &list);
if(cnt < 0)
LOGF_WARN("Failed to get device list", __FUNCTION__, libusb_error_name(rc));
handle = nullptr;
for (i = 0; i < cnt; ++i)
{
if (!libusb_get_device_descriptor(list[i], &desc))
{
int sbigCameraTypeFound = 0;
// SBIG ST-7/8/9/10/2K cameras
if ((desc.idVendor == 0x0d97) && (desc.idProduct == 0x0001))
sbigCameraTypeFound = 1;
//Need the code here to detect ST-4K Camera, since it has the same Vendor and Product ID as above
// SBIG ST-L cameras
if ((desc.idVendor == 0x0d97) && (desc.idProduct == 0x0002))
sbigCameraTypeFound = 3;
// SBIG ST-402/1603/3200/8300 cameras
if ((desc.idVendor == 0x0d97) && (desc.idProduct == 0x0003))
sbigCameraTypeFound = 4;
if(sbigCameraTypeFound != 0)
{
libusb_open(list[i], &handle);
if (handle)
{
libusb_kernel_driver_active(handle, 0);
libusb_claim_interface(handle, 0);
char driverSupportPath[MAXRBUF];
//On OS X, Prefer embedded App location if it exists
if (getenv("INDIPREFIX") != nullptr)
snprintf(driverSupportPath, MAXRBUF, "%s/Contents/Resources", getenv("INDIPREFIX"));
else
strncpy(driverSupportPath, "/usr/local/lib/indi", MAXRBUF);
int status = 0;
if(sbigCameraTypeFound == 1) // SBIG ST-7/8/9/10/2K cameras
{
strncat(driverSupportPath, "/DriverSupport/sbig/sbigucam.hex", MAXRBUF);
status = ezusb_load_ram(handle, driverSupportPath, FX_TYPE_FX1, IMG_TYPE_HEX, 0);
}
//Note that we NEED to add the code here to load sbigpcam.hex to ST-4K
if(sbigCameraTypeFound == 3) // SBIG ST-L cameras
{
strncat(driverSupportPath, "/DriverSupport/sbig/sbiglcam.hex", MAXRBUF);
status = ezusb_load_ram(handle, driverSupportPath, FX_TYPE_FX1, IMG_TYPE_HEX, 0);
}
if(sbigCameraTypeFound == 4) // SBIG ST-402/1603/3200/8300 cameras
{
strncat(driverSupportPath, "/DriverSupport/sbig/sbigfcam.hex", MAXRBUF);
status = ezusb_load_ram(handle, driverSupportPath, FX_TYPE_FX2, IMG_TYPE_HEX, 0);
}
if (status == 0 )
LOGF_DEBUG("Failed to load firmware", __FUNCTION__);
libusb_close(handle);
}
}
}
}
libusb_free_device_list(list, 0);
list = nullptr;
#endif
}
int SBIGCCD::OpenDriver()
{
loadFirmwareOnOSXifNeeded();
GetDriverHandleResults gdhr;
SetDriverHandleParams sdhp;
int res = ::SBIGUnivDrvCommand(CC_OPEN_DRIVER, nullptr, nullptr);
if (res == CE_NO_ERROR)
{
LOGF_DEBUG("%s: CC_OPEN_DRIVER successful", __FUNCTION__);
res = ::SBIGUnivDrvCommand(CC_GET_DRIVER_HANDLE, nullptr, &gdhr);
}
else if (res == CE_DRIVER_NOT_CLOSED)
{
LOGF_WARN("%s: CC_OPEN_DRIVER -> (%s)", __FUNCTION__, GetErrorString(res));
// The driver is already open which we interpret as having been
// opened by another instance of the class so get the driver to
// allocate a new handle and then record it.
sdhp.handle = INVALID_HANDLE_VALUE;
res = ::SBIGUnivDrvCommand(CC_SET_DRIVER_HANDLE, &sdhp, nullptr);
if (res == CE_NO_ERROR)
{
res = ::SBIGUnivDrvCommand(CC_OPEN_DRIVER, nullptr, nullptr);
if (res == CE_NO_ERROR)
{
res = ::SBIGUnivDrvCommand(CC_GET_DRIVER_HANDLE, nullptr, &gdhr);
}
}
}
if (res == CE_NO_ERROR)
{
SetDriverHandle(gdhr.handle);
}
else
{
LOGF_ERROR("%s: CC_OPEN_DRIVER -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
//==========================================================================
int SBIGCCD::CloseDriver()
{
int res = ::SBIGUnivDrvCommand(CC_CLOSE_DRIVER, nullptr, nullptr);
if (res == CE_NO_ERROR)
{
LOGF_DEBUG("%s: CC_CLOSE_DRIVER successful", __FUNCTION__);
SetDriverHandle();
}
else
{
LOGF_ERROR("%s: CC_CLOSE_DRIVER -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
//==========================================================================
int SBIGCCD::OpenDevice(uint32_t devType)
{
int res = CE_NO_ERROR;
if (isSimulation())
{
return res;
}
OpenDeviceParams odp;
if (IsDeviceOpen()) // Check if device already opened
return (CE_NO_ERROR);
odp.deviceType = devType; // Try to open new device
if (devType == DEV_ETH)
{
unsigned long ip = htonl(inet_addr(IpTP.tp->text));
if (ip == INADDR_NONE)
return (CE_BAD_PARAMETER);
odp.ipAddress = ip;
}
res = SBIGUnivDrvCommand(CC_OPEN_DEVICE, &odp, nullptr);
if (res == CE_NO_ERROR)
{
//SetDeviceName(devType);
SetFileDescriptor(true);
}
else
{
LOGF_ERROR("%s: CC_OPEN_DEVICE %d -> (%s)", __FUNCTION__, devType, GetErrorString(res));
}
return res;
}
//==========================================================================
int SBIGCCD::CloseDevice()
{
int res = CE_NO_ERROR;
if (isSimulation())
{
return res;
}
if (IsDeviceOpen())
{
if ((res = SBIGUnivDrvCommand(CC_CLOSE_DEVICE, nullptr, nullptr)) == CE_NO_ERROR)
{
SetFileDescriptor(); // set value to -1
SetCameraType(); // set value to NO_CAMERA
}
}
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_CLOSE_DEVICE -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
//==========================================================================
SBIGCCD::SBIGCCD() : FilterInterface(this)
{
InitVars();
int res = OpenDriver();
if (res != CE_NO_ERROR)
LOGF_DEBUG("%s: Error (%s)", __FUNCTION__, GetErrorString(res));
// TBD: For now let's set name to default name. In the future, we need to to support multiple devices per one driver
if (*getDeviceName() == '\0')
strncpy(name, getDefaultName(), MAXINDINAME);
else
strncpy(name, getDeviceName(), MAXINDINAME);
setVersion(SBIG_VERSION_MAJOR, SBIG_VERSION_MINOR);
}
//==========================================================================
/*SBIGCCD::SBIGCCD(const char* devName) {
int res = CE_NO_ERROR;
InitVars();
if ((res = OpenDriver()) == CE_NO_ERROR)
OpenDevice(devName);
if (res != CE_NO_ERROR)
LOGF_DEBUG("%s: Error (%s)", __FUNCTION__, GetErrorString(res));
}*/
//==========================================================================
SBIGCCD::~SBIGCCD()
{
CloseDevice();
CloseDriver();
}
//==========================================================================
const char *SBIGCCD::getDefaultName()
{
return "SBIG CCD";
}
bool SBIGCCD::initProperties()
{
INDI::CCD::initProperties();
addSimulationControl();
// CCD PRODUCT
IUFillText(&ProductInfoT[0], "NAME", "Name", "");
IUFillText(&ProductInfoT[1], "ID", "ID", "");
IUFillTextVector(&ProductInfoTP, ProductInfoT, 2, getDeviceName(), "CCD_PRODUCT", "Product", MAIN_CONTROL_TAB,
IP_RO, 0, IPS_IDLE);
// IP Address
IUFillText(&IpT[0], "IP", "IP Address", "192.168.0.100");
IUFillTextVector(&IpTP, IpT, 1, getDeviceName(), "IP_ADDRESS", "IP Address", MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE);
// CCD DEVICE PORT
IUFillSwitch(&PortS[0], "Ethernet", "Ethernet", ISS_OFF);
SBIGPortMap[0] = DEV_ETH;
PortS[0].aux = &SBIGPortMap[0];
IUFillSwitch(&PortS[1], "USB 1", "USB 1", ISS_ON);
SBIGPortMap[1] = DEV_USB1;
PortS[1].aux = &SBIGPortMap[1];
IUFillSwitch(&PortS[2], "USB 2", "USB 2", ISS_OFF);
SBIGPortMap[2] = DEV_USB2;
PortS[2].aux = &SBIGPortMap[2];
IUFillSwitch(&PortS[3], "USB 3", "USB 3", ISS_OFF);
SBIGPortMap[3] = DEV_USB3;
PortS[3].aux = &SBIGPortMap[3];
IUFillSwitch(&PortS[4], "USB 4", "USB 4", ISS_OFF);
SBIGPortMap[4] = DEV_USB4;
PortS[4].aux = &SBIGPortMap[4];
IUFillSwitch(&PortS[5], "LPT 1", "LPT 1", ISS_OFF);
SBIGPortMap[5] = DEV_LPT1;
PortS[5].aux = &SBIGPortMap[5];
IUFillSwitch(&PortS[6], "LPT 2", "LPT 2", ISS_OFF);
SBIGPortMap[6] = DEV_LPT2;
PortS[6].aux = &SBIGPortMap[6];
IUFillSwitch(&PortS[7], "LPT 3", "LPT 3", ISS_OFF);
SBIGPortMap[7] = DEV_LPT3;
PortS[7].aux = &SBIGPortMap[7];
IUFillSwitchVector(&PortSP, PortS, 8, getDeviceName(), "DEVICE_PORT_TYPE", "Port", MAIN_CONTROL_TAB, IP_RW,
ISR_1OFMANY, 0, IPS_IDLE);
// CCD FAN STATE
IUFillSwitch(&FanStateS[0], "FAN_ON", "On", ISS_ON);
IUFillSwitch(&FanStateS[1], "FAN_OFF", "Off", ISS_OFF);
IUFillSwitchVector(&FanStateSP, FanStateS, 2, getDeviceName(), "CCD_FAN", "Fan", MAIN_CONTROL_TAB, IP_RW,
ISR_1OFMANY, 0, IPS_OK);
// CCD Cooler Switch
IUFillSwitch(&CoolerS[0], "COOLER_ON", "On", ISS_OFF);
IUFillSwitch(&CoolerS[1], "COOLER_OFF", "Off", ISS_ON);
IUFillSwitchVector(&CoolerSP, CoolerS, 2, getDeviceName(), "CCD_COOLER", "Cooler", MAIN_CONTROL_TAB, IP_RW,
ISR_1OFMANY, 0, IPS_OK);
// CCD COOLER:
IUFillNumber(&CoolerN[0], "CCD_COOLER_VALUE", "[%]", "%.1f", 0, 0, 0, 0);
IUFillNumberVector(&CoolerNP, CoolerN, 1, getDeviceName(), "CCD_COOLER_POWER", "Cooler %", MAIN_CONTROL_TAB, IP_RO,
0, IPS_IDLE);
// Ignore errors
IUFillSwitch(&IgnoreErrorsS[0], "SHUTTER_ERRORS", "Shutter Errors", ISS_OFF);
IUFillSwitchVector(&IgnoreErrorsSP, IgnoreErrorsS, 1, getDeviceName(), "CCD_IGNORE_ERRORS", "Ignore", OPTIONS_TAB, IP_RW,
ISR_NOFMANY, 0, IPS_OK);
// CFW PRODUCT
IUFillText(&FilterProdcutT[0], "NAME", "Name", "");
IUFillText(&FilterProdcutT[1], "ID", "ID", "");
IUFillTextVector(&FilterProdcutTP, FilterProdcutT, 2, getDeviceName(), "CFW_PRODUCT", "Product", FILTER_TAB, IP_RO,
0, IPS_IDLE);
// CFW_MODEL
IUFillSwitch(&FilterTypeS[0], "CFW1", "CFW-2", ISS_OFF);
FilterTypeS[0].aux = &SBIGFilterMap[0];
SBIGFilterMap[0] = CFWSEL_CFW2;
IUFillSwitch(&FilterTypeS[1], "CFW2", "CFW-5", ISS_OFF);
FilterTypeS[1].aux = &SBIGFilterMap[1];
SBIGFilterMap[1] = CFWSEL_CFW5;
IUFillSwitch(&FilterTypeS[2], "CFW3", "CFW-6A", ISS_OFF);
FilterTypeS[2].aux = &SBIGFilterMap[2];
SBIGFilterMap[2] = CFWSEL_CFW6A;
IUFillSwitch(&FilterTypeS[3], "CFW4", "CFW-8", ISS_OFF);
FilterTypeS[3].aux = &SBIGFilterMap[3];
SBIGFilterMap[3] = CFWSEL_CFW8;
IUFillSwitch(&FilterTypeS[4], "CFW5", "CFW-402", ISS_OFF);
FilterTypeS[4].aux = &SBIGFilterMap[4];
SBIGFilterMap[4] = CFWSEL_CFW402;
IUFillSwitch(&FilterTypeS[5], "CFW6", "CFW-10", ISS_OFF);
FilterTypeS[5].aux = &SBIGFilterMap[5];
SBIGFilterMap[5] = CFWSEL_CFW10;
IUFillSwitch(&FilterTypeS[6], "CFW7", "CFW-10 SA", ISS_OFF);
FilterTypeS[6].aux = &SBIGFilterMap[6];
SBIGFilterMap[6] = CFWSEL_CFW10_SERIAL;
IUFillSwitch(&FilterTypeS[7], "CFW8", "CFW-L", ISS_OFF);
FilterTypeS[7].aux = &SBIGFilterMap[7];
SBIGFilterMap[7] = CFWSEL_CFWL;
IUFillSwitch(&FilterTypeS[8], "CFW9", "CFW-9", ISS_OFF);
FilterTypeS[8].aux = &SBIGFilterMap[8];
SBIGFilterMap[8] = CFWSEL_CFW9;
IUFillSwitch(&FilterTypeS[9], "CFW10", "CFW-8LG", ISS_OFF);
FilterTypeS[9].aux = &SBIGFilterMap[9];
SBIGFilterMap[9] = CFWSEL_CFWL8G;
IUFillSwitch(&FilterTypeS[10], "CFW11", "CFW-1603", ISS_OFF);
FilterTypeS[10].aux = &SBIGFilterMap[10];
SBIGFilterMap[10] = CFWSEL_CFW1603;
IUFillSwitch(&FilterTypeS[11], "CFW12", "CFW-FW5-STX", ISS_OFF);
FilterTypeS[11].aux = &SBIGFilterMap[11];
SBIGFilterMap[11] = CFWSEL_FW5_STX;
IUFillSwitch(&FilterTypeS[12], "CFW13", "CFW-FW5-8300", ISS_OFF);
FilterTypeS[12].aux = &SBIGFilterMap[12];
SBIGFilterMap[12] = CFWSEL_FW5_8300;
IUFillSwitch(&FilterTypeS[13], "CFW14", "CFW-FW8-8300", ISS_OFF);
FilterTypeS[13].aux = &SBIGFilterMap[13];
SBIGFilterMap[13] = CFWSEL_FW8_8300;
IUFillSwitch(&FilterTypeS[14], "CFW15", "CFW-FW7-STX", ISS_OFF);
FilterTypeS[14].aux = &SBIGFilterMap[14];
SBIGFilterMap[14] = CFWSEL_FW7_STX;
IUFillSwitch(&FilterTypeS[15], "CFW16", "CFW-FW8-STT", ISS_OFF);
FilterTypeS[15].aux = &SBIGFilterMap[15];
SBIGFilterMap[15] = CFWSEL_FW8_STT;
#ifdef USE_CFW_AUTO
IUFillSwitch(&FilterTypeS[16], "CFW17", "CFW-Auto", ISS_OFF);
FilterTypeS[16].aux = &SBIGFilterMap[16];
SBIGFilterMap[16] = CFWSEL_AUTO;
#endif
IUFillSwitchVector(&FilterTypeSP, FilterTypeS, MAX_CFW_TYPES, getDeviceName(), "CFW_TYPE", "Type", FILTER_TAB,
IP_RW, ISR_ATMOST1, 0, IPS_IDLE);
// CFW CONNECTION
IUFillSwitch(&FilterConnectionS[0], "CONNECT", "Connect", ISS_OFF);
IUFillSwitch(&FilterConnectionS[1], "DISCONNECT", "Disconnect", ISS_ON);
IUFillSwitchVector(&FilterConnectionSP, FilterConnectionS, 2, getDeviceName(), "CFW_CONNECTION", "Connect",
FILTER_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE);
/////////////////////////////////////////////////////////////////////////////
/// Adaptive Optics
/////////////////////////////////////////////////////////////////////////////
IUFillNumber(&AONSN[AO_NORTH], "AO_N", "North (steps)", "%.f", 0, 2048, 100, 0);
IUFillNumber(&AONSN[AO_SOUTH], "AO_S", "South (steps)", "%.f", 0, 2048, 100, 0);
IUFillNumberVector(&AONSNP, AONSN, 2, getDeviceName(), "AO_NS", "AO Tilt North/South", GUIDE_CONTROL_TAB, IP_RW, 60,
IPS_IDLE);
IUFillNumber(&AOWEN[AO_EAST], "AO_E", "East (steps)", "%.f", 0, 2048, 100, 0);
IUFillNumber(&AOWEN[AO_WEST], "AO_W", "West (steps)", "%.f", 0, 2048, 100, 0);
IUFillNumberVector(&AOWENP, AOWEN, 2, getDeviceName(), "AO_WE", "AO Tilt East/West", GUIDE_CONTROL_TAB, IP_RW, 60,
IPS_IDLE);
IUFillSwitch(&CenterS[0], "CENTER", "Center", ISS_OFF);
IUFillSwitchVector(&CenterSP, CenterS, 1, getDeviceName(), "AO_CENTER", "AO Center", GUIDE_CONTROL_TAB, IP_RW,
ISR_1OFMANY, 60, IPS_IDLE);
IUSaveText(&BayerT[2], "BGGR");
INDI::FilterInterface::initProperties(FILTER_TAB);
FilterSlotN[0].min = 1;
FilterSlotN[0].max = MAX_CFW_TYPES;
// Set minimum exposure speed to 0.001 seconds
PrimaryCCD.setMinMaxStep("CCD_EXPOSURE", "CCD_EXPOSURE_VALUE", 0.001, 3600, 1, false);
setDriverInterface(getDriverInterface() | FILTER_INTERFACE | AO_INTERFACE);
return true;
}
void SBIGCCD::ISGetProperties(const char *dev)
{
INDI::CCD::ISGetProperties(dev);
defineProperty(&PortSP);
loadConfig(true, "DEVICE_PORT_TYPE");
loadConfig(true, "IP_ADDRESS");
addAuxControls();
}
bool SBIGCCD::updateProperties()
{
// Set format first if connected.
if (isConnected())
{
// N.B. AFAIK, there is no way to switch image formats.
CaptureFormatSP.resize(0);
CaptureFormat format;
if (m_isColor)
{
format = {"INDI_RAW", "RAW", 16, true};
}
else
{
format = {"INDI_MONO", "Mono", 16, true};
}
addCaptureFormat(format);
}
INDI::CCD::updateProperties();
if (isConnected())
{
defineProperty(&ProductInfoTP);
if (IsFanControlAvailable())
{
defineProperty(&FanStateSP);
}
if (HasCooler())
{
defineProperty(&CoolerSP);
defineProperty(&CoolerNP);
}
defineProperty(&IgnoreErrorsSP);
if (m_hasFilterWheel)
{
defineProperty(&FilterConnectionSP);
defineProperty(&FilterTypeSP);
}
// AO Properties
if (m_hasAO)
{
defineProperty(&AONSNP);
defineProperty(&AOWENP);
defineProperty(&CenterSP);
}
setupParams();
if (m_hasFilterWheel) // If filter type already selected (from config file), then try to connect to CFW
{
loadConfig(true, "CFW_TYPE");
ISwitch *p = IUFindOnSwitch(&FilterTypeSP);
if (p != nullptr && FilterConnectionS[0].s == ISS_OFF)
{
LOG_DEBUG("Filter type is already selected and filter is not connected. Will "
"attempt to connect to filter now...");
CFWConnect();
}
}
m_TimerID = SetTimer(getCurrentPollingPeriod());
}
else
{
deleteProperty(ProductInfoTP.name);
if (IsFanControlAvailable())
{
deleteProperty(FanStateSP.name);
}
if (HasCooler())
{
deleteProperty(CoolerSP.name);
deleteProperty(CoolerNP.name);
}
deleteProperty(IgnoreErrorsSP.name);
if (m_hasAO)
{
deleteProperty(AONSNP.name);
deleteProperty(AOWENP.name);
deleteProperty(CenterSP.name);
}
if (m_hasFilterWheel)
{
deleteProperty(FilterConnectionSP.name);
deleteProperty(FilterTypeSP.name);
deleteProperty(FilterProdcutTP.name);
if (FilterNameT != nullptr)
{
deleteProperty(FilterNameTP->name);
}
}
rmTimer(m_TimerID);
}
return true;
}
bool SBIGCCD::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
{
if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
{
// IP Address
if (strcmp(name, IpTP.name) == 0)
{
unsigned long ip = htonl(inet_addr(texts[0]));
if (ip == INADDR_NONE)
{
LOGF_ERROR("Invalid ip address %s.", texts[0]);
IpTP.s = IPS_ALERT;
IDSetText(&IpTP, nullptr);
return false;
}
IpTP.s = IPS_OK;
IUUpdateText(&IpTP, texts, names, n);
IDSetText(&IpTP, nullptr);
return true;
}
// Filter Name
else if (strcmp(name, FilterNameTP->name) == 0)
{
INDI::FilterInterface::processText(dev, name, texts, names, n);
return true;
}
}
return INDI::CCD::ISNewText(dev, name, texts, names, n);
}
bool SBIGCCD::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
{
if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
{
// Device Port
if (strcmp(name, PortSP.name) == 0)
{
IUUpdateSwitch(&PortSP, states, names, n);
if (*(static_cast(IUFindOnSwitch(&PortSP)->aux)) == DEV_ETH)
{
defineProperty(&IpTP);
}
else
{
deleteProperty(IpTP.name);
}
PortSP.s = IPS_OK;
IDSetSwitch(&PortSP, nullptr);
return true;
}
// Fan Status
else if (strcmp(name, FanStateSP.name) == 0)
{
IUUpdateSwitch(&FanStateSP, states, names, n);
MiscellaneousControlParams mcp;
mcp.fanEnable = FanStateS[0].s == ISS_ON;
mcp.shutterCommand = SC_LEAVE_SHUTTER;
mcp.ledState = LED_OFF;
if (MiscellaneousControl(&mcp) == CE_NO_ERROR)
{
FanStateSP.s = IPS_OK;
IDSetSwitch(&FanStateSP, mcp.fanEnable == 1 ? "Fan turned On." : "Fan turned Off.");
return true;
}
FanStateSP.s = IPS_ALERT;
LOG_ERROR("Failed to control fan.");
IDSetSwitch(&FanStateSP, nullptr);
return false;
}
// Filter Type
else if (strcmp(name, FilterTypeSP.name) == 0) // CFW TYPE
{
IUResetSwitch(&FilterTypeSP);
IUUpdateSwitch(&FilterTypeSP, states, names, n);
FilterTypeSP.s = IPS_OK;
IDSetSwitch(&FilterTypeSP, nullptr);
return true;
}
// Cooler control
else if (strcmp(name, CoolerSP.name) == 0)
{
IUUpdateSwitch(&CoolerSP, states, names, n);
bool coolerON = CoolerS[0].s == ISS_ON;
if (SetTemperatureRegulation(TemperatureN[0].value, coolerON) == CE_NO_ERROR)
{
CoolerSP.s = coolerON ? IPS_OK : IPS_IDLE;
LOGF_INFO("Cooler turned %s.", coolerON ? "On" : "Off");
IDSetSwitch(&CoolerSP, nullptr);
return true;
}
CoolerSP.s = IPS_ALERT;
LOG_ERROR("Failed to control cooler.");
IDSetSwitch(&CoolerSP, nullptr);
return false;
}
// AO Center
else if (!strcmp(name, CenterSP.name))
{
CenterSP.s = (AoCenter() == CE_NO_ERROR) ? IPS_OK : IPS_ALERT;
if (CenterSP.s == IPS_OK)
{
m_AOParams.xDeflection = m_AOParams.yDeflection = 0;
AONSN[AO_NORTH].value = AONSN[AO_SOUTH].value = 0;
AONSNP.s = IPS_IDLE;
AOWEN[AO_EAST].value = AOWEN[AO_WEST].value = 0;
AOWENP.s = IPS_IDLE;
IDSetNumber(&AONSNP, nullptr);
IDSetNumber(&AOWENP, nullptr);
LOG_INFO("Adaptive Optics are centered.");
}
else
LOG_ERROR("Failed to center adaptive optics.");
IDSetSwitch(&CenterSP, nullptr);
return true;
}
// Ignore errors
else if (!strcmp(name, IgnoreErrorsSP.name))
{
IUUpdateSwitch(&IgnoreErrorsSP, states, names, n);
IgnoreErrorsSP.s = IPS_OK;
IDSetSwitch(&IgnoreErrorsSP, nullptr);
saveConfig(true);
return true;
}
// Filter connection
else if (!strcmp(name, FilterConnectionSP.name))
{
IUUpdateSwitch(&FilterConnectionSP, states, names, n);
FilterConnectionSP.s = IPS_BUSY;
if (FilterConnectionS[0].s == ISS_ON)
{
ISwitch *p = IUFindOnSwitch(&FilterTypeSP);
if (p == nullptr)
{
FilterConnectionSP.s = IPS_ALERT;
IUResetSwitch(&FilterConnectionSP);
FilterConnectionSP.sp[1].s = ISS_ON;
IDSetSwitch(&FilterConnectionSP, "Please select CFW type before connecting");
return false;
}
CFWConnect();
}
else
{
CFWDisconnect();
}
return true;
}
}
return INDI::CCD::ISNewSwitch(dev, name, states, names, n);
}
bool SBIGCCD::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
{
if (dev != nullptr && strcmp(dev, getDeviceName()) == 0)
{
// Filter Slot Handling
if (!strcmp(name, FilterSlotNP.name))
{
INDI::FilterInterface::processNumber(dev, name, values, names, n);
return true;
}
// NS Adaptive Optics
else if (!strcmp(name, AONSNP.name))
{
IUUpdateNumber(&AONSNP, values, names, n);
uint16_t deflection = 0;
// Check if N > 0 then if it is
// reset S to zero regardless.
if (AONSN[AO_NORTH].value > 0)
{
AONSN[AO_SOUTH].value = 0;
deflection = std::min(4095.0, 2048 + AONSN[AO_NORTH].value);
LOGF_DEBUG("AO North: %.f --> yDeflection: %d", AONSN[AO_NORTH].value, deflection);
}
// Same as above but reversed.
else
{
AONSN[AO_NORTH].value = 0;
deflection = std::max(0.0, 2048 - AONSN[AO_SOUTH].value);
LOGF_DEBUG("AO South: %.f --> yDeflection: %d", AONSN[AO_SOUTH].value, deflection);
}
// Just change yDeflection
m_AOParams.yDeflection = deflection;
AONSNP.s = (AoTipTilt() == CE_NO_ERROR) ? IPS_OK : IPS_ALERT;
IDSetNumber(&AONSNP, nullptr);
return true;
}
// WE Adaptive Optiocs
else if (!strcmp(name, AOWENP.name))
{
IUUpdateNumber(&AOWENP, values, names, n);
uint16_t deflection = 0;
// Check if E > 0 then if it is
// reset W to zero regardless.
if (AOWEN[AO_EAST].value > 0)
{
AOWEN[AO_WEST].value = 0;
deflection = std::min(4095.0, 2048 + AOWEN[AO_EAST].value);
LOGF_DEBUG("AO East: %.f --> xDeflection: %d", AOWEN[AO_EAST].value, deflection);
}
// Same as above but reversed.
else
{
AOWEN[AO_EAST].value = 0;
deflection = std::max(0.0, 2048 - AOWEN[AO_WEST].value);
LOGF_DEBUG("AO West: %.f --> xDeflection: %d", AOWEN[AO_WEST].value, deflection);
}
// Just change xDeflection
m_AOParams.xDeflection = deflection;
AOWENP.s = (AoTipTilt() == CE_NO_ERROR) ? IPS_OK : IPS_ALERT;
IDSetNumber(&AOWENP, nullptr);
return true;
}
}
return INDI::CCD::ISNewNumber(dev, name, values, names, n);
}
bool SBIGCCD::Connect()
{
int numModes = -1;
int maxBinX = 1;
int maxBinY = 1;
int res = CE_NO_ERROR;
loadFirmwareOnOSXifNeeded();
if (isConnected())
{
LOG_DEBUG("CCD device already connected");
return true;
}
m_hasGuideHead = false;
m_hasFilterWheel = false;
uint32_t devType = *(static_cast(IUFindOnSwitch(&PortSP)->aux));
char *port = IUFindOnSwitch(&PortSP)->label;
if (OpenDevice(devType) != CE_NO_ERROR)
{
LOGF_ERROR("Failed to open CCD at port %s", port);
return false;
}
if (EstablishLink() != CE_NO_ERROR)
{
LOGF_ERROR("Failed to connect CCD at port %s", port);
return false;
}
LOGF_INFO("CCD is connected at port %s", port);
if (GetExtendedCCDInfo() != CE_NO_ERROR)
{
LOG_ERROR("Failed to get extended CCD info.");
return false;
}
uint32_t cap = CCD_CAN_ABORT | CCD_CAN_BIN | CCD_CAN_SUBFRAME | CCD_HAS_SHUTTER | CCD_HAS_ST4_PORT;
if (m_hasGuideHead)
cap |= CCD_HAS_GUIDE_HEAD;
if (m_isColor)
cap |= CCD_HAS_BAYER;
if (GetCameraType() != STI_CAMERA)
{
cap |= CCD_HAS_COOLER;
IEAddTimer(TEMPERATURE_POLL_MS, SBIGCCD::updateTemperatureHelper, this);
}
res = getReadoutModes(&PrimaryCCD, numModes, maxBinX, maxBinY);
if (res != CE_NO_ERROR || numModes < CCD_BIN_1x1_I || numModes > CCD_BIN_NxN_I)
{
LOG_ERROR("Failed to determine number of supported readout modes for primary CCD");
return false;
}
PrimaryCCD.setMinMaxStep("CCD_BINNING", "HOR_BIN", 1, maxBinX, 1, false);
PrimaryCCD.setMinMaxStep("CCD_BINNING", "VER_BIN", 1, maxBinY, 1, false);
if (m_hasGuideHead)
{
res = getReadoutModes(&GuideCCD, numModes, maxBinX, maxBinY);
if (res != CE_NO_ERROR || numModes < CCD_BIN_1x1_I || numModes > CCD_BIN_NxN_I)
{
LOG_ERROR("Failed to determine number of supported readout modes for primary CCD");
return false;
}
GuideCCD.setMinMaxStep("CCD_BINNING", "HOR_BIN", 1, maxBinX, 1, false);
GuideCCD.setMinMaxStep("CCD_BINNING", "VER_BIN", 1, maxBinY, 1, false);
}
SetCCDCapability(cap);
m_hasAO = AoCenter() == CE_NO_ERROR;
return true;
}
bool SBIGCCD::Disconnect()
{
if (!isConnected())
return true;
m_useExternalTrackingCCD = false;
m_hasGuideHead = false;
#ifdef ASYNC_READOUT
pthread_mutex_lock(&condMutex);
grabPredicate = GRAB_PRIMARY_CCD;
terminateThread = true;
pthread_cond_signal(&cv);
pthread_mutex_unlock(&condMutex);
#endif
if (FilterConnectionS[0].s == ISS_ON)
CFWDisconnect();
if (CloseDevice() == CE_NO_ERROR)
{
LOG_INFO("CCD is disconnected");
return true;
}
else
{
LOG_ERROR("Failed to disconnect CCD");
}
return false;
}
bool SBIGCCD::setupParams()
{
LOG_DEBUG("Retrieving CCD Parameters...");
float x_pixel_size, y_pixel_size;
int bit_depth = 16;
int x_1, y_1, x_2, y_2;
int wCcd = 0, hCcd = 0, binning = 0;
double wPixel = 0, hPixel = 0;
if (getBinningMode(&PrimaryCCD, binning) != CE_NO_ERROR)
{
LOG_ERROR("Failed to get primary camera binning mode");
return false;
}
if (getCCDSizeInfo(CCD_IMAGING, binning, wCcd, hCcd, wPixel, hPixel) != CE_NO_ERROR)
{
LOG_ERROR("Failed to get primary camera size info");
return false;
}
x_pixel_size = wPixel;
y_pixel_size = hPixel;
x_1 = y_1 = 0;
x_2 = wCcd;
y_2 = hCcd;
SetCCDParams(x_2 - x_1, y_2 - y_1, bit_depth, x_pixel_size, y_pixel_size);
if (HasGuideHead())
{
if (getBinningMode(&GuideCCD, binning) != CE_NO_ERROR)
{
LOG_ERROR("Failed to get guide head binning mode");
return false;
}
if (getCCDSizeInfo(m_useExternalTrackingCCD ? CCD_EXT_TRACKING : CCD_TRACKING, binning, wCcd, hCcd, wPixel,
hPixel) != CE_NO_ERROR)
{
LOG_DEBUG("Invalid external tracking camera results, trying regular tracking");
if (getCCDSizeInfo(CCD_TRACKING, binning, wCcd, hCcd, wPixel, hPixel) != CE_NO_ERROR)
{
LOG_ERROR("Failed to get external tracking camera size info");
return false;
}
m_useExternalTrackingCCD = false;
}
x_pixel_size = wPixel;
y_pixel_size = hPixel;
x_1 = y_1 = 0;
x_2 = wCcd;
y_2 = hCcd;
SetGuiderParams(x_2 - x_1, y_2 - y_1, bit_depth, x_pixel_size, y_pixel_size);
}
int nbuf = PrimaryCCD.getXRes() * PrimaryCCD.getYRes() * PrimaryCCD.getBPP() / 8 + 512;
PrimaryCCD.setFrameBufferSize(nbuf);
if (PrimaryCCD.getFrameBuffer() == nullptr)
{
LOG_ERROR("Failed to allocate memory for primary camera buffer");
return false;
}
LOGF_DEBUG("Created primary camera buffer %d bytes.", nbuf);
if (HasGuideHead())
{
nbuf = GuideCCD.getXRes() * GuideCCD.getYRes() * GuideCCD.getBPP() / 8 + 512;
GuideCCD.setFrameBufferSize(nbuf);
if (GuideCCD.getFrameBuffer() == nullptr)
{
LOG_ERROR("Failed to allocate memory for guide head buffer");
return false;
}
LOGF_DEBUG("Created guide head buffer %d bytes.", nbuf);
}
if (HasCooler())
{
bool regulationEnabled = false;
double temp, setPoint, power;
QueryTemperatureStatus(regulationEnabled, temp, setPoint, power);
CoolerS[0].s = regulationEnabled ? ISS_ON : ISS_OFF;
CoolerS[1].s = regulationEnabled ? ISS_OFF : ISS_ON;
IDSetSwitch(&CoolerSP, nullptr);
CoolerN[0].value = power * 100;
IDSetNumber(&CoolerNP, nullptr);
TemperatureN[0].min = MIN_CCD_TEMP;
TemperatureN[0].max = MAX_CCD_TEMP;
IUUpdateMinMax(&TemperatureNP);
}
IUSaveText(&ProductInfoT[0], GetCameraName());
IUSaveText(&ProductInfoT[1], GetCameraID());
ProductInfoTP.s = IPS_OK;
IDSetText(&ProductInfoTP, nullptr);
return true;
}
int SBIGCCD::SetTemperature(double temperature)
{
if (fabs(temperature - TemperatureN[0].value) < 0.1)
return 1;
if (SetTemperatureRegulation(temperature) == CE_NO_ERROR)
{
// Set property to busy and poll in ISPoll for CCD temp
TemperatureRequest = temperature;
LOGF_INFO("Temperature set to %+.1fC", temperature);
if (CoolerS[0].s != ISS_ON)
{
CoolerS[0].s = ISS_ON;
CoolerS[1].s = ISS_OFF;
CoolerSP.s = IPS_BUSY;
IDSetSwitch(&CoolerSP, nullptr);
}
return 0;
}
LOG_ERROR("Failed to set temperature");
return -1;
}
int SBIGCCD::StartExposure(INDI::CCDChip *targetChip, double duration)
{
int res, binning, shutter;
if ((res = getShutterMode(targetChip, shutter)) != CE_NO_ERROR)
{
return res;
}
if ((res = getBinningMode(targetChip, binning)) != CE_NO_ERROR)
{
return res;
}
INDI::CCDChip::CCD_FRAME frameType;
getFrameType(targetChip, &frameType);
uint32_t expTime = floor(duration * 100.0 + 0.5);
if (frameType == INDI::CCDChip::BIAS_FRAME)
{
// Flat frame = zero seconds
expTime = 0;
}
uint16_t left = targetChip->getSubX();
uint16_t top = targetChip->getSubY();
uint16_t width = targetChip->getSubW() / targetChip->getBinX();
uint16_t height = targetChip->getSubH() / targetChip->getBinY();
int ccd;
if (targetChip == &PrimaryCCD)
{
ccd = CCD_IMAGING;
}
else
{
ccd = m_useExternalTrackingCCD ? CCD_EXT_TRACKING : CCD_TRACKING;
}
StartExposureParams2 sep;
sep.ccd = ccd;
sep.abgState = ABG_LOW7;
sep.openShutter = shutter;
sep.exposureTime = expTime;
sep.readoutMode = binning;
sep.left = left;
sep.top = top;
sep.width = width;
sep.height = height;
LOGF_DEBUG(
"Exposure params for CCD (%d) openShutter(%d), exposureTime (%ld), binning (%d), left (%d), top (%d), w(%d), "
"h(%d)",
sep.ccd, sep.openShutter, sep.exposureTime, sep.readoutMode, sep.left, sep.top, sep.width, sep.height);
for (int i = 0; i < MAX_THREAD_RETRIES; i++)
{
std::unique_lock guard(sbigLock);
res = StartExposure(&sep);
guard.unlock();
if (res == CE_NO_ERROR)
{
targetChip->setExposureDuration(duration);
break;
}
usleep(MAX_THREAD_WAIT);
}
if (res != CE_NO_ERROR)
{
return res;
}
if (frameType == INDI::CCDChip::LIGHT_FRAME)
{
LOG_DEBUG("Light Frame exposure in progress...");
}
else if (frameType == INDI::CCDChip::DARK_FRAME)
{
LOG_DEBUG("Dark Frame exposure in progress...");
}
else if (frameType == INDI::CCDChip::FLAT_FRAME)
{
LOG_DEBUG("Flat Frame exposure in progress...");
}
else if (frameType == INDI::CCDChip::BIAS_FRAME)
{
LOG_DEBUG("Bias Frame exposure in progress...");
}
return res;
}
bool SBIGCCD::StartExposure(float duration)
{
ExposureRequest = duration;
if (duration >= 3)
LOGF_INFO("Taking %.2fs exposure on main camera...", ExposureRequest);
int res = StartExposure(&PrimaryCCD, duration);
if (res != CE_NO_ERROR)
{
LOG_DEBUG("Failed to start exposure on main camera");
return false;
}
ExpStart = std::chrono::system_clock::now();
InExposure = true;
return true;
}
bool SBIGCCD::StartGuideExposure(float duration)
{
GuideExposureRequest = duration;
if (duration >= 3)
LOGF_INFO("Taking %.2fs exposure on guide head...", GuideExposureRequest);
int res = StartExposure(&GuideCCD, duration);
if (res != CE_NO_ERROR)
{
LOG_DEBUG("Failed to start exposure on guide head");
return false;
}
GuideExpStart = std::chrono::system_clock::now();
InGuideExposure = true;
return true;
}
int SBIGCCD::AbortExposure(INDI::CCDChip *targetChip)
{
int ccd;
if (targetChip == &PrimaryCCD)
{
ccd = CCD_IMAGING;
}
else
{
ccd = m_useExternalTrackingCCD ? CCD_EXT_TRACKING : CCD_TRACKING;
}
EndExposureParams eep;
eep.ccd = ccd;
std::unique_lock guard(sbigLock);
int res = EndExposure(&eep);
guard.unlock();
return res;
}
bool SBIGCCD::AbortExposure()
{
int res = CE_NO_ERROR;
LOG_DEBUG("Aborting primary camera exposure...");
for (int i = 0; i < MAX_THREAD_RETRIES; i++)
{
res = AbortExposure(&PrimaryCCD);
if (res == CE_NO_ERROR)
{
break;
}
usleep(MAX_THREAD_WAIT);
}
if (res != CE_NO_ERROR)
{
LOG_ERROR("Failed to abort primary camera exposure");
return false;
}
InExposure = false;
LOG_DEBUG("Primary camera exposure aborted");
return true;
}
bool SBIGCCD::AbortGuideExposure()
{
int res = CE_NO_ERROR;
LOG_DEBUG("Aborting guide head exposure...");
for (int i = 0; i < MAX_THREAD_RETRIES; i++)
{
res = AbortExposure(&GuideCCD);
if (res == CE_NO_ERROR)
{
break;
}
usleep(MAX_THREAD_WAIT);
}
if (res != CE_NO_ERROR)
{
LOG_ERROR("Failed to abort guide head exposure");
return false;
}
InExposure = false;
LOG_DEBUG("Guide head exposure aborted");
return true;
}
bool SBIGCCD::UpdateCCDFrameType(INDI::CCDChip::CCD_FRAME fType)
{
INDI::CCDChip::CCD_FRAME imageFrameType = PrimaryCCD.getFrameType();
if (fType != imageFrameType)
{
PrimaryCCD.setFrameType(fType);
}
return true;
}
bool SBIGCCD::updateFrameProperties(INDI::CCDChip *targetChip)
{
int wCcd, hCcd, binning;
double wPixel, hPixel;
LOG_DEBUG("Updating frame properties ...");
int res = getBinningMode(targetChip, binning);
if (res != CE_NO_ERROR)
{
return false;
}
if (targetChip == &PrimaryCCD)
{
res = getCCDSizeInfo(CCD_IMAGING, binning, wCcd, hCcd, wPixel, hPixel);
}
else
{
res = getCCDSizeInfo(m_useExternalTrackingCCD ? CCD_EXT_TRACKING : CCD_TRACKING, binning, wCcd, hCcd, wPixel,
hPixel);
}
if (res == CE_NO_ERROR)
{
// SBIG returns binned width and height, which is OK, but we used unbinned width and height across all drivers to be consistent.
wCcd *= targetChip->getBinX();
hCcd *= targetChip->getBinY();
targetChip->setResolution(wCcd, hCcd);
if (targetChip == &PrimaryCCD)
{
UpdateCCDFrame(0, 0, wCcd, hCcd);
}
else
{
UpdateGuiderFrame(0, 0, wCcd, hCcd);
}
return true;
}
LOG_DEBUG("Failed to update frame properties");
return false;
}
bool SBIGCCD::UpdateCCDFrame(int x, int y, int w, int h)
{
LOGF_DEBUG("The final main camera image area is (%ld, %ld), (%ld, %ld)", x, y, w, h);
PrimaryCCD.setFrame(x, y, w, h);
int nbuf = (w * h * PrimaryCCD.getBPP() / 8) + 512;
PrimaryCCD.setFrameBufferSize(nbuf);
LOGF_DEBUG("Created primary camera buffer %d bytes", nbuf);
return true;
}
bool SBIGCCD::UpdateGuiderFrame(int x, int y, int w, int h)
{
LOGF_DEBUG("The final guide head image area is (%ld, %ld), (%ld, %ld)", x, y, w, h);
GuideCCD.setFrame(x, y, w, h);
int nbuf = (w * h * GuideCCD.getBPP() / 8) + 512;
GuideCCD.setFrameBufferSize(nbuf);
LOGF_DEBUG("Created guide head buffer %d bytes", nbuf);
return true;
}
bool SBIGCCD::UpdateCCDBin(int binx, int biny)
{
// only basic sanity checks; if the camera really supports the requested binning
// mode is checked in getBinningMode
if (binx > 255 || biny > 255)
{
LOG_ERROR("Failed to update main camera binning mode, binning should be at least < 256");
return false;
}
if (binx > 3 && biny != binx)
{
LOG_WARN("Forcing y-binning = x-binning while updating main camera binning mode");
biny = binx;
}
PrimaryCCD.setBin(binx, biny);
return updateFrameProperties(&PrimaryCCD);
}
bool SBIGCCD::UpdateGuiderBin(int binx, int biny)
{
if (binx != biny)
{
LOG_WARN("Forcing y-binning = x-binning while updating guide head binning mode");
biny = binx;
}
if (binx < 1 || binx > 3)
{
LOG_ERROR("Failed to update guide head binning mode, use 1x1, 2x2 or 3x3");
return false;
}
GuideCCD.setBin(binx, biny);
return updateFrameProperties(&GuideCCD);
}
void SBIGCCD::NSGuideHelper(void *context)
{
static_cast(context)->NSGuideCallback();
}
void SBIGCCD::WEGuideHelper(void *context)
{
static_cast(context)->WEGuideCallback();
}
void SBIGCCD::NSGuideCallback()
{
rp.tYMinus = rp.tYPlus = 0;
ActivateRelay(&rp);
}
void SBIGCCD::WEGuideCallback()
{
rp.tXMinus = rp.tXPlus = 0;
rp.tXPlus = 0;
ActivateRelay(&rp);
}
IPState SBIGCCD::GuideNorth(uint32_t ms)
{
rmTimer(m_NSTimerID);
rp.tYMinus = rp.tYPlus = 0;
rp.tYMinus = ms / 10.0;
m_NSTimerID = IEAddTimer(ms, &SBIGCCD::NSGuideHelper, this);
return (ActivateRelay(&rp) == CE_NO_ERROR ? IPS_BUSY : IPS_ALERT);
}
IPState SBIGCCD::GuideSouth(uint32_t ms)
{
rmTimer(m_NSTimerID);
rp.tYMinus = rp.tYPlus = 0;
rp.tYPlus = ms / 10.0;
m_NSTimerID = IEAddTimer(ms, &SBIGCCD::NSGuideHelper, this);
return (ActivateRelay(&rp) == CE_NO_ERROR ? IPS_BUSY : IPS_ALERT);
}
IPState SBIGCCD::GuideEast(uint32_t ms)
{
rmTimer(m_WETimerID);
rp.tXMinus = rp.tXPlus = 0;
rp.tXPlus = ms / 10.0;
m_WETimerID = IEAddTimer(ms, &SBIGCCD::WEGuideHelper, this);
return (ActivateRelay(&rp) == CE_NO_ERROR ? IPS_BUSY : IPS_ALERT);
}
IPState SBIGCCD::GuideWest(uint32_t ms)
{
rmTimer(m_WETimerID);
rp.tXMinus = rp.tXPlus = 0;
rp.tXMinus = ms / 10.0;
m_WETimerID = IEAddTimer(ms, &SBIGCCD::WEGuideHelper, this);
return (ActivateRelay(&rp) == CE_NO_ERROR ? IPS_BUSY : IPS_ALERT);
}
#ifdef ASYNC_READOUT
void *SBIGCCD::grabCCDHelper(void *context)
{
return ((SBIGCCD *)context)->grabCCD();
}
void *SBIGCCD::grabCCD()
{
LOG_DEBUG("grabCCD thread started...");
INDI::CCDChip *targetChip = nullptr;
pthread_mutex_lock(&condMutex);
while (true)
{
while (grabPredicate == GRAB_NO_CCD)
{
pthread_cond_wait(&cv, &condMutex);
}
targetChip = (grabPredicate == GRAB_PRIMARY_CCD) ? &PrimaryCCD : &GuideCCD;
grabPredicate = GRAB_NO_CCD;
if (terminateThread)
break;
pthread_mutex_unlock(&condMutex);
if (grabImage(targetChip) == false)
{
targetChip->setExposureFailed();
}
pthread_mutex_lock(&condMutex);
}
pthread_mutex_unlock(&condMutex);
LOG_DEBUG("grabCCD thread finished");
return 0;
}
#endif
bool SBIGCCD::grabImage(INDI::CCDChip *targetChip)
{
uint16_t left = targetChip->getSubX() / targetChip->getBinX();
uint16_t top = targetChip->getSubY() / targetChip->getBinX();
uint16_t width = targetChip->getSubW() / targetChip->getBinX();
uint16_t height = targetChip->getSubH() / targetChip->getBinY();
LOGF_DEBUG("%s readout in progress...", targetChip == &PrimaryCCD ? "Primary camera" : "Guide head");
if (isSimulation())
{
uint8_t *image = targetChip->getFrameBuffer();
for (int i = 0; i < height * 2; i++)
{
for (int j = 0; j < width; j++)
{
image[i * width + j] = rand() % 255;
}
}
}
else
{
uint16_t *buffer = reinterpret_cast(targetChip->getFrameBuffer());
int res = 0;
for (int i = 0; i < MAX_THREAD_RETRIES; i++)
{
res = readoutCCD(left, top, width, height, buffer, targetChip);
if (res == CE_NO_ERROR)
break;
LOGF_DEBUG("Readout error, retrying...", res);
usleep(MAX_THREAD_WAIT);
}
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s readout error",
targetChip == &PrimaryCCD ? "Primary camera" : "Guide head");
return false;
}
}
LOGF_DEBUG("%s readout complete", targetChip == &PrimaryCCD ? "Primary camera" : "Guide head");
ExposureComplete(targetChip);
return true;
}
bool SBIGCCD::saveConfigItems(FILE *fp)
{
INDI::CCD::saveConfigItems(fp);
IUSaveConfigSwitch(fp, &PortSP);
IUSaveConfigText(fp, &IpTP);
IUSaveConfigSwitch(fp, &IgnoreErrorsSP);
if (FilterNameT)
INDI::FilterInterface::saveConfigItems(fp);
IUSaveConfigSwitch(fp, &FilterTypeSP);
return true;
}
void SBIGCCD::TimerHit()
{
INDI::CCDChip *targetChip = nullptr;
if (isConnected() == false)
{
return;
}
if (InExposure)
{
targetChip = &PrimaryCCD;
std::chrono::duration elapsed = std::chrono::system_clock::now() - ExpStart;
double timeLeft = std::max(0.0, ExposureRequest - elapsed.count());
if (isExposureDone(targetChip))
{
LOG_DEBUG("Primay camera exposure done, downloading image...");
targetChip->setExposureLeft(0);
InExposure = false;
if (grabImage(targetChip) == false)
targetChip->setExposureFailed();
}
else
{
targetChip->setExposureLeft(timeLeft);
LOGF_DEBUG("Primary camera exposure in progress with %.2f seconds left...", timeLeft);
}
}
if (InGuideExposure)
{
targetChip = &GuideCCD;
std::chrono::duration elapsed = std::chrono::system_clock::now() - GuideExpStart;
double timeLeft = std::max(0.0, GuideExposureRequest - elapsed.count());
if (isExposureDone(targetChip))
{
LOG_DEBUG("Guide head exposure done, downloading image...");
targetChip->setExposureLeft(0);
InGuideExposure = false;
if (grabImage(targetChip) == false)
targetChip->setExposureFailed();
}
else
{
targetChip->setExposureLeft(timeLeft);
LOGF_DEBUG("Guide head exposure in progress with %.2f seconds left...", timeLeft);
}
}
SetTimer(getCurrentPollingPeriod());
return;
}
//=========================================================================
int SBIGCCD::GetDriverInfo(GetDriverInfoParams *gdip, void *res)
{
return SBIGUnivDrvCommand(CC_GET_DRIVER_INFO, gdip, res);
}
int SBIGCCD::SetDriverHandle(SetDriverHandleParams *sdhp)
{
int res = SBIGUnivDrvCommand(CC_SET_DRIVER_HANDLE, sdhp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_SET_DRIVER_HANDLE -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::GetDriverHandle(GetDriverHandleResults *gdhr)
{
int res = SBIGUnivDrvCommand(CC_GET_DRIVER_HANDLE, nullptr, gdhr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_GET_DRIVER_HANDLE -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::StartExposure(StartExposureParams2 *sep)
{
if (isSimulation())
{
return CE_NO_ERROR;
}
int res = SBIGUnivDrvCommand(CC_START_EXPOSURE2, sep, nullptr);
if (res != CE_NO_ERROR)
{
// If we need to ignore shutter errors, let's do so.
if (res == CE_SHUTTER_ERROR && IgnoreErrorsS[0].s == ISS_ON)
res = CE_NO_ERROR;
else
LOGF_ERROR("%s: CC_START_EXPOSURE2 -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::EndExposure(EndExposureParams *eep)
{
if (isSimulation())
{
return CE_NO_ERROR;
}
int res = SBIGUnivDrvCommand(CC_END_EXPOSURE, eep, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_END_EXPOSURE -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::StartReadout(StartReadoutParams *srp)
{
int res = SBIGUnivDrvCommand(CC_START_READOUT, srp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_START_READOUT -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::ReadoutLine(ReadoutLineParams *rlp, uint16_t *results, bool bSubtract)
{
int res;
if (bSubtract)
{
res = SBIGUnivDrvCommand(CC_READ_SUBTRACT_LINE, rlp, results);
}
else
{
res = SBIGUnivDrvCommand(CC_READOUT_LINE, rlp, results);
}
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_READ_SUBTRACT_LINE/CC_READOUT_LINE -> (%s)", __FUNCTION__,
GetErrorString(res));
}
return res;
}
int SBIGCCD::DumpLines(DumpLinesParams *dlp)
{
int res = SBIGUnivDrvCommand(CC_DUMP_LINES, dlp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_DUMP_LINES -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::EndReadout(EndReadoutParams *erp)
{
int res = SBIGUnivDrvCommand(CC_END_READOUT, erp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_END_READOUT -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::SetTemperatureRegulation(SetTemperatureRegulationParams *strp)
{
int res = SBIGUnivDrvCommand(CC_SET_TEMPERATURE_REGULATION, strp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_SET_TEMPERATURE_REGULATION -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::SetTemperatureRegulation(double temperature, bool enable)
{
int res;
SetTemperatureRegulationParams strp;
if (isSimulation())
{
TemperatureN[0].value = temperature;
return CE_NO_ERROR;
}
if (CheckLink())
{
strp.regulation = enable ? REGULATION_ON : REGULATION_OFF;
strp.ccdSetpoint = CalcSetpoint(temperature);
res = SBIGUnivDrvCommand(CC_SET_TEMPERATURE_REGULATION, &strp, nullptr);
}
else
{
res = CE_DEVICE_NOT_OPEN;
}
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_SET_TEMPERATURE_REGULATION -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::QueryTemperatureStatus(bool &enabled, double &ccdTemp, double &setpointTemp, double &power)
{
int res;
QueryTemperatureStatusResults qtsr;
if (isSimulation())
{
enabled = (CoolerS[0].s == ISS_ON);
ccdTemp = TemperatureN[0].value;
setpointTemp = ccdTemp;
power = enabled ? 0.5 : 0;
return CE_NO_ERROR;
}
if (CheckLink())
{
res = SBIGUnivDrvCommand(CC_QUERY_TEMPERATURE_STATUS, nullptr, &qtsr);
if (res == CE_NO_ERROR)
{
enabled = (qtsr.enabled != 0);
ccdTemp = CalcTemperature(CCD_THERMISTOR, qtsr.ccdThermistor);
setpointTemp = CalcTemperature(CCD_THERMISTOR, qtsr.ccdSetpoint);
power = qtsr.power / 255.0;
LOGF_DEBUG("Cooler: %s Temperature: %.3f Set Point: %.3f Power: %.2f",
enabled ? "On" : "Off", ccdTemp, setpointTemp, power);
}
}
else
{
res = CE_DEVICE_NOT_OPEN;
}
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_SET_TEMPERATURE_REGULATION -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
uint16_t SBIGCCD::CalcSetpoint(double temperature)
{
// Calculate 'setpoint' from the temperature T in degr. of Celsius.
double expo = (log(R_RATIO_CCD) * (T0 - temperature)) / DT_CCD;
double r = R0 * exp(expo);
return (static_cast(((MAX_AD / (R_BRIDGE_CCD / r + 1.0)) + 0.5)));
}
double SBIGCCD::CalcTemperature(short thermistorType, short setpoint)
{
double r, expo, rBridge, rRatio, dt;
switch (thermistorType)
{
case AMBIENT_THERMISTOR:
rBridge = R_BRIDGE_AMBIENT;
rRatio = R_RATIO_AMBIENT;
dt = DT_AMBIENT;
break;
case CCD_THERMISTOR:
default:
rBridge = R_BRIDGE_CCD;
rRatio = R_RATIO_CCD;
dt = DT_CCD;
break;
}
// Calculate temperature T in degr. Celsius from the 'setpoint'
r = rBridge / ((MAX_AD / setpoint) - 1.0);
expo = log(r / R0) / log(rRatio);
return (T0 - dt * expo);
}
int SBIGCCD::ActivateRelay(ActivateRelayParams *arp)
{
int res = SBIGUnivDrvCommand(CC_ACTIVATE_RELAY, arp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_ACTIVATE_RELAY -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::PulseOut(PulseOutParams *pop)
{
int res = SBIGUnivDrvCommand(CC_PULSE_OUT, pop, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_PULSE_OUT -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::TxSerialBytes(TXSerialBytesParams *txsbp, TXSerialBytesResults *txsbr)
{
int res = SBIGUnivDrvCommand(CC_TX_SERIAL_BYTES, txsbp, txsbr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_TX_SERIAL_BYTES -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::GetSerialStatus(GetSerialStatusResults *gssr)
{
int res = SBIGUnivDrvCommand(CC_GET_SERIAL_STATUS, nullptr, gssr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_GET_SERIAL_STATUS -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::AoTipTilt()
{
int res = SBIGUnivDrvCommand(CC_AO_TIP_TILT, &m_AOParams, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_AO_TIP_TILT -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::AoDelay(AODelayParams *aodp)
{
int res = SBIGUnivDrvCommand(CC_AO_DELAY, aodp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_AO_DELAY -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::AoSetFocus(AOSetFocusParams *aofc)
{
int res = SBIGUnivDrvCommand(CC_AO_SET_FOCUS, aofc, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_AO_SET_FOCUS -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::AoCenter()
{
int res = SBIGUnivDrvCommand(CC_AO_CENTER, nullptr, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_AO_CENTER -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::CFW(CFWParams *CFWp, CFWResults *CFWr)
{
int res = SBIGUnivDrvCommand(CC_CFW, CFWp, CFWr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_CFW -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::EstablishLink()
{
EstablishLinkParams elp;
EstablishLinkResults elr;
elp.sbigUseOnly = 0;
int res = SBIGUnivDrvCommand(CC_ESTABLISH_LINK, &elp, &elr);
if (res == CE_NO_ERROR)
{
SetCameraType(static_cast(elr.cameraType));
SetLinkStatus(true);
}
else
{
LOGF_ERROR("%s: CC_ESTABLISH_LINK -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::GetCcdInfo(GetCCDInfoParams *gcp, void *gcr)
{
int res = SBIGUnivDrvCommand(CC_GET_CCD_INFO, gcp, gcr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_GET_CCD_INFO -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::getCCDSizeInfo(int ccd, int binning, int &frmW, int &frmH, double &pixW, double &pixH)
{
int roModeIdx = binning & 0x00FF; // mask low byte because vertical binning is written to high byte
GetCCDInfoParams gcp;
GetCCDInfoResults0 gcr;
if (isSimulation())
{
if (ccd == CCD_IMAGING)
{
frmW = 1024;
frmH = 1024;
}
else
{
frmW = 512;
frmH = 512;
}
pixW = 5.2;
pixH = 5.2;
return CE_NO_ERROR;
}
gcp.request = ccd;
int res = SBIGUnivDrvCommand(CC_GET_CCD_INFO, &gcp, &gcr);
// If there is no name, then it is invalid
if (!gcr.name[0])
return CE_DEVICE_NOT_IMPLEMENTED;
if (res == CE_NO_ERROR)
{
frmW = gcr.readoutInfo[roModeIdx].width;
pixW = BcdPixel2double(gcr.readoutInfo[roModeIdx].pixelWidth);
// modify height and pixelHeight for readout modes with vertical binning
if ( ( (binning & 0x00FF) == CCD_BIN_1xN_I ) ||
( (binning & 0x00FF) == CCD_BIN_2xN_I ) ||
( (binning & 0x00FF) == CCD_BIN_3xN_I ) )
{
frmH = gcr.readoutInfo[0].height / ( (binning & 0xFF00) >> 8);
pixH = BcdPixel2double(gcr.readoutInfo[0].pixelHeight * ( (binning & 0xFF00) >> 8) );
}
else
{
frmH = gcr.readoutInfo[roModeIdx].height;
pixH = BcdPixel2double(gcr.readoutInfo[roModeIdx].pixelHeight);
}
LOGF_DEBUG(
"%s: CC_GET_CCD_INFO -> binning (%d) width (%d) height (%d) pixW (%g) pixH (%g)", __FUNCTION__, binning,
frmW, frmH, pixW, pixH);
}
else
{
LOGF_ERROR("%s: CC_GET_CCD_INFO -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::QueryCommandStatus(QueryCommandStatusParams *qcsp, QueryCommandStatusResults *qcsr)
{
int res = SBIGUnivDrvCommand(CC_QUERY_COMMAND_STATUS, qcsp, qcsr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_QUERY_COMMAND_STATUS -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::MiscellaneousControl(MiscellaneousControlParams *mcp)
{
int res = SBIGUnivDrvCommand(CC_MISCELLANEOUS_CONTROL, mcp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_QUERY_COMMAND_STATUS -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::ReadOffset(ReadOffsetParams *rop, ReadOffsetResults *ror)
{
int res = SBIGUnivDrvCommand(CC_READ_OFFSET, rop, ror);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_READ_OFFSET -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::GetLinkStatus(GetLinkStatusResults *glsr)
{
int res = SBIGUnivDrvCommand(CC_GET_LINK_STATUS, glsr, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_GET_LINK_STATUS -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
char *SBIGCCD::GetErrorString(int err)
{
GetErrorStringParams gesp;
gesp.errorNo = err;
static GetErrorStringResults gesr;
int res = SBIGUnivDrvCommand(CC_GET_ERROR_STRING, &gesp, &gesr);
if (res == CE_NO_ERROR)
{
return gesr.errorString;
}
static char str[128];
sprintf(str, "No error string found! Error code: %d", err);
return str;
}
int SBIGCCD::SetDriverControl(SetDriverControlParams *sdcp)
{
int res = SBIGUnivDrvCommand(CC_SET_DRIVER_CONTROL, sdcp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_SET_DRIVER_CONTROL -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::GetDriverControl(GetDriverControlParams *gdcp, GetDriverControlResults *gdcr)
{
int res = SBIGUnivDrvCommand(CC_GET_DRIVER_CONTROL, gdcp, gdcr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_GET_DRIVER_CONTROL -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::UsbAdControl(USBADControlParams *usbadcp)
{
int res = SBIGUnivDrvCommand(CC_USB_AD_CONTROL, usbadcp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_USB_AD_CONTROL -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::QueryUsb(QueryUSBResults *qusbr)
{
int res = SBIGUnivDrvCommand(CC_QUERY_USB, nullptr, qusbr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_QUERY_USB -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::RwUsbI2c(RWUSBI2CParams *rwusbi2cp)
{
int res = SBIGUnivDrvCommand(CC_RW_USB_I2C, rwusbi2cp, nullptr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_RW_USB_I2C -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
int SBIGCCD::BitIo(BitIOParams *biop, BitIOResults *bior)
{
int res = SBIGUnivDrvCommand(CC_BIT_IO, biop, bior);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_BIT_IO -> (%s)", __FUNCTION__, GetErrorString(res));
}
return res;
}
const char *SBIGCCD::GetCameraName()
{
if (isSimulation())
return "Simulated camera";
GetCCDInfoParams gccdip;
static GetCCDInfoResults0 gccdir;
gccdip.request = CCD_INFO_IMAGING;
int res = SBIGUnivDrvCommand(CC_GET_CCD_INFO, &gccdip, &gccdir);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_GET_CCD_INFO -> (%s)", __FUNCTION__, GetErrorString(res));
return "Unknown camera";
}
if (gccdir.cameraType == NO_CAMERA)
{
return "No camera";
}
return gccdir.name;
}
const char *SBIGCCD::GetCameraID()
{
if (isSimulation())
{
return "Simulated ID";
}
GetCCDInfoParams gccdip;
static GetCCDInfoResults2 gccdir2;
gccdip.request = CCD_INFO_EXTENDED;
int res = GetCcdInfo(&gccdip, &gccdir2);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_GET_CCD_INFO -> (%s)", __FUNCTION__, GetErrorString(res));
return "Unknown ID";
}
return gccdir2.serialNumber;
}
int SBIGCCD::getReadoutModes(INDI::CCDChip *targetChip, int &numModes, int &maxBinX, int &maxBinY)
{
int res = CE_BAD_PARAMETER;
GetCCDInfoParams gccdip;
static GetCCDInfoResults0 gccdir;
if (targetChip == &PrimaryCCD)
gccdip.request = CCD_INFO_IMAGING;
else if (targetChip == &GuideCCD)
gccdip.request = CCD_INFO_TRACKING;
else
{
LOGF_ERROR("%s: CCD not selected and/or uninitialized", __FUNCTION__);
return res;
}
res = SBIGUnivDrvCommand(CC_GET_CCD_INFO, &gccdip, &gccdir);
if (res == CE_NO_ERROR)
{
numModes = gccdir.readoutModes - 1;
switch(numModes)
{
case CCD_BIN_2x2_I:
case CCD_BIN_2x2_E:
maxBinX = 2;
maxBinY = maxBinX;
break;
case CCD_BIN_3x3_I:
case CCD_BIN_3x3_E:
maxBinX = 3;
maxBinY = maxBinX;
break;
case CCD_BIN_1xN_I:
maxBinX = 1;
maxBinY = 255;
break;
case CCD_BIN_2xN_I:
maxBinX = 2;
maxBinY = 255;
break;
case CCD_BIN_3xN_I:
maxBinX = 3;
maxBinY = 255;
break;
case CCD_BIN_9x9_I:
maxBinX = 9;
maxBinY = 255; // because vertical binning modes are also available
break;
case CCD_BIN_NxN_I:
maxBinX = 255;
maxBinY = maxBinX;
break;
case CCD_BIN_1x1_I:
case CCD_BIN_1x1_E:
default: // no binning at all
maxBinX = 1;
maxBinY = maxBinX;
break;
}
}
LOGF_DEBUG("%s: max horizontal/vertical binning (%d / %d) supported readout modes (%d)", __FUNCTION__,
maxBinX, maxBinY, numModes);
return res;
}
int SBIGCCD::GetExtendedCCDInfo()
{
int res = CE_NO_ERROR;
GetCCDInfoParams gccdip;
GetCCDInfoResults4 results4;
GetCCDInfoResults6 results6;
LOG_DEBUG("Fetching extended CCD info from device ...");
if (isSimulation())
{
m_hasGuideHead = true;
m_hasFilterWheel = true;
return res;
}
// Extended 2 Imaging caps
gccdip.request = CCD_INFO_EXTENDED2_IMAGING;
if ((res = GetCcdInfo(&gccdip, &results4)) == CE_NO_ERROR)
LOGF_DEBUG("CCD_IMAGING Extended CCD Info 4. CapabilitiesBit: (%u) Dump Extra (%u)", results4.capabilitiesBits,
results4.dumpExtra);
else
{
LOGF_WARN("%s: CCD_INFO_EXTENDED2_IMAGING -> (%s)", __FUNCTION__, GetErrorString(res));
}
// Extended 2 Tracking
gccdip.request = CCD_INFO_EXTENDED2_TRACKING;
if ((res = GetCcdInfo(&gccdip, &results4)) == CE_NO_ERROR)
{
m_hasGuideHead = true;
m_useExternalTrackingCCD = results4.capabilitiesBits & CB_CCD_EXT_TRACKER_YES;
LOGF_DEBUG("TRACKING_CCD Extended CCD Info 4. CapabilitiesBit: (%u) Dump Extra (%u)",
results4.capabilitiesBits, results4.dumpExtra);
}
else
{
m_hasGuideHead = false;
LOGF_DEBUG("%s: CCD_INFO_EXTENDED2_TRACKING -> (%s). No guide head detected.", __FUNCTION__, GetErrorString(res));
}
gccdip.request = CCD_INFO_EXTENDED3;
if ((res = GetCcdInfo(&gccdip, &results6)) == CE_NO_ERROR)
{
LOGF_DEBUG("Extended CCD Info 6. Camerabit: (%ld) CCD bits (%ld) Extra bit (%ld)", results6.cameraBits, results6.ccdBits,
results6.extraBits);
if (results6.ccdBits & 0x0001)
{
LOG_DEBUG("Color CCD detected.");
m_isColor = true;
LOGF_DEBUG("Detected color matrix is %s.",
(results6.ccdBits & 0x0002) ? "Truesense" : "Bayer");
}
else
{
LOG_DEBUG("Mono CCD detected.");
m_isColor = false;
}
}
else
{
LOGF_DEBUG("Error getting extended CCD Info 6 (%s)", GetErrorString(res));
}
CFWParams CFWp;
CFWResults CFWr;
CFWp.cfwModel = CFWSEL_AUTO;
CFWp.cfwCommand = CFWC_GET_INFO;
CFWp.cfwParam1 = CFWG_FIRMWARE_VERSION;
if ((res = SBIGUnivDrvCommand(CC_CFW, &CFWp, &CFWr)) == CE_NO_ERROR)
{
LOGF_DEBUG("Filter wheel detected (firmware %ld).", CFWr.cfwResult1);
m_hasFilterWheel = true;
}
else
{
m_hasFilterWheel = false;
}
return CE_NO_ERROR;
}
//==========================================================================
/*int SBIGCCD::SetDeviceName(const char *name) {
int res = CE_NO_ERROR;
if (strlen(name) < PATH_MAX) {
strcpy(m_dev_name, name);
} else {
res = CE_BAD_PARAMETER;
}
return res;
}*/
//==========================================================================
// SBIGUnivDrvCommand:
// Bottleneck function for all calls to the driver that logs the command
// and error. First it activates our handle and then it calls the driver.
// Activating the handle first allows having multiple instances of this
// class dealing with multiple cameras on different communications port.
// Also allows direct access to the SBIG Universal Driver after the driver
// has been opened.
int SBIGCCD::SBIGUnivDrvCommand(PAR_COMMAND command, void *params, void *results)
{
int res;
SetDriverHandleParams sdhp;
if (isSimulation())
{
return CE_NO_ERROR;
}
// Make sure we have a valid handle to the driver.
if (GetDriverHandle() == INVALID_HANDLE_VALUE)
{
res = CE_DRIVER_NOT_OPEN;
}
else
{
// Handle is valid so install it in the driver.
sdhp.handle = GetDriverHandle();
res = ::SBIGUnivDrvCommand(CC_SET_DRIVER_HANDLE, &sdhp, nullptr);
if (res == CE_NO_ERROR)
{
res = ::SBIGUnivDrvCommand(command, params, results);
}
}
return res;
}
bool SBIGCCD::CheckLink()
{
if (GetCameraType() != NO_CAMERA && GetLinkStatus())
{
return true;
}
return false;
}
/*int SBIGCCD::getNumberOfINDI::CCDChips()
{
int res;
switch(GetCameraType())
{
case ST237_CAMERA:
case ST5C_CAMERA:
case ST402_CAMERA:
case STI_CAMERA:
case STT_CAMERA:
case STF_CAMERA:
res = 1;
break;
case ST7_CAMERA:
case ST8_CAMERA:
case ST9_CAMERA:
case ST10_CAMERA:
case ST2K_CAMERA:
res = 2;
break;
case STL_CAMERA:
res = 3;
break;
case NO_CAMERA:
default:
res = 0;
break;
}
LOGF_DEBUG("%s Camera Type (%d) Number of chips (%d)", __FUNCTION__, GetCameraType(), res);
return res;
}*/
//==========================================================================
bool SBIGCCD::IsFanControlAvailable()
{
CAMERA_TYPE camera = GetCameraType();
if (camera == ST5C_CAMERA || camera == ST402_CAMERA || camera == STI_CAMERA)
{
return false;
}
return true;
}
double SBIGCCD::BcdPixel2double(ulong bcd)
{
double value = 0.0;
double digit = 0.01;
for (int i = 0; i < 8; i++)
{
value += (bcd & 0x0F) * digit;
digit *= 10.0;
bcd >>= 4;
}
return value;
}
void SBIGCCD::InitVars()
{
SetFileDescriptor();
SetCameraType();
SetLinkStatus();
memset(&rp, 0, sizeof(rp));
m_AOParams.xDeflection = m_AOParams.yDeflection = 2048;
}
//==========================================================================
int SBIGCCD::getBinningMode(INDI::CCDChip *targetChip, int &binning)
{
int maxBinX, maxBinY, numModes;
int res = getReadoutModes(targetChip, numModes, maxBinX, maxBinY);
if (res != CE_NO_ERROR || targetChip->getBinX() > maxBinX || targetChip->getBinY() > maxBinY)
{
binning = CCD_BIN_1x1_I;
return res;
}
if (targetChip->getBinX() == targetChip->getBinY())
{
if (targetChip->getBinX() == 1)
binning = CCD_BIN_1x1_I;
else if (targetChip->getBinX() == 2)
binning = CCD_BIN_2x2_I;
else if (targetChip->getBinX() == 3)
binning = CCD_BIN_3x3_I;
else if (targetChip->getBinX() == 9)
binning = CCD_BIN_9x9_I;
else
// store amount of binning in the high byte
// not mentioned in the SBIG documentation, but probably similar to the
// vertical binning case (see below)
binning = CCD_BIN_NxN_I + (targetChip->getBinX() << 8);
}
else
{
if (targetChip->getBinX() == 1)
binning = CCD_BIN_1xN_I;
else if (targetChip->getBinX() == 2)
binning = CCD_BIN_2xN_I;
else if (targetChip->getBinX() == 3)
binning = CCD_BIN_3xN_I;
else // this should not happen
{
res = CE_BAD_PARAMETER;
LOG_ERROR("Bad CCD binning mode: x-binning > 3 and y-binning != x-binning");
}
// amount of vertical binning is specified in the most significant byte of the readout mode
// (see notes in Sec. 3.2.4 of SBIG Universal Driver documentation)
binning += targetChip->getBinY() << 8;
}
// check if the requested binning mode (low byte only) is supported by the device
if ((binning & 0x00FF) > (numModes - 1))
{
res = CE_BAD_PARAMETER;
binning = CCD_BIN_1x1_I; // fallback mode -> no binning
LOG_ERROR("Binning mode not supported by the device");
}
LOGF_DEBUG("%s: binx (%d) biny (%d) binning_mode (%d)", __FUNCTION__, targetChip->getBinX(),
targetChip->getBinY(), binning);
return res;
}
int SBIGCCD::getFrameType(INDI::CCDChip *targetChip, INDI::CCDChip::CCD_FRAME *frameType)
{
*frameType = targetChip->getFrameType();
return CE_NO_ERROR;
}
int SBIGCCD::getShutterMode(INDI::CCDChip *targetChip, int &shutter)
{
int res = CE_NO_ERROR;
INDI::CCDChip::CCD_FRAME frameType;
getFrameType(targetChip, &frameType);
int ccd = CCD_IMAGING;
if (targetChip == &PrimaryCCD)
{
ccd = CCD_IMAGING;
}
else if (targetChip == &GuideCCD)
{
ccd = m_useExternalTrackingCCD ? CCD_EXT_TRACKING : CCD_TRACKING;
}
if (frameType == INDI::CCDChip::LIGHT_FRAME || frameType == INDI::CCDChip::FLAT_FRAME)
{
if (ccd == CCD_EXT_TRACKING)
{
shutter = SC_OPEN_EXT_SHUTTER;
}
else
{
shutter = SC_OPEN_SHUTTER;
}
}
else if (frameType == INDI::CCDChip::DARK_FRAME || frameType == INDI::CCDChip::BIAS_FRAME)
{
if (ccd == CCD_EXT_TRACKING)
{
shutter = SC_CLOSE_EXT_SHUTTER;
}
else
{
shutter = SC_CLOSE_SHUTTER;
}
}
else
{
res = CE_OS_ERROR;
LOGF_ERROR("Unknown selected CCD frame type %s", targetChip->getFrameTypeName(frameType));
}
return res;
}
bool SBIGCCD::SelectFilter(int position)
{
CFWResults CFWr;
int res = CFWGoto(&CFWr, position);
if (res == CE_NO_ERROR)
{
int type = GetCFWSelType();
if (type == CFWSEL_CFW6A || type == CFWSEL_CFW8)
{
LOG_INFO("CFW position reached");
CFWr.cfwPosition = position;
}
else
{
LOGF_INFO("CFW position %d reached.", CFWr.cfwPosition);
}
SelectFilterDone(CurrentFilter = CFWr.cfwPosition);
return true;
}
else
{
FilterSlotNP.s = IPS_ALERT;
IDSetNumber(&FilterSlotNP, nullptr);
LOG_INFO("Failed to reach position");
return false;
}
}
int SBIGCCD::QueryFilter()
{
return CurrentFilter;
}
void SBIGCCD::updateTemperatureHelper(void *p)
{
if (static_cast(p)->isConnected())
static_cast(p)->updateTemperature();
}
void SBIGCCD::updateTemperature()
{
bool enabled;
double ccdTemp, setpointTemp, percentTE, power;
std::unique_lock guard(sbigLock);
int res = QueryTemperatureStatus(enabled, ccdTemp, setpointTemp, percentTE);
guard.unlock();
if (res == CE_NO_ERROR)
{
power = 100.0 * percentTE;
// Compare the current temperature against the setpoint value:
// if (fabs(setpointTemp - ccdTemp) <= TEMP_DIFF)
// {
// TemperatureNP.s = IPS_OK;
// }
if (power == 0)
{
TemperatureNP.s = IPS_IDLE;
}
else
{
TemperatureNP.s = IPS_BUSY;
LOGF_DEBUG("CCD temperature %+.1f [C], TE cooler: %.1f [%%].", ccdTemp, power);
}
TemperatureN[0].value = ccdTemp;
// Check the TE cooler if inside the range:
if (power <= CCD_COOLER_THRESHOLD)
{
CoolerNP.s = IPS_OK;
}
else
{
CoolerNP.s = IPS_BUSY;
}
CoolerN[0].value = power;
IDSetNumber(&TemperatureNP, nullptr);
IDSetNumber(&CoolerNP, nullptr);
}
else
{
// ignore share errors
if (res == CE_SHARE_ERROR)
{
LOGF_DEBUG("Erro reading temperature. %s", GetErrorString(res));
TemperatureNP.s = IPS_IDLE;
}
else
{
LOGF_ERROR("Erro reading temperature. %s", GetErrorString(res));
TemperatureNP.s = IPS_ALERT;
}
IDSetNumber(&TemperatureNP, nullptr);
}
IEAddTimer(TEMPERATURE_POLL_MS, SBIGCCD::updateTemperatureHelper, this);
}
bool SBIGCCD::isExposureDone(INDI::CCDChip *targetChip)
{
int ccd = 0;
if (isSimulation())
{
double timeLeft = 1e6;
if (targetChip == &PrimaryCCD)
{
std::chrono::duration elapsed = std::chrono::system_clock::now() - ExpStart;
timeLeft = ExposureRequest - elapsed.count();
}
else
{
std::chrono::duration elapsed = std::chrono::system_clock::now() - GuideExpStart;
timeLeft = GuideExposureRequest - elapsed.count();
}
return (timeLeft <= 0);
}
if (targetChip == &PrimaryCCD)
{
ccd = CCD_IMAGING;
}
else
{
ccd = m_useExternalTrackingCCD ? CCD_EXT_TRACKING : CCD_TRACKING;
}
EndExposureParams eep;
QueryCommandStatusParams qcsp;
QueryCommandStatusResults qcsr;
// Query command status:
qcsp.command = CC_START_EXPOSURE2;
std::unique_lock guard(sbigLock);
int res = QueryCommandStatus(&qcsp, &qcsr);
if (res != CE_NO_ERROR)
{
guard.unlock();
return false;
}
int mask = 12; // Tracking & external tracking CCD chip mask.
if (ccd == CCD_IMAGING)
{
mask = 3; // Imaging chip mask.
}
// Check exposure progress:
if ((qcsr.status & mask) != mask)
{
// The exposure is still in progress, decrement an
// exposure time:
guard.unlock();
return false;
}
// Exposure done - update client's property:
eep.ccd = ccd;
EndExposure(&eep);
guard.unlock();
return true;
}
//==========================================================================
int SBIGCCD::readoutCCD(uint16_t left, uint16_t top, uint16_t width, uint16_t height,
uint16_t *buffer, INDI::CCDChip *targetChip)
{
int h, ccd, binning, res;
if (targetChip == &PrimaryCCD)
{
ccd = CCD_IMAGING;
}
else
{
ccd = m_useExternalTrackingCCD ? CCD_EXT_TRACKING : CCD_TRACKING;
}
if ((res = getBinningMode(targetChip, binning)) != CE_NO_ERROR)
{
return res;
}
StartReadoutParams srp;
srp.ccd = ccd;
srp.readoutMode = binning;
srp.left = left;
srp.top = top;
srp.width = width;
srp.height = height;
std::unique_lock guard(sbigLock);
res = StartReadout(&srp);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s readoutCCD - StartReadout error! (%s)",
(targetChip == &PrimaryCCD) ? "Primary" : "Guide", GetErrorString(res));
guard.unlock();
return res;
}
ReadoutLineParams rlp;
rlp.ccd = ccd;
rlp.readoutMode = binning;
rlp.pixelStart = left;
rlp.pixelLength = width;
for (h = 0; h < height; h++)
{
ReadoutLine(&rlp, buffer + (h * width), false);
}
EndReadoutParams erp;
erp.ccd = ccd;
if ((res = EndReadout(&erp)) != CE_NO_ERROR)
{
LOGF_ERROR("%s readoutCCD - EndReadout error! (%s)",
(targetChip == &PrimaryCCD) ? "Primary" : "Guide", GetErrorString(res));
guard.unlock();
return res;
}
guard.unlock();
return res;
}
//==========================================================================
int SBIGCCD::CFWConnect()
{
IUResetSwitch(&FilterConnectionSP);
if (isConnected() == false)
{
LOG_ERROR("You must establish connection to CCD before connecting to filter wheel.");
FilterConnectionSP.s = IPS_IDLE;
FilterConnectionS[1].s = ISS_ON;
IDSetSwitch(&FilterConnectionSP, nullptr);
return CE_OS_ERROR;
}
CFWResults CFWr;
CFWParams CFWp;
int res = CE_NO_ERROR;
CFWp.cfwModel = GetCFWSelType();
if (CFWp.cfwModel == CFWSEL_CFW10_SERIAL)
{
CFWp.cfwCommand = CFWC_OPEN_DEVICE;
res = SBIGUnivDrvCommand(CC_CFW, &CFWp, &CFWr);
if (res != CE_NO_ERROR)
LOGF_ERROR("%s: CC_CFW/CFWC_OPEN_DEVICE -> (%s)", __FUNCTION__, GetErrorString(res));
}
if (res == CE_NO_ERROR)
{
CFWp.cfwCommand = CFWC_INIT;
for (int i = 0; i < 3; i++)
{
res = SBIGUnivDrvCommand(CC_CFW, &CFWp, &CFWr);
if (res == CE_NO_ERROR)
{
res = CFWGotoMonitor(&CFWr);
break;
}
LOGF_ERROR("%s: CC_CFW/CFWC_INIT -> (%s)", __FUNCTION__, GetErrorString(res));
sleep(1);
}
}
if (res == CE_NO_ERROR)
{
if (isSimulation())
{
CFWr.cfwModel = CFWp.cfwModel;
CFWr.cfwPosition = 1;
CFWr.cfwResult1 = 0;
int cfwsim[16] = { 2, 5, 6, 8, 4, 10, 10, 8, 9, 8, 10, 5, 5, 8, 7, 8 };
int filnum = IUFindOnSwitchIndex(&FilterTypeSP);
if (filnum < 0)
{
CFWr.cfwResult2 = 5;
}
else
{
CFWr.cfwResult2 = cfwsim[filnum];
}
}
else
{
CFWp.cfwCommand = CFWC_GET_INFO;
CFWp.cfwParam1 = CFWG_FIRMWARE_VERSION;
res = SBIGUnivDrvCommand(CC_CFW, &CFWp, &CFWr);
if (res != CE_NO_ERROR)
LOGF_ERROR("%s: CC_CFW/CFWC_GET_INFO -> (%s)", __FUNCTION__, GetErrorString(res));
}
}
if (res == CE_NO_ERROR)
{
const char *name = "Unknown filterwheel";
char fw[64] = "Unknown ID";
bool bClear = true;
int model = CFWr.cfwModel;
for (int i = 0; i < MAX_CFW_TYPES; i++)
{
if (model == SBIGFilterMap[i])
{
name = FilterTypeS[i].label;
bClear = false;
break;
}
}
IText *pIText = IUFindText(&FilterProdcutTP, "NAME");
if (pIText)
{
IUSaveText(pIText, name);
}
LOGF_DEBUG("CFW Product ID: %s", name);
if (!bClear)
{
sprintf(fw, "%ld", CFWr.cfwResult1);
}
pIText = IUFindText(&FilterProdcutTP, "ID");
if (pIText)
{
IUSaveText(pIText, fw);
}
LOGF_DEBUG("CFW Firmware: %s", fw);
FilterProdcutTP.s = IPS_OK;
defineProperty(&FilterProdcutTP);
FilterSlotN[0].min = 1;
FilterSlotN[0].max = CFWr.cfwResult2;
FilterSlotN[0].value = CFWr.cfwPosition;
if (FilterSlotN[0].value < FilterSlotN[0].min)
{
FilterSlotN[0].value = FilterSlotN[0].min;
}
else if (FilterSlotN[0].value > FilterSlotN[0].max)
{
FilterSlotN[0].value = FilterSlotN[0].max;
}
LOGF_DEBUG("CFW min: 1 Max: %g Current Slot: %g", FilterSlotN[0].max, FilterSlotN[0].value);
defineProperty(&FilterSlotNP);
if (FilterNameT == nullptr)
GetFilterNames();
if (FilterNameT)
defineProperty(FilterNameTP);
LOG_DEBUG("Loading FILTER_SLOT from config file...");
loadConfig(true, "FILTER_SLOT");
FilterConnectionSP.s = IPS_OK;
LOG_INFO("CFW connected.");
FilterConnectionS[0].s = ISS_ON;
IDSetSwitch(&FilterConnectionSP, nullptr);
}
else
{
FilterConnectionSP.s = IPS_ALERT;
FilterConnectionS[1].s = ISS_ON;
IUResetSwitch(&FilterConnectionSP);
FilterConnectionSP.sp[1].s = ISS_ON;
LOG_ERROR("Failed to connect CFW");
IDSetSwitch(&FilterConnectionSP, nullptr);
}
return res;
}
//==========================================================================
int SBIGCCD::CFWDisconnect()
{
CFWParams CFWp;
CFWResults CFWr;
CFWp.cfwModel = GetCFWSelType();
CFWp.cfwCommand = CFWC_CLOSE_DEVICE;
IUResetSwitch(&FilterConnectionSP);
int res = SBIGUnivDrvCommand(CC_CFW, &CFWp, &CFWr);
if (res != CE_NO_ERROR)
{
LOGF_ERROR("%s: CC_CFW/CFWC_CLOSE_DEVICE -> (%s)", __FUNCTION__, GetErrorString(res));
FilterConnectionS[0].s = ISS_ON;
FilterConnectionSP.s = IPS_ALERT;
IDSetSwitch(&FilterConnectionSP, "Failed to disconnect CFW");
}
else
{
FilterConnectionS[1].s = ISS_ON;
FilterConnectionSP.s = IPS_IDLE;
IDSetSwitch(&FilterConnectionSP, "CFW disconnected");
deleteProperty(FilterSlotNP.name);
deleteProperty(FilterProdcutTP.name);
deleteProperty(FilterNameTP->name);
}
return res;
}
//==========================================================================
int SBIGCCD::CFWQuery(CFWResults *CFWr)
{
CFWParams CFWp;
CFWp.cfwModel = GetCFWSelType();
CFWp.cfwCommand = CFWC_QUERY;
int res = SBIGUnivDrvCommand(CC_CFW, &CFWp, CFWr);
if (res != CE_NO_ERROR)
LOGF_ERROR("%s: CC_CFW/CFWC_QUERY -> (%s)", __FUNCTION__, GetErrorString(res));
return res;
}
//==========================================================================
int SBIGCCD::CFWGoto(CFWResults *CFWr, int position)
{
if (CFWr == nullptr)
return CE_NO_ERROR;
if (isSimulation())
{
CFWr->cfwPosition = position;
return CE_NO_ERROR;
}
LOGF_DEBUG("CFW GOTO: %d", position);
// 2014-06-16: Do we need to also checking if the position is reached here? A test will determine.
CFWParams CFWp;
CFWp.cfwModel = GetCFWSelType();
CFWp.cfwCommand = CFWC_GOTO;
CFWp.cfwParam1 = position;
int res = SBIGUnivDrvCommand(CC_CFW, &CFWp, CFWr);
if (res == CE_NO_ERROR)
{
if (CFWp.cfwParam1 == CFWr->cfwPosition)
{
LOGF_DEBUG("CFW Reached position %d", CFWr->cfwPosition);
return res;
}
LOG_DEBUG("CFW did not reach position yet, invoking CFWGotoMonitor");
return CFWGotoMonitor(CFWr);
}
LOGF_ERROR("%s: CC_CFW/CFWC_GOTO -> (%s)", __FUNCTION__, GetErrorString(res));
return res;
}
//==========================================================================
int SBIGCCD::CFWGotoMonitor(CFWResults *CFWr)
{
int res;
if (isSimulation())
return CE_NO_ERROR;
do
{
if ((res = CFWQuery(CFWr)) != CE_NO_ERROR)
return res;
switch (CFWr->cfwStatus)
{
case CFWS_IDLE:
LOG_DEBUG("CFW Status Idle.");
break;
case CFWS_BUSY:
LOG_DEBUG("CFW Status Busy.");
break;
default:
LOG_DEBUG("CFW Status Unknown.");
break;
}
sleep(1);
}
while (CFWr->cfwStatus != CFWS_IDLE);
return res;
}
//==========================================================================
int SBIGCCD::GetCFWSelType()
{
int filnum = IUFindOnSwitchIndex(&FilterTypeSP);
if (filnum < 0)
{
return CFWSEL_UNKNOWN;
}
return *(static_cast(FilterTypeS[filnum].aux));
}
indi-sbig-2.1+20221220234924/ezusb.c 0000644 0001751 0001751 00000056565 14174600255 015350 0 ustar debian debian /*
* Copyright © 2001 Stephen Williams (steve@icarus.com)
* Copyright © 2001-2002 David Brownell (dbrownell@users.sourceforge.net)
* Copyright © 2008 Roger Williams (rawqux@users.sourceforge.net)
* Copyright © 2012 Pete Batard (pete@akeo.ie)
* Copyright © 2013 Federico Manzan (f.manzan@gmail.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program 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 program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include
#include
#include
#include
#include
#include
#include "ezusb.h"
//extern void logerror(const char *format, ...)
// __attribute__ ((format(printf, 1, 2)));
/*
* This file contains functions for uploading firmware into Cypress
* EZ-USB microcontrollers. These chips use control endpoint 0 and vendor
* specific commands to support writing into the on-chip SRAM. They also
* support writing into the CPUCS register, which is how we reset the
* processor after loading firmware (including the reset vector).
*
* These Cypress devices are 8-bit 8051 based microcontrollers with
* special support for USB I/O. They come in several packages, and
* some can be set up with external memory when device costs allow.
* Note that the design was originally by AnchorChips, so you may find
* references to that vendor (which was later merged into Cypress).
* The Cypress FX parts are largely compatible with the Anchorhip ones.
*/
int verbose = 1;
/*
* return true if [addr,addr+len] includes external RAM
* for Anchorchips EZ-USB or Cypress EZ-USB FX
*/
static bool fx_is_external(uint32_t addr, size_t len)
{
/* with 8KB RAM, 0x0000-0x1b3f can be written
* we can't tell if it's a 4KB device here
*/
if (addr <= 0x1b3f)
return ((addr + len) > 0x1b40);
/* there may be more RAM; unclear if we can write it.
* some bulk buffers may be unused, 0x1b3f-0x1f3f
* firmware can set ISODISAB for 2KB at 0x2000-0x27ff
*/
return true;
}
/*
* return true if [addr,addr+len] includes external RAM
* for Cypress EZ-USB FX2
*/
static bool fx2_is_external(uint32_t addr, size_t len)
{
/* 1st 8KB for data/code, 0x0000-0x1fff */
if (addr <= 0x1fff)
return ((addr + len) > 0x2000);
/* and 512 for data, 0xe000-0xe1ff */
else if (addr >= 0xe000 && addr <= 0xe1ff)
return ((addr + len) > 0xe200);
/* otherwise, it's certainly external */
else
return true;
}
/*
* return true if [addr,addr+len] includes external RAM
* for Cypress EZ-USB FX2LP
*/
static bool fx2lp_is_external(uint32_t addr, size_t len)
{
/* 1st 16KB for data/code, 0x0000-0x3fff */
if (addr <= 0x3fff)
return ((addr + len) > 0x4000);
/* and 512 for data, 0xe000-0xe1ff */
else if (addr >= 0xe000 && addr <= 0xe1ff)
return ((addr + len) > 0xe200);
/* otherwise, it's certainly external */
else
return true;
}
/*****************************************************************************/
/*
* These are the requests (bRequest) that the bootstrap loader is expected
* to recognize. The codes are reserved by Cypress, and these values match
* what EZ-USB hardware, or "Vend_Ax" firmware (2nd stage loader) uses.
* Cypress' "a3load" is nice because it supports both FX and FX2, although
* it doesn't have the EEPROM support (subset of "Vend_Ax").
*/
#define RW_INTERNAL 0xA0 /* hardware implements this one */
#define RW_MEMORY 0xA3
/*
* Issues the specified vendor-specific write request.
*/
static int ezusb_write(libusb_device_handle *device, const char *label,
uint8_t opcode, uint32_t addr, const unsigned char *data, size_t len)
{
int status;
(void)label; // UNUSED
//if (verbose > 1)
// logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
status = libusb_control_transfer(device,
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
opcode, addr & 0xFFFF, addr >> 16,
(unsigned char*)data, (uint16_t)len, 1000);
if (status != (signed)len) {
//if (status < 0)
// logerror("%s: %s\n", label, libusb_error_name(status));
//else
// logerror("%s ==> %d\n", label, status);
}
return (status < 0) ? -EIO : 0;
}
/*
* Issues the specified vendor-specific read request.
*/
static int ezusb_read(libusb_device_handle *device, const char *label,
uint8_t opcode, uint32_t addr, const unsigned char *data, size_t len)
{
int status;
(void)label; // UNUSED
//if (verbose > 1)
// logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
status = libusb_control_transfer(device,
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
opcode, addr & 0xFFFF, addr >> 16,
(unsigned char*)data, (uint16_t)len, 1000);
if (status != (signed)len) {
//if (status < 0)
// logerror("%s: %s\n", label, libusb_error_name(status));
//else
// logerror("%s ==> %d\n", label, status);
}
return (status < 0) ? -EIO : 0;
}
/*
* Modifies the CPUCS register to stop or reset the CPU.
* Returns false on error.
*/
static bool ezusb_cpucs(libusb_device_handle *device, uint32_t addr, bool doRun)
{
int status;
uint8_t data = doRun ? 0x00 : 0x01;
//if (verbose)
// logerror("%s\n", data ? "stop CPU" : "reset CPU");
status = libusb_control_transfer(device,
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
RW_INTERNAL, addr & 0xFFFF, addr >> 16,
&data, 1, 1000);
if ((status != 1) &&
/* We may get an I/O error from libusb as the device disappears */
((!doRun) || (status != LIBUSB_ERROR_IO)))
{
//const char *mesg = "can't modify CPUCS";
//if (status < 0)
// logerror("%s: %s\n", mesg, libusb_error_name(status));
//else
// logerror("%s\n", mesg);
return false;
} else
return true;
}
/*
* Send an FX3 jumpt to address command
* Returns false on error.
*/
static bool ezusb_fx3_jump(libusb_device_handle *device, uint32_t addr)
{
int status;
//if (verbose)
// logerror("transfer execution to Program Entry at 0x%08x\n", addr);
status = libusb_control_transfer(device,
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
RW_INTERNAL, addr & 0xFFFF, addr >> 16,
NULL, 0, 1000);
/* We may get an I/O error from libusb as the device disappears */
if ((status != 0) && (status != LIBUSB_ERROR_IO))
{
//const char *mesg = "failed to send jump command";
//if (status < 0)
// logerror("%s: %s\n", mesg, libusb_error_name(status));
//else
// logerror("%s\n", mesg);
return false;
} else
return true;
}
/*****************************************************************************/
/*
* Parse an Intel HEX image file and invoke the poke() function on the
* various segments to implement policies such as writing to RAM (with
* a one or two stage loader setup, depending on the firmware) or to
* EEPROM (two stages required).
*
* image - the hex image file
* context - for use by poke()
* is_external - if non-null, used to check which segments go into
* external memory (writable only by software loader)
* poke - called with each memory segment; errors indicated
* by returning negative values.
*
* Caller is responsible for halting CPU as needed, such as when
* overwriting a second stage loader.
*/
static int parse_ihex(FILE *image, void *context,
bool (*is_external)(uint32_t addr, size_t len),
int (*poke) (void *context, uint32_t addr, bool external,
const unsigned char *data, size_t len))
{
unsigned char data[1023];
uint32_t data_addr = 0;
size_t data_len = 0;
int rc;
int first_line = 1;
bool external = false;
/* Read the input file as an IHEX file, and report the memory segments
* as we go. Each line holds a max of 16 bytes, but uploading is
* faster (and EEPROM space smaller) if we merge those lines into larger
* chunks. Most hex files keep memory segments together, which makes
* such merging all but free. (But it may still be worth sorting the
* hex files to make up for undesirable behavior from tools.)
*
* Note that EEPROM segments max out at 1023 bytes; the upload protocol
* allows segments of up to 64 KBytes (more than a loader could handle).
*/
for (;;) {
char buf[512], *cp;
char tmp, type;
size_t len;
unsigned idx, off;
cp = fgets(buf, sizeof(buf), image);
if (cp == NULL) {
//logerror("EOF without EOF record!\n");
break;
}
/* EXTENSION: "# comment-till-end-of-line", for copyrights etc */
if (buf[0] == '#')
continue;
if (buf[0] != ':') {
//logerror("not an ihex record: %s", buf);
return -2;
}
/* ignore any newline */
cp = strchr(buf, '\n');
if (cp)
*cp = 0;
//if (verbose >= 3)
// logerror("** LINE: %s\n", buf);
/* Read the length field (up to 16 bytes) */
tmp = buf[3];
buf[3] = 0;
len = strtoul(buf+1, NULL, 16);
buf[3] = tmp;
/* Read the target offset (address up to 64KB) */
tmp = buf[7];
buf[7] = 0;
off = (int)strtoul(buf+3, NULL, 16);
buf[7] = tmp;
/* Initialize data_addr */
if (first_line) {
data_addr = off;
first_line = 0;
}
/* Read the record type */
tmp = buf[9];
buf[9] = 0;
type = (char)strtoul(buf+7, NULL, 16);
buf[9] = tmp;
/* If this is an EOF record, then make it so. */
if (type == 1) {
//if (verbose >= 2)
// logerror("EOF on hexfile\n");
break;
}
if (type != 0) {
//logerror("unsupported record type: %u\n", type);
return -3;
}
if ((len * 2) + 11 > strlen(buf)) {
//logerror("record too short?\n");
return -4;
}
/* FIXME check for _physically_ contiguous not just virtually
* e.g. on FX2 0x1f00-0x2100 includes both on-chip and external
* memory so it's not really contiguous */
/* flush the saved data if it's not contiguous,
* or when we've buffered as much as we can.
*/
if (data_len != 0
&& (off != (data_addr + data_len)
/* || !merge */
|| (data_len + len) > sizeof(data))) {
if (is_external)
external = is_external(data_addr, data_len);
rc = poke(context, data_addr, external, data, data_len);
if (rc < 0)
return -1;
data_addr = off;
data_len = 0;
}
/* append to saved data, flush later */
for (idx = 0, cp = buf+9 ; idx < len ; idx += 1, cp += 2) {
tmp = cp[2];
cp[2] = 0;
data[data_len + idx] = (uint8_t)strtoul(cp, NULL, 16);
cp[2] = tmp;
}
data_len += len;
}
/* flush any data remaining */
if (data_len != 0) {
if (is_external)
external = is_external(data_addr, data_len);
rc = poke(context, data_addr, external, data, data_len);
if (rc < 0)
return -1;
}
return 0;
}
/*
* Parse a binary image file and write it as is to the target.
* Applies to Cypress BIX images for RAM or Cypress IIC images
* for EEPROM.
*
* image - the BIX image file
* context - for use by poke()
* is_external - if non-null, used to check which segments go into
* external memory (writable only by software loader)
* poke - called with each memory segment; errors indicated
* by returning negative values.
*
* Caller is responsible for halting CPU as needed, such as when
* overwriting a second stage loader.
*/
static int parse_bin(FILE *image, void *context,
bool (*is_external)(uint32_t addr, size_t len), int (*poke)(void *context,
uint32_t addr, bool external, const unsigned char *data, size_t len))
{
unsigned char data[4096];
uint32_t data_addr = 0;
size_t data_len = 0;
int rc;
bool external = false;
for (;;) {
data_len = fread(data, 1, 4096, image);
if (data_len == 0)
break;
if (is_external)
external = is_external(data_addr, data_len);
rc = poke(context, data_addr, external, data, data_len);
if (rc < 0)
return -1;
data_addr += (uint32_t)data_len;
}
return feof(image)?0:-1;
}
/*
* Parse a Cypress IIC image file and invoke the poke() function on the
* various segments for writing to RAM
*
* image - the IIC image file
* context - for use by poke()
* is_external - if non-null, used to check which segments go into
* external memory (writable only by software loader)
* poke - called with each memory segment; errors indicated
* by returning negative values.
*
* Caller is responsible for halting CPU as needed, such as when
* overwriting a second stage loader.
*/
static int parse_iic(FILE *image, void *context,
bool (*is_external)(uint32_t addr, size_t len),
int (*poke)(void *context, uint32_t addr, bool external, const unsigned char *data, size_t len))
{
unsigned char data[4096];
uint32_t data_addr = 0;
size_t data_len = 0, read_len;
uint8_t block_header[4];
int rc;
bool external = false;
long file_size, initial_pos;
initial_pos = ftell(image);
if (initial_pos < 0)
return -1;
if (fseek(image, 0L, SEEK_END) != 0)
return -1;
file_size = ftell(image);
if (fseek(image, initial_pos, SEEK_SET) != 0)
return -1;
for (;;) {
/* Ignore the trailing reset IIC data (5 bytes) */
if (ftell(image) >= (file_size - 5))
break;
if (fread(&block_header, 1, sizeof(block_header), image) != 4) {
//logerror("unable to read IIC block header\n");
return -1;
}
data_len = (block_header[0] << 8) + block_header[1];
data_addr = (block_header[2] << 8) + block_header[3];
if (data_len > sizeof(data)) {
/* If this is ever reported as an error, switch to using malloc/realloc */
//logerror("IIC data block too small - please report this error to libusb.info\n");
return -1;
}
read_len = fread(data, 1, data_len, image);
if (read_len != data_len) {
//logerror("read error\n");
return -1;
}
if (is_external)
external = is_external(data_addr, data_len);
rc = poke(context, data_addr, external, data, data_len);
if (rc < 0)
return -1;
}
return 0;
}
/* the parse call will be selected according to the image type */
static int (*parse[IMG_TYPE_MAX])(FILE *image, void *context, bool (*is_external)(uint32_t addr, size_t len),
int (*poke)(void *context, uint32_t addr, bool external, const unsigned char *data, size_t len))
= { parse_ihex, parse_iic, parse_bin };
/*****************************************************************************/
/*
* For writing to RAM using a first (hardware) or second (software)
* stage loader and 0xA0 or 0xA3 vendor requests
*/
typedef enum {
_undef = 0,
internal_only, /* hardware first-stage loader */
skip_internal, /* first phase, second-stage loader */
skip_external /* second phase, second-stage loader */
} ram_mode;
struct ram_poke_context {
libusb_device_handle *device;
ram_mode mode;
size_t total, count;
};
#define RETRY_LIMIT 5
static int ram_poke(void *context, uint32_t addr, bool external,
const unsigned char *data, size_t len)
{
struct ram_poke_context *ctx = (struct ram_poke_context*)context;
int rc;
unsigned retry = 0;
switch (ctx->mode) {
case internal_only: /* CPU should be stopped */
if (external) {
//logerror("can't write %u bytes external memory at 0x%08x\n",
// (unsigned)len, addr);
return -EINVAL;
}
break;
case skip_internal: /* CPU must be running */
if (!external) {
if (verbose >= 2) {
//logerror("SKIP on-chip RAM, %u bytes at 0x%08x\n",
// (unsigned)len, addr);
}
return 0;
}
break;
case skip_external: /* CPU should be stopped */
if (external) {
if (verbose >= 2) {
//logerror("SKIP external RAM, %u bytes at 0x%08x\n",
// (unsigned)len, addr);
}
return 0;
}
break;
case _undef:
default:
//logerror("bug\n");
return -EDOM;
}
ctx->total += len;
ctx->count++;
/* Retry this till we get a real error. Control messages are not
* NAKed (just dropped) so time out means is a real problem.
*/
while ((rc = ezusb_write(ctx->device,
external ? "write external" : "write on-chip",
external ? RW_MEMORY : RW_INTERNAL,
addr, data, len)) < 0
&& retry < RETRY_LIMIT) {
if (rc != LIBUSB_ERROR_TIMEOUT)
break;
retry += 1;
}
return rc;
}
/*
* Load a Cypress Image file into target RAM.
* See http://www.cypress.com/?docID=41351 (AN76405 PDF) for more info.
*/
static int fx3_load_ram(libusb_device_handle *device, const char *path)
{
uint32_t dCheckSum, dExpectedCheckSum, dAddress, i, dLen, dLength;
uint32_t* dImageBuf;
unsigned char *bBuf, hBuf[4], blBuf[4], rBuf[4096];
FILE *image;
int ret = 0;
image = fopen(path, "rb");
if (image == NULL) {
//logerror("unable to open '%s' for input\n", path);
return -2;
} else if (verbose)
//logerror("open firmware image %s for RAM upload\n", path);
// Read header
if (fread(hBuf, sizeof(char), sizeof(hBuf), image) != sizeof(hBuf)) {
//logerror("could not read image header");
ret = -3;
goto exit;
}
// check "CY" signature byte and format
if ((hBuf[0] != 'C') || (hBuf[1] != 'Y')) {
//logerror("image doesn't have a CYpress signature\n");
ret = -3;
goto exit;
}
// Check bImageType
switch(hBuf[3]) {
case 0xB0:
//if (verbose)
// logerror("normal FW binary %s image with checksum\n", (hBuf[2]&0x01)?"data":"executable");
break;
case 0xB1:
//logerror("security binary image is not currently supported\n");
ret = -3;
goto exit;
case 0xB2:
//logerror("VID:PID image is not currently supported\n");
ret = -3;
goto exit;
default:
//logerror("invalid image type 0x%02X\n", hBuf[3]);
ret = -3;
goto exit;
}
// Read the bootloader version
if (verbose) {
if ((ezusb_read(device, "read bootloader version", RW_INTERNAL, 0xFFFF0020, blBuf, 4) < 0)) {
//logerror("Could not read bootloader version\n");
ret = -8;
goto exit;
}
//logerror("FX3 bootloader version: 0x%02X%02X%02X%02X\n", blBuf[3], blBuf[2], blBuf[1], blBuf[0]);
}
dCheckSum = 0;
//if (verbose)
// logerror("writing image...\n");
while (1) {
if ((fread(&dLength, sizeof(uint32_t), 1, image) != 1) || // read dLength
(fread(&dAddress, sizeof(uint32_t), 1, image) != 1)) { // read dAddress
//logerror("could not read image");
ret = -3;
goto exit;
}
if (dLength == 0)
break; // done
// coverity[tainted_data]
dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t));
if (dImageBuf == NULL) {
//logerror("could not allocate buffer for image chunk\n");
ret = -4;
goto exit;
}
// read sections
if (fread(dImageBuf, sizeof(uint32_t), dLength, image) != dLength) {
//logerror("could not read image");
free(dImageBuf);
ret = -3;
goto exit;
}
for (i = 0; i < dLength; i++)
dCheckSum += dImageBuf[i];
dLength <<= 2; // convert to Byte length
bBuf = (unsigned char*) dImageBuf;
while (dLength > 0) {
dLen = 4096; // 4K max
if (dLen > dLength)
dLen = dLength;
if ((ezusb_write(device, "write firmware", RW_INTERNAL, dAddress, bBuf, dLen) < 0) ||
(ezusb_read(device, "read firmware", RW_INTERNAL, dAddress, rBuf, dLen) < 0)) {
//logerror("R/W error\n");
free(dImageBuf);
ret = -5;
goto exit;
}
// Verify data: rBuf with bBuf
for (i = 0; i < dLen; i++) {
if (rBuf[i] != bBuf[i]) {
//logerror("verify error");
free(dImageBuf);
ret = -6;
goto exit;
}
}
dLength -= dLen;
bBuf += dLen;
dAddress += dLen;
}
free(dImageBuf);
}
// read pre-computed checksum data
if ((fread(&dExpectedCheckSum, sizeof(uint32_t), 1, image) != 1) ||
(dCheckSum != dExpectedCheckSum)) {
//logerror("checksum error\n");
ret = -7;
goto exit;
}
// transfer execution to Program Entry
if (!ezusb_fx3_jump(device, dAddress)) {
ret = -6;
}
exit:
fclose(image);
return ret;
}
/*
* Load a firmware file into target RAM. device is the open libusb
* device, and the path is the name of the source file. Open the file,
* parse the bytes, and write them in one or two phases.
*
* If stage == 0, this uses the first stage loader, built into EZ-USB
* hardware but limited to writing on-chip memory or CPUCS. Everything
* is written during one stage, unless there's an error such as the image
* holding data that needs to be written to external memory.
*
* Otherwise, things are written in two stages. First the external
* memory is written, expecting a second stage loader to have already
* been loaded. Then file is re-parsed and on-chip memory is written.
*/
int ezusb_load_ram(libusb_device_handle *device, const char *path, int fx_type, int img_type, int stage)
{
FILE *image;
uint32_t cpucs_addr;
bool (*is_external)(uint32_t off, size_t len);
struct ram_poke_context ctx;
int status;
uint8_t iic_header[8] = { 0 };
int ret = 0;
if (fx_type == FX_TYPE_FX3)
return fx3_load_ram(device, path);
image = fopen(path, "rb");
if (image == NULL) {
//logerror("%s: unable to open for input.\n", path);
return -2;
} //else if (verbose > 1)
//logerror("open firmware image %s for RAM upload\n", path);
if (img_type == IMG_TYPE_IIC) {
if ( (fread(iic_header, 1, sizeof(iic_header), image) != sizeof(iic_header))
|| (((fx_type == FX_TYPE_FX2LP) || (fx_type == FX_TYPE_FX2)) && (iic_header[0] != 0xC2))
|| ((fx_type == FX_TYPE_AN21) && (iic_header[0] != 0xB2))
|| ((fx_type == FX_TYPE_FX1) && (iic_header[0] != 0xB6)) ) {
//logerror("IIC image does not contain executable code - cannot load to RAM.\n");
ret = -1;
goto exit;
}
}
/* EZ-USB original/FX and FX2 devices differ, apart from the 8051 core */
switch(fx_type) {
case FX_TYPE_FX2LP:
cpucs_addr = 0xe600;
is_external = fx2lp_is_external;
break;
case FX_TYPE_FX2:
cpucs_addr = 0xe600;
is_external = fx2_is_external;
break;
default:
cpucs_addr = 0x7f92;
is_external = fx_is_external;
break;
}
/* use only first stage loader? */
if (stage == 0) {
ctx.mode = internal_only;
/* if required, halt the CPU while we overwrite its code/data */
if (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, false))
{
ret = -1;
goto exit;
}
/* 2nd stage, first part? loader was already uploaded */
} else {
ctx.mode = skip_internal;
/* let CPU run; overwrite the 2nd stage loader later */
//if (verbose)
// logerror("2nd stage: write external memory\n");
}
/* scan the image, first (maybe only) time */
ctx.device = device;
ctx.total = ctx.count = 0;
status = parse[img_type](image, &ctx, is_external, ram_poke);
if (status < 0) {
//logerror("unable to upload %s\n", path);
ret = status;
goto exit;
}
/* second part of 2nd stage: rescan */
// TODO: what should we do for non HEX images there?
if (stage) {
ctx.mode = skip_external;
/* if needed, halt the CPU while we overwrite the 1st stage loader */
if (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, false))
{
ret = -1;
goto exit;
}
/* at least write the interrupt vectors (at 0x0000) for reset! */
rewind(image);
//if (verbose)
// logerror("2nd stage: write on-chip memory\n");
status = parse_ihex(image, &ctx, is_external, ram_poke);
if (status < 0) {
//logerror("unable to completely upload %s\n", path);
ret = status;
goto exit;
}
}
//if (verbose && (ctx.count != 0)) {
// logerror("... WROTE: %d bytes, %d segments, avg %d\n",
// (int)ctx.total, (int)ctx.count, (int)(ctx.total/ctx.count));
//}
/* if required, reset the CPU so it runs what we just uploaded */
if (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, true))
ret = -1;
exit:
fclose(image);
return ret;
}
indi-sbig-2.1+20221220234924/sbig_ccd.h 0000644 0001751 0001751 00000042361 14243553447 015756 0 ustar debian debian /*
Driver type: SBIG CCD Camera INDI Driver
Copyright (C) 2013-2018 Jasem Mutlaq (mutlaqja AT ikarustech DOT com)
Copyright (C) 2005-2006 Jan Soldan (jsoldan AT asu DOT cas DOT cz)
Acknowledgement:
Matt Longmire (matto AT sbig DOT com)
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
#include "config.h"
#include
#include
#ifdef __APPLE__
#include
#include
#else
#include
#endif
#include
#define DEVICE struct usb_device *
/*
How to use SBIG CFW-10 SA under Linux:
1) If you have a RS-232 port on you computer, localize its serial device.
It may look like this one: /dev/ttyS0
In the case you use an USB to RS-232 adapter, the device may be
located at: /dev/ttyUSB0
2) Make a symbolic link to this device with the following name:
ln -s /dev/ttyUSB0 ~/kdeedu/kstars/kstars/indi/sbigCFW
Please note that the SBIG CFW-10 SA _always_ uses device named sbigCFW.
3) Change mode of this device:
chmod a+rw /dev/ttyUSB0
4) Inside KStars:
a) Open CFW panel
b) Set CFW Type to CFW-10 SA
c) Press Connect button
d) The CFW's detection may take a few seconds due to its internal initialization.
*/
//=============================================================================
const int INVALID_HANDLE_VALUE = -1; // for file operations
//=============================================================================
// SBIG temperature constants:
const double T0 = 25.000;
const double MAX_AD = 4096.000;
const double R_RATIO_CCD = 2.570;
const double R_BRIDGE_CCD = 10.000;
const double DT_CCD = 25.000;
const double R0 = 3.000;
const double R_RATIO_AMBIENT = 7.791;
const double R_BRIDGE_AMBIENT = 3.000;
const double DT_AMBIENT = 45.000;
const double MIN_CCD_TEMP = -70.0;
const double MAX_CCD_TEMP = 40.0;
const double CCD_TEMP_STEP = 0.1;
const double DEF_CCD_TEMP = 0.0;
const double TEMP_DIFF = 0.5;
const double CCD_COOLER_THRESHOLD = 95.0;
const double MIN_POLLING_TIME = 1.0;
const double MAX_POLLING_TIME = 3600.0;
const double STEP_POLLING_TIME = 1.0;
const double CUR_POLLING_TIME = 10.0;
// CCD BINNING: (see Sec. 3.2.3 of SBIG Universal Driver documentation)
const int CCD_BIN_1x1_I = 0;
const int CCD_BIN_2x2_I = 1;
const int CCD_BIN_3x3_I = 2;
const int CCD_BIN_1xN_I = 3; // variable vertical binning modes
const int CCD_BIN_2xN_I = 4;
const int CCD_BIN_3xN_I = 5;
const int CCD_BIN_1x1_E = 6; // off-chip binning modes
const int CCD_BIN_2x2_E = 7;
const int CCD_BIN_3x3_E = 8;
const int CCD_BIN_9x9_I = 9;
const int CCD_BIN_NxN_I = 10;
const double MIN_EXP_TIME = 0.0;
const double MAX_EXP_TIME = 3600.0;
const double EXP_TIME_STEP = 0.01;
const double DEF_EXP_TIME = 1.0;
#ifdef USE_CFW_AUTO
const int MAX_CFW_TYPES = 17;
#else
const int MAX_CFW_TYPES = 16;
#endif
#define GET_BIG_ENDIAN(p) (((p & 0xff) << 8) | (p >> 8))
typedef enum { CCD_THERMISTOR, AMBIENT_THERMISTOR } THERMISTOR_TYPE;
typedef unsigned long ulong; /* Short for unsigned long */
class SBIGCCD : public INDI::CCD, public INDI::FilterInterface
{
public:
SBIGCCD();
virtual ~SBIGCCD() override;
virtual const char *getDefaultName() override;
virtual bool initProperties() override;
virtual void ISGetProperties(const char *dev) override;
virtual bool updateProperties() override;
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
void updateTemperature();
static void updateTemperatureHelper(void *);
#ifdef ASYNC_READOUT
static void *grabCCDHelper(void *context);
#endif
bool isExposureDone(INDI::CCDChip *targetChip);
static void NSGuideHelper(void *context);
static void WEGuideHelper(void *context);
protected:
virtual bool Connect() override;
virtual bool Disconnect() override;
virtual bool StartExposure(float duration) override;
virtual bool AbortExposure() override;
virtual bool UpdateCCDFrame(int x, int y, int w, int h) override;
virtual bool UpdateCCDBin(int binx, int biny) override;
virtual bool UpdateCCDFrameType(INDI::CCDChip::CCD_FRAME fType) override;
virtual bool StartGuideExposure(float duration) override;
virtual bool AbortGuideExposure() override;
#ifdef __APPLE__
libusb_device *dev;
libusb_device_handle *handle;
#endif
virtual void TimerHit() override;
virtual int SetTemperature(double temperature) override;
virtual bool saveConfigItems(FILE *fp) override;
virtual bool UpdateGuiderFrame(int x, int y, int w, int h) override;
virtual bool UpdateGuiderBin(int binx, int biny) override;
virtual IPState GuideNorth(uint32_t ms) override;
virtual IPState GuideSouth(uint32_t ms) override;
virtual IPState GuideEast(uint32_t ms) override;
virtual IPState GuideWest(uint32_t ms) override;
// Filter Wheel CFW
virtual int QueryFilter() override;
virtual bool SelectFilter(int position) override;
int m_fd;
CAMERA_TYPE m_camera_type;
int m_drv_handle;
bool m_link_status;
std::string m_start_exposure_timestamp;
void InitVars();
void loadFirmwareOnOSXifNeeded();
int OpenDriver();
int CloseDriver();
unsigned short CalcSetpoint(double temperature);
double CalcTemperature(short thermistorType, short ccdSetpoint);
double BcdPixel2double(ulong bcd);
private:
DEVICE device;
char name[MAXINDINAME];
/////////////////////////////////////////////////////////////////////////////
/// Product Information & Connection Properties
/////////////////////////////////////////////////////////////////////////////
ITextVectorProperty ProductInfoTP;
IText ProductInfoT[2] {};
ISwitchVectorProperty PortSP;
ISwitch PortS[8];
int SBIGPortMap[8];
// IP Address
ITextVectorProperty IpTP;
IText IpT[1];
/////////////////////////////////////////////////////////////////////////////
/// Cooler Properties
/////////////////////////////////////////////////////////////////////////////
ISwitch FanStateS[2];
ISwitchVectorProperty FanStateSP;
ISwitch CoolerS[2];
ISwitchVectorProperty CoolerSP;
INumber CoolerN[1];
INumberVectorProperty CoolerNP;
/////////////////////////////////////////////////////////////////////////////
/// Adaptive Optics Properties
/////////////////////////////////////////////////////////////////////////////
INumberVectorProperty AONSNP;
INumber AONSN[2];
enum
{
AO_NORTH,
AO_SOUTH,
};
INumberVectorProperty AOWENP;
INumber AOWEN[2];
enum
{
AO_EAST,
AO_WEST,
};
ISwitch CenterS[1];
ISwitchVectorProperty CenterSP;
AOTipTiltParams m_AOParams;
/////////////////////////////////////////////////////////////////////////////
/// Options Properties
/////////////////////////////////////////////////////////////////////////////
ISwitch IgnoreErrorsS[1];
ISwitchVectorProperty IgnoreErrorsSP;
/////////////////////////////////////////////////////////////////////////////
/// Filter Wheel Properties
/////////////////////////////////////////////////////////////////////////////
IText FilterProdcutT[2] {};
ITextVectorProperty FilterProdcutTP;
ISwitch FilterTypeS[MAX_CFW_TYPES];
ISwitchVectorProperty FilterTypeSP;
int SBIGFilterMap[MAX_CFW_TYPES];
ISwitch FilterConnectionS[2];
ISwitchVectorProperty FilterConnectionSP;
/////////////////////////////////////////////////////////////////////////////
/// Camera capabilities
/////////////////////////////////////////////////////////////////////////////
bool m_isColor { false };
bool m_useExternalTrackingCCD { false };
bool m_hasGuideHead { false };
bool m_hasFilterWheel { false };
bool m_hasAO { false };
/////////////////////////////////////////////////////////////////////////////
/// Threading Variables
/////////////////////////////////////////////////////////////////////////////
std::mutex sbigLock;
/////////////////////////////////////////////////////////////////////////////
/// Exposure Variables
/////////////////////////////////////////////////////////////////////////////
int m_TimerID { -1 };
std::chrono::system_clock::time_point ExpStart, GuideExpStart;
float ExposureRequest;
float GuideExposureRequest;
float TemperatureRequest;
/////////////////////////////////////////////////////////////////////////////
/// Guiding Variables
/////////////////////////////////////////////////////////////////////////////
ActivateRelayParams rp;
int m_NSTimerID {-1}, m_WETimerID {-1};
inline int GetFileDescriptor()
{
return (m_fd);
}
inline void SetFileDescriptor(int val = -1)
{
m_fd = val;
}
inline bool IsDeviceOpen()
{
return ((m_fd == -1) ? false : true);
}
inline CAMERA_TYPE GetCameraType()
{
return (m_camera_type);
}
inline void SetCameraType(CAMERA_TYPE val = NO_CAMERA)
{
m_camera_type = val;
}
inline int GetDriverHandle()
{
return (m_drv_handle);
}
inline void SetDriverHandle(int val = INVALID_HANDLE_VALUE)
{
m_drv_handle = val;
}
inline bool GetLinkStatus()
{
return (m_link_status);
}
inline void SetLinkStatus(bool val = false)
{
m_link_status = val;
}
int SetDeviceName(const char *);
inline std::string GetStartExposureTimestamp()
{
return (m_start_exposure_timestamp);
}
inline void SetStartExposureTimestamp(const char *p)
{
m_start_exposure_timestamp = p;
}
/////////////////////////////////////////////////////////////////////////////
/// Driver Communication Commands
/////////////////////////////////////////////////////////////////////////////
int GetCFWSelType();
int OpenDevice(uint32_t devType);
int CloseDevice();
int GetDriverInfo(GetDriverInfoParams *, void *);
int SetDriverHandle(SetDriverHandleParams *);
int GetDriverHandle(GetDriverHandleResults *);
/////////////////////////////////////////////////////////////////////////////
/// Exposure Commands
/////////////////////////////////////////////////////////////////////////////
int StartExposure(StartExposureParams2 *);
int EndExposure(EndExposureParams *);
int StartReadout(StartReadoutParams *);
int ReadoutLine(ReadoutLineParams *, unsigned short *results, bool subtract);
int DumpLines(DumpLinesParams *);
int EndReadout(EndReadoutParams *);
/////////////////////////////////////////////////////////////////////////////
/// Temperature Commands
/////////////////////////////////////////////////////////////////////////////
int SetTemperatureRegulation(SetTemperatureRegulationParams *);
int SetTemperatureRegulation(double temp, bool enable = true);
int QueryTemperatureStatus(QueryTemperatureStatusResults *);
int QueryTemperatureStatus(bool &enabled, double &ccdTemp, double &setpointT, double &power);
/////////////////////////////////////////////////////////////////////////////
/// External Control Comands
/////////////////////////////////////////////////////////////////////////////
int ActivateRelay(ActivateRelayParams *);
void NSGuideCallback();
void WEGuideCallback();
int PulseOut(PulseOutParams *);
int TxSerialBytes(TXSerialBytesParams *, TXSerialBytesResults *);
int GetSerialStatus(GetSerialStatusResults *);
/////////////////////////////////////////////////////////////////////////////
/// General Purpose Commands
/////////////////////////////////////////////////////////////////////////////
int EstablishLink();
int GetCcdInfo(GetCCDInfoParams *, void *);
int GetExtendedCCDInfo();
int QueryCommandStatus(QueryCommandStatusParams *, QueryCommandStatusResults *);
int MiscellaneousControl(MiscellaneousControlParams *);
int ReadOffset(ReadOffsetParams *, ReadOffsetResults *);
int GetLinkStatus(GetLinkStatusResults *);
char *GetErrorString(int err);
int SetDriverControl(SetDriverControlParams *);
int GetDriverControl(GetDriverControlParams *, GetDriverControlResults *);
int UsbAdControl(USBADControlParams *);
int QueryUsb(QueryUSBResults *);
int RwUsbI2c(RWUSBI2CParams *);
int BitIo(BitIOParams *, BitIOResults *);
/////////////////////////////////////////////////////////////////////////////
/// Camera Functions
/////////////////////////////////////////////////////////////////////////////
int getCCDSizeInfo(int ccd, int rm, int &frmW, int &frmH, double &pixW, double &pixH);
bool IsFanControlAvailable();
bool updateFrameProperties(INDI::CCDChip *targetChip);
int StartExposure(INDI::CCDChip *targetChip, double duration);
int AbortExposure(INDI::CCDChip *targetChip);
int GetSelectedCCDChip(int &ccd_request);
int getBinningMode(INDI::CCDChip *targetChip, int &binning);
int getFrameType(INDI::CCDChip *targetChip, INDI::CCDChip::CCD_FRAME *frameType);
int getShutterMode(INDI::CCDChip *targetChip, int &shutter);
int readoutCCD(unsigned short left, unsigned short top, unsigned short width, unsigned short height,
unsigned short *buffer, INDI::CCDChip *targetChip);
/////////////////////////////////////////////////////////////////////////////
/// Filter Wheel Functions
/////////////////////////////////////////////////////////////////////////////
int CFW(CFWParams *, CFWResults *);
int CFWConnect();
int CFWDisconnect();
int CFWInit(CFWResults *);
int CFWQuery(CFWResults *);
int CFWGoto(CFWResults *, int position);
int CFWGotoMonitor(CFWResults *);
/////////////////////////////////////////////////////////////////////////////
/// Adaptive Optics Functions
/////////////////////////////////////////////////////////////////////////////
int AoTipTilt();
int AoDelay(AODelayParams *);
int AoCenter();
// N.B. Not implemented in SBIGUDRV
int AoSetFocus(AOSetFocusParams *aofc);
/////////////////////////////////////////////////////////////////////////////
/// Utility Functions
/////////////////////////////////////////////////////////////////////////////
bool grabImage(INDI::CCDChip *targetChip);
bool setupParams();
// SBIG's software interface to the Universal Driver Library function:
int SBIGUnivDrvCommand(PAR_COMMAND, void *, void *);
bool CheckLink();
const char *GetCameraName();
const char *GetCameraID();
int getReadoutModes(INDI::CCDChip *targetChip, int &numModes, int &maxBinX, int &maxBinY);
friend void ::ISGetProperties(const char *dev);
friend void ::ISSnoopDevice(XMLEle *root);
friend void ::ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int num);
friend void ::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int num);
friend void ::ISNewNumber(const char *dev, const char *name, double values[], char *names[], int num);
friend void ::ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[],
char *formats[], char *names[], int n);
};
indi-sbig-2.1+20221220234924/cmake_modules/ 0000755 0001751 0001751 00000000000 14347562502 016647 5 ustar debian debian indi-sbig-2.1+20221220234924/cmake_modules/FindGPSD.cmake 0000644 0001751 0001751 00000001036 14174600255 021203 0 ustar debian debian # - Find GPSD
# Find the native GPSD includes and library
FIND_PATH(GPSD_INCLUDE_DIR libgpsmm.h gps.h)
SET(GPSD_NAMES ${GPSD_NAMES} gps)
FIND_LIBRARY(GPSD_LIBRARY NAMES ${GPSD_NAMES} )
# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSD DEFAULT_MSG GPSD_LIBRARY GPSD_INCLUDE_DIR)
IF(GPSD_FOUND)
SET(GPSD_LIBRARIES ${GPSD_LIBRARY})
message(STATUS "Found libgps: ${GPSD_LIBRARIES}")
ENDIF(GPSD_FOUND)
indi-sbig-2.1+20221220234924/cmake_modules/FindFTDI1.cmake 0000644 0001751 0001751 00000002672 14174600255 021264 0 ustar debian debian # - Try to find FTDI1
# Once done this will define
#
# FTDI1_FOUND - system has FTDI
# FTDI1_INCLUDE_DIR - the FTDI include directory
# FTDI1_LIBRARIES - Link these to use FTDI
#
# N.B. You must include the file as following:
#
#include
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (FTDI1_INCLUDE_DIR AND FTDI1_LIBRARIES)
# in cache already
set(FTDI1_FOUND TRUE)
message(STATUS "Found libftdi1: ${FTDI1_LIBRARIES}")
else (FTDI1_INCLUDE_DIR AND FTDI1_LIBRARIES)
find_path(FTDI1_INCLUDE_DIR ftdi.h
PATH_SUFFIXES libftdi1
${_obIncDir}
${GNUWIN32_DIR}/include
/usr/local/include
)
find_library(FTDI1_LIBRARIES NAMES ftdi1
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
/usr/local/lib
)
if(FTDI1_INCLUDE_DIR AND FTDI1_LIBRARIES)
set(FTDI1_FOUND TRUE)
else (FTDI1_INCLUDE_DIR AND FTDI1_LIBRARIES)
set(FTDI1_FOUND FALSE)
endif(FTDI1_INCLUDE_DIR AND FTDI1_LIBRARIES)
if (FTDI1_FOUND)
if (NOT FTDI1_FIND_QUIETLY)
message(STATUS "Found FTDI1: ${FTDI1_LIBRARIES}")
endif (NOT FTDI1_FIND_QUIETLY)
else (FTDI1_FOUND)
if (FTDI1_FIND_REQUIRED)
message(FATAL_ERROR "FTDI not found. Please install libftdi1-dev")
endif (FTDI1_FIND_REQUIRED)
endif (FTDI1_FOUND)
mark_as_advanced(FTDI1_INCLUDE_DIR FTDI1_LIBRARIES)
endif (FTDI1_INCLUDE_DIR AND FTDI1_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindOpenAL.cmake 0000644 0001751 0001751 00000006604 14174600255 021572 0 ustar debian debian # Locate OpenAL
# This module defines
# OPENAL_LIBRARY
# OPENAL_FOUND, if false, do not try to link to OpenAL
# OPENAL_INCLUDE_DIR, where to find the headers
#
# $OPENALDIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENALDIR
# used in building OpenAL.
#
# Created by Eric Wing. This was influenced by the FindSDL.cmake module.
# This makes the presumption that you are include al.h like
# #include "al.h"
# and not
# #include
# The reason for this is that the latter is not entirely portable.
# Windows/Creative Labs does not by default put their headers in AL/ and
# OS X uses the convention .
#
# For Windows, Creative Labs seems to have added a registry key for their
# OpenAL 1.1 installer. I have added that key to the list of search paths,
# however, the key looks like it could be a little fragile depending on
# if they decide to change the 1.00.0000 number for bug fix releases.
# Also, they seem to have laid down groundwork for multiple library platforms
# which puts the library in an extra subdirectory. Currently there is only
# Win32 and I have hardcoded that here. This may need to be adjusted as
# platforms are introduced.
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
# I do not know if the Nvidia OpenAL SDK has a registry key.
#
# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
# To support the framework, I originally wrote special framework detection
# code in this module which I have now removed with CMake's introduction
# of native support for frameworks.
# In addition, OpenAL is open source, and it is possible to compile on Panther.
# Furthermore, due to bugs in the initial OpenAL release, and the
# transition to OpenAL 1.1, it is common to need to override the built-in
# framework.
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
# /Library/Frameworks/OpenAL.framework/Headers
# /System/Library/Frameworks/OpenAL.framework/Headers
#
# On OS X, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# OPENAL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
FIND_PATH(OPENAL_INCLUDE_DIR al.h
PATHS
$ENV{OPENALDIR}
NO_DEFAULT_PATH
PATH_SUFFIXES include/AL include/OpenAL include
)
FIND_PATH(OPENAL_INCLUDE_DIR al.h
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
PATH_SUFFIXES include/AL include/OpenAL include
)
FIND_LIBRARY(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
PATHS
$ENV{OPENALDIR}
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
)
FIND_LIBRARY(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
)
SET(OPENAL_FOUND "NO")
IF(OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
SET(OPENAL_FOUND "YES")
ENDIF(OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
indi-sbig-2.1+20221220234924/cmake_modules/FindFFTW3.cmake 0000644 0001751 0001751 00000002573 14174600255 021306 0 ustar debian debian # - Try to find FFTW3
# Once done this will define
#
# FFTW3_FOUND - system has FFTW3
# FFTW3_INCLUDE_DIR - the FFTW3 include directory
# FFTW3_LIBRARIES - Link these to use FFTW3
# FFTW3_VERSION_STRING - Human readable version number of fftw3
# FFTW3_VERSION_MAJOR - Major version number of fftw3
# FFTW3_VERSION_MINOR - Minor version number of fftw3
# Copyright (c) 2017, Ilia Platone,
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (FFTW3_LIBRARIES)
# in cache already
set(FFTW3_FOUND TRUE)
message(STATUS "Found FFTW3: ${FFTW3_LIBRARIES}")
else (FFTW3_LIBRARIES)
find_library(FFTW3_LIBRARIES NAMES fftw3
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
/usr/local/lib
)
if(FFTW3_LIBRARIES)
set(FFTW3_FOUND TRUE)
else (FFTW3_LIBRARIES)
set(FFTW3_FOUND FALSE)
endif(FFTW3_LIBRARIES)
if (FFTW3_FOUND)
if (NOT FFTW3_FIND_QUIETLY)
message(STATUS "Found FFTW3: ${FFTW3_LIBRARIES}")
endif (NOT FFTW3_FIND_QUIETLY)
else (FFTW3_FOUND)
if (FFTW3_FIND_REQUIRED)
message(FATAL_ERROR "FFTW3 not found. Please install libfftw3-dev")
endif (FFTW3_FIND_REQUIRED)
endif (FFTW3_FOUND)
mark_as_advanced(FFTW3_LIBRARIES)
endif (FFTW3_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindSVBONY.cmake 0000644 0001751 0001751 00000002740 14347562502 021475 0 ustar debian debian # - Try to find SVBONY Library
# Once done this will define
#
# SVBONY_FOUND - system has SVBONY CCD
# SVBONY_INCLUDE_DIR - the SVBONY CCD include directory
# SVBONY_LIBRARIES - Link these to use SVBONY CCD
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (SVBONY_INCLUDE_DIR AND SVBONY_LIBRARIES)
# in cache already
set(SVBONY_FOUND TRUE)
message(STATUS "Found libsvbony: ${SVBONY_LIBRARIES}")
else (SVBONY_INCLUDE_DIR AND SVBONY_LIBRARIES)
# find headers
find_path(SVBONY_INCLUDE_DIR NAMES SVBCameraSDK.h
PATH_SUFFIXES libsvbony
${_obIncDir}
${GNUWIN32_DIR}/include
)
# find libraries
find_library(SVBONY_LIBRARIES NAMES SVBCameraSDK
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(SVBONY_INCLUDE_DIR AND SVBONY_LIBRARIES)
set(SVBONY_FOUND TRUE)
else (SVBONY_INCLUDE_DIR AND SVBONY_LIBRARIES)
set(SVBONY_FOUND FALSE)
endif(SVBONY_INCLUDE_DIR AND SVBONY_LIBRARIES)
if (SVBONY_FOUND)
if (NOT SVBONY_FIND_QUIETLY)
message(STATUS "Found SVBONY libraries : ${SVBONY_LIBRARIES}")
endif (NOT SVBONY_FIND_QUIETLY)
else (SVBONY_FOUND)
if (SVBONY_FIND_REQUIRED)
message(FATAL_ERROR "SVBONY libraries not found. Please install libsvbony http://www.indilib.org")
endif (SVBONY_FIND_REQUIRED)
endif (SVBONY_FOUND)
mark_as_advanced(SVBONY_INCLUDE_DIR SVBONY_LIBRARIES)
endif (SVBONY_INCLUDE_DIR AND SVBONY_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindMALLINCAM.cmake 0000644 0001751 0001751 00000003013 14174600255 021740 0 ustar debian debian # - Try to find MALLINCAM Camera Library
# Once done this will define
#
# MALLINCAM_FOUND - system has Levenhuk
# MALLINCAM_INCLUDE_DIR - the Levenhuk include directory
# MALLINCAM_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 (MALLINCAM_INCLUDE_DIR AND MALLINCAM_LIBRARIES)
# in cache already
set(MALLINCAM_FOUND TRUE)
message(STATUS "Found libnncam: ${MALLINCAM_LIBRARIES}")
else (MALLINCAM_INCLUDE_DIR AND MALLINCAM_LIBRARIES)
find_path(MALLINCAM_INCLUDE_DIR mallincam.h
PATH_SUFFIXES libmallincam
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(MALLINCAM_LIBRARIES NAMES mallincam
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(MALLINCAM_INCLUDE_DIR AND MALLINCAM_LIBRARIES)
set(MALLINCAM_FOUND TRUE)
else (MALLINCAM_INCLUDE_DIR AND MALLINCAM_LIBRARIES)
set(MALLINCAM_FOUND FALSE)
endif(MALLINCAM_INCLUDE_DIR AND MALLINCAM_LIBRARIES)
if (MALLINCAM_FOUND)
if (NOT MALLINCAM_FIND_QUIETLY)
message(STATUS "Found MALLINCAM: ${MALLINCAM_LIBRARIES}")
endif (NOT MALLINCAM_FIND_QUIETLY)
else (MALLINCAM_FOUND)
if (MALLINCAM_FIND_REQUIRED)
message(FATAL_ERROR "MALLINCAM not found. Please install MALLINCAM Library http://www.indilib.org")
endif (MALLINCAM_FIND_REQUIRED)
endif (MALLINCAM_FOUND)
mark_as_advanced(MALLINCAM_INCLUDE_DIR MALLINCAM_LIBRARIES)
endif (MALLINCAM_INCLUDE_DIR AND MALLINCAM_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindNova.cmake 0000644 0001751 0001751 00000003046 14174600255 021354 0 ustar debian debian # - Try to find NOVA
# Once done this will define
#
# NOVA_FOUND - system has NOVA
# NOVA_INCLUDE_DIR - the NOVA include directory
# NOVA_LIBRARIES - Link these to use NOVA
# Copyright (c) 2006, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES)
# in cache already
set(NOVA_FOUND TRUE)
message(STATUS "Found libnova: ${NOVA_LIBRARIES}")
else (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES)
find_path(NOVA_INCLUDE_DIR libnova.h
PATH_SUFFIXES libnova
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(NOVA_LIBRARIES NAMES nova libnova libnovad
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
set(CMAKE_REQUIRED_INCLUDES ${NOVA_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${NOVA_LIBRARIES})
if(NOVA_INCLUDE_DIR AND NOVA_LIBRARIES)
set(NOVA_FOUND TRUE)
else (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES)
set(NOVA_FOUND FALSE)
endif(NOVA_INCLUDE_DIR AND NOVA_LIBRARIES)
if (NOVA_FOUND)
if (NOT Nova_FIND_QUIETLY)
message(STATUS "Found NOVA: ${NOVA_LIBRARIES}")
endif (NOT Nova_FIND_QUIETLY)
else (NOVA_FOUND)
if (Nova_FIND_REQUIRED)
message(FATAL_ERROR "libnova not found. Please install libnova development package.")
endif (Nova_FIND_REQUIRED)
endif (NOVA_FOUND)
mark_as_advanced(NOVA_INCLUDE_DIR NOVA_LIBRARIES)
endif (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindVorbis.cmake 0000644 0001751 0001751 00000002044 14174600255 021712 0 ustar debian debian # - Find vorbis
# Find the native vorbis includes and libraries
#
# VORBIS_INCLUDE_DIR - where to find vorbis.h, etc.
# VORBIS_LIBRARIES - List of libraries when using vorbis(file).
# VORBIS_FOUND - True if vorbis found.
if(VORBIS_INCLUDE_DIR)
# Already in cache, be silent
set(VORBIS_FIND_QUIETLY TRUE)
endif(VORBIS_INCLUDE_DIR)
find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
find_library(OGG_LIBRARY NAMES ogg)
find_library(VORBIS_LIBRARY NAMES vorbis)
find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VORBIS DEFAULT_MSG
VORBIS_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBIS_LIBRARY)
if(VORBIS_FOUND)
set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
else(VORBIS_FOUND)
set(VORBIS_LIBRARIES)
endif(VORBIS_FOUND)
mark_as_advanced(VORBIS_INCLUDE_DIR)
mark_as_advanced(OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
indi-sbig-2.1+20221220234924/cmake_modules/FindJPEG.cmake 0000644 0001751 0001751 00000001663 14174600255 021201 0 ustar debian debian # - Find JPEG
# Find the native JPEG includes and library
# This module defines
# JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
# JPEG_LIBRARIES, the libraries needed to use JPEG.
# JPEG_FOUND, If false, do not try to use JPEG.
# also defined, but not for general use are
# JPEG_LIBRARY, where to find the JPEG library.
FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)
SET(JPEG_NAMES ${JPEG_NAMES} jpeg)
FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
IF(JPEG_FOUND)
SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
ENDIF(JPEG_FOUND)
# Deprecated declarations.
SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )
indi-sbig-2.1+20221220234924/cmake_modules/FindCFITSIO.cmake 0000644 0001751 0001751 00000004346 14174600255 021555 0 ustar debian debian # - Try to find CFITSIO
# Once done this will define
#
# CFITSIO_FOUND - system has CFITSIO
# CFITSIO_INCLUDE_DIR - the CFITSIO include directory
# CFITSIO_LIBRARIES - Link these to use CFITSIO
# CFITSIO_VERSION_STRING - Human readable version number of cfitsio
# CFITSIO_VERSION_MAJOR - Major version number of cfitsio
# CFITSIO_VERSION_MINOR - Minor version number of cfitsio
# Copyright (c) 2006, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
# in cache already
set(CFITSIO_FOUND TRUE)
message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}")
else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
# JM: Packages from different distributions have different suffixes
find_path(CFITSIO_INCLUDE_DIR fitsio.h
PATH_SUFFIXES libcfitsio3 libcfitsio0 cfitsio
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(CFITSIO_LIBRARIES NAMES cfitsio
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
set(CFITSIO_FOUND TRUE)
else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
set(CFITSIO_FOUND FALSE)
endif(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
if (CFITSIO_FOUND)
# Find the version of the cfitsio header
file(STRINGS ${CFITSIO_INCLUDE_DIR}/fitsio.h CFITSIO_VERSION_STRING LIMIT_COUNT 1 REGEX "CFITSIO_VERSION")
STRING(REGEX REPLACE "[^0-9.]" "" CFITSIO_VERSION_STRING ${CFITSIO_VERSION_STRING})
STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)" "\\1" CFITSIO_VERSION_MAJOR ${CFITSIO_VERSION_STRING})
STRING(REGEX REPLACE "^([0-9]+)[.]([0-9]+)" "\\2" CFITSIO_VERSION_MINOR ${CFITSIO_VERSION_STRING})
if (NOT CFITSIO_FIND_QUIETLY)
message(STATUS "Found CFITSIO ${CFITSIO_VERSION_STRING}: ${CFITSIO_LIBRARIES}")
endif (NOT CFITSIO_FIND_QUIETLY)
else (CFITSIO_FOUND)
if (CFITSIO_FIND_REQUIRED)
message(STATUS "CFITSIO not found.")
endif (CFITSIO_FIND_REQUIRED)
endif (CFITSIO_FOUND)
mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARIES)
endif (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindUSB1.cmake 0000644 0001751 0001751 00000005623 14174600255 021166 0 ustar debian debian # - Try to find libusb-1.0
# Once done this will define
#
# USB1_FOUND - system has libusb-1.0
# USB1_INCLUDE_DIRS - the libusb-1.0 include directories
# USB1_LIBRARIES - Link these to use libusb-1.0
# USB1_DEFINITIONS - Compiler switches required for using libusb-1.0
#
# USB1_HAS_LIBUSB_ERROR_NAME - defined when libusb-1.0 has libusb_error_name()
#=============================================================================
# Copyright (c) 2017 Pino Toscano
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
find_package(PkgConfig)
pkg_check_modules(PC_LIBUSB1 QUIET libusb-1.0)
find_path(USB1_INCLUDE_DIR
NAMES
libusb.h
HINTS
${PC_LIBUSB1_INCLUDE_DIRS}
PATH_SUFFIXES
libusb-1.0
)
find_library(USB1_LIBRARY
NAMES
${PC_LIBUSB1_LIBRARIES}
usb-1.0
HINTS
${PC_LIBUSB1_LIBRARY_DIRS}
)
set(USB1_INCLUDE_DIRS ${USB1_INCLUDE_DIR})
set(USB1_LIBRARIES ${USB1_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(USB1
FOUND_VAR
USB1_FOUND
REQUIRED_VARS
USB1_LIBRARY
USB1_INCLUDE_DIR
VERSION_VAR
PC_LIBUSB1_VERSION
)
mark_as_advanced(USB1_INCLUDE_DIRS USB1_LIBRARIES)
if(USB1_FOUND)
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES ${USB1_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${USB1_LIBRARIES})
check_cxx_source_compiles("#include
int main() { libusb_error_name(0); return 0; }" USB1_HAS_LIBUSB_ERROR_NAME)
cmake_pop_check_state()
endif()
indi-sbig-2.1+20221220234924/cmake_modules/FindGMock.cmake 0000644 0001751 0001751 00000011623 14174600255 021451 0 ustar debian debian #.rst:
# FindGMock
# ---------
#
# Locate the Google C++ Mocking Framework.
#
# Defines the following variables:
#
# ::
#
# GMOCK_FOUND - Found the Google Mocking framework
# GMOCK_INCLUDE_DIRS - Include directories
#
#
#
# Also defines the library variables below as normal variables. These
# contain debug/optimized keywords when a debugging library is found.
#
# ::
#
# GMOCK_LIBRARIES - libgmock
#
#
#
# Accepts the following variables as input:
#
# ::
#
# GMOCK_ROOT - (as a CMake or environment variable)
# The root directory of the gmock install prefix
#
#
#
# ::
#
# GMOCK_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
# "MD" or "MT" to enable searching a GMock build tree
# (defaults: "MD")
#
#
#
# Example Usage:
#
# ::
#
# find_package(GMock REQUIRED)
# include_directories(${GMOCK_INCLUDE_DIRS})
#
#
#
# ::
#
# add_executable(foo foo.cc)
# target_link_libraries(foo ${GMOCK_LIBRARIES})
#
#
#
# ::
#
# add_test(AllMocksInFoo foo)
#
#
#
#
#
# If you would like each Google test to show up in CMock as a test you
# may use the following macro. NOTE: It will slow down your tests by
# running an executable for each test and test fixture. You will also
# have to rerun CMake after adding or removing tests or test fixtures.
#
# GMOCK_ADD_MOCKS(executable extra_args ARGN)
#
# ::
#
# executable = The path to the test executable
# extra_args = Pass a list of extra arguments to be passed to
# executable enclosed in quotes (or "" for none)
# ARGN = A list of source files to search for tests & test
# fixtures.
#
#
#
# ::
#
# Example:
# set(FooMockArgs --foo 1 --bar 2)
# add_executable(FooMock FooUnitMock.cc)
# GMOCK_ADD_MOCKS(FooMock "${FooMockArgs}" FooUnitMock.cc)
#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009 Philip Lowman
# Copyright 2009 Daniel Blezek
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#
# Thanks to Daniel Blezek for the GMOCK_ADD_MOCKS code
function(GMOCK_ADD_MOCKS executable extra_args)
if(NOT ARGN)
message(FATAL_ERROR "Missing ARGN: Read the documentation for GMOCK_ADD_MOCKS")
endif()
foreach(source ${ARGN})
file(READ "${source}" contents)
string(REGEX MATCHALL "MOCK_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
foreach(hit ${found_tests})
string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit})
add_test(${test_name} ${executable} --gmock_filter=${test_name} ${extra_args})
endforeach()
endforeach()
endfunction()
function(_gmock_append_debugs _endvar _library)
if(${_library} AND ${_library}_DEBUG)
set(_output optimized ${${_library}} debug ${${_library}_DEBUG})
else()
set(_output ${${_library}})
endif()
set(${_endvar} ${_output} PARENT_SCOPE)
endfunction()
function(_gmock_find_library _name)
find_library(${_name}
NAMES ${ARGN}
HINTS
ENV GMOCK_ROOT
${GMOCK_ROOT}
PATH_SUFFIXES ${_gmock_libpath_suffixes}
)
mark_as_advanced(${_name})
endfunction()
#
if(NOT DEFINED GMOCK_MSVC_SEARCH)
set(GMOCK_MSVC_SEARCH MD)
endif()
set(_gmock_libpath_suffixes lib)
if(MSVC)
if(GMOCK_MSVC_SEARCH STREQUAL "MD")
list(APPEND _gmock_libpath_suffixes
msvc/gmock-md/Debug
msvc/gmock-md/Release)
elseif(GMOCK_MSVC_SEARCH STREQUAL "MT")
list(APPEND _gmock_libpath_suffixes
msvc/gmock/Debug
msvc/gmock/Release)
endif()
endif()
find_path(GMOCK_INCLUDE_DIR gmock/gmock.h
HINTS
$ENV{GMOCK_ROOT}/include
${GMOCK_ROOT}/include
)
mark_as_advanced(GMOCK_INCLUDE_DIR)
if(MSVC AND GMOCK_MSVC_SEARCH STREQUAL "MD")
# The provided /MD project files for Google Mock add -md suffixes to the
# library names.
_gmock_find_library(GMOCK_LIBRARY gmock-md gmock)
_gmock_find_library(GMOCK_LIBRARY_DEBUG gmock-mdd gmockd)
else()
_gmock_find_library(GMOCK_LIBRARY gmock)
_gmock_find_library(GMOCK_LIBRARY_DEBUG gmockd)
endif()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMock DEFAULT_MSG GMOCK_LIBRARY GMOCK_INCLUDE_DIR)
if(GMOCK_FOUND)
set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR})
_gmock_append_debugs(GMOCK_LIBRARIES GMOCK_LIBRARY)
endif()
indi-sbig-2.1+20221220234924/cmake_modules/FindPackageMessage.cmake 0000644 0001751 0001751 00000003755 14174600255 023320 0 ustar debian debian #.rst:
# FindPackageMessage
# ------------------
#
#
#
# FIND_PACKAGE_MESSAGE( "message for user" "find result details")
#
# This macro is intended to be used in FindXXX.cmake modules files. It
# will print a message once for each unique find result. This is useful
# for telling the user where a package was found. The first argument
# specifies the name (XXX) of the package. The second argument
# specifies the message to display. The third argument lists details
# about the find result so that if they change the message will be
# displayed again. The macro also obeys the QUIET argument to the
# find_package command.
#
# Example:
#
# ::
#
# if(X11_FOUND)
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
# else()
# ...
# endif()
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(FIND_PACKAGE_MESSAGE pkg msg details)
# Avoid printing a message repeatedly for the same find result.
if(NOT ${pkg}_FIND_QUIETLY)
string(REPLACE "\n" "" details "${details}")
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
# message again.
set("${DETAILS_VAR}" "${details}"
CACHE INTERNAL "Details about finding ${pkg}")
endif()
endif()
endfunction()
indi-sbig-2.1+20221220234924/cmake_modules/FindFTDI.cmake 0000644 0001751 0001751 00000002671 14174600255 021202 0 ustar debian debian # - Try to find FTDI
# This finds libFTDI that is compatible with old libusb v 0.1
# For newer libusb > 1.0, use FindFTDI1.cmake
# Once done this will define
#
# FTDI_FOUND - system has FTDI
# FTDI_INCLUDE_DIR - the FTDI include directory
# FTDI_LIBRARIES - Link these to use FTDI
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (FTDI_INCLUDE_DIR AND FTDI_LIBRARIES)
# in cache already
set(FTDI_FOUND TRUE)
message(STATUS "Found libftdi: ${FTDI_LIBRARIES}")
else (FTDI_INCLUDE_DIR AND FTDI_LIBRARIES)
find_path(FTDI_INCLUDE_DIR ftdi.h
PATH_SUFFIXES libftdi1
${_obIncDir}
${GNUWIN32_DIR}/include
/usr/local/include
)
find_library(FTDI_LIBRARIES NAMES ftdi ftdi1
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
/usr/local/lib
)
if(FTDI_INCLUDE_DIR AND FTDI_LIBRARIES)
set(FTDI_FOUND TRUE)
else (FTDI_INCLUDE_DIR AND FTDI_LIBRARIES)
set(FTDI_FOUND FALSE)
endif(FTDI_INCLUDE_DIR AND FTDI_LIBRARIES)
if (FTDI_FOUND)
if (NOT FTDI_FIND_QUIETLY)
message(STATUS "Found FTDI: ${FTDI_LIBRARIES}")
endif (NOT FTDI_FIND_QUIETLY)
else (FTDI_FOUND)
if (FTDI_FIND_REQUIRED)
message(FATAL_ERROR "FTDI not found. Please install libftdi-dev")
endif (FTDI_FIND_REQUIRED)
endif (FTDI_FOUND)
mark_as_advanced(FTDI_INCLUDE_DIR FTDI_LIBRARIES)
endif (FTDI_INCLUDE_DIR AND FTDI_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindMODBUS.cmake 0000644 0001751 0001751 00000003201 14174600255 021433 0 ustar debian debian # - Try to find libmodbus
# Once done this will define
#
# MODBUS_FOUND - system has MODBUS
# MODBUS_INCLUDE_DIR - the MODBUS include directory
# MODBUS_LIBRARIES - Link these to use MODBUS
# Copyright (c) 2006, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (MODBUS_INCLUDE_DIR AND MODBUS_LIBRARIES)
# in cache already
set(MODBUS_FOUND TRUE)
message(STATUS "Found libmodbus: ${MODBUS_LIBRARIES}")
else (MODBUS_INCLUDE_DIR AND MODBUS_LIBRARIES)
find_path(MODBUS_INCLUDE_DIR modbus.h
PATH_SUFFIXES modbus
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(MODBUS_LIBRARIES NAMES modbus
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
set(CMAKE_REQUIRED_INCLUDES ${MODBUS_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${MODBUS_LIBRARIES})
if(MODBUS_INCLUDE_DIR AND MODBUS_LIBRARIES)
set(MODBUS_FOUND TRUE)
else (MODBUS_INCLUDE_DIR AND MODBUS_LIBRARIES)
set(MODBUS_FOUND FALSE)
endif(MODBUS_INCLUDE_DIR AND MODBUS_LIBRARIES)
if (MODBUS_FOUND)
if (NOT MODBUS_FIND_QUIETLY)
message(STATUS "Found libmodbus: ${MODBUS_LIBRARIES}")
endif (NOT MODBUS_FIND_QUIETLY)
else (MODBUS_FOUND)
if (MODBUS_FIND_REQUIRED)
message(FATAL_ERROR "libmodbus not found. Please install libmodbus-devel. https://launchpad.net/libmodbus/")
endif (MODBUS_FIND_REQUIRED)
endif (MODBUS_FOUND)
mark_as_advanced(MODBUS_INCLUDE_DIR MODBUS_LIBRARIES)
endif (MODBUS_INCLUDE_DIR AND MODBUS_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindSTARSHOOTG.cmake 0000644 0001751 0001751 00000003070 14174600255 022143 0 ustar debian debian # - Try to find Starshoot Camera Library
# Once done this will define
#
# STARSHOOTG_FOUND - system has Starshoot
# STARSHOOTG_INCLUDE_DIR - the Starshoot include directory
# STARSHOOTG_LIBRARIES - Link these to use Starshoot
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (STARSHOOTG_INCLUDE_DIR AND STARSHOOTG_LIBRARIES)
# in cache already
set(STARSHOOTG_FOUND TRUE)
message(STATUS "Found libstarshootg: ${STARSHOOTG_LIBRARIES}")
else (STARSHOOTG_INCLUDE_DIR AND STARSHOOTG_LIBRARIES)
find_path(STARSHOOTG_INCLUDE_DIR starshootg.h
PATH_SUFFIXES libstarshootg
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(STARSHOOTG_LIBRARIES NAMES starshootg
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(STARSHOOTG_INCLUDE_DIR AND STARSHOOTG_LIBRARIES)
set(STARSHOOTG_FOUND TRUE)
else (STARSHOOTG_INCLUDE_DIR AND STARSHOOTG_LIBRARIES)
set(STARSHOOTG_FOUND FALSE)
endif(STARSHOOTG_INCLUDE_DIR AND STARSHOOTG_LIBRARIES)
if (STARSHOOTG_FOUND)
if (NOT STARSHOOTG_FIND_QUIETLY)
message(STATUS "Found StarshootG: ${STARSHOOTG_LIBRARIES}")
endif (NOT STARSHOOTG_FIND_QUIETLY)
else (STARSHOOTG_FOUND)
if (STARSHOOTG_FIND_REQUIRED)
message(FATAL_ERROR "StarshootG not found. Please install StarshootG Library http://www.indilib.org")
endif (STARSHOOTG_FIND_REQUIRED)
endif (STARSHOOTG_FOUND)
mark_as_advanced(STARSHOOTG_INCLUDE_DIR STARSHOOTG_LIBRARIES)
endif (STARSHOOTG_INCLUDE_DIR AND STARSHOOTG_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/InstallImported.cmake 0000644 0001751 0001751 00000006611 14174600255 022763 0 ustar debian debian
function (install_imported)
cmake_parse_arguments (ARG "" "DESTINATION" "TARGETS" ${ARGN})
if (NOT DEFINED ARG_DESTINATION)
message (FATAL_ERROR "DESTINATION not defined")
endif ()
foreach (target ${ARG_TARGETS})
get_target_property (location ${target} LOCATION)
get_target_property (version ${target} VERSION)
get_target_property (soversion ${target} SOVERSION)
get_target_property (output_name ${target} OUTPUT_NAME)
get_target_property (suffix ${target} SUFFIX)
get_target_property (type ${target} TYPE)
if (NOT ${type} STREQUAL "SHARED_LIBRARY")
message (FATAL_ERROR "install_imported: ${type} not supported")
endif ()
if (${location} STREQUAL "${target}-NOTFOUND")
return ()
endif ()
if (NOT ${version} STREQUAL "version-NOTFOUND")
set (version ".${version}")
else ()
set (version "")
endif ()
if (NOT ${soversion} STREQUAL "soversion-NOTFOUND")
set (soversion ".${soversion}")
else ()
set (soversion "")
endif ()
if (${output_name} STREQUAL "output_name-NOTFOUND")
set (output_name ${target})
endif ()
set (name_noversion "${CMAKE_SHARED_LIBRARY_PREFIX}${output_name}${CMAKE_SHARED_LIBRARY_SUFFIX}")
if (APPLE)
set (name_version "${CMAKE_SHARED_LIBRARY_PREFIX}${output_name}${version}${CMAKE_SHARED_LIBRARY_SUFFIX}")
set (name_soversion "${CMAKE_SHARED_LIBRARY_PREFIX}${output_name}${soversion}${CMAKE_SHARED_LIBRARY_SUFFIX}")
else ()
set (name_version "${CMAKE_SHARED_LIBRARY_PREFIX}${output_name}${CMAKE_SHARED_LIBRARY_SUFFIX}${version}")
set (name_soversion "${CMAKE_SHARED_LIBRARY_PREFIX}${output_name}${CMAKE_SHARED_LIBRARY_SUFFIX}${soversion}")
endif ()
if (NOT IS_ABSOLUTE ${location})
set (location ${CMAKE_CURRENT_SOURCE_DIR}/${location})
endif ()
if (NOT ${name_noversion} STREQUAL ${name_soversion})
add_custom_command (
OUTPUT ${name_noversion}
COMMAND ${CMAKE_COMMAND} -E create_symlink ${name_soversion} ${name_noversion} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${name_soversion}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${name_noversion} DESTINATION ${ARG_DESTINATION})
endif ()
if (NOT ${name_soversion} STREQUAL ${name_version})
add_custom_command (
OUTPUT ${name_soversion}
COMMAND ${CMAKE_COMMAND} -E create_symlink ${name_version} ${name_soversion} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${name_version}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${name_soversion} DESTINATION ${ARG_DESTINATION})
endif ()
add_custom_command (
OUTPUT ${name_version}
COMMAND ${CMAKE_COMMAND} -E copy "${location}" "${CMAKE_CURRENT_BINARY_DIR}/${name_version}"
MAIN_DEPENDENCY ${location}
)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${name_version} DESTINATION ${ARG_DESTINATION})
add_custom_target(
imported_${output_name} ALL
DEPENDS ${name_version} ${name_noversion} ${name_soversion}
)
endforeach ()
endfunction ()
indi-sbig-2.1+20221220234924/cmake_modules/FindAHPXC.cmake 0000644 0001751 0001751 00000002732 14174600255 021315 0 ustar debian debian # - Try to find AHPXC Universal Library
# Once done this will define
#
# AHPXC_FOUND - system has AHPXC
# AHPXC_INCLUDE_DIR - the AHPXC include directory
# AHPXC_LIBRARIES - Link these to use AHPXC
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (AHPXC_INCLUDE_DIR AND AHPXC_LIBRARIES)
# in cache already
set(AHPXC_FOUND TRUE)
message(STATUS "Found libahp_xc: ${AHPXC_LIBRARIES}")
else (AHPXC_INCLUDE_DIR AND AHPXC_LIBRARIES)
find_path(AHPXC_INCLUDE_DIR ahp_xc.h
PATH_SUFFIXES ahp
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(AHPXC_LIBRARIES NAMES ahp_xc
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(AHPXC_INCLUDE_DIR AND AHPXC_LIBRARIES)
set(AHPXC_FOUND TRUE)
else (AHPXC_INCLUDE_DIR AND AHPXC_LIBRARIES)
set(AHPXC_FOUND FALSE)
endif(AHPXC_INCLUDE_DIR AND AHPXC_LIBRARIES)
if (AHPXC_FOUND)
if (NOT AHPXC_FIND_QUIETLY)
message(STATUS "Found AHP XC: ${AHPXC_LIBRARIES}")
endif (NOT AHPXC_FIND_QUIETLY)
else (AHPXC_FOUND)
if (AHPXC_FIND_REQUIRED)
message(FATAL_ERROR "AHP XC not found. Please install libahp_xc http://www.indilib.org")
endif (AHPXC_FIND_REQUIRED)
endif (AHPXC_FOUND)
mark_as_advanced(AHPXC_INCLUDE_DIR AHPXC_LIBRARIES)
endif (AHPXC_INCLUDE_DIR AND AHPXC_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindFLI.cmake 0000644 0001751 0001751 00000002645 14174600255 021067 0 ustar debian debian # - Try to find Finger Lakes Instruments Library
# Once done this will define
#
# FLI_FOUND - system has FLI
# FLI_INCLUDE_DIR - the FLI include directory
# FLI_LIBRARIES - Link these to use FLI
# Copyright (c) 2008, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (FLI_INCLUDE_DIR AND FLI_LIBRARIES)
# in cache already
set(FLI_FOUND TRUE)
message(STATUS "Found libfli: ${FLI_LIBRARIES}")
else (FLI_INCLUDE_DIR AND FLI_LIBRARIES)
find_path(FLI_INCLUDE_DIR libfli.h
PATH_SUFFIXES fli
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(FLI_LIBRARIES NAMES fli
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(FLI_INCLUDE_DIR AND FLI_LIBRARIES)
set(FLI_FOUND TRUE)
else (FLI_INCLUDE_DIR AND FLI_LIBRARIES)
set(FLI_FOUND FALSE)
endif(FLI_INCLUDE_DIR AND FLI_LIBRARIES)
if (FLI_FOUND)
if (NOT FLI_FIND_QUIETLY)
message(STATUS "Found FLI: ${FLI_LIBRARIES}")
endif (NOT FLI_FIND_QUIETLY)
else (FLI_FOUND)
if (FLI_FIND_REQUIRED)
message(FATAL_ERROR "FLI not found. Please install libfli-dev. http://www.indilib.org")
endif (FLI_FIND_REQUIRED)
endif (FLI_FOUND)
mark_as_advanced(FLI_INCLUDE_DIR FLI_LIBRARIES)
endif (FLI_INCLUDE_DIR AND FLI_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindASI.cmake 0000644 0001751 0001751 00000003565 14174600255 021073 0 ustar debian debian # - Try to find ASI Library
# Once done this will define
#
# ASI_FOUND - system has ASI
# ASI_INCLUDE_DIR - the ASI include directory
# ASI_LIBRARIES - Link these to use ASI
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (ASI_INCLUDE_DIR AND ASI_LIBRARIES)
# in cache already
set(ASI_FOUND TRUE)
message(STATUS "Found libasi: ${ASI_LIBRARIES}")
else (ASI_INCLUDE_DIR AND ASI_LIBRARIES)
find_path(ASI_INCLUDE_DIR ASICamera2.h
PATH_SUFFIXES libasi
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(ASICAM_LIBRARIES NAMES ASICamera2
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(ASIEFW_LIBRARIES NAMES EFWFilter
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(ASIST4_LIBRARIES NAMES USB2ST4Conv
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(ASIEAF_LIBRARIES NAMES EAFFocuser
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if (ASICAM_LIBRARIES AND ASIEFW_LIBRARIES AND ASIST4_LIBRARIES AND ASIEAF_LIBRARIES)
set(ASI_LIBRARIES ${ASICAM_LIBRARIES} ${ASIEFW_LIBRARIES} ${ASIST4_LIBRARIES} ${ASIEAF_LIBRARIES})
endif (ASICAM_LIBRARIES AND ASIEFW_LIBRARIES AND ASIST4_LIBRARIES AND ASIEAF_LIBRARIES)
if(ASI_INCLUDE_DIR AND ASI_LIBRARIES)
set(ASI_FOUND TRUE)
else (ASI_INCLUDE_DIR AND ASI_LIBRARIES)
set(ASI_FOUND FALSE)
endif(ASI_INCLUDE_DIR AND ASI_LIBRARIES)
if (ASI_FOUND)
if (NOT ASI_FIND_QUIETLY)
message(STATUS "Found ASI: ${ASI_LIBRARIES}")
endif (NOT ASI_FIND_QUIETLY)
else (ASI_FOUND)
if (ASI_FIND_REQUIRED)
message(FATAL_ERROR "ASI not found. Please install libasi http://www.indilib.org")
endif (ASI_FIND_REQUIRED)
endif (ASI_FOUND)
mark_as_advanced(ASI_INCLUDE_DIR ASI_LIBRARIES)
endif (ASI_INCLUDE_DIR AND ASI_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindINDI.cmake 0000644 0001751 0001751 00000034574 14174600255 021206 0 ustar debian debian # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This module can find INDI Library
#
# Requirements:
# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
#
# The following variables will be defined for your use:
# - INDI_FOUND : were all of your specified components found (include dependencies)?
# - INDI_WEBSOCKET : was INDI compiled with websocket support?
# - INDI_INCLUDE_DIR : INDI include directory
# - INDI_DATA_DIR : INDI include directory
# - INDI_LIBRARIES : INDI libraries
# - INDI_DRIVER_LIBRARIES : Same as above maintained for backward compatibility
# - INDI_VERSION : complete version of INDI (x.y.z)
# - INDI_MAJOR_VERSION : major version of INDI
# - INDI_MINOR_VERSION : minor version of INDI
# - INDI_RELEASE_VERSION : release version of INDI
# - INDI__FOUND : were found? (FALSE for non specified component if it is not a dependency)
#
# For windows or non standard installation, define INDI_ROOT variable to point to the root installation of INDI. Two ways:
# - run cmake with -DINDI_ROOT=
# - define an environment variable with the same name before running cmake
# With cmake-gui, before pressing "Configure":
# 1) Press "Add Entry" button
# 2) Add a new entry defined as:
# - Name: INDI_ROOT
# - Type: choose PATH in the selection list
# - Press "..." button and select the root installation of INDI
#
# Example Usage:
#
# 1. Copy this file in the root of your project source directory
# 2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
# set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
# 3. Finally call find_package() once, here are some examples to pick from
#
# Require INDI 1.4 or later
# find_package(INDI 1.4 REQUIRED)
#
# if(INDI_FOUND)
# include_directories(${INDI_INCLUDE_DIR})
# add_executable(myapp myapp.cpp)
# target_link_libraries(myapp ${INDI_LIBRARIES})
# endif(INDI_FOUND)
#
#
# Using Components:
#
# You can search for specific components. Currently, the following components are available
# * driver: to build INDI hardware drivers.
# * align: to build drivers that use INDI Alignment Subsystem.
# * client: to build pure C++ INDI clients.
# * clientqt5: to build Qt5-based INDI clients.
# * lx200: To build LX200-based 3rd party drivers (you must link with driver above as well).
#
# By default, if you do not specify any components, driver and align components are searched.
#
# Example:
#
# To use INDI Qt5 Client library only in your application:
#
# find_package(INDI COMPONENTS clientqt5 REQUIRED)
#
# if(INDI_FOUND)
# include_directories(${INDI_INCLUDE_DIR})
# add_executable(myapp myapp.cpp)
# target_link_libraries(myapp ${INDI_LIBRARIES})
# endif(INDI_FOUND)
#
# To use INDI driver + lx200 component in your application:
#
# find_package(INDI COMPONENTS driver lx200 REQUIRED)
#
# if(INDI_FOUND)
# include_directories(${INDI_INCLUDE_DIR})
# add_executable(myapp myapp.cpp)
# target_link_libraries(myapp ${INDI_LIBRARIES})
# endif(INDI_FOUND)
#
# Notice we still use ${INDI_LIBRARIES} which now should contain both driver & lx200 libraries.
#==============================================================================================
# Copyright (c) 2011-2013, julp
# Copyright (c) 2017-2019 Jasem Mutlaq
#
# Distributed under the OSI-approved BSD License
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTINDILAR PURPOSE.
#=============================================================================
find_package(PkgConfig QUIET)
########## Private ##########
if(NOT DEFINED INDI_PUBLIC_VAR_NS)
set(INDI_PUBLIC_VAR_NS "INDI") # Prefix for all INDI relative public variables
endif(NOT DEFINED INDI_PUBLIC_VAR_NS)
if(NOT DEFINED INDI_PRIVATE_VAR_NS)
set(INDI_PRIVATE_VAR_NS "_${INDI_PUBLIC_VAR_NS}") # Prefix for all INDI relative internal variables
endif(NOT DEFINED INDI_PRIVATE_VAR_NS)
if(NOT DEFINED PC_INDI_PRIVATE_VAR_NS)
set(PC_INDI_PRIVATE_VAR_NS "_PC${INDI_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
endif(NOT DEFINED PC_INDI_PRIVATE_VAR_NS)
function(indidebug _VARNAME)
if(${INDI_PUBLIC_VAR_NS}_DEBUG)
if(DEFINED ${INDI_PUBLIC_VAR_NS}_${_VARNAME})
message("${INDI_PUBLIC_VAR_NS}_${_VARNAME} = ${${INDI_PUBLIC_VAR_NS}_${_VARNAME}}")
else(DEFINED ${INDI_PUBLIC_VAR_NS}_${_VARNAME})
message("${INDI_PUBLIC_VAR_NS}_${_VARNAME} = ")
endif(DEFINED ${INDI_PUBLIC_VAR_NS}_${_VARNAME})
endif(${INDI_PUBLIC_VAR_NS}_DEBUG)
endfunction(indidebug)
set(${INDI_PRIVATE_VAR_NS}_ROOT "")
if(DEFINED ENV{INDI_ROOT})
set(${INDI_PRIVATE_VAR_NS}_ROOT "$ENV{INDI_ROOT}")
endif(DEFINED ENV{INDI_ROOT})
if (DEFINED INDI_ROOT)
set(${INDI_PRIVATE_VAR_NS}_ROOT "${INDI_ROOT}")
endif(DEFINED INDI_ROOT)
set(${INDI_PRIVATE_VAR_NS}_BIN_SUFFIXES )
set(${INDI_PRIVATE_VAR_NS}_LIB_SUFFIXES )
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND ${INDI_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin64")
list(APPEND ${INDI_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib64")
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND ${INDI_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin")
list(APPEND ${INDI_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib")
set(${INDI_PRIVATE_VAR_NS}_COMPONENTS )
# ...
macro(INDI_declare_component _NAME)
list(APPEND ${INDI_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
set("${INDI_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
endmacro(INDI_declare_component)
INDI_declare_component(driver indidriver)
INDI_declare_component(align indiAlignmentDriver)
INDI_declare_component(client indiclient)
INDI_declare_component(clientqt5 indiclientqt5)
INDI_declare_component(lx200 indilx200)
########## Public ##########
set(${INDI_PUBLIC_VAR_NS}_FOUND TRUE)
set(${INDI_PUBLIC_VAR_NS}_LIBRARIES )
set(${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR )
foreach(${INDI_PRIVATE_VAR_NS}_COMPONENT ${${INDI_PRIVATE_VAR_NS}_COMPONENTS})
string(TOUPPER "${${INDI_PRIVATE_VAR_NS}_COMPONENT}" ${INDI_PRIVATE_VAR_NS}_UPPER_COMPONENT)
set("${INDI_PUBLIC_VAR_NS}_${${INDI_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the INDI_declare_component macro
endforeach(${INDI_PRIVATE_VAR_NS}_COMPONENT)
# Check components
if(NOT ${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS) # driver and posix client by default
set(${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS driver align)
else(NOT ${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS)
#list(APPEND ${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
list(REMOVE_DUPLICATES ${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS)
foreach(${INDI_PRIVATE_VAR_NS}_COMPONENT ${${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS})
if(NOT DEFINED ${INDI_PRIVATE_VAR_NS}_COMPONENTS_${${INDI_PRIVATE_VAR_NS}_COMPONENT})
message(FATAL_ERROR "Unknown INDI component: ${${INDI_PRIVATE_VAR_NS}_COMPONENT}")
endif(NOT DEFINED ${INDI_PRIVATE_VAR_NS}_COMPONENTS_${${INDI_PRIVATE_VAR_NS}_COMPONENT})
endforeach(${INDI_PRIVATE_VAR_NS}_COMPONENT)
endif(NOT ${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS)
# Includes
find_path(
${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR
indidevapi.h
PATH_SUFFIXES libindi include/libindi
${PC_INDI_INCLUDE_DIR}
${_obIncDir}
${GNUWIN32_DIR}/include
HINTS ${${INDI_PRIVATE_VAR_NS}_ROOT}
DOC "Include directory for INDI"
)
find_path(
WEBSOCKET_HEADER
indiwsserver.h
PATH_SUFFIXES libindi
${PC_INDI_INCLUDE_DIR}
${_obIncDir}
${GNUWIN32_DIR}/include
)
if (WEBSOCKET_HEADER)
SET(INDI_WEBSOCKET TRUE)
else()
SET(INDI_WEBSOCKET FALSE)
endif()
find_path(${INDI_PUBLIC_VAR_NS}_DATA_DIR
drivers.xml
PATH_SUFFIXES share/indi
DOC "Data directory for INDI"
)
if(${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR)
if(EXISTS "${${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR}/indiversion.h") # INDI >= 1.4
file(READ "${${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR}/indiversion.h" ${INDI_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
else()
message(FATAL_ERROR "INDI version header not found")
endif()
if(${INDI_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*INDI_VERSION ([0-9]+).([0-9]+).([0-9]+)")
set(${INDI_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
set(${INDI_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
set(${INDI_PUBLIC_VAR_NS}_RELEASE_VERSION "${CMAKE_MATCH_3}")
else()
message(FATAL_ERROR "failed to detect INDI version")
endif()
set(${INDI_PUBLIC_VAR_NS}_VERSION "${${INDI_PUBLIC_VAR_NS}_MAJOR_VERSION}.${${INDI_PUBLIC_VAR_NS}_MINOR_VERSION}.${${INDI_PUBLIC_VAR_NS}_RELEASE_VERSION}")
# Check libraries
foreach(${INDI_PRIVATE_VAR_NS}_COMPONENT ${${INDI_PUBLIC_VAR_NS}_FIND_COMPONENTS})
set(${INDI_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
set(${INDI_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
foreach(${INDI_PRIVATE_VAR_NS}_BASE_NAME ${${INDI_PRIVATE_VAR_NS}_COMPONENTS_${${INDI_PRIVATE_VAR_NS}_COMPONENT}})
list(APPEND ${INDI_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${INDI_PRIVATE_VAR_NS}_BASE_NAME}")
list(APPEND ${INDI_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${INDI_PRIVATE_VAR_NS}_BASE_NAME}d")
list(APPEND ${INDI_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${INDI_PRIVATE_VAR_NS}_BASE_NAME}${INDI_MAJOR_VERSION}${INDI_MINOR_VERSION}")
list(APPEND ${INDI_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${INDI_PRIVATE_VAR_NS}_BASE_NAME}${INDI_MAJOR_VERSION}${INDI_MINOR_VERSION}d")
endforeach(${INDI_PRIVATE_VAR_NS}_BASE_NAME)
find_library(
${INDI_PRIVATE_VAR_NS}_LIB_RELEASE_${${INDI_PRIVATE_VAR_NS}_COMPONENT}
NAMES ${${INDI_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
HINTS ${${INDI_PRIVATE_VAR_NS}_ROOT}
PATH_SUFFIXES ${_INDI_LIB_SUFFIXES}
DOC "Release libraries for INDI"
)
find_library(
${INDI_PRIVATE_VAR_NS}_LIB_DEBUG_${${INDI_PRIVATE_VAR_NS}_COMPONENT}
NAMES ${${INDI_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
HINTS ${${INDI_PRIVATE_VAR_NS}_ROOT}
PATH_SUFFIXES ${_INDI_LIB_SUFFIXES}
DOC "Debug libraries for INDI"
)
string(TOUPPER "${${INDI_PRIVATE_VAR_NS}_COMPONENT}" ${INDI_PRIVATE_VAR_NS}_UPPER_COMPONENT)
if(NOT ${INDI_PRIVATE_VAR_NS}_LIB_RELEASE_${${INDI_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${INDI_PRIVATE_VAR_NS}_LIB_DEBUG_${${INDI_PRIVATE_VAR_NS}_COMPONENT}) # both not found
set("${INDI_PUBLIC_VAR_NS}_${${INDI_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE)
set("${INDI_PUBLIC_VAR_NS}_FOUND" FALSE)
else(NOT ${INDI_PRIVATE_VAR_NS}_LIB_RELEASE_${${INDI_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${INDI_PRIVATE_VAR_NS}_LIB_DEBUG_${${INDI_PRIVATE_VAR_NS}_COMPONENT}) # one or both found
set("${INDI_PUBLIC_VAR_NS}_${${INDI_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
if(NOT ${INDI_PRIVATE_VAR_NS}_LIB_RELEASE_${${INDI_PRIVATE_VAR_NS}_COMPONENT}) # release not found => we are in debug
set(${INDI_PRIVATE_VAR_NS}_LIB_${${INDI_PRIVATE_VAR_NS}_COMPONENT} "${${INDI_PRIVATE_VAR_NS}_LIB_DEBUG_${${INDI_PRIVATE_VAR_NS}_COMPONENT}}")
elseif(NOT ${INDI_PRIVATE_VAR_NS}_LIB_DEBUG_${${INDI_PRIVATE_VAR_NS}_COMPONENT}) # debug not found => we are in release
set(${INDI_PRIVATE_VAR_NS}_LIB_${${INDI_PRIVATE_VAR_NS}_COMPONENT} "${${INDI_PRIVATE_VAR_NS}_LIB_RELEASE_${${INDI_PRIVATE_VAR_NS}_COMPONENT}}")
else() # both found
set(
${INDI_PRIVATE_VAR_NS}_LIB_${${INDI_PRIVATE_VAR_NS}_COMPONENT}
optimized ${${INDI_PRIVATE_VAR_NS}_LIB_RELEASE_${${INDI_PRIVATE_VAR_NS}_COMPONENT}}
debug ${${INDI_PRIVATE_VAR_NS}_LIB_DEBUG_${${INDI_PRIVATE_VAR_NS}_COMPONENT}}
)
endif()
list(APPEND ${INDI_PUBLIC_VAR_NS}_LIBRARIES ${${INDI_PRIVATE_VAR_NS}_LIB_${${INDI_PRIVATE_VAR_NS}_COMPONENT}})
endif(NOT ${INDI_PRIVATE_VAR_NS}_LIB_RELEASE_${${INDI_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${INDI_PRIVATE_VAR_NS}_LIB_DEBUG_${${INDI_PRIVATE_VAR_NS}_COMPONENT})
endforeach(${INDI_PRIVATE_VAR_NS}_COMPONENT)
# Check find_package arguments
include(FindPackageHandleStandardArgs)
if(${INDI_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${INDI_PUBLIC_VAR_NS}_FIND_QUIETLY)
find_package_handle_standard_args(
${INDI_PUBLIC_VAR_NS}
REQUIRED_VARS ${INDI_PUBLIC_VAR_NS}_LIBRARIES ${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR
VERSION_VAR ${INDI_PUBLIC_VAR_NS}_VERSION
)
else(${INDI_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${INDI_PUBLIC_VAR_NS}_FIND_QUIETLY)
find_package_handle_standard_args(${INDI_PUBLIC_VAR_NS} "INDI not found" ${INDI_PUBLIC_VAR_NS}_LIBRARIES ${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR)
endif(${INDI_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${INDI_PUBLIC_VAR_NS}_FIND_QUIETLY)
else(${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR)
set("${INDI_PUBLIC_VAR_NS}_FOUND" FALSE)
if(${INDI_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${INDI_PUBLIC_VAR_NS}_FIND_QUIETLY)
message(FATAL_ERROR "Could not find INDI include directory")
endif(${INDI_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${INDI_PUBLIC_VAR_NS}_FIND_QUIETLY)
endif(${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR)
mark_as_advanced(
${INDI_PUBLIC_VAR_NS}_INCLUDE_DIR
${INDI_PUBLIC_VAR_NS}_LIBRARIES
INDI_WEBSOCKET
)
# IN (args)
indidebug("FIND_COMPONENTS")
indidebug("FIND_REQUIRED")
indidebug("FIND_QUIETLY")
indidebug("FIND_VERSION")
# OUT
# Found
indidebug("FOUND")
indidebug("SERVER_FOUND")
indidebug("DRIVERS_FOUND")
indidebug("CLIENT_FOUND")
indidebug("QT5CLIENT_FOUND")
indidebug("LX200_FOUND")
# Linking
indidebug("INCLUDE_DIR")
indidebug("DATA_DIR")
indidebug("LIBRARIES")
# Backward compatibility
set(${INDI_PUBLIC_VAR_NS}_DRIVER_LIBRARIES ${${INDI_PUBLIC_VAR_NS}_LIBRARIES})
indidebug("DRIVER_LIBRARIES")
# Version
indidebug("MAJOR_VERSION")
indidebug("MINOR_VERSION")
indidebug("RELEASE_VERSION")
indidebug("VERSION")
indi-sbig-2.1+20221220234924/cmake_modules/CMakeCommon.cmake 0000644 0001751 0001751 00000013667 14174600255 022013 0 ustar debian debian
include(CheckCCompilerFlag)
#IF (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#ENDIF ()
# C++14 Support
if (NOT ANDROID)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif(NOT ANDROID)
# Position Independent Code
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Ccache support
IF (ANDROID OR UNIX OR APPLE)
FIND_PROGRAM(CCACHE_FOUND ccache)
SET(CCACHE_SUPPORT OFF CACHE BOOL "Enable ccache support")
IF ((CCACHE_FOUND OR ANDROID) AND CCACHE_SUPPORT MATCHES ON)
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
ENDIF ()
ENDIF ()
# Add security (hardening flags)
IF (UNIX OR APPLE OR ANDROID)
# Older compilers are predefining _FORTIFY_SOURCE, so defining it causes a
# warning, which is then considered an error. Second issue is that for
# these compilers, _FORTIFY_SOURCE must be used while optimizing, else
# causes a warning, which also results in an error. And finally, CMake is
# not using optimization when testing for libraries, hence breaking the build.
CHECK_C_COMPILER_FLAG("-Werror -D_FORTIFY_SOURCE=2" COMPATIBLE_FORTIFY_SOURCE)
IF (${COMPATIBLE_FORTIFY_SOURCE})
SET(SEC_COMP_FLAGS "-D_FORTIFY_SOURCE=2")
ENDIF ()
SET(SEC_COMP_FLAGS "${SEC_COMP_FLAGS} -fstack-protector-all -fPIE")
# Make sure to add optimization flag. Some systems require this for _FORTIFY_SOURCE.
IF (NOT CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND NOT CMAKE_BUILD_TYPE MATCHES "Release" AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
SET(SEC_COMP_FLAGS "${SEC_COMP_FLAGS} -O1")
ENDIF ()
IF (NOT ANDROID AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT APPLE AND NOT CYGWIN)
SET(SEC_COMP_FLAGS "${SEC_COMP_FLAGS} -Wa,--noexecstack")
ENDIF ()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SEC_COMP_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEC_COMP_FLAGS}")
SET(SEC_LINK_FLAGS "")
IF (NOT APPLE AND NOT CYGWIN)
SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
ENDIF ()
IF (NOT ANDROID AND NOT APPLE)
SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -pie")
ENDIF ()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SEC_LINK_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SEC_LINK_FLAGS}")
ENDIF ()
# Warning, debug and linker flags
SET(FIX_WARNINGS OFF CACHE BOOL "Enable strict compilation mode to turn compiler warnings to errors")
IF (UNIX OR APPLE)
SET(COMP_FLAGS "")
SET(LINKER_FLAGS "")
# Verbose warnings and turns all to errors
SET(COMP_FLAGS "${COMP_FLAGS} -Wall -Wextra")
IF (FIX_WARNINGS)
SET(COMP_FLAGS "${COMP_FLAGS} -Werror")
ENDIF ()
# Omit problematic warnings
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(COMP_FLAGS "${COMP_FLAGS} -Wno-unused-but-set-variable")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.9.9)
SET(COMP_FLAGS "${COMP_FLAGS} -Wno-format-truncation")
ENDIF ()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
SET(COMP_FLAGS "${COMP_FLAGS} -Wno-nonnull -Wno-deprecated-declarations")
ENDIF ()
# Minimal debug info with Clang
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(COMP_FLAGS "${COMP_FLAGS} -gline-tables-only")
ELSE ()
SET(COMP_FLAGS "${COMP_FLAGS} -g")
ENDIF ()
# Note: The following flags are problematic on older systems with gcc 4.8
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9.9))
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
SET(COMP_FLAGS "${COMP_FLAGS} -Wno-unused-command-line-argument")
ENDIF ()
FIND_PROGRAM(LDGOLD_FOUND ld.gold)
SET(LDGOLD_SUPPORT OFF CACHE BOOL "Enable ld.gold support")
# Optional ld.gold is 2x faster than normal ld
IF (LDGOLD_FOUND AND LDGOLD_SUPPORT MATCHES ON AND NOT APPLE AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES arm)
SET(LINKER_FLAGS "${LINKER_FLAGS} -fuse-ld=gold")
# Use Identical Code Folding
SET(COMP_FLAGS "${COMP_FLAGS} -ffunction-sections")
SET(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--icf=safe")
# Compress the debug sections
# Note: Before valgrind 3.12.0, patch should be applied for valgrind (https://bugs.kde.org/show_bug.cgi?id=303877)
IF (NOT APPLE AND NOT ANDROID AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES arm AND NOT CMAKE_CXX_CLANG_TIDY)
SET(COMP_FLAGS "${COMP_FLAGS} -Wa,--compress-debug-sections")
SET(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--compress-debug-sections=zlib")
ENDIF ()
ENDIF ()
ENDIF ()
# Apply the flags
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMP_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMP_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
ENDIF ()
# Sanitizer support
SET(CLANG_SANITIZERS OFF CACHE BOOL "Clang's sanitizer support")
IF (CLANG_SANITIZERS AND
((UNIX AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR (APPLE AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")))
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer")
ENDIF ()
# Unity Build support
include(UnityBuild)
indi-sbig-2.1+20221220234924/cmake_modules/FindFLIPRO.cmake 0000644 0001751 0001751 00000003140 14347562502 021443 0 ustar debian debian # - Try to find Finger Lakes Instruments Library
# Once done this will define
#
# FLIPRO_FOUND - system has FLI
# FLIPRO_INCLUDE_DIR - the FLI include directory
# FLIPRO_LIBRARIES - Link these to use FLI
# Copyright (c) 2008, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (FLIPRO_INCLUDE_DIR AND FLIPRO_LIBRARIES)
# in cache already
set(FLIPRO_FOUND TRUE)
message(STATUS "Found libflipro: ${FLIPRO_LIBRARIES}")
else (FLIPRO_INCLUDE_DIR AND FLIPRO_LIBRARIES)
# Might need to remove lib prefix once FLI fixes their library name
find_path(FLIPRO_INCLUDE_DIR libflipro.h
PATH_SUFFIXES fli
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(FLIPRO_LIBRARIES NAMES libflipro
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(FLIPRO_INCLUDE_DIR AND FLIPRO_LIBRARIES)
set(FLIPRO_FOUND TRUE)
else (FLIPRO_INCLUDE_DIR AND FLIPRO_LIBRARIES)
set(FLIPRO_FOUND FALSE)
endif(FLIPRO_INCLUDE_DIR AND FLIPRO_LIBRARIES)
if (FLIPRO_FOUND)
if (NOT FLIPRO_FIND_QUIETLY)
message(STATUS "Found FLIPRO: ${FLIPRO_LIBRARIES}")
endif (NOT FLIPRO_FIND_QUIETLY)
else (FLIPRO_FOUND)
if (FLIPRO_FIND_REQUIRED)
message(FATAL_ERROR "FLIPRO not found. Please install it and try again. http://www.indilib.org")
endif (FLIPRO_FIND_REQUIRED)
endif (FLIPRO_FOUND)
mark_as_advanced(FLIPRO_INCLUDE_DIR FLIPRO_LIBRARIES)
endif (FLIPRO_INCLUDE_DIR AND FLIPRO_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindINOVASDK.cmake 0000644 0001751 0001751 00000002753 14174600255 021673 0 ustar debian debian # - Try to find INOVASDK Universal Library
# Once done this will define
#
# INOVASDK_FOUND - system has INOVASDK
# INOVASDK_INCLUDE_DIR - the INOVASDK include directory
# INOVASDK_LIBRARIES - Link these to use INOVASDK
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (INOVASDK_INCLUDE_DIR AND INOVASDK_LIBRARIES)
# in cache already
set(INOVASDK_FOUND TRUE)
message(STATUS "Found libinovasdk: ${INOVASDK_LIBRARIES}")
else (INOVASDK_INCLUDE_DIR AND INOVASDK_LIBRARIES)
find_path(INOVASDK_INCLUDE_DIR inovasdk.h
PATH_SUFFIXES inovasdk
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(INOVASDK_LIBRARIES NAMES inovasdk
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(INOVASDK_INCLUDE_DIR AND INOVASDK_LIBRARIES)
set(INOVASDK_FOUND TRUE)
else (INOVASDK_INCLUDE_DIR AND INOVASDK_LIBRARIES)
set(INOVASDK_FOUND FALSE)
endif(INOVASDK_INCLUDE_DIR AND INOVASDK_LIBRARIES)
if (INOVASDK_FOUND)
if (NOT INOVASDK_FIND_QUIETLY)
message(STATUS "Found INOVASDK: ${INOVASDK_LIBRARIES}")
endif (NOT INOVASDK_FIND_QUIETLY)
else (INOVASDK_FOUND)
if (INOVASDK_FIND_REQUIRED)
message(FATAL_ERROR "INOVASDK not found. Please install INOVASDK Library http://www.indilib.org")
endif (INOVASDK_FIND_REQUIRED)
endif (INOVASDK_FOUND)
mark_as_advanced(INOVASDK_INCLUDE_DIR INOVASDK_LIBRARIES)
endif (INOVASDK_INCLUDE_DIR AND INOVASDK_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindQHY.cmake 0000644 0001751 0001751 00000002426 14174600255 021113 0 ustar debian debian # - Try to find QHY Library
# Once done this will define
#
# QHY_FOUND - system has QHY
# QHY_INCLUDE_DIR - the QHY include directory
# QHY_LIBRARIES - Link these to use QHY
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (QHY_INCLUDE_DIR AND QHY_LIBRARIES)
# in cache already
set(QHY_FOUND TRUE)
message(STATUS "Found libqhyccd: ${QHY_LIBRARIES}")
else (QHY_INCLUDE_DIR AND QHY_LIBRARIES)
find_path(QHY_INCLUDE_DIR qhyccd.h
PATH_SUFFIXES libqhy
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(QHY_LIBRARIES NAMES qhyccd
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(QHY_INCLUDE_DIR AND QHY_LIBRARIES)
set(QHY_FOUND TRUE)
else (QHY_INCLUDE_DIR AND QHY_LIBRARIES)
set(QHY_FOUND FALSE)
endif(QHY_INCLUDE_DIR AND QHY_LIBRARIES)
if (QHY_FOUND)
if (NOT QHY_FIND_QUIETLY)
message(STATUS "Found QHY: ${QHY_LIBRARIES}")
endif (NOT QHY_FIND_QUIETLY)
else (QHY_FOUND)
if (QHY_FIND_REQUIRED)
message(FATAL_ERROR "QHY not found. Please install libqhy http://www.indilib.org")
endif (QHY_FIND_REQUIRED)
endif (QHY_FOUND)
mark_as_advanced(QHY_INCLUDE_DIR QHY_LIBRARIES)
endif (QHY_INCLUDE_DIR AND QHY_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindPENTAX.cmake 0000644 0001751 0001751 00000005530 14174600255 021450 0 ustar debian debian # - Try to find PENTAX Universal Libraries
# Once done this will define
#
# PENTAX_FOUND - system has PENTAX
# PENTAX_INCLUDE_DIR - the PENTAX include directory
# PENTAX_LIBRARIES - Link these to use PENTAX
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (PENTAX_INCLUDE_DIR AND PENTAX_LIBRARIES)
# in cache already
set(PENTAX_FOUND TRUE)
message(STATUS "Found PENTAX libraries: ${PENTAX_LIBRARIES}")
else (PENTAX_INCLUDE_DIR AND PENTAX_LIBRARIES)
find_path(PKTRIGGERCORD_INCLUDE_DIR libpktriggercord.h
PATH_SUFFIXES libpktriggercord
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(PKTRIGGERCORD_LIBRARIES NAMES pktriggercord
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
PATH_SUFFIXES indipentax
)
#if not armv8, then look for ricoh library; otherwise only use pktriggercord library
if(NOT (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64"))
find_path(RICOH_INCLUDE_DIR ricoh_camera_sdk.hpp
PATH_SUFFIXES libpentax libricohcamerasdk
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(RICOH_LIBRARIES NAMES RicohCameraSDKCpp
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(RICOHMTP_LIBRARIES NAMES libmtpricoh.so.9.3.0
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if (RICOH_INCLUDE_DIR AND PKTRIGGERCORD_INCLUDE_DIR)
set(PENTAX_INCLUDE_DIR ${RICOH_INCLUDE_DIR} ${PKTRIGGERCORD_INCLUDE_DIR})
endif (RICOH_INCLUDE_DIR AND PKTRIGGERCORD_INCLUDE_DIR)
if (RICOH_LIBRARIES AND RICOHMTP_LIBRARIES AND PKTRIGGERCORD_LIBRARIES)
set(PENTAX_LIBRARIES ${RICOH_LIBRARIES} ${RICOHMTP_LIBRARIES} ${PKTRIGGERCORD_LIBRARIES})
endif (RICOH_LIBRARIES AND RICOHMTP_LIBRARIES AND PKTRIGGERCORD_LIBRARIES)
else()
if (PKTRIGGERCORD_INCLUDE_DIR)
set(PENTAX_INCLUDE_DIR ${PKTRIGGERCORD_INCLUDE_DIR})
endif (PKTRIGGERCORD_INCLUDE_DIR)
if (PKTRIGGERCORD_LIBRARIES)
set(PENTAX_LIBRARIES ${PKTRIGGERCORD_LIBRARIES})
endif (PKTRIGGERCORD_LIBRARIES)
endif()
if(PENTAX_INCLUDE_DIR AND PENTAX_LIBRARIES)
set(PENTAX_FOUND TRUE)
else (PENTAX_INCLUDE_DIR AND PENTAX_LIBRARIES)
set(PENTAX_FOUND FALSE)
endif(PENTAX_INCLUDE_DIR AND PENTAX_LIBRARIES)
if (PENTAX_FOUND)
if (NOT PENTAX_FIND_QUIETLY)
message(STATUS "Found PENTAX libraries: ${PENTAX_LIBRARIES}")
endif (NOT PENTAX_FIND_QUIETLY)
else (PENTAX_FOUND)
if (PENTAX_FIND_REQUIRED)
message(FATAL_ERROR "One or both of libricohcamersdk and libpktriggercord are not found. Please install them. See http://www.indilib.org.")
endif (PENTAX_FIND_REQUIRED)
endif (PENTAX_FOUND)
mark_as_advanced(PENTAX_INCLUDE_DIR PENTAX_LIBRARIES)
endif (PENTAX_INCLUDE_DIR AND PENTAX_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindGLIB2.cmake 0000644 0001751 0001751 00000013271 14174600255 021251 0 ustar debian debian # - Try to find GLib2
# Once done this will define
#
# GLIB2_FOUND - system has GLib2
# GLIB2_INCLUDE_DIRS - the GLib2 include directory
# GLIB2_LIBRARIES - Link these to use GLib2
#
# HAVE_GLIB_GREGEX_H glib has gregex.h header and
# supports g_regex_match_simple
#
# Copyright (c) 2006 Andreas Schneider
# Copyright (c) 2006 Philippe Bernery
# Copyright (c) 2007 Daniel Gollub
# Copyright (c) 2007 Alban Browaeys
# Copyright (c) 2008 Michael Bell
# Copyright (c) 2008 Bjoern Ricks
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
# in cache already
SET(GLIB2_FOUND TRUE)
ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
INCLUDE(FindPkgConfig)
## Glib
IF ( GLIB2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "REQUIRED" )
ELSE ( GLIB2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "" )
ENDIF ( GLIB2_FIND_REQUIRED )
IF ( GLIB2_MIN_VERSION )
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
ELSE ( GLIB2_MIN_VERSION )
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
ENDIF ( GLIB2_MIN_VERSION )
IF ( PKG_CONFIG_FOUND )
IF ( GLIB2_FOUND )
SET ( GLIB2_CORE_FOUND TRUE )
ELSE ( GLIB2_FOUND )
SET ( GLIB2_CORE_FOUND FALSE )
ENDIF ( GLIB2_FOUND )
ENDIF ( PKG_CONFIG_FOUND )
# Look for glib2 include dir and libraries w/o pkgconfig
IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
FIND_PATH(
_glibconfig_include_DIR
NAMES
glibconfig.h
PATHS
/opt/gnome/lib64
/opt/gnome/lib
/opt/lib/
/opt/local/lib
/sw/lib/
/usr/lib64
/usr/lib
/usr/local/include
${CMAKE_LIBRARY_PATH}
PATH_SUFFIXES
glib-2.0/include
)
FIND_PATH(
_glib2_include_DIR
NAMES
glib.h
PATHS
/opt/gnome/include
/opt/local/include
/sw/include
/usr/include
/usr/local/include
PATH_SUFFIXES
glib-2.0
)
#MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
FIND_LIBRARY(
_glib2_link_DIR
NAMES
glib-2.0
glib
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/lib
/usr/local/lib
)
IF ( _glib2_include_DIR AND _glib2_link_DIR )
SET ( _glib2_FOUND TRUE )
ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
IF ( _glib2_FOUND )
SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
SET ( GLIB2_CORE_FOUND TRUE )
ELSE ( _glib2_FOUND )
SET ( GLIB2_CORE_FOUND FALSE )
ENDIF ( _glib2_FOUND )
# Handle dependencies
# libintl
IF ( NOT LIBINTL_FOUND )
FIND_PATH(LIBINTL_INCLUDE_DIR
NAMES
libintl.h
PATHS
/opt/gnome/include
/opt/local/include
/sw/include
/usr/include
/usr/local/include
)
FIND_LIBRARY(LIBINTL_LIBRARY
NAMES
intl
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/local/lib
/usr/lib
)
IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
SET (LIBINTL_FOUND TRUE)
ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
ENDIF ( NOT LIBINTL_FOUND )
# libiconv
IF ( NOT LIBICONV_FOUND )
FIND_PATH(LIBICONV_INCLUDE_DIR
NAMES
iconv.h
PATHS
/opt/gnome/include
/opt/local/include
/opt/local/include
/sw/include
/sw/include
/usr/local/include
/usr/include
PATH_SUFFIXES
glib-2.0
)
FIND_LIBRARY(LIBICONV_LIBRARY
NAMES
iconv
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/lib
/usr/local/lib
)
IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
SET (LIBICONV_FOUND TRUE)
ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
ENDIF ( NOT LIBICONV_FOUND )
IF (LIBINTL_FOUND)
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY})
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR})
ENDIF (LIBINTL_FOUND)
IF (LIBICONV_FOUND)
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY})
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR})
ENDIF (LIBICONV_FOUND)
ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
##
IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
SET (GLIB2_FOUND TRUE)
ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
IF (GLIB2_FOUND)
IF (NOT GLIB2_FIND_QUIETLY)
MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}")
ENDIF (NOT GLIB2_FIND_QUIETLY)
ELSE (GLIB2_FOUND)
IF (GLIB2_FIND_REQUIRED)
MESSAGE (SEND_ERROR "Could not find GLib2")
ENDIF (GLIB2_FIND_REQUIRED)
ENDIF (GLIB2_FOUND)
# show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES)
MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY)
MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY)
ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS)
IF ( GLIB2_FOUND )
# Check if system has a newer version of glib
# which supports g_regex_match_simple
INCLUDE( CheckIncludeFiles )
SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
# Reset CMAKE_REQUIRED_INCLUDES
SET( CMAKE_REQUIRED_INCLUDES "" )
ENDIF( GLIB2_FOUND )
indi-sbig-2.1+20221220234924/cmake_modules/FindATIK.cmake 0000644 0001751 0001751 00000002540 14174600255 021177 0 ustar debian debian # - Try to find Atik Camera Library
# Once done this will define
#
# ATIK_FOUND - system has ATIK
# ATIK_INCLUDE_DIR - the ATIK include directory
# ATIK_LIBRARIES - Link these to use ATIK
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (ATIK_INCLUDE_DIR AND ATIK_LIBRARIES)
# in cache already
set(ATIK_FOUND TRUE)
message(STATUS "Found libatik: ${ATIK_LIBRARIES}")
else (ATIK_INCLUDE_DIR AND ATIK_LIBRARIES)
find_path(ATIK_INCLUDE_DIR AtikCameras.h
PATH_SUFFIXES libatik
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(ATIK_LIBRARIES NAMES atikcameras
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(ATIK_INCLUDE_DIR AND ATIK_LIBRARIES)
set(ATIK_FOUND TRUE)
else (ATIK_INCLUDE_DIR AND ATIK_LIBRARIES)
set(ATIK_FOUND FALSE)
endif(ATIK_INCLUDE_DIR AND ATIK_LIBRARIES)
if (ATIK_FOUND)
if (NOT ATIK_FIND_QUIETLY)
message(STATUS "Found Atik Library: ${ATIK_LIBRARIES}")
endif (NOT ATIK_FIND_QUIETLY)
else (ATIK_FOUND)
if (ATIK_FIND_REQUIRED)
message(FATAL_ERROR "Atik Library not found. Please install Atik Library http://www.indilib.org")
endif (ATIK_FIND_REQUIRED)
endif (ATIK_FOUND)
mark_as_advanced(ATIK_INCLUDE_DIR ATIK_LIBRARIES)
endif (ATIK_INCLUDE_DIR AND ATIK_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindALUT.cmake 0000644 0001751 0001751 00000005042 14174600255 021214 0 ustar debian debian # - Locate ALUT
# This module defines
# ALUT_LIBRARY
# ALUT_FOUND, if false, do not try to link to OpenAL
# ALUT_INCLUDE_DIR, where to find the headers
#
# $OPENALDIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENALDIR
# used in building OpenAL.
#
# Created by Bryan Donlan, based on the FindOpenAL.cmake module by Eric Wang.
FIND_PATH(ALUT_INCLUDE_DIR alut.h
$ENV{OPENALDIR}/include
~/Library/Frameworks/OpenAL.framework/Headers
/Library/Frameworks/OpenAL.framework/Headers
/System/Library/Frameworks/OpenAL.framework/Headers # Tiger
/usr/local/include/AL
/usr/local/include/OpenAL
/usr/local/include
/usr/include/AL
/usr/include/OpenAL
/usr/include
/sw/include/AL # Fink
/sw/include/OpenAL
/sw/include
/opt/local/include/AL # DarwinPorts
/opt/local/include/OpenAL
/opt/local/include
/opt/csw/include/AL # Blastwave
/opt/csw/include/OpenAL
/opt/csw/include
/opt/include/AL
/opt/include/OpenAL
/opt/include
)
# I'm not sure if I should do a special casing for Apple. It is
# unlikely that other Unix systems will find the framework path.
# But if they do ([Next|Open|GNU]Step?),
# do they want the -framework option also?
IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
)
# String is in default search path, don't need to use -F
SET (ALUT_LIBRARY "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
ELSE("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
)
# String is not /Library/Frameworks, need to use -F
SET(ALUT_LIBRARY "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
ENDIF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
)
# Clear the temp variable so nobody can see it
SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
ELSE(${ALUT_INCLUDE_DIR} MATCHES ".framework")
FIND_LIBRARY(ALUT_LIBRARY
NAMES alut
PATHS
$ENV{OPENALDIR}/lib
$ENV{OPENALDIR}/libs
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
)
ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
SET(ALUT_FOUND "NO")
IF(ALUT_LIBRARY)
SET(ALUT_FOUND "YES")
ENDIF(ALUT_LIBRARY)
indi-sbig-2.1+20221220234924/cmake_modules/FindAHPGT.cmake 0000644 0001751 0001751 00000003333 14347562502 021317 0 ustar debian debian # - Try to find AHPGT
# Once done this will define
#
# AHPGT_FOUND - system has AHPGT
# AHPGT_INCLUDE_DIR - the AHPGT include directory
# AHPGT_LIBRARIES - Link these to use AHPGT
# AHPGT_VERSION_STRING - Human readable version number of ahp_gt
# AHPGT_VERSION_MAJOR - Major version number of ahp_gt
# AHPGT_VERSION_MINOR - Minor version number of ahp_gt
# Copyright (c) 2017, Ilia Platone,
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (AHPGT_INCLUDE_DIR AND AHPGT_LIBRARIES)
# in cache already
set(AHPGT_FOUND TRUE)
message(STATUS "Found AHPGT: ${AHPGT_LIBRARIES}")
else (AHPGT_INCLUDE_DIR AND AHPGT_LIBRARIES)
find_path(AHPGT_INCLUDE_DIR ahp_gt.h
PATH_SUFFIXES ahp
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(AHPGT_LIBRARIES NAMES ahp_gt
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
/usr/local/lib
HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
)
if(AHPGT_INCLUDE_DIR AND AHPGT_LIBRARIES)
set(AHPGT_FOUND TRUE)
else (AHPGT_INCLUDE_DIR AND AHPGT_LIBRARIES)
set(AHPGT_FOUND FALSE)
endif(AHPGT_INCLUDE_DIR AND AHPGT_LIBRARIES)
if (AHPGT_FOUND)
if (NOT AHPGT_FIND_QUIETLY)
message(STATUS "Found AHPGT: ${AHPGT_LIBRARIES}")
endif (NOT AHPGT_FIND_QUIETLY)
else (AHPGT_FOUND)
if (AHPGT_FIND_REQUIRED)
message(FATAL_ERROR "AHPGT not found. Please install libahp_gt-dev")
endif (AHPGT_FIND_REQUIRED)
endif (AHPGT_FOUND)
mark_as_advanced(AHPGT_LIBRARIES)
endif (AHPGT_INCLUDE_DIR AND AHPGT_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindD2XX.cmake 0000644 0001751 0001751 00000002620 14174600255 021173 0 ustar debian debian # - Try to find D2XX
# Once done this will define
#
# D2XX_FOUND - system has FTDI
# D2XX_INCLUDE_DIR - the FTDI include directory
# D2XX_LIBRARIES - Link these to use FTDI
#
# N.B. You must include the file as following:
#
#include
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
# in cache already
set(D2XX_FOUND TRUE)
message(STATUS "Found libfd2xx: ${D2XX_LIBRARIES}")
else (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
find_path(D2XX_INCLUDE_DIR ftd2xx.h
#PATH_SUFFIXES libD2XX
${_obIncDir}
${GNUWIN32_DIR}/include
/usr/local/include
)
find_library(D2XX_LIBRARIES NAMES ftd2xx
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
/usr/local/lib
)
if(D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
set(D2XX_FOUND TRUE)
else (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
set(D2XX_FOUND FALSE)
endif(D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
if (D2XX_FOUND)
if (NOT D2XX_FIND_QUIETLY)
message(STATUS "Found D2XX: ${D2XX_LIBRARIES}")
endif (NOT D2XX_FIND_QUIETLY)
else (D2XX_FOUND)
if (D2XX_FIND_REQUIRED)
message(FATAL_ERROR "D2XX not found. Please install libd2xx")
endif (D2XX_FIND_REQUIRED)
endif (D2XX_FOUND)
mark_as_advanced(D2XX_INCLUDE_DIR D2XX_LIBRARIES)
endif (D2XX_INCLUDE_DIR AND D2XX_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindARAVIS.cmake 0000644 0001751 0001751 00000002723 14174600255 021437 0 ustar debian debian # - Find the native sqlite3 includes and library
#
# This module defines
# ARV_INCLUDE_DIR, where to find libgphoto2 header files
# ARV_LIBRARIES, the libraries to link against to use libgphoto2
# ARV_FOUND, If false, do not try to use libgphoto2.
# ARV_VERSION_STRING, e.g. 2.4.14
# ARV_VERSION_MAJOR, e.g. 2
# ARV_VERSION_MINOR, e.g. 4
# ARV_VERSION_PATCH, e.g. 14
#
# also defined, but not for general use are
# ARV_LIBRARY, where to find the sqlite3 library.
#=============================================================================
# Copyright 2010 henrik andersson
#=============================================================================
SET(ARV_FIND_REQUIRED ${Arv_FIND_REQUIRED})
find_path(ARV_INCLUDE_DIR aravis-0.8/arv.h)
mark_as_advanced(ARV_INCLUDE_DIR)
set(ARV_NAMES ${ARV_NAMES} aravis-0.8)
find_library(ARV_LIBRARY NAMES ${ARV_NAMES} )
mark_as_advanced(ARV_LIBRARY)
set(ARV_VERSION_MAJOR "0")
set(ARV_VERSION_MINOR "8")
set(ARV_VERSION_STRING "${ARV_VERSION_MAJOR}.${ARV_VERSION_MINOR}")
# handle the QUIETLY and REQUIRED arguments and set ARV_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ARV DEFAULT_MSG ARV_LIBRARY ARV_INCLUDE_DIR)
IF(ARV_FOUND)
#SET(Arv_LIBRARIES ${ARV_LIBRARY})
SET(Arv_LIBRARIES "aravis-0.8")
SET(Arv_INCLUDE_DIRS "${ARV_INCLUDE_DIR}/aravis-0.8")
MESSAGE (STATUS "Found aravis: ${Arv_LIBRARIES} ${Arv_INCLUDE_DIRS}")
ENDIF(ARV_FOUND)
indi-sbig-2.1+20221220234924/cmake_modules/FindFISHCAMP.cmake 0000644 0001751 0001751 00000003225 14174600255 021642 0 ustar debian debian # - Try to find FISHCAMP CCD
# Once done this will define
#
# FISHCAMP_FOUND - system has FISHCAMP
# FISHCAMP_LIBRARIES - Link these to use FISHCAMP
# FISHCAMP_INCLUDE_DIR - Fishcamp include directory
# Copyright (c) 2006, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (FISHCAMP_LIBRARIES AND FISHCAMP_INCLUDE_DIR)
# in cache already
set(FISHCAMP_FOUND TRUE)
message(STATUS "Found FISHCAMP: ${FISHCAMP_LIBRARIES}")
else (FISHCAMP_LIBRARIES AND FISHCAMP_INCLUDE_DIR)
find_library(FISHCAMP_LIBRARIES NAMES fishcamp
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_path(FISHCAMP_INCLUDE_DIR fishcamp.h
PATH_SUFFIXES libfishcamp
${_obIncDir}
${GNUWIN32_DIR}/include
)
set(CMAKE_REQUIRED_LIBRARIES ${FISHCAMP_LIBRARIES})
if(FISHCAMP_LIBRARIES AND FISHCAMP_INCLUDE_DIR)
set(FISHCAMP_FOUND TRUE)
else (FISHCAMP_LIBRARIES AND FISHCAMP_INCLUDE_DIR)
set(FISHCAMP_FOUND FALSE)
endif(FISHCAMP_LIBRARIES AND FISHCAMP_INCLUDE_DIR)
if (FISHCAMP_FOUND)
if (NOT FISHCAMP_FIND_QUIETLY)
message(STATUS "Found FISHCAMP: ${FISHCAMP_LIBRARIES}")
endif (NOT FISHCAMP_FIND_QUIETLY)
else (FISHCAMP_FOUND)
if (FISHCAMP_FIND_REQUIRED)
message(FATAL_ERROR "FISHCAMP not found. Please install FISHCAMP library. http://www.indilib.org")
endif (FISHCAMP_FIND_REQUIRED)
endif (FISHCAMP_FOUND)
mark_as_advanced(FISHCAMP_LIBRARIES FISHCAMP_INCLUDE_DIR)
endif (FISHCAMP_LIBRARIES AND FISHCAMP_INCLUDE_DIR)
indi-sbig-2.1+20221220234924/cmake_modules/FindDC1394.cmake 0000644 0001751 0001751 00000002643 14174600255 021262 0 ustar debian debian # - Try to find dc1394 library (version 2) and include files
# Once done this will define
#
# DC1394_FOUND - system has DC1394
# DC1394_INCLUDE_DIR - the DC1394 include directory
# DC1394_LIBRARIES - Link these to use DC1394
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
# in cache already
set(DC1394_FOUND TRUE)
message(STATUS "Found libdc1394: ${DC1394_LIBRARIES}")
else (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
find_path(DC1394_INCLUDE_DIR control.h
PATH_SUFFIXES dc1394
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(DC1394_LIBRARIES NAMES dc1394
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
set(DC1394_FOUND TRUE)
else (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
set(DC1394_FOUND FALSE)
endif(DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
if (DC1394_FOUND)
if (NOT DC1394_FIND_QUIETLY)
message(STATUS "Found DC1394: ${DC1394_LIBRARIES}")
endif (NOT DC1394_FIND_QUIETLY)
else (DC1394_FOUND)
if (DC1394_FIND_REQUIRED)
message(FATAL_ERROR "DC1394 not found. Please install libdc1394 development package.")
endif (DC1394_FIND_REQUIRED)
endif (DC1394_FOUND)
mark_as_advanced(DC1394_INCLUDE_DIR DC1394_LIBRARIES)
endif (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindTIFFXX.cmake 0000644 0001751 0001751 00000001763 14174600255 021465 0 ustar debian debian # - Try to find TIFFXX Library
# Once done this will define
#
# TIFXX_LIBRARY - Link these to use TIFFXX
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (TIFFXX_LIBRARY)
# in cache already
set(TIFFXX_FOUND TRUE)
message(STATUS "Found libtiffxx: ${TIFFXX_LIBRARY}")
else (TIFFXX_LIBRARY)
find_library(TIFFXX_LIBRARY NAMES tiffxx
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(TIFFXX_LIBRARY)
set(TIFFXX_FOUND TRUE)
else (TIFFXX_LIBRARY)
set(TIFFXX_FOUND FALSE)
endif(TIFFXX_LIBRARY)
if (TIFFXX_FOUND)
if (NOT TIFFXX_FIND_QUIETLY)
message(STATUS "Found tiffxx: ${TIFFXX_LIBRARY}")
endif (NOT TIFFXX_FIND_QUIETLY)
else (TIFFXX_FOUND)
if (TIFFXX_FIND_REQUIRED)
message(FATAL_ERROR "tiffxx is not found. Please install it first.")
endif (TIFFXX_FIND_REQUIRED)
endif (TIFFXX_FOUND)
mark_as_advanced(TIFFXX_LIBRARY)
endif (TIFFXX_LIBRARY)
indi-sbig-2.1+20221220234924/cmake_modules/FindGSL.cmake 0000644 0001751 0001751 00000022241 14174600255 021074 0 ustar debian debian #.rst:
# FindGSL
# --------
#
# Find the native GSL includes and libraries.
#
# The GNU Scientific Library (GSL) is a numerical library for C and C++
# programmers. It is free software under the GNU General Public
# License.
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# If GSL is found, this module defines the following :prop_tgt:`IMPORTED`
# targets::
#
# GSL::gsl - The main GSL library.
# GSL::gslcblas - The CBLAS support library used by GSL.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project::
#
# GSL_FOUND - True if GSL found on the local system
# GSL_INCLUDE_DIRS - Location of GSL header files.
# GSL_LIBRARIES - The GSL libraries.
# GSL_VERSION - The version of the discovered GSL install.
#
# Hints
# ^^^^^
#
# Set ``GSL_ROOT_DIR`` to a directory that contains a GSL installation.
#
# This script expects to find libraries at ``$GSL_ROOT_DIR/lib`` and the GSL
# headers at ``$GSL_ROOT_DIR/include/gsl``. The library directory may
# optionally provide Release and Debug folders. For Unix-like systems, this
# script will use ``$GSL_ROOT_DIR/bin/gsl-config`` (if found) to aid in the
# discovery GSL.
#
# Cache Variables
# ^^^^^^^^^^^^^^^
#
# This module may set the following variables depending on platform and type
# of GSL installation discovered. These variables may optionally be set to
# help this module find the correct files::
#
# GSL_CLBAS_LIBRARY - Location of the GSL CBLAS library.
# GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any).
# GSL_CONFIG_EXECUTABLE - Location of the ``gsl-config`` script (if any).
# GSL_LIBRARY - Location of the GSL library.
# GSL_LIBRARY_DEBUG - Location of the debug GSL library (if any).
#
#=============================================================================
# Copyright 2014 Kelly Thompson
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Include these modules to handle the QUIETLY and REQUIRED arguments.
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
#=============================================================================
# If the user has provided ``GSL_ROOT_DIR``, use it! Choose items found
# at this location over system locations.
if( EXISTS "$ENV{GSL_ROOT_DIR}" )
file( TO_CMAKE_PATH "$ENV{GSL_ROOT_DIR}" GSL_ROOT_DIR )
set( GSL_ROOT_DIR "${GSL_ROOT_DIR}" CACHE PATH "Prefix for GSL installation." )
endif()
if( NOT EXISTS "${GSL_ROOT_DIR}" )
set( GSL_USE_PKGCONFIG ON )
endif()
#=============================================================================
# As a first try, use the PkgConfig module. This will work on many
# *NIX systems. See :module:`findpkgconfig`
# This will return ``GSL_INCLUDEDIR`` and ``GSL_LIBDIR`` used below.
if( GSL_USE_PKGCONFIG )
find_package(PkgConfig)
pkg_check_modules( GSL QUIET gsl )
if( EXISTS "${GSL_INCLUDEDIR}" )
get_filename_component( GSL_ROOT_DIR "${GSL_INCLUDEDIR}" DIRECTORY CACHE)
endif()
endif()
#=============================================================================
# Set GSL_INCLUDE_DIRS and GSL_LIBRARIES. If we skipped the PkgConfig step, try
# to find the libraries at $GSL_ROOT_DIR (if provided) or in standard system
# locations. These find_library and find_path calls will prefer custom
# locations over standard locations (HINTS). If the requested file is not found
# at the HINTS location, standard system locations will be still be searched
# (/usr/lib64 (Redhat), lib/i386-linux-gnu (Debian)).
find_path( GSL_INCLUDE_DIR
NAMES gsl/gsl_sf.h
HINTS ${GSL_ROOT_DIR}/include ${GSL_INCLUDEDIR}
)
find_library( GSL_LIBRARY
NAMES gsl
HINTS ${GSL_ROOT_DIR}/lib ${GSL_LIBDIR}
PATH_SUFFIXES Release Debug
)
find_library( GSL_CBLAS_LIBRARY
NAMES gslcblas cblas
HINTS ${GSL_ROOT_DIR}/lib ${GSL_LIBDIR}
PATH_SUFFIXES Release Debug
)
# Do we also have debug versions?
find_library( GSL_LIBRARY_DEBUG
NAMES gsl
HINTS ${GSL_ROOT_DIR}/lib ${GSL_LIBDIR}
PATH_SUFFIXES Debug
)
find_library( GSL_CBLAS_LIBRARY_DEBUG
NAMES gslcblas cblas
HINTS ${GSL_ROOT_DIR}/lib ${GSL_LIBDIR}
PATH_SUFFIXES Debug
)
set( GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )
set( GSL_LIBRARIES ${GSL_LIBRARY} ${GSL_CBLAS_LIBRARY} )
# If we didn't use PkgConfig, try to find the version via gsl-config or by
# reading gsl_version.h.
if( NOT GSL_VERSION )
# 1. If gsl-config exists, query for the version.
find_program( GSL_CONFIG_EXECUTABLE
NAMES gsl-config
HINTS "${GSL_ROOT_DIR}/bin"
)
if( EXISTS "${GSL_CONFIG_EXECUTABLE}" )
execute_process(
COMMAND "${GSL_CONFIG_EXECUTABLE}" --version
OUTPUT_VARIABLE GSL_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
endif()
# 2. If gsl-config is not available, try looking in gsl/gsl_version.h
if( NOT GSL_VERSION AND EXISTS "${GSL_INCLUDE_DIRS}/gsl/gsl_version.h" )
file( STRINGS "${GSL_INCLUDE_DIRS}/gsl/gsl_version.h" gsl_version_h_contents REGEX "define GSL_VERSION" )
string( REGEX REPLACE ".*([0-9].[0-9][0-9]).*" "\\1" GSL_VERSION ${gsl_version_h_contents} )
endif()
# might also try scraping the directory name for a regex match "gsl-X.X"
endif()
#=============================================================================
# handle the QUIETLY and REQUIRED arguments and set GSL_FOUND to TRUE if all
# listed variables are TRUE
find_package_handle_standard_args( GSL
FOUND_VAR
GSL_FOUND
REQUIRED_VARS
GSL_INCLUDE_DIR
GSL_LIBRARY
GSL_CBLAS_LIBRARY
VERSION_VAR
GSL_VERSION
)
mark_as_advanced( GSL_ROOT_DIR GSL_VERSION GSL_LIBRARY GSL_INCLUDE_DIR
GSL_CBLAS_LIBRARY GSL_LIBRARY_DEBUG GSL_CBLAS_LIBRARY_DEBUG
GSL_USE_PKGCONFIG GSL_CONFIG )
#=============================================================================
# Register imported libraries:
# 1. If we can find a Windows .dll file (or if we can find both Debug and
# Release libraries), we will set appropriate target properties for these.
# 2. However, for most systems, we will only register the import location and
# include directory.
# Look for dlls, or Release and Debug libraries.
if(WIN32)
string( REPLACE ".lib" ".dll" GSL_LIBRARY_DLL "${GSL_LIBRARY}" )
string( REPLACE ".lib" ".dll" GSL_CBLAS_LIBRARY_DLL "${GSL_CBLAS_LIBRARY}" )
string( REPLACE ".lib" ".dll" GSL_LIBRARY_DEBUG_DLL "${GSL_LIBRARY_DEBUG}" )
string( REPLACE ".lib" ".dll" GSL_CBLAS_LIBRARY_DEBUG_DLL "${GSL_CBLAS_LIBRARY_DEBUG}" )
endif()
if( GSL_FOUND AND NOT TARGET GSL::gsl )
if( EXISTS "${GSL_LIBRARY_DLL}" AND EXISTS "${GSL_CBLAS_LIBRARY_DLL}")
# Windows systems with dll libraries.
add_library( GSL::gsl SHARED IMPORTED )
add_library( GSL::gslcblas SHARED IMPORTED )
# Windows with dlls, but only Release libraries.
set_target_properties( GSL::gslcblas PROPERTIES
IMPORTED_LOCATION_RELEASE "${GSL_CBLAS_LIBRARY_DLL}"
IMPORTED_IMPLIB "${GSL_CBLAS_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GSL_INCLUDE_DIRS}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
set_target_properties( GSL::gsl PROPERTIES
IMPORTED_LOCATION_RELEASE "${GSL_LIBRARY_DLL}"
IMPORTED_IMPLIB "${GSL_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GSL_INCLUDE_DIRS}"
IMPORTED_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
INTERFACE_LINK_LIBRARIES GSL::gslcblas )
# If we have both Debug and Release libraries
if( EXISTS "${GSL_LIBRARY_DEBUG_DLL}" AND EXISTS "${GSL_CBLAS_LIBRARY_DEBUG_DLL}")
set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( GSL::gslcblas PROPERTIES
IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" )
set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( GSL::gsl PROPERTIES
IMPORTED_LOCATION_DEBUG "${GSL_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${GSL_LIBRARY_DEBUG}" )
endif()
else()
# For all other environments (ones without dll libraries), create
# the imported library targets.
add_library( GSL::gsl UNKNOWN IMPORTED )
add_library( GSL::gslcblas UNKNOWN IMPORTED )
set_target_properties( GSL::gslcblas PROPERTIES
IMPORTED_LOCATION "${GSL_CBLAS_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GSL_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C" )
set_target_properties( GSL::gsl PROPERTIES
IMPORTED_LOCATION "${GSL_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GSL_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
INTERFACE_LINK_LIBRARIES GSL::gslcblas )
endif()
endif()
indi-sbig-2.1+20221220234924/cmake_modules/FindMICAM.cmake 0000644 0001751 0001751 00000002567 14174600255 021306 0 ustar debian debian # - Try to find Moravian Instruments Camera Library
# Once done this will define
#
# MICAM_FOUND - system has MI
# MICAM_INCLUDE_DIR - the MI include directory
# MICAM_LIBRARIES - Link these to use MI
# 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 MI Library: ${MICAM_LIBRARIES}")
endif (NOT MICAM_FIND_QUIETLY)
else (MICAM_FOUND)
if (MICAM_FIND_REQUIRED)
message(FATAL_ERROR "MI Library not found. Please install MI 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)
indi-sbig-2.1+20221220234924/cmake_modules/FindPackageHandleStandardArgs.cmake 0000644 0001751 0001751 00000035657 14174600255 025433 0 ustar debian debian #[=======================================================================[.rst:
FindPackageHandleStandardArgs
-----------------------------
This module provides a function intended to be used in :ref:`Find Modules`
implementing :command:`find_package()` calls. It handles the
``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``.
It also sets the ``_FOUND`` variable. The package is
considered found if all variables listed contain valid results, e.g.
valid filepaths.
.. command:: find_package_handle_standard_args
There are two signatures::
find_package_handle_standard_args(
(DEFAULT_MSG|)
...
)
find_package_handle_standard_args(
[FOUND_VAR ]
[REQUIRED_VARS ...]
[VERSION_VAR ]
[HANDLE_COMPONENTS]
[CONFIG_MODE]
[FAIL_MESSAGE ]
)
The ``_FOUND`` variable will be set to ``TRUE`` if all
the variables ``...`` are valid and any optional
constraints are satisfied, and ``FALSE`` otherwise. A success or
failure message may be displayed based on the results and on
whether the ``REQUIRED`` and/or ``QUIET`` option was given to
the :command:`find_package` call.
The options are:
``(DEFAULT_MSG|)``
In the simple signature this specifies the failure message.
Use ``DEFAULT_MSG`` to ask for a default message to be computed
(recommended). Not valid in the full signature.
``FOUND_VAR ``
Obsolete. Specifies either ``_FOUND`` or
``_FOUND`` as the result variable. This exists only
for compatibility with older versions of CMake and is now ignored.
Result variables of both names are always set for compatibility.
``REQUIRED_VARS ...``
Specify the variables which are required for this package.
These may be named in the generated failure message asking the
user to set the missing variable values. Therefore these should
typically be cache entries such as ``FOO_LIBRARY`` and not output
variables like ``FOO_LIBRARIES``.
``VERSION_VAR ``
Specify the name of a variable that holds the version of the package
that has been found. This version will be checked against the
(potentially) specified required version given to the
:command:`find_package` call, including its ``EXACT`` option.
The default messages include information about the required
version and the version which has been actually found, both
if the version is ok or not.
``HANDLE_COMPONENTS``
Enable handling of package components. In this case, the command
will report which components have been found and which are missing,
and the ``_FOUND`` variable will be set to ``FALSE``
if any of the required components (i.e. not the ones listed after
the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are
missing.
``CONFIG_MODE``
Specify that the calling find module is a wrapper around a
call to ``find_package( NO_MODULE)``. This implies
a ``VERSION_VAR`` value of ``_VERSION``. The command
will automatically check whether the package configuration file
was found.
``FAIL_MESSAGE ``
Specify a custom failure message instead of using the default
generated message. Not recommended.
Example for the simple signature:
.. code-block:: cmake
find_package_handle_standard_args(LibXml2 DEFAULT_MSG
LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
The ``LibXml2`` package is considered to be found if both
``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid.
Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found
and ``REQUIRED`` was used, it fails with a
:command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was
used or not. If it is found, success will be reported, including
the content of the first ````. On repeated CMake runs,
the same message will not be printed again.
Example for the full signature:
.. code-block:: cmake
find_package_handle_standard_args(LibArchive
REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
VERSION_VAR LibArchive_VERSION)
In this case, the ``LibArchive`` package is considered to be found if
both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid.
Also the version of ``LibArchive`` will be checked by using the version
contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given,
the default messages will be printed.
Another example for the full signature:
.. code-block:: cmake
find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
find_package_handle_standard_args(Automoc4 CONFIG_MODE)
In this case, a ``FindAutmoc4.cmake`` module wraps a call to
``find_package(Automoc4 NO_MODULE)`` and adds an additional search
directory for ``automoc4``. Then the call to
``find_package_handle_standard_args`` produces a proper success/failure
message.
#]=======================================================================]
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
# internal helper macro
macro(_FPHSA_FAILURE_MESSAGE _msg)
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_msg}")
else ()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_msg}")
endif ()
endif ()
endmacro()
# internal helper macro to generate the failure message when used in CONFIG_MODE:
macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
# _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
if(${_NAME}_CONFIG)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
else()
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
# List them all in the error message:
if(${_NAME}_CONSIDERED_CONFIGS)
set(configsText "")
list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
math(EXPR configsCount "${configsCount} - 1")
foreach(currentConfigIndex RANGE ${configsCount})
list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
set(configsText "${configsText} ${filename} (version ${version})\n")
endforeach()
if (${_NAME}_NOT_FOUND_MESSAGE)
set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
else()
# Simple case: No Config-file was found at all:
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
endif()
endif()
endmacro()
function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
# new extended or in the "old" mode:
set(options CONFIG_MODE HANDLE_COMPONENTS)
set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR)
set(multiValueArgs REQUIRED_VARS)
set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
if(${INDEX} EQUAL -1)
set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
set(FPHSA_REQUIRED_VARS ${ARGN})
set(FPHSA_VERSION_VAR)
else()
CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
if(FPHSA_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT FPHSA_FAIL_MESSAGE)
set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
endif()
endif()
# now that we collected all arguments, process them
if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
endif()
# In config-mode, we rely on the variable _CONFIG, which is set by find_package()
# when it successfully found the config-file, including version checking:
if(FPHSA_CONFIG_MODE)
list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
endif()
if(NOT FPHSA_REQUIRED_VARS)
message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
endif()
list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
string(TOUPPER ${_NAME} _NAME_UPPER)
string(TOLOWER ${_NAME} _NAME_LOWER)
if(FPHSA_FOUND_VAR)
if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
set(_FOUND_VAR ${FPHSA_FOUND_VAR})
else()
message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
endif()
else()
set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
endif()
# collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
set(MISSING_VARS "")
set(DETAILS "")
# check if all passed variables are valid
set(FPHSA_FOUND_${_NAME} TRUE)
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
if(NOT ${_CURRENT_VAR})
set(FPHSA_FOUND_${_NAME} FALSE)
set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
else()
set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
endif()
endforeach()
if(FPHSA_FOUND_${_NAME})
set(${_NAME}_FOUND TRUE)
set(${_NAME_UPPER}_FOUND TRUE)
else()
set(${_NAME}_FOUND FALSE)
set(${_NAME_UPPER}_FOUND FALSE)
endif()
# component handling
unset(FOUND_COMPONENTS_MSG)
unset(MISSING_COMPONENTS_MSG)
if(FPHSA_HANDLE_COMPONENTS)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(${_NAME}_${comp}_FOUND)
if(NOT DEFINED FOUND_COMPONENTS_MSG)
set(FOUND_COMPONENTS_MSG "found components: ")
endif()
set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
else()
if(NOT DEFINED MISSING_COMPONENTS_MSG)
set(MISSING_COMPONENTS_MSG "missing components: ")
endif()
set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
set(MISSING_VARS "${MISSING_VARS} ${comp}")
endif()
endif()
endforeach()
set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
endif()
# version handling:
set(VERSION_MSG "")
set(VERSION_OK TRUE)
set(VERSION ${${FPHSA_VERSION_VAR}})
# check with DEFINED here as the requested or found version may be "0"
if (DEFINED ${_NAME}_FIND_VERSION)
if(DEFINED ${FPHSA_VERSION_VAR})
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
# count the dots in the version string
string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${VERSION}")
# add one dot because there is one dot more than there are components
string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS)
if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT)
# Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT
# is at most 4 here. Therefore a simple lookup table is used.
if (${_NAME}_FIND_VERSION_COUNT EQUAL 1)
set(_VERSION_REGEX "[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2)
set(_VERSION_REGEX "[^.]*\\.[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3)
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*")
else ()
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*")
endif ()
string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${VERSION}")
unset(_VERSION_REGEX)
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD)
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
endif ()
unset(_VERSION_HEAD)
else ()
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL VERSION)
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
endif ()
endif ()
unset(_VERSION_DOTS)
else() # minimum version specified:
if (${_NAME}_FIND_VERSION VERSION_GREATER VERSION)
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
endif ()
endif()
else()
# if the package was not found, but a version was given, add that to the output:
if(${_NAME}_FIND_VERSION_EXACT)
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
else()
set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
endif()
endif()
else ()
if(VERSION)
set(VERSION_MSG "(found version \"${VERSION}\")")
endif()
endif ()
if(VERSION_OK)
set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
else()
set(${_NAME}_FOUND FALSE)
endif()
# print the result:
if (${_NAME}_FOUND)
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
else ()
if(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
else()
if(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
else()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
endif()
endif()
endif ()
set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
endfunction()
indi-sbig-2.1+20221220234924/cmake_modules/FindOggTheora.cmake 0000644 0001751 0001751 00000002472 14174600255 022332 0 ustar debian debian #
# Find the native Ogg/Theora includes and libraries
#
# This module defines
# OGGTHEORA_INCLUDE_DIR, where to find ogg/ogg.h and theora/theora.h
# OGGTHEORA_LIBRARIES, the libraries to link against to use Ogg/Theora.
# OGGTHEORA_FOUND, If false, do not try to use Ogg/Theora.
FIND_PATH(OGGTHEORA_ogg_INCLUDE_DIR ogg/ogg.h)
FIND_PATH(OGGTHEORA_theora_INCLUDE_DIR theora/theora.h)
FIND_LIBRARY(OGGTHEORA_ogg_LIBRARY ogg)
FIND_LIBRARY(OGGTHEORA_theoraenc_LIBRARY theoraenc)
FIND_LIBRARY(OGGTHEORA_theoradec_LIBRARY theoradec)
SET(OGGTHEORA_INCLUDE_DIRS
${OGGTHEORA_ogg_INCLUDE_DIR}
${OGGTHEORA_theora_INCLUDE_DIR}
)
#HACK multiple directories
SET(OGGTHEORA_INCLUDE_DIR ${OGGTHEORA_INCLUDE_DIRS})
SET(OGGTHEORA_LIBRARIES
${OGGTHEORA_theoraenc_LIBRARY}
${OGGTHEORA_theoradec_LIBRARY}
${OGGTHEORA_ogg_LIBRARY}
)
#HACK multiple libraries
SET(OGGTHEORA_LIBRARY ${OGGTHEORA_LIBRARIES})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGGTHEORA
"Could NOT find the ogg and theora libraries"
OGGTHEORA_ogg_LIBRARY
OGGTHEORA_theoraenc_LIBRARY
OGGTHEORA_theoradec_LIBRARY
OGGTHEORA_ogg_INCLUDE_DIR
OGGTHEORA_theora_INCLUDE_DIR
)
MARK_AS_ADVANCED(OGGTHEORA_ogg_INCLUDE_DIR OGGTHEORA_theora_INCLUDE_DIR
OGGTHEORA_ogg_LIBRARY OGGTHEORA_theoraenc_LIBRARY
OGGTHEORA_theoradec_LIBRARY
)
indi-sbig-2.1+20221220234924/cmake_modules/FindMEADE.cmake 0000644 0001751 0001751 00000002477 14174600255 021273 0 ustar debian debian # - Try to find Meade DSI Library.
# Once done this will define
#
# MEADEDSI_FOUND - system has Meade DSI
# MEADEDSI_LIBRARIES - Link these to use Meade DSI
# Copyright (c) 2006, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (MEADEDSI_LIBRARIES)
# in cache already
set(MEADEDSI_FOUND TRUE)
message(STATUS "Found MEADEDSI: ${MEADEDSI_LIBRARIES}")
else (MEADEDSI_LIBRARIES)
find_library(MEADEDSI_LIBRARIES NAMES dsi
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
set(CMAKE_REQUIRED_LIBRARIES ${MEADEDSI_LIBRARIES})
if(MEADEDSI_LIBRARIES)
set(MEADEDSI_FOUND TRUE)
else (MEADEDSI_LIBRARIES)
set(MEADEDSI_FOUND FALSE)
endif(MEADEDSI_LIBRARIES)
if (MEADEDSI_FOUND)
if (NOT MEADEDSI_FIND_QUIETLY)
message(STATUS "Found Meade DSI: ${MEADEDSI_LIBRARIES}")
endif (NOT MEADEDSI_FIND_QUIETLY)
else (MEADEDSI_FOUND)
if (MEADEDSI_FIND_REQUIRED)
message(FATAL_ERROR "Meade DSI not found. Please install Meade DSI library. http://linuxdsi.sourceforge.net")
endif (MEADEDSI_FIND_REQUIRED)
endif (MEADEDSI_FOUND)
mark_as_advanced(MEADEDSI_LIBRARIES)
endif (MEADEDSI_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindTOUPCAM.cmake 0000644 0001751 0001751 00000002676 14174600255 021571 0 ustar debian debian # - Try to find Toupcam Camera Library
# Once done this will define
#
# TOUPCAM_FOUND - system has Toupcam
# TOUPCAM_INCLUDE_DIR - the Toupcam include directory
# TOUPCAM_LIBRARIES - Link these to use Toupcam
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (TOUPCAM_INCLUDE_DIR AND TOUPCAM_LIBRARIES)
# in cache already
set(TOUPCAM_FOUND TRUE)
message(STATUS "Found libsbig: ${TOUPCAM_LIBRARIES}")
else (TOUPCAM_INCLUDE_DIR AND TOUPCAM_LIBRARIES)
find_path(TOUPCAM_INCLUDE_DIR toupcam.h
PATH_SUFFIXES libtoupcam
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(TOUPCAM_LIBRARIES NAMES toupcam
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(TOUPCAM_INCLUDE_DIR AND TOUPCAM_LIBRARIES)
set(TOUPCAM_FOUND TRUE)
else (TOUPCAM_INCLUDE_DIR AND TOUPCAM_LIBRARIES)
set(TOUPCAM_FOUND FALSE)
endif(TOUPCAM_INCLUDE_DIR AND TOUPCAM_LIBRARIES)
if (TOUPCAM_FOUND)
if (NOT TOUPCAM_FIND_QUIETLY)
message(STATUS "Found Toupcam: ${TOUPCAM_LIBRARIES}")
endif (NOT TOUPCAM_FIND_QUIETLY)
else (TOUPCAM_FOUND)
if (TOUPCAM_FIND_REQUIRED)
message(FATAL_ERROR "Toupcam not found. Please install Toupcam Library http://www.indilib.org")
endif (TOUPCAM_FIND_REQUIRED)
endif (TOUPCAM_FOUND)
mark_as_advanced(TOUPCAM_INCLUDE_DIR TOUPCAM_LIBRARIES)
endif (TOUPCAM_INCLUDE_DIR AND TOUPCAM_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindQSI.cmake 0000644 0001751 0001751 00000002455 14174600255 021110 0 ustar debian debian # - Try to find Quantum Scientific Imaging Library
# Once done this will define
#
# QSI_FOUND - system has QSI
# QSI_INCLUDE_DIR - the QSI include directory
# QSI_LIBRARIES - Link these to use QSI
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (QSI_INCLUDE_DIR AND QSI_LIBRARIES)
# in cache already
set(QSI_FOUND TRUE)
message(STATUS "Found libqsiapi: ${QSI_LIBRARIES}")
else (QSI_INCLUDE_DIR AND QSI_LIBRARIES)
find_path(QSI_INCLUDE_DIR qsiapi.h
PATH_SUFFIXES qsiapi
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(QSI_LIBRARIES NAMES qsiapi
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(QSI_INCLUDE_DIR AND QSI_LIBRARIES)
set(QSI_FOUND TRUE)
else (QSI_INCLUDE_DIR AND QSI_LIBRARIES)
set(QSI_FOUND FALSE)
endif(QSI_INCLUDE_DIR AND QSI_LIBRARIES)
if (QSI_FOUND)
if (NOT QSI_FIND_QUIETLY)
message(STATUS "Found QSI: ${QSI_LIBRARIES}")
endif (NOT QSI_FIND_QUIETLY)
else (QSI_FOUND)
if (QSI_FIND_REQUIRED)
message(FATAL_ERROR "QSI not found. Please install libqsi http://www.indilib.org")
endif (QSI_FIND_REQUIRED)
endif (QSI_FOUND)
mark_as_advanced(QSI_INCLUDE_DIR QSI_LIBRARIES)
endif (QSI_INCLUDE_DIR AND QSI_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/UnityBuild.cmake 0000644 0001751 0001751 00000016277 14174600255 021752 0 ustar debian debian #
# Copyright (c) 2009-2012 Christoph Heindl
# Copyright (c) 2015 Csaba Kertész (csaba.kertesz@gmail.com)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
MACRO (COMMIT_UNITY_FILE UNITY_FILE FILE_CONTENT)
SET(DIRTY FALSE)
# Check if the build file exists
SET(OLD_FILE_CONTENT "")
IF (NOT EXISTS ${${UNITY_FILE}} AND NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${${UNITY_FILE}})
SET(DIRTY TRUE)
ELSE ()
# Check the file content
FILE(STRINGS ${${UNITY_FILE}} OLD_FILE_CONTENT)
STRING(REPLACE ";" "" OLD_FILE_CONTENT "${OLD_FILE_CONTENT}")
STRING(REPLACE "\n" "" NEW_CONTENT "${${FILE_CONTENT}}")
STRING(COMPARE EQUAL "${OLD_FILE_CONTENT}" "${NEW_CONTENT}" EQUAL_CHECK)
IF (NOT EQUAL_CHECK EQUAL 1)
SET(DIRTY TRUE)
ENDIF ()
ENDIF ()
IF (DIRTY MATCHES TRUE)
MESSAGE(STATUS "Write Unity Build file: " ${${UNITY_FILE}})
FILE(WRITE ${${UNITY_FILE}} "${${FILE_CONTENT}}")
ENDIF ()
# Create a dummy copy of the unity file to trigger CMake reconfigure if it is deleted.
SET(UNITY_FILE_PATH "")
SET(UNITY_FILE_NAME "")
GET_FILENAME_COMPONENT(UNITY_FILE_PATH ${${UNITY_FILE}} PATH)
GET_FILENAME_COMPONENT(UNITY_FILE_NAME ${${UNITY_FILE}} NAME)
CONFIGURE_FILE(${${UNITY_FILE}} ${UNITY_FILE_PATH}/CMakeFiles/${UNITY_FILE_NAME}.dummy)
ENDMACRO ()
MACRO (ENABLE_UNITY_BUILD TARGET_NAME SOURCE_VARIABLE_NAME UNIT_SIZE EXTENSION)
# Limit is zero based conversion of unit_size
MATH(EXPR LIMIT ${UNIT_SIZE}-1)
SET(FILES ${SOURCE_VARIABLE_NAME})
# Effectivly ignore the source files from the build, but keep track them for changes.
SET_SOURCE_FILES_PROPERTIES(${${FILES}} PROPERTIES HEADER_FILE_ONLY true)
# Counts the number of source files up to the threshold
SET(COUNTER ${LIMIT})
# Have one or more unity build files
SET(FILE_NUMBER 0)
SET(BUILD_FILE "")
SET(BUILD_FILE_CONTENT "")
SET(UNITY_BUILD_FILES "")
SET(_DEPS "")
FOREACH (SOURCE_FILE ${${FILES}})
IF (COUNTER EQUAL LIMIT)
SET(_DEPS "")
# Write the actual Unity Build file
IF (NOT ${BUILD_FILE} STREQUAL "" AND NOT ${BUILD_FILE_CONTENT} STREQUAL "")
COMMIT_UNITY_FILE(BUILD_FILE BUILD_FILE_CONTENT)
ENDIF ()
SET(UNITY_BUILD_FILES ${UNITY_BUILD_FILES} ${BUILD_FILE})
# Set the variables for the current Unity Build file
SET(BUILD_FILE ${CMAKE_CURRENT_BINARY_DIR}/unitybuild_${FILE_NUMBER}_${TARGET_NAME}.${EXTENSION})
SET(BUILD_FILE_CONTENT "// Unity Build file generated by CMake\n")
MATH(EXPR FILE_NUMBER ${FILE_NUMBER}+1)
SET(COUNTER 0)
ENDIF ()
# Add source path to the file name if it is not there yet.
SET(FINAL_SOURCE_FILE "")
SET(SOURCE_PATH "")
GET_FILENAME_COMPONENT(SOURCE_PATH ${SOURCE_FILE} PATH)
IF (SOURCE_PATH STREQUAL "" OR NOT EXISTS ${SOURCE_FILE})
SET(FINAL_SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE})
ELSE ()
SET(FINAL_SOURCE_FILE ${SOURCE_FILE})
ENDIF ()
# Treat only the existing files or moc_*.cpp files
STRING(FIND ${SOURCE_FILE} "moc_" MOC_POS)
IF (EXISTS ${FINAL_SOURCE_FILE} OR MOC_POS GREATER -1)
# Add md5 hash of the source file (except moc files) to the build file content
IF (MOC_POS LESS 0)
SET(MD5_HASH "")
FILE(MD5 ${FINAL_SOURCE_FILE} MD5_HASH)
SET(BUILD_FILE_CONTENT "${BUILD_FILE_CONTENT}// md5: ${MD5_HASH}\n")
ENDIF ()
# Add the source file to the build file content
IF (MOC_POS GREATER -1)
SET(BUILD_FILE_CONTENT "${BUILD_FILE_CONTENT}#include <${SOURCE_FILE}>\n")
ELSE ()
SET(BUILD_FILE_CONTENT "${BUILD_FILE_CONTENT}#include <${FINAL_SOURCE_FILE}>\n")
ENDIF ()
# Add the source dependencies to the Unity Build file
GET_SOURCE_FILE_PROPERTY(_FILE_DEPS ${SOURCE_FILE} OBJECT_DEPENDS)
IF (_FILE_DEPS)
SET(_DEPS ${_DEPS} ${_FILE_DEPS})
SET_SOURCE_FILES_PROPERTIES(${BUILD_FILE} PROPERTIES OBJECT_DEPENDS "${_DEPS}")
ENDIF()
# Keep counting up to the threshold. Increment counter.
MATH(EXPR COUNTER ${COUNTER}+1)
ENDIF ()
ENDFOREACH ()
# Write out the last Unity Build file
IF (NOT ${BUILD_FILE} STREQUAL "" AND NOT ${BUILD_FILE_CONTENT} STREQUAL "")
COMMIT_UNITY_FILE(BUILD_FILE BUILD_FILE_CONTENT)
ENDIF ()
SET(UNITY_BUILD_FILES ${UNITY_BUILD_FILES} ${BUILD_FILE})
SET(${SOURCE_VARIABLE_NAME} ${${SOURCE_VARIABLE_NAME}} ${UNITY_BUILD_FILES})
ENDMACRO ()
MACRO (UNITY_GENERATE_MOC TARGET_NAME SOURCES HEADERS)
SET(NEW_SOURCES "")
FOREACH (HEADER_FILE ${${HEADERS}})
IF (NOT EXISTS ${HEADER_FILE})
MESSAGE(FATAL_ERROR "Header file does not exist (mocing): ${HEADER_FILE}")
ENDIF ()
FILE(READ ${HEADER_FILE} FILE_CONTENT)
STRING(FIND "${FILE_CONTENT}" "Q_OBJECT" QOBJECT_POS)
STRING(FIND "${FILE_CONTENT}" "Q_SLOTS" QSLOTS_POS)
STRING(FIND "${FILE_CONTENT}" "Q_SIGNALS" QSIGNALS_POS)
STRING(FIND "${FILE_CONTENT}" "QObject" OBJECT_POS)
STRING(FIND "${FILE_CONTENT}" "slots" SLOTS_POS)
STRING(FIND "${FILE_CONTENT}" "signals" SIGNALS_POS)
IF (QOBJECT_POS GREATER 0 OR OBJECT_POS GREATER 0 OR QSLOTS_POS GREATER 0 OR Q_SIGNALS GREATER 0 OR
SLOTS_POS GREATER 0 OR SIGNALS GREATER 0)
# Generate the moc filename
GET_FILENAME_COMPONENT(HEADER_BASENAME ${HEADER_FILE} NAME_WE)
SET(MOC_FILENAME "moc_${HEADER_BASENAME}.cpp")
SET(NEW_SOURCES ${NEW_SOURCES} ; "${CMAKE_CURRENT_BINARY_DIR}/${MOC_FILENAME}")
ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${MOC_FILENAME}"
DEPENDS ${HEADER_FILE}
COMMAND ${QT_MOC_EXECUTABLE} ${HEADER_FILE} -o "${CMAKE_CURRENT_BINARY_DIR}/${MOC_FILENAME}")
ENDIF ()
ENDFOREACH ()
IF (NEW_SOURCES)
SET_SOURCE_FILES_PROPERTIES(${NEW_SOURCES} PROPERTIES GENERATED TRUE)
SET(${SOURCES} ${${SOURCES}} ; ${NEW_SOURCES})
ENDIF ()
ENDMACRO ()
indi-sbig-2.1+20221220234924/cmake_modules/FindLibRaw.cmake 0000644 0001751 0001751 00000005625 14174600255 021636 0 ustar debian debian # - Find LibRaw
# Find the LibRaw library
# This module defines
# LibRaw_VERSION_STRING, the version string of LibRaw
# LibRaw_INCLUDE_DIR, where to find libraw.h
# LibRaw_LIBRARIES, the libraries needed to use LibRaw (non-thread-safe)
# LibRaw_r_LIBRARIES, the libraries needed to use LibRaw (thread-safe)
# LibRaw_DEFINITIONS, the definitions needed to use LibRaw (non-thread-safe)
# LibRaw_r_DEFINITIONS, the definitions needed to use LibRaw (thread-safe)
#
# Copyright (c) 2013, Pino Toscano
# Copyright (c) 2013, Gilles Caulier
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
FIND_PACKAGE(PkgConfig)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(PC_LIBRAW libraw)
SET(LibRaw_DEFINITIONS ${PC_LIBRAW_CFLAGS_OTHER})
PKG_CHECK_MODULES(PC_LIBRAW_R libraw_r)
SET(LibRaw_r_DEFINITIONS ${PC_LIBRAW_R_CFLAGS_OTHER})
ENDIF()
FIND_PATH(LibRaw_INCLUDE_DIR libraw.h
HINTS
${PC_LIBRAW_INCLUDEDIR}
${PC_LibRaw_INCLUDE_DIRS}
PATH_SUFFIXES libraw
)
FIND_LIBRARY(LibRaw_LIBRARIES NAMES raw
HINTS
${PC_LIBRAW_LIBDIR}
${PC_LIBRAW_LIBRARY_DIRS}
)
FIND_LIBRARY(LibRaw_r_LIBRARIES NAMES raw_r
HINTS
${PC_LIBRAW_R_LIBDIR}
${PC_LIBRAW_R_LIBRARY_DIRS}
)
IF(LibRaw_INCLUDE_DIR)
FILE(READ ${LibRaw_INCLUDE_DIR}/libraw_version.h _libraw_version_content)
STRING(REGEX MATCH "#define LIBRAW_MAJOR_VERSION[ \t]*([0-9]*)\n" _version_major_match ${_libraw_version_content})
SET(_libraw_version_major "${CMAKE_MATCH_1}")
STRING(REGEX MATCH "#define LIBRAW_MINOR_VERSION[ \t]*([0-9]*)\n" _version_minor_match ${_libraw_version_content})
SET(_libraw_version_minor "${CMAKE_MATCH_1}")
STRING(REGEX MATCH "#define LIBRAW_PATCH_VERSION[ \t]*([0-9]*)\n" _version_patch_match ${_libraw_version_content})
SET(_libraw_version_patch "${CMAKE_MATCH_1}")
IF(_version_major_match AND _version_minor_match AND _version_patch_match)
SET(LibRaw_VERSION_STRING "${_libraw_version_major}.${_libraw_version_minor}.${_libraw_version_patch}")
ELSE()
IF(NOT LibRaw_FIND_QUIETLY)
MESSAGE(STATUS "Failed to get version information from ${LibRaw_INCLUDE_DIR}/libraw_version.h")
ENDIF()
ENDIF()
ENDIF()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibRaw
REQUIRED_VARS LibRaw_LIBRARIES LibRaw_INCLUDE_DIR
VERSION_VAR LibRaw_VERSION_STRING
)
MARK_AS_ADVANCED(LibRaw_VERSION_STRING
LibRaw_INCLUDE_DIR
LibRaw_LIBRARIES
LibRaw_r_LIBRARIES
LibRaw_DEFINITIONS
LibRaw_r_DEFINITIONS
)
indi-sbig-2.1+20221220234924/cmake_modules/FindALTAIRCAM.cmake 0000644 0001751 0001751 00000003010 14174600255 021735 0 ustar debian debian # - Try to find Altair Camera Library
# Once done this will define
#
# ALTAIRCAM_FOUND - system has Altair
# ALTAIRCAM_INCLUDE_DIR - the Altair include directory
# ALTAIRCAM_LIBRARIES - Link these to use Altair
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (ALTAIRCAM_INCLUDE_DIR AND ALTAIRCAM_LIBRARIES)
# in cache already
set(ALTAIRCAM_FOUND TRUE)
message(STATUS "Found libaltaircam: ${ALTAIRCAM_LIBRARIES}")
else (ALTAIRCAM_INCLUDE_DIR AND ALTAIRCAM_LIBRARIES)
find_path(ALTAIRCAM_INCLUDE_DIR altaircam.h
PATH_SUFFIXES libaltaircam
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(ALTAIRCAM_LIBRARIES NAMES altaircam
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(ALTAIRCAM_INCLUDE_DIR AND ALTAIRCAM_LIBRARIES)
set(ALTAIRCAM_FOUND TRUE)
else (ALTAIRCAM_INCLUDE_DIR AND ALTAIRCAM_LIBRARIES)
set(ALTAIRCAM_FOUND FALSE)
endif(ALTAIRCAM_INCLUDE_DIR AND ALTAIRCAM_LIBRARIES)
if (ALTAIRCAM_FOUND)
if (NOT ALTAIRCAM_FIND_QUIETLY)
message(STATUS "Found Altaircam: ${ALTAIRCAM_LIBRARIES}")
endif (NOT ALTAIRCAM_FIND_QUIETLY)
else (ALTAIRCAM_FOUND)
if (ALTAIRCAM_FIND_REQUIRED)
message(FATAL_ERROR "Altaircam not found. Please install Altaircam Library http://www.indilib.org")
endif (ALTAIRCAM_FIND_REQUIRED)
endif (ALTAIRCAM_FOUND)
mark_as_advanced(ALTAIRCAM_INCLUDE_DIR ALTAIRCAM_LIBRARIES)
endif (ALTAIRCAM_INCLUDE_DIR AND ALTAIRCAM_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindSBIG.cmake 0000644 0001751 0001751 00000002512 14174600255 021172 0 ustar debian debian # - Try to find SBIG Universal Library
# Once done this will define
#
# SBIG_FOUND - system has SBIG
# SBIG_INCLUDE_DIR - the SBIG include directory
# SBIG_LIBRARIES - Link these to use SBIG
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (SBIG_INCLUDE_DIR AND SBIG_LIBRARIES)
# in cache already
set(SBIG_FOUND TRUE)
message(STATUS "Found libsbig: ${SBIG_LIBRARIES}")
else (SBIG_INCLUDE_DIR AND SBIG_LIBRARIES)
find_path(SBIG_INCLUDE_DIR sbigudrv.h
PATH_SUFFIXES libsbig
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(SBIG_LIBRARIES NAMES sbig
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(SBIG_INCLUDE_DIR AND SBIG_LIBRARIES)
set(SBIG_FOUND TRUE)
else (SBIG_INCLUDE_DIR AND SBIG_LIBRARIES)
set(SBIG_FOUND FALSE)
endif(SBIG_INCLUDE_DIR AND SBIG_LIBRARIES)
if (SBIG_FOUND)
if (NOT SBIG_FIND_QUIETLY)
message(STATUS "Found SBIG: ${SBIG_LIBRARIES}")
endif (NOT SBIG_FIND_QUIETLY)
else (SBIG_FOUND)
if (SBIG_FIND_REQUIRED)
message(FATAL_ERROR "SBIG not found. Please install SBIG Library http://www.indilib.org")
endif (SBIG_FIND_REQUIRED)
endif (SBIG_FOUND)
mark_as_advanced(SBIG_INCLUDE_DIR SBIG_LIBRARIES)
endif (SBIG_INCLUDE_DIR AND SBIG_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/CMakeParseArguments.cmake 0000644 0001751 0001751 00000001642 14174600255 023511 0 ustar debian debian #.rst:
# CMakeParseArguments
# -------------------
#
# This module once implemented the :command:`cmake_parse_arguments` command
# that is now implemented natively by CMake. It is now an empty placeholder
# for compatibility with projects that include it to get the command from
# CMake 3.4 and lower.
#=============================================================================
# Copyright 2010 Alexander Neundorf
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
indi-sbig-2.1+20221220234924/cmake_modules/FindGPHOTO2.cmake 0000644 0001751 0001751 00000005626 14174600255 021541 0 ustar debian debian # - Find the native sqlite3 includes and library
#
# This module defines
# GPHOTO2_INCLUDE_DIR, where to find libgphoto2 header files
# GPHOTO2_LIBRARIES, the libraries to link against to use libgphoto2
# GPHOTO2_FOUND, If false, do not try to use libgphoto2.
# GPHOTO2_VERSION_STRING, e.g. 2.4.14
# GPHOTO2_VERSION_MAJOR, e.g. 2
# GPHOTO2_VERSION_MINOR, e.g. 4
# GPHOTO2_VERSION_PATCH, e.g. 14
#
# also defined, but not for general use are
# GPHOTO2_LIBRARY, where to find the sqlite3 library.
#=============================================================================
# Copyright 2010 henrik andersson
#=============================================================================
SET(GPHOTO2_FIND_REQUIRED ${Gphoto2_FIND_REQUIRED})
find_path(GPHOTO2_INCLUDE_DIR gphoto2/gphoto2.h)
mark_as_advanced(GPHOTO2_INCLUDE_DIR)
set(GPHOTO2_NAMES ${GPHOTO2_NAMES} gphoto2 libgphoto2)
set(GPHOTO2_PORT_NAMES ${GPHOTO2_PORT_NAMES} gphoto2_port libgphoto2_port)
find_library(GPHOTO2_LIBRARY NAMES ${GPHOTO2_NAMES} )
find_library(GPHOTO2_PORT_LIBRARY NAMES ${GPHOTO2_PORT_NAMES} )
mark_as_advanced(GPHOTO2_LIBRARY)
mark_as_advanced(GPHOTO2_PORT_LIBRARY)
# Detect libgphoto2 version
FIND_PROGRAM(GPHOTO2CONFIG_EXECUTABLE NAMES gphoto2-config)
IF(GPHOTO2CONFIG_EXECUTABLE)
EXEC_PROGRAM(${GPHOTO2CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2_VERSION)
string(REGEX REPLACE "^.*libgphoto2 ([0-9]+).*$" "\\1" GPHOTO2_VERSION_MAJOR "${GPHOTO2_VERSION}")
string(REGEX REPLACE "^.*libgphoto2 [0-9]+\\.([0-9]+).*$" "\\1" GPHOTO2_VERSION_MINOR "${GPHOTO2_VERSION}")
string(REGEX REPLACE "^.*libgphoto2 [0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" GPHOTO2_VERSION_PATCH "${GPHOTO2_VERSION}")
set(GPHOTO2_VERSION_STRING "${GPHOTO2_VERSION_MAJOR}.${GPHOTO2_VERSION_MINOR}.${GPHOTO2_VERSION_PATCH}")
ENDIF(GPHOTO2CONFIG_EXECUTABLE)
# handle the QUIETLY and REQUIRED arguments and set GPHOTO2_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GPHOTO2 DEFAULT_MSG GPHOTO2_LIBRARY GPHOTO2_INCLUDE_DIR)
IF(GPHOTO2_FOUND)
SET(Gphoto2_LIBRARIES ${GPHOTO2_LIBRARY} ${GPHOTO2_PORT_LIBRARY})
SET(Gphoto2_INCLUDE_DIRS ${GPHOTO2_INCLUDE_DIR})
# libgphoto2 dynamically loads and unloads usb library
# without calling any cleanup functions (since they are absent from libusb-0.1).
# This leaves usb event handling threads running with invalid callback and return addresses,
# which causes a crash after any usb event is generated, at least in Mac OS X.
# libusb1 backend does correctly call exit function, but ATM it crashes anyway.
# Workaround is to link against libusb so that it wouldn't get unloaded.
IF(APPLE)
find_library(USB_LIBRARY NAMES usb-1.0 libusb-1.0)
mark_as_advanced(USB_LIBRARY)
IF(USB_LIBRARY)
SET(Gphoto2_LIBRARIES ${Gphoto2_LIBRARIES} ${USB_LIBRARY})
ENDIF(USB_LIBRARY)
ENDIF(APPLE)
ENDIF(GPHOTO2_FOUND)
indi-sbig-2.1+20221220234924/cmake_modules/FindMMAL.cmake 0000644 0001751 0001751 00000003032 14174600255 021172 0 ustar debian debian # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This module can find the MMAL camera libraries.
#
cmake_minimum_required(VERSION 3.0.0)
set (MMAL_LIBS mmal_core mmal_util mmal_vc_client)
set (EGL_LIBS brcmGLESv2 brcmEGL)
foreach(lib ${MMAL_LIBS} ${EGL_LIBS} vcos bcm_host m dl)
find_library(${lib}_LIBRARY
NAMES ${lib}
HINTS ${MMAL_DIR}/lib /opt/vc/lib
)
if (DEFINED ${lib}_LIBRARY)
set(MMAL_LIBRARIES ${MMAL_LIBRARIES} ${${lib}_LIBRARY})
else()
message(FATAL_ERROR "Failed to find ${${lib}_LIBRARY} library")
endif()
endforeach(lib)
find_path(BCM_INCLUDE_DIR NAMES bcm_host.h
HINTS "/opt/vc/include"
)
find_path(MMAL_BASE_INCLUDE_DIR NAMES mmal.h
HINTS "/opt/vc/include/interface/mmal"
)
find_path(MMAL_UTIL_INCLUDE_DIR NAMES mmal_util.h
HINTS "/opt/vc/include/interface/mmal/util"
)
if (MMAL_BASE_INCLUDE_DIR AND BCM_INCLUDE_DIR AND MMAL_UTIL_INCLUDE_DIR)
set(MMAL_INCLUDE_DIR ${MMAL_BASE_INCLUDE_DIR} ${BCM_INCLUDE_DIR} ${MMAL_UTIL_INCLUDE_DIR})
set(MMAL_FOUND TRUE)
endif()
indi-sbig-2.1+20221220234924/cmake_modules/FindAIOUSB.cmake 0000644 0001751 0001751 00000003713 14174600255 021434 0 ustar debian debian # - Try to find libaiousb
# Once done this will define
#
# AIOUSB_FOUND - system has AIOUSB
# AIOUSB_INCLUDE_DIR - the AIOUSB include directory
# AIOUSB_LIBRARIES - Link these to use AIOUSB (C)
# AIOUSB_CPP_LIBRARIES - Link these to use AIOUSB (C++)
# Copyright (c) 2006, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
# in cache already
set(AIOUSB_FOUND TRUE)
message(STATUS "Found libaiusb: ${AIOUSB_LIBRARIES}")
message(STATUS "Found libaiusbcpp: ${AIOUSB_CPP_LIBRARIES}")
else (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
find_path(AIOUSB_INCLUDE_DIR aiousb.h
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(AIOUSB_LIBRARIES NAMES aiousb
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(AIOUSB_CPP_LIBRARIES NAMES aiousbcpp
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
set(AIOUSB_FOUND TRUE)
else (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
set(AIOUSB_FOUND FALSE)
endif(AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
if (AIOUSB_FOUND)
if (NOT AIOUSB_FIND_QUIETLY)
message(STATUS "Found libaiousb: ${AIOUSB_LIBRARIES}")
message(STATUS "Found libaiusbcpp: ${AIOUSB_CPP_LIBRARIES}")
endif (NOT AIOUSB_FIND_QUIETLY)
else (AIOUSB_FOUND)
if (AIOUSB_FIND_REQUIRED)
message(FATAL_ERROR "libaiousb not found. Please install libaiousb. https://www.accesio.com")
endif (AIOUSB_FIND_REQUIRED)
endif (AIOUSB_FOUND)
mark_as_advanced(AIOUSB_INCLUDE_DIR AIOUSB_LIBRARIES AIOUSB_CPP_LIBRARIES)
endif (AIOUSB_INCLUDE_DIR AND AIOUSB_LIBRARIES AND AIOUSB_CPP_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindAPOGEE.cmake 0000644 0001751 0001751 00000003115 14174600255 021406 0 ustar debian debian # - Try to find Apogee Instruments Library
# Once done this will define
#
# APOGEE_FOUND - system has APOGEE
# APOGEE_INCLUDE_DIR - the APOGEE include directory
# APOGEE_LIBRARY - Link these to use APOGEE
# Copyright (c) 2008, Jasem Mutlaq
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (APOGEE_INCLUDE_DIR AND APOGEE_LIBRARY)
# in cache already
set(APOGEE_FOUND TRUE)
message(STATUS "Found libapogee: ${APOGEE_LIBRARY}")
else (APOGEE_INCLUDE_DIR AND APOGEE_LIBRARY)
find_path(APOGEE_INCLUDE_DIR ApogeeCam.h
PATH_SUFFIXES libapogee
${_obIncDir}
${GNUWIN32_DIR}/include
)
# Find Apogee Library
find_library(APOGEE_LIBRARY NAMES apogee
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(APOGEE_INCLUDE_DIR AND APOGEE_LIBRARY)
set(APOGEE_FOUND TRUE)
else (APOGEE_INCLUDE_DIR AND APOGEE_LIBRARY)
set(APOGEE_FOUND FALSE)
endif(APOGEE_INCLUDE_DIR AND APOGEE_LIBRARY)
if (APOGEE_FOUND)
if (NOT APOGEE_FIND_QUIETLY)
message(STATUS "Found APOGEE: ${APOGEE_LIBRARY}")
endif (NOT APOGEE_FIND_QUIETLY)
else (APOGEE_FOUND)
if (APOGEE_FIND_REQUIRED)
message(FATAL_ERROR "libapogee not found. Cannot compile Apogee CCD Driver. Please install libapogee and try again. http://www.indilib.org")
endif (APOGEE_FIND_REQUIRED)
endif (APOGEE_FOUND)
mark_as_advanced(APOGEE_INCLUDE_DIR APOGEE_LIBRARY)
endif (APOGEE_INCLUDE_DIR AND APOGEE_LIBRARY)
indi-sbig-2.1+20221220234924/cmake_modules/FindFFmpeg.cmake 0000644 0001751 0001751 00000016154 14243553447 021630 0 ustar debian debian # - Try to find ffmpeg libraries (libavcodec, libavdevice, libavformat, libavutil, and libswscale)
# Once done this will define
#
# FFMPEG_FOUND - system has ffmpeg or libav
# FFMPEG_INCLUDE_DIR - the ffmpeg include directory
# FFMPEG_LIBRARIES - Link these to use ffmpeg
# FFMPEG_LIBAVCODEC
# FFMPEG_LIBAVDEVICE
# FFMPEG_LIBAVFORMAT
# FFMPEG_LIBAVUTIL
# FFMPEG_LIBSWSCALE
#
# Copyright (c) 2008 Andreas Schneider
# Modified for other libraries by Lasse Kärkkäinen
# Modified for Hedgewars by Stepik777
# Modified for INDILIB by rlancaste
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
#
macro(_FFMPEG_PACKAGE_check_version)
if(EXISTS "${PACKAGE_INCLUDE_DIR}/version.h")
file(READ "${PACKAGE_INCLUDE_DIR}/version.h" _FFMPEG_PACKAGE_version_header)
string(REGEX MATCH "#define ${PACKAGE_NAME}_VERSION_MAJOR[ \t]+([0-9]+)" _VERSION_MAJOR_match "${_FFMPEG_PACKAGE_version_header}")
set(FFMPEG_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define ${PACKAGE_NAME}_VERSION_MINOR[ \t]+([0-9]+)" _VERSION_MINOR_match "${_FFMPEG_PACKAGE_version_header}")
set(FFMPEG_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define ${PACKAGE_NAME}_VERSION_MICRO[ \t]+([0-9]+)" _VERSION_MICRO_match "${_FFMPEG_PACKAGE_version_header}")
set(FFMPEG_PACKAGE_VERSION_MICRO "${CMAKE_MATCH_1}")
set(FFMPEG_PACKAGE_VERSION ${FFMPEG_PACKAGE_VERSION_MAJOR}.${FFMPEG_PACKAGE_VERSION_MINOR}.${FFMPEG_PACKAGE_VERSION_MICRO})
if(${FFMPEG_PACKAGE_VERSION} VERSION_LESS ${FFMPEG_PACKAGE_FIND_VERSION})
set(FFMPEG_PACKAGE_VERSION_OK FALSE)
else(${FFMPEG_PACKAGE_VERSION} VERSION_LESS ${FFMPEG_PACKAGE_FIND_VERSION})
set(FFMPEG_PACKAGE_VERSION_OK TRUE)
endif(${FFMPEG_PACKAGE_VERSION} VERSION_LESS ${FFMPEG_PACKAGE_FIND_VERSION})
if(NOT FFMPEG_PACKAGE_VERSION_OK)
message(STATUS "${PACKAGE_NAME} version ${FFMPEG_PACKAGE_VERSION} found in ${PACKAGE_INCLUDE_DIR}, "
"but at least version ${FFMPEG_PACKAGE_FIND_VERSION} is required")
else(NOT FFMPEG_PACKAGE_VERSION_OK)
mark_as_advanced(FFMPEG_PACKAGE_VERSION_MAJOR FFMPEG_PACKAGE_VERSION_MINOR FFMPEG_PACKAGE_VERSION_MICRO)
endif(NOT FFMPEG_PACKAGE_VERSION_OK)
else(EXISTS "${PACKAGE_INCLUDE_DIR}/version.h")
set(FFMPEG_PACKAGE_VERSION_OK FALSE)
message(STATUS "${PACKAGE_NAME}'s version.h file was not found in the include directory: ${PACKAGE_INCLUDE_DIR}, please install this program.")
endif(EXISTS "${PACKAGE_INCLUDE_DIR}/version.h")
endmacro(_FFMPEG_PACKAGE_check_version)
# required ffmpeg library versions, Requiring at least FFMPEG 3.2.11, Hypatia
set(_avcodec_ver ">=57.64.101")
set(_avdevice_ver ">=57.1.100")
set(_avformat_ver ">=57.56.100")
set(_avutil_ver ">=55.34.100")
set(_swscale_ver ">=4.2.100")
if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
# in cache already
set(FFMPEG_FOUND TRUE)
else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_path(FFMPEG_INCLUDE_DIR
NAMES libavcodec/avcodec.h
PATHS ${FFMPEG_INCLUDE_DIRS} ${CMAKE_INSTALL_PREFIX}/include /usr/include /usr/local/include /opt/local/include /sw/include
PATH_SUFFIXES ffmpeg libav
)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(AVCODEC libavcodec${_avcodec_ver})
pkg_check_modules(AVDEVICE libavdevice${_avdevice_ver})
pkg_check_modules(AVFORMAT libavformat${_avformat_ver})
pkg_check_modules(AVUTIL libavutil${_avutil_ver})
pkg_check_modules(SWSCALE libswscale${_swscale_ver})
endif (PKG_CONFIG_FOUND)
if (NOT PKG_CONFIG_FOUND OR
NOT FFMPEG_LIBAVCODEC OR
NOT FFMPEG_LIBAVDEVICE OR
NOT FFMPEG_LIBAVFORMAT OR
NOT FFMPEG_LIBAVUTIL OR
NOT FFMPEG_LIBSWSCALE)
# LIBAVCODEC
set(PACKAGE_NAME "LIBAVCODEC")
set(PACKAGE_INCLUDE_DIR "${FFMPEG_INCLUDE_DIR}/libavcodec")
set(FFMPEG_PACKAGE_FIND_VERSION _avcodec_ver)
_FFMPEG_PACKAGE_check_version()
if(FFMPEG_PACKAGE_VERSION_OK)
set(AVCODEC_VERSION FFMPEG_PACKAGE_VERSION)
endif(FFMPEG_PACKAGE_VERSION_OK)
# LIBAVDEVICE
set(PACKAGE_NAME "LIBAVDEVICE")
set(PACKAGE_INCLUDE_DIR "${FFMPEG_INCLUDE_DIR}/libavdevice")
set(FFMPEG_PACKAGE_FIND_VERSION _avdevice_ver)
_FFMPEG_PACKAGE_check_version()
if(FFMPEG_PACKAGE_VERSION_OK)
set(AVDEVICE_VERSION FFMPEG_PACKAGE_VERSION)
endif(FFMPEG_PACKAGE_VERSION_OK)
# LIBAVFORMAT
set(PACKAGE_NAME "LIBAVFORMAT")
set(PACKAGE_INCLUDE_DIR "${FFMPEG_INCLUDE_DIR}/libavformat")
set(FFMPEG_PACKAGE_FIND_VERSION _avformat_ver)
_FFMPEG_PACKAGE_check_version()
if(FFMPEG_PACKAGE_VERSION_OK)
set(AVFORMAT_VERSION FFMPEG_PACKAGE_VERSION)
endif(FFMPEG_PACKAGE_VERSION_OK)
# LIBAVUTIL
set(PACKAGE_NAME "LIBAVUTIL")
set(PACKAGE_INCLUDE_DIR "${FFMPEG_INCLUDE_DIR}/libavutil")
set(FFMPEG_PACKAGE_FIND_VERSION _avutil_ver)
_FFMPEG_PACKAGE_check_version()
if(FFMPEG_PACKAGE_VERSION_OK)
set(AVUTIL_VERSION FFMPEG_PACKAGE_VERSION)
endif(FFMPEG_PACKAGE_VERSION_OK)
# LIBSWSCALE
set(PACKAGE_NAME "LIBSWSCALE")
set(PACKAGE_INCLUDE_DIR "${FFMPEG_INCLUDE_DIR}/libswscale")
set(FFMPEG_PACKAGE_FIND_VERSION _swscale_ver)
_FFMPEG_PACKAGE_check_version()
if(FFMPEG_PACKAGE_VERSION_OK)
set(SWSCALE_VERSION FFMPEG_PACKAGE_VERSION)
endif(FFMPEG_PACKAGE_VERSION_OK)
endif ()
find_library(FFMPEG_LIBAVCODEC
NAMES avcodec libavcodec
PATHS ${AVCODEC_LIBRARY_DIRS} ${CMAKE_INSTALL_PREFIX}/lib /usr/lib /usr/local/lib /opt/local/lib /sw/lib
)
find_library(FFMPEG_LIBAVDEVICE
NAMES avdevice libavdevice
PATHS ${AVDEVICE_LIBRARY_DIRS} ${CMAKE_INSTALL_PREFIX}/lib /usr/lib /usr/local/lib /opt/local/lib /sw/lib
)
find_library(FFMPEG_LIBAVFORMAT
NAMES avformat libavformat
PATHS ${AVFORMAT_LIBRARY_DIRS} ${CMAKE_INSTALL_PREFIX}/lib /usr/lib /usr/local/lib /opt/local/lib /sw/lib
)
find_library(FFMPEG_LIBAVUTIL
NAMES avutil libavutil
PATHS ${AVUTIL_LIBRARY_DIRS} ${CMAKE_INSTALL_PREFIX}/lib /usr/lib /usr/local/lib /opt/local/lib /sw/lib
)
find_library(FFMPEG_LIBSWSCALE
NAMES swscale libswscale
PATHS ${SWSCALE_LIBRARY_DIRS} ${CMAKE_INSTALL_PREFIX}/lib /usr/lib /usr/local/lib /opt/local/lib /sw/lib
)
#Only set FFMPEG to found if all the libraries are found in the right versions.
if(AVCODEC_VERSION AND
AVDEVICE_VERSION AND
AVFORMAT_VERSION AND
AVUTIL_VERSION AND
SWSCALE_VERSION AND
FFMPEG_LIBAVCODEC AND
FFMPEG_LIBAVDEVICE AND
FFMPEG_LIBAVFORMAT AND
FFMPEG_LIBAVUTIL AND
FFMPEG_LIBSWSCALE)
set(FFMPEG_FOUND TRUE)
endif()
if (FFMPEG_FOUND)
set(FFMPEG_LIBRARIES
${FFMPEG_LIBAVCODEC}
${FFMPEG_LIBAVDEVICE}
${FFMPEG_LIBAVFORMAT}
${FFMPEG_LIBAVUTIL}
${FFMPEG_LIBSWSCALE}
)
endif (FFMPEG_FOUND)
if (FFMPEG_FOUND)
if (NOT FFMPEG_FIND_QUIETLY)
message(STATUS "Found FFMPEG: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}")
endif (NOT FFMPEG_FIND_QUIETLY)
else (FFMPEG_FOUND)
message(STATUS "Could not find up to date FFMPEG for INDI Webcam. Up to date versions of these packages are required: libavcodec, libavdevice, libavformat, libavutil, and libswscale")
if (FFMPEG_FIND_REQUIRED)
message(FATAL_ERROR "Error: FFMPEG is required by this package!")
endif (FFMPEG_FIND_REQUIRED)
endif (FFMPEG_FOUND)
endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
indi-sbig-2.1+20221220234924/cmake_modules/FindNUTClient.cmake 0000644 0001751 0001751 00000003040 14347562502 022254 0 ustar debian debian # - Try to find nutclient library (version 2) and include files
# Once done this will define
#
# NUTCLIENT_FOUND - system has NUTCLIENT
# NUTCLIENT_INCLUDE_DIR - the NUTCLIENT include directory
# NUTCLIENT_LIBRARIES - Link these to use NUTCLIENT
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (NUTCLIENT_INCLUDE_DIR AND NUTCLIENT_LIBRARIES)
# in cache already
set(NUTCLIENT_FOUND TRUE)
message(STATUS "Found libnutclient: ${NUTCLIENT_LIBRARIES}")
else (NUTCLIENT_INCLUDE_DIR AND NUTCLIENT_LIBRARIES)
find_path(NUTCLIENT_INCLUDE_DIR nutclient.h
PATH_SUFFIXES nutclient
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(NUTCLIENT_LIBRARIES NAMES nutclient
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(NUTCLIENT_INCLUDE_DIR AND NUTCLIENT_LIBRARIES)
set(NUTCLIENT_FOUND TRUE)
else (NUTCLIENT_INCLUDE_DIR AND NUTCLIENT_LIBRARIES)
set(NUTCLIENT_FOUND FALSE)
endif(NUTCLIENT_INCLUDE_DIR AND NUTCLIENT_LIBRARIES)
if (NUTCLIENT_FOUND)
if (NOT NUTCLIENT_FIND_QUIETLY)
message(STATUS "Found NUTCLIENT: ${NUTCLIENT_LIBRARIES}")
endif (NOT NUTCLIENT_FIND_QUIETLY)
else (NUTCLIENT_FOUND)
if (NUTCLIENT_FIND_REQUIRED)
message(FATAL_ERROR "NUTCLIENT not found. Please install libnutclient development package.")
endif (NUTCLIENT_FIND_REQUIRED)
endif (NUTCLIENT_FOUND)
mark_as_advanced(NUTCLIENT_INCLUDE_DIR NUTCLIENT_LIBRARIES)
endif (NUTCLIENT_INCLUDE_DIR AND NUTCLIENT_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindIconv.cmake 0000644 0001751 0001751 00000004261 14174600255 021527 0 ustar debian debian #
# Copyright (C) 2010 Michael Bell
# 2015-2016 MariaDB Corporation AB
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the COPYING-CMAKE-SCRIPTS file.
#
# ICONV_EXTERNAL - Iconv is an external library (not libc)
# ICONV_FOUND - system has Iconv
# ICONV_INCLUDE_DIR - the Iconv include directory
# ICONV_LIBRARIES - Link these to use Iconv
# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
# ICONV_VERSION - Iconv version string
if (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
# Already in cache, be silent
set(ICONV_FIND_QUIETLY TRUE)
endif (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
find_path(ICONV_INCLUDE_DIR iconv.h)
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
# There is some libiconv.so in /usr/local that must
# be avoided, iconv routines are in libc
ELSEIF(APPLE)
find_library(ICONV_LIBRARIES NAMES iconv libiconv PATHS
/usr/lib/
NO_CMAKE_SYSTEM_PATH)
SET(ICONV_EXTERNAL TRUE)
ELSE()
find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2)
IF(ICONV_LIBRARIES)
SET(ICONV_EXTERNAL TRUE)
ENDIF()
ENDIF()
if (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
set (ICONV_FOUND TRUE)
endif (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
IF(ICONV_EXTERNAL)
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
ENDIF()
if (ICONV_FOUND)
include(CheckCSourceCompiles)
CHECK_C_SOURCE_COMPILES("
#include
int main(){
iconv_t conv = 0;
const char* in = 0;
size_t ilen = 0;
char* out = 0;
size_t olen = 0;
iconv(conv, &in, &ilen, &out, &olen);
return 0;
}
" ICONV_SECOND_ARGUMENT_IS_CONST )
endif (ICONV_FOUND)
set (CMAKE_REQUIRED_INCLUDES)
set (CMAKE_REQUIRED_LIBRARIES)
if (ICONV_FOUND)
if (NOT ICONV_FIND_QUIETLY)
message (STATUS "Found Iconv: ${ICONV_LIBRARIES}")
endif (NOT ICONV_FIND_QUIETLY)
else (ICONV_FOUND)
if (Iconv_FIND_REQUIRED)
message (FATAL_ERROR "Could not find Iconv")
endif (Iconv_FIND_REQUIRED)
endif (ICONV_FOUND)
MARK_AS_ADVANCED(
ICONV_INCLUDE_DIR
ICONV_LIBRARIES
ICONV_EXTERNAL
ICONV_SECOND_ARGUMENT_IS_CONST
)
indi-sbig-2.1+20221220234924/cmake_modules/FindLIMESUITE.cmake 0000644 0001751 0001751 00000003012 14174600255 022002 0 ustar debian debian # - Try to find LIMESUITE
# Once done this will define
#
# LIMESUITE_FOUND - system has LIMESUITE
# LIMESUITE_INCLUDE_DIR - the LIMESUITE include directory
# LIMESUITE_LIBRARIES - Link these to use LIMESUITE
# LIMESUITE_VERSION_STRING - Human readable version number of rtlsdr
# LIMESUITE_VERSION_MAJOR - Major version number of rtlsdr
# LIMESUITE_VERSION_MINOR - Minor version number of rtlsdr
# Copyright (c) 2017, Ilia Platone,
# Based on FindLibfacile by Carsten Niehaus,
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (LIMESUITE_LIBRARIES)
# in cache already
set(LIMESUITE_FOUND TRUE)
message(STATUS "Found LIMESUITE: ${LIMESUITE_LIBRARIES}")
else (LIMESUITE_LIBRARIES)
find_library(LIMESUITE_LIBRARIES NAMES LimeSuite
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
/usr/local/lib
)
if(LIMESUITE_LIBRARIES)
set(LIMESUITE_FOUND TRUE)
else (LIMESUITE_LIBRARIES)
set(LIMESUITE_FOUND FALSE)
endif(LIMESUITE_LIBRARIES)
if (LIMESUITE_FOUND)
if (NOT LIMESUITE_FIND_QUIETLY)
message(STATUS "Found LIMESUITE: ${LIMESUITE_LIBRARIES}")
endif (NOT LIMESUITE_FIND_QUIETLY)
else (LIMESUITE_FOUND)
if (LIMESUITE_FIND_REQUIRED)
message(FATAL_ERROR "LIMESUITE not found. Please install libLimeSuite-dev")
endif (LIMESUITE_FIND_REQUIRED)
endif (LIMESUITE_FOUND)
mark_as_advanced(LIMESUITE_LIBRARIES)
endif (LIMESUITE_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindOMEGONPROCAM.cmake 0000644 0001751 0001751 00000003233 14247236061 022336 0 ustar debian debian # - Try to find Omegon Pro Cam Camera Library
# Once done this will define
#
# OMEGONPROCAM_FOUND - system has Omegon Pro Cam
# OMEGONPROCAM_INCLUDE_DIR - the Omegon Pro Cam include directory
# OMEGONPROCAM_LIBRARIES - Link these to use Omegon Pro Cam
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (OMEGONPROCAM_INCLUDE_DIR AND OMEGONPROCAM_LIBRARIES)
# in cache already
set(OMEGONPROCAM_FOUND TRUE)
message(STATUS "Found libomegonprocam: ${OMEGONPROCAM_LIBRARIES}")
else (OMEGONPROCAM_INCLUDE_DIR AND OMEGONPROCAM_LIBRARIES)
find_path(OMEGONPROCAM_INCLUDE_DIR omegonprocam.h
PATH_SUFFIXES libomegonprocam
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(OMEGONPROCAM_LIBRARIES NAMES omegonprocam
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(OMEGONPROCAM_INCLUDE_DIR AND OMEGONPROCAM_LIBRARIES)
set(OMEGONPROCAM_FOUND TRUE)
else (OMEGONPROCAM_INCLUDE_DIR AND OMEGONPROCAM_LIBRARIES)
set(OMEGONPROCAM_FOUND FALSE)
endif(OMEGONPROCAM_INCLUDE_DIR AND OMEGONPROCAM_LIBRARIES)
if (OMEGONPROCAM_FOUND)
if (NOT OMEGONPROCAM_FIND_QUIETLY)
message(STATUS "Found OmegonProCam: ${OMEGONPROCAM_LIBRARIES}")
endif (NOT OMEGONPROCAM_FIND_QUIETLY)
else (OMEGONPROCAM_FOUND)
if (OMEGONPROCAM_FIND_REQUIRED)
message(FATAL_ERROR "OmegonProCam not found. Please install OmegonProCam Library http://www.indilib.org")
endif (OMEGONPROCAM_FIND_REQUIRED)
endif (OMEGONPROCAM_FOUND)
mark_as_advanced(OMEGONPROCAM_INCLUDE_DIR OMEGONPROCAM_LIBRARIES)
endif (OMEGONPROCAM_INCLUDE_DIR AND OMEGONPROCAM_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindPLAYERONE.cmake 0000644 0001751 0001751 00000003221 14347562502 022006 0 ustar debian debian # - Try to find PlayerOne Library
# Once done this will define
#
# PLAYERONE_FOUND - system has PLAYERONE
# PLAYERONE_INCLUDE_DIR - the PLAYERONE include directory
# PLAYERONE_LIBRARIES - Link these to use ASI
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (PLAYERONE_INCLUDE_DIR AND PLAYERONE_LIBRARIES)
# in cache already
set(PLAYERONE_FOUND TRUE)
message(STATUS "Found libplayerone: ${PLAYERONE_LIBRARIES}")
else (PLAYERONE_INCLUDE_DIR AND PLAYERONE_LIBRARIES)
find_path(PLAYERONE_INCLUDE_DIR PlayerOneCamera.h
PATH_SUFFIXES libplayerone
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(PLAYERONECAM_LIBRARIES NAMES PlayerOneCamera
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if (PLAYERONECAM_LIBRARIES)
set(PLAYERONE_LIBRARIES ${PLAYERONECAM_LIBRARIES})
endif (PLAYERONECAM_LIBRARIES)
if(PLAYERONE_INCLUDE_DIR AND PLAYERONE_LIBRARIES)
set(PLAYERONE_FOUND TRUE)
else (PLAYERONE_INCLUDE_DIR AND PLAYERONE_LIBRARIES)
set(PLAYERONE_FOUND FALSE)
endif(PLAYERONE_INCLUDE_DIR AND PLAYERONE_LIBRARIES)
if (PLAYERONE_FOUND)
if (NOT PLAYERONE_FIND_QUIETLY)
message(STATUS "Found PLAYERONE: ${PLAYERONE_LIBRARIES}")
endif (NOT PLAYERONE_FIND_QUIETLY)
else (PLAYERONE_FOUND)
if (PLAYERONE_FIND_REQUIRED)
message(FATAL_ERROR "PLAYERONE not found. Please install libPlayerOneCamera.3 http://www.indilib.org")
endif (PLAYERONE_FIND_REQUIRED)
endif (PLAYERONE_FOUND)
mark_as_advanced(PLAYERONE_INCLUDE_DIR PLAYERONE_LIBRARIES)
endif (PLAYERONE_INCLUDE_DIR AND PLAYERONE_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindLibCameraApps.cmake 0000644 0001751 0001751 00000004251 14347562502 023117 0 ustar debian debian # - Try to find LIBCAMERAAPPS Library
# Once done this will define
#
# LIBCAMERAAPPS_FOUND - system has LIBCAMERAAPPS
# LIBCAMERAAPPS_APPS - Link these to use Apps
# LIBCAMERAAPPS_ENCODERS - Link these to use Encoders
# LIBCAMERAAPPS_IMAGES - Link these to use Images
# LIBCAMERAAPPS_OUTPUTS - Link these to use Outputs
# LIBCAMERAAPPS_PREVIEW - Link these to use Preview
# LIBCAMERAAPPS_POST - Link these to use Post Processing Stages
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (LIBCAMERAAPPS_APPS)
# in cache already
set(LIBCAMERAAPPS_FOUND TRUE)
message(STATUS "Found LIBCAMERAAPPS: ${LIBCAMERAAPPS_APPS}")
else (LIBCAMERAAPPS_APPS)
find_library(LIBCAMERAAPPS_APPS NAMES camera_app
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(LIBCAMERAAPPS_ENCODERS NAMES encoders
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(LIBCAMERAAPPS_IMAGES NAMES images
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(LIBCAMERAAPPS_OUTPUTS NAMES outputs
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(LIBCAMERAAPPS_POST NAMES post_processing_stages
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(LIBCAMERAAPPS_PREVIEW NAMES preview
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(LIBCAMERAAPPS_APPS)
set(LIBCAMERAAPPS_FOUND TRUE)
else (LIBCAMERAAPPS_APPS)
set(LIBCAMERAAPPS_FOUND FALSE)
endif(LIBCAMERAAPPS_APPS)
if (LIBCAMERAAPPS_FOUND)
if (NOT LIBCAMERAAPPS_FIND_QUIETLY)
message(STATUS "Found LIBCAMERAAPPS Library: ${LIBCAMERAAPPS_APPS}")
endif (NOT LIBCAMERAAPPS_FIND_QUIETLY)
else (LIBCAMERAAPPS_FOUND)
if (LIBCAMERAAPPS_FIND_REQUIRED)
message(FATAL_ERROR "LIBCAMERAAPPS Library not found. Please install libcamera-apps")
endif (LIBCAMERAAPPS_FIND_REQUIRED)
endif (LIBCAMERAAPPS_FOUND)
mark_as_advanced(LIBCAMERAAPPS_APPS LIBCAMERAAPPS_ENCODERS LIBCAMERAAPPS_IMAGES LIBCAMERAAPPS_OUTPUTS LIBCAMERAAPPS_POST LIBCAMERAAPPS_PREVIEW)
endif (LIBCAMERAAPPS_APPS)
indi-sbig-2.1+20221220234924/cmake_modules/FindNNCAM.cmake 0000644 0001751 0001751 00000002563 14174600255 021310 0 ustar debian debian # - Try to find NNCAM Camera Library
# Once done this will define
#
# NNCAM_FOUND - system has Levenhuk
# NNCAM_INCLUDE_DIR - the Levenhuk include directory
# NNCAM_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 (NNCAM_INCLUDE_DIR AND NNCAM_LIBRARIES)
# in cache already
set(NNCAM_FOUND TRUE)
message(STATUS "Found libnncam: ${NNCAM_LIBRARIES}")
else (NNCAM_INCLUDE_DIR AND NNCAM_LIBRARIES)
find_path(NNCAM_INCLUDE_DIR nncam.h
PATH_SUFFIXES libnncam
${_obIncDir}
${GNUWIN32_DIR}/include
)
find_library(NNCAM_LIBRARIES NAMES nncam
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(NNCAM_INCLUDE_DIR AND NNCAM_LIBRARIES)
set(NNCAM_FOUND TRUE)
else (NNCAM_INCLUDE_DIR AND NNCAM_LIBRARIES)
set(NNCAM_FOUND FALSE)
endif(NNCAM_INCLUDE_DIR AND NNCAM_LIBRARIES)
if (NNCAM_FOUND)
if (NOT NNCAM_FIND_QUIETLY)
message(STATUS "Found NNCAM: ${NNCAM_LIBRARIES}")
endif (NOT NNCAM_FIND_QUIETLY)
else (NNCAM_FOUND)
if (NNCAM_FIND_REQUIRED)
message(FATAL_ERROR "NNCAM not found. Please install NNCAM Library http://www.indilib.org")
endif (NNCAM_FIND_REQUIRED)
endif (NNCAM_FOUND)
mark_as_advanced(NNCAM_INCLUDE_DIR NNCAM_LIBRARIES)
endif (NNCAM_INCLUDE_DIR AND NNCAM_LIBRARIES)
indi-sbig-2.1+20221220234924/cmake_modules/FindRT.cmake 0000644 0001751 0001751 00000001525 14174600255 020776 0 ustar debian debian # FindRT.cmake - Try to find the RT library
# Once done this will define
#
# RT_FOUND - System has rt
# RT_INCLUDE_DIR - The rt include directory
# RT_LIBRARIES - The libraries needed to use rt
# RT_DEFINITIONS - Compiler switches required for using rt
#
# Also creates an import target called RT::RT
find_path (RT_INCLUDE_DIR NAMES time.h
PATHS
/usr
/usr/local
/opt
PATH_SUFFIXES
)
find_library(RT_LIBRARIES NAMES rt
PATHS
/usr
/usr/local
/opt
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(rt DEFAULT_MSG RT_LIBRARIES RT_INCLUDE_DIR)
mark_as_advanced(RT_INCLUDE_DIR RT_LIBRARIES)
if (NOT TARGET RT::RT)
add_library(RT::RT INTERFACE IMPORTED)
set_target_properties(RT::RT PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${RT_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES ${RT_LIBRARIES}
)
endif() indi-sbig-2.1+20221220234924/indi_sbig.xml.cmake 0000644 0001751 0001751 00000000773 14174600255 017572 0 ustar debian debian
indi_sbig_ccd
@SBIG_VERSION_MAJOR@.@SBIG_VERSION_MINOR@
indi_sbig_ccd
@SBIG_VERSION_MAJOR@.@SBIG_VERSION_MINOR@
indi-sbig-2.1+20221220234924/ChangeLog 0000644 0001751 0001751 00000000122 14174600255 015600 0 ustar debian debian ChangeLog:
2008-10-03 Initial Release.
2013-11-04 Migrated to INDI::CCD (JM) indi-sbig-2.1+20221220234924/indi-sbig.spec 0000644 0001751 0001751 00000004177 14347562502 016571 0 ustar debian debian %define __cmake_in_source_build %{_vpath_builddir}
Name: indi-sbig
Version:1.9.9.git
Release: %(date -u +%%Y%%m%%d%%H%%M%%S)%{?dist}
Summary: Instrument Neutral Distributed Interface 3rd party drivers
License: LGPLv2
# See COPYRIGHT file for a description of the licenses and files covered
URL: https://indilib.org
Source0: https://github.com/indilib/indi-3rdparty/archive/master.tar.gz
BuildRequires: cmake
BuildRequires: libfli-devel
BuildRequires: libnova-devel
BuildRequires: qt5-qtbase-devel
BuildRequires: systemd
BuildRequires: gphoto2-devel
BuildRequires: LibRaw-devel
BuildRequires: indi-libs
BuildRequires: indi-devel
BuildRequires: libtiff-devel
BuildRequires: cfitsio-devel
BuildRequires: zlib-devel
BuildRequires: gsl-devel
BuildRequires: libcurl-devel
BuildRequires: libjpeg-turbo-devel
BuildRequires: fftw-devel
BuildRequires: libftdi-devel
BuildRequires: gpsd-devel
BuildRequires: libdc1394-devel
BuildRequires: boost-devel
BuildRequires: boost-regex
BuildRequires: libasi
BuildRequires: gmock
BuildRequires: pkgconfig(fftw3)
BuildRequires: pkgconfig(cfitsio)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(gsl)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(zlib)
BuildRequires: libsbig
Requires: libsbig
%description
INDI is a distributed control protocol designed to operate
astronomical instrumentation. INDI is small, flexible, easy to parse,
and scalable. It supports common DCS functions such as remote control,
data acquisition, monitoring, and a lot more. This is a 3rd party driver.
%prep -v
%autosetup -v -p1 -n indi-3rdparty-master
%build
# This package tries to mix and match PIE and PIC which is wrong and will
# trigger link errors when LTO is enabled.
# Disable LTO
%define _lto_cflags %{nil}
cd indi-sbig
%cmake -DINDI_DATA_DIR=/usr/share/indi .
make VERBOSE=1 %{?_smp_mflags} -j4
%install
cd indi-sbig
make DESTDIR=%{buildroot} install
%files
%{_bindir}/*
%{_datadir}/indi
%changelog
* Sun Jul 19 2020 Jim Howard 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
indi-sbig-2.1+20221220234924/CMakeLists.txt 0000644 0001751 0001751 00000003042 14174600255 016572 0 ustar debian debian cmake_minimum_required(VERSION 3.0)
PROJECT(indi_sbig CXX C)
set (SBIG_VERSION_MAJOR 2)
set (SBIG_VERSION_MINOR 1)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules/")
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
find_package(CFITSIO REQUIRED)
find_package(INDI REQUIRED)
find_package(ZLIB REQUIRED)
find_package(SBIG REQUIRED)
find_package(Threads REQUIRED)
find_package(USB1 REQUIRED)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/indi_sbig.xml.cmake ${CMAKE_CURRENT_BINARY_DIR}/indi_sbig.xml )
include_directories( ${CMAKE_CURRENT_BINARY_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
include_directories( ${INDI_INCLUDE_DIR})
include_directories( ${SBIG_INCLUDE_DIR})
include_directories( ${CFITSIO_INCLUDE_DIR})
include(CMakeCommon)
############# SBIG CCD ###############
if (CFITSIO_FOUND)
set(sbigccd_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/sbig_ccd.cpp
)
if (APPLE)
set(sbigccd_SRCS
${sbigccd_SRCS}
${CMAKE_CURRENT_SOURCE_DIR}/ezusb.c)
endif()
add_executable(indi_sbig_ccd ${sbigccd_SRCS})
target_link_libraries(indi_sbig_ccd ${INDI_LIBRARIES} ${CFITSIO_LIBRARIES} ${SBIG_LIBRARIES} ${M_LIB} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${USB1_LIBRARIES})
install(TARGETS indi_sbig_ccd RUNTIME DESTINATION bin)
endif (CFITSIO_FOUND)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_sbig.xml DESTINATION ${INDI_DATA_DIR})
indi-sbig-2.1+20221220234924/config.h.cmake 0000644 0001751 0001751 00000000373 14174600255 016533 0 ustar debian debian #ifndef CONFIG_H
#define CONFIG_H
/* Define INDI Data Dir */
#cmakedefine INDI_DATA_DIR "@INDI_DATA_DIR@"
/* Define Driver version */
#define SBIG_VERSION_MAJOR @SBIG_VERSION_MAJOR@
#define SBIG_VERSION_MINOR @SBIG_VERSION_MINOR@
#endif // CONFIG_H
indi-sbig-2.1+20221220234924/.project 0000644 0001751 0001751 00000000331 14174600255 015477 0 ustar debian debian
Project-Source@indi-sbig
indi-sbig-2.1+20221220234924/ezusb.h 0000644 0001751 0001751 00000010333 14174600255 015334 0 ustar debian debian #ifndef __ezusb_H
#define __ezusb_H
/*
* Copyright © 2001 Stephen Williams (steve@icarus.com)
* Copyright © 2002 David Brownell (dbrownell@users.sourceforge.net)
* Copyright © 2013 Federico Manzan (f.manzan@gmail.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program 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 program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(_MSC_VER)
#include
#else
#define __attribute__(x)
#if !defined(bool)
#define bool int
#endif
#if !defined(true)
#define true (1 == 1)
#endif
#if !defined(false)
#define false (!true)
#endif
#if defined(_PREFAST_)
#pragma warning(disable:28193)
#endif
#endif
#define FX_TYPE_UNDEFINED -1
#define FX_TYPE_AN21 0 /* Original AnchorChips parts */
#define FX_TYPE_FX1 1 /* Updated Cypress versions */
#define FX_TYPE_FX2 2 /* USB 2.0 versions */
#define FX_TYPE_FX2LP 3 /* Updated FX2 */
#define FX_TYPE_FX3 4 /* USB 3.0 versions */
#define FX_TYPE_MAX 5
#define FX_TYPE_NAMES { "an21", "fx", "fx2", "fx2lp", "fx3" }
#define IMG_TYPE_UNDEFINED -1
#define IMG_TYPE_HEX 0 /* Intel HEX */
#define IMG_TYPE_IIC 1 /* Cypress 8051 IIC */
#define IMG_TYPE_BIX 2 /* Cypress 8051 BIX */
#define IMG_TYPE_IMG 3 /* Cypress IMG format */
#define IMG_TYPE_MAX 4
#define IMG_TYPE_NAMES { "Intel HEX", "Cypress 8051 IIC", "Cypress 8051 BIX", "Cypress IMG format" }
#ifdef __cplusplus
extern "C" {
#endif
/*
* Automatically identified devices (VID, PID, type, designation).
* TODO: Could use some validation. Also where's the FX2?
*/
typedef struct {
uint16_t vid;
uint16_t pid;
int type;
const char* designation;
} fx_known_device;
#define FX_KNOWN_DEVICES { \
{ 0x0547, 0x2122, FX_TYPE_AN21, "Cypress EZ-USB (2122S)" },\
{ 0x0547, 0x2125, FX_TYPE_AN21, "Cypress EZ-USB (2121S/2125S)" },\
{ 0x0547, 0x2126, FX_TYPE_AN21, "Cypress EZ-USB (2126S)" },\
{ 0x0547, 0x2131, FX_TYPE_AN21, "Cypress EZ-USB (2131Q/2131S/2135S)" },\
{ 0x0547, 0x2136, FX_TYPE_AN21, "Cypress EZ-USB (2136S)" },\
{ 0x0547, 0x2225, FX_TYPE_AN21, "Cypress EZ-USB (2225)" },\
{ 0x0547, 0x2226, FX_TYPE_AN21, "Cypress EZ-USB (2226)" },\
{ 0x0547, 0x2235, FX_TYPE_AN21, "Cypress EZ-USB (2235)" },\
{ 0x0547, 0x2236, FX_TYPE_AN21, "Cypress EZ-USB (2236)" },\
{ 0x04b4, 0x6473, FX_TYPE_FX1, "Cypress EZ-USB FX1" },\
{ 0x04b4, 0x8613, FX_TYPE_FX2LP, "Cypress EZ-USB FX2LP (68013A/68014A/68015A/68016A)" }, \
{ 0x04b4, 0x00f3, FX_TYPE_FX3, "Cypress FX3" },\
}
/*
* This function uploads the firmware from the given file into RAM.
* Stage == 0 means this is a single stage load (or the first of
* two stages). Otherwise it's the second of two stages; the
* caller having preloaded the second stage loader.
*
* The target processor is reset at the end of this upload.
*/
extern int ezusb_load_ram(libusb_device_handle *device,
const char *path, int fx_type, int img_type, int stage);
/*
* This function uploads the firmware from the given file into EEPROM.
* This uses the right CPUCS address to terminate the EEPROM load with
* a reset command where FX parts behave differently than FX2 ones.
* The configuration byte is as provided here (zero for an21xx parts)
* and the EEPROM type is set so that the microcontroller will boot
* from it.
*
* The caller must have preloaded a second stage loader that knows
* how to respond to the EEPROM write request.
*/
extern int ezusb_load_eeprom(libusb_device_handle *device,
const char *path, int fx_type, int img_type, int config);
/* Verbosity level (default 1). Can be increased or decreased with options v/q */
extern int verbose;
#ifdef __cplusplus
}
#endif
#endif
indi-sbig-2.1+20221220234924/AUTHORS 0000644 0001751 0001751 00000000132 14174600255 015077 0 ustar debian debian Jan Soldan (jsoldan AT asu DOT cas DOT cz)
Jasem Mutlaq (mutlaqja AT ikarustech DOT com)
indi-sbig-2.1+20221220234924/COPYING.LIB 0000644 0001751 0001751 00000061334 14174600255 015502 0 ustar debian debian GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
indi-sbig-2.1+20221220234924/INSTALL 0000644 0001751 0001751 00000000526 14174600255 015067 0 ustar debian debian SBIG INSTALL
============
You must have CMake >= 2.4.7 in order to build this package.
1) $ tar -xzf indi_sbig.tar.gz
2) $ mkdir indi_sbig_build
3) $ cd indi_sbig_build
4) $ cmake -DCMAKE_INSTALL_PREFIX=/usr . ../indi_sbig
5) $ su -c 'make install' or sudo make install
Refer to README for instructions on using the driver.
That's it!