mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Implemented compile capability for MacOS.
Former-commit-id: 86e560e0d4f03251ee08a648ffa6fd9a0e01ae78
This commit is contained in:
@@ -57,7 +57,6 @@ target_link_libraries(hyperion
|
||||
hyperion-utils
|
||||
leddevice
|
||||
effectengine
|
||||
hidapi-libusb
|
||||
serialport
|
||||
${QT_LIBRARIES}
|
||||
)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
|
||||
// STL includes
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
|
||||
// hyperion includes
|
||||
|
@@ -7,9 +7,6 @@
|
||||
// Qt includes
|
||||
#include <QTimer>
|
||||
|
||||
// Linux-SPI includes
|
||||
#include <linux/spi/spidev.h>
|
||||
|
||||
// hyperion incluse
|
||||
#include <leddevice/LedDevice.h>
|
||||
|
||||
|
@@ -12,22 +12,14 @@ include_directories(
|
||||
${LIBUSB_1_INCLUDE_DIRS}) # for Lightpack device
|
||||
|
||||
# Group the headers that go through the MOC compiler
|
||||
SET(Leddevice_QT_HEADERS
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.h
|
||||
)
|
||||
|
||||
SET(Leddevice_HEADERS
|
||||
${CURRENT_HEADER_DIR}/LedDevice.h
|
||||
${CURRENT_HEADER_DIR}/LedDeviceFactory.h
|
||||
|
||||
${CURRENT_SOURCE_DIR}/LedSpiDevice.h
|
||||
${CURRENT_SOURCE_DIR}/LedRs232Device.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceTest.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceSedu.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2811.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLightpack.h
|
||||
${CURRENT_SOURCE_DIR}/LedDevicePaintpack.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceMultiLightpack.h
|
||||
@@ -36,20 +28,39 @@ SET(Leddevice_HEADERS
|
||||
SET(Leddevice_SOURCES
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceFactory.cpp
|
||||
|
||||
${CURRENT_SOURCE_DIR}/LedSpiDevice.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedRs232Device.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceSedu.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceTest.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2811.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLightpack.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDevicePaintpack.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceMultiLightpack.cpp
|
||||
)
|
||||
|
||||
if(ENABLE_SPIDEV)
|
||||
SET(Leddevice_QT_HEADERS
|
||||
${Leddevice_QT_HEADERS}
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.h
|
||||
)
|
||||
SET(Leddevice_HEADERS
|
||||
${Leddevice_HEADERS}
|
||||
${CURRENT_SOURCE_DIR}/LedSpiDevice.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.h
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2811.h
|
||||
)
|
||||
SET(Leddevice_SOURCES
|
||||
${Leddevice_SOURCES}
|
||||
${CURRENT_SOURCE_DIR}/LedSpiDevice.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.cpp
|
||||
${CURRENT_SOURCE_DIR}/LedDeviceWs2811.cpp
|
||||
)
|
||||
endif(ENABLE_SPIDEV)
|
||||
|
||||
|
||||
QT4_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
|
||||
|
||||
add_library(leddevice
|
||||
@@ -61,9 +72,13 @@ add_library(leddevice
|
||||
|
||||
target_link_libraries(leddevice
|
||||
hyperion-utils
|
||||
hidapi-libusb
|
||||
serialport
|
||||
${LIBUSB_1_LIBRARIES} #apt-get install libusb-1.0-0-dev
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${QT_LIBRARIES}
|
||||
)
|
||||
if(APPLE)
|
||||
target_link_libraries(leddevice hidapi-mac)
|
||||
else()
|
||||
target_link_libraries(leddevice hidapi-libusb)
|
||||
endif()
|
||||
|
@@ -3,12 +3,15 @@
|
||||
#include <leddevice/LedDeviceFactory.h>
|
||||
|
||||
// Local Leddevice includes
|
||||
#include "LedDeviceLpd6803.h"
|
||||
#include "LedDeviceLpd8806.h"
|
||||
#ifdef ENABLE_SPIDEV
|
||||
#include "LedDeviceLpd6803.h"
|
||||
#include "LedDeviceLpd8806.h"
|
||||
#include "LedDeviceWs2801.h"
|
||||
#include "LedDeviceWs2811.h"
|
||||
#endif
|
||||
|
||||
#include "LedDeviceSedu.h"
|
||||
#include "LedDeviceTest.h"
|
||||
#include "LedDeviceWs2801.h"
|
||||
#include "LedDeviceWs2811.h"
|
||||
#include "LedDeviceAdalight.h"
|
||||
#include "LedDevicePaintpack.h"
|
||||
#include "LedDeviceLightpack.h"
|
||||
@@ -22,7 +25,9 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
std::transform(type.begin(), type.end(), type.begin(), ::tolower);
|
||||
|
||||
LedDevice* device = nullptr;
|
||||
if (type == "ws2801" || type == "lightberry")
|
||||
if (false) {}
|
||||
#ifdef ENABLE_SPIDEV
|
||||
else if (type == "ws2801" || type == "lightberry")
|
||||
{
|
||||
const std::string output = deviceConfig["output"].asString();
|
||||
const unsigned rate = deviceConfig["rate"].asInt();
|
||||
@@ -69,16 +74,6 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
|
||||
device = deviceLpd8806;
|
||||
}
|
||||
else if (type == "sedu")
|
||||
{
|
||||
const std::string output = deviceConfig["output"].asString();
|
||||
const unsigned rate = deviceConfig["rate"].asInt();
|
||||
|
||||
LedDeviceSedu* deviceSedu = new LedDeviceSedu(output, rate);
|
||||
deviceSedu->open();
|
||||
|
||||
device = deviceSedu;
|
||||
}
|
||||
else if (type == "adalight")
|
||||
{
|
||||
const std::string output = deviceConfig["output"].asString();
|
||||
@@ -89,6 +84,17 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
|
||||
|
||||
device = deviceAdalight;
|
||||
}
|
||||
#endif
|
||||
else if (type == "sedu")
|
||||
{
|
||||
const std::string output = deviceConfig["output"].asString();
|
||||
const unsigned rate = deviceConfig["rate"].asInt();
|
||||
|
||||
LedDeviceSedu* deviceSedu = new LedDeviceSedu(output, rate);
|
||||
deviceSedu->open();
|
||||
|
||||
device = deviceSedu;
|
||||
}
|
||||
else if (type == "lightpack")
|
||||
{
|
||||
const std::string output = deviceConfig.get("output", "").asString();
|
||||
|
Reference in New Issue
Block a user