2016-05-26 23:44:27 +02:00
|
|
|
|
|
|
|
# Define the current source locations
|
|
|
|
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/leddevice)
|
|
|
|
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/leddevice)
|
|
|
|
|
|
|
|
#add libusb and pthreads (required for the Lighpack usb device)
|
|
|
|
find_package(libusb-1.0 REQUIRED)
|
2016-06-23 00:11:09 +02:00
|
|
|
#find_package(Threads REQUIRED)
|
2016-05-26 23:44:27 +02:00
|
|
|
|
|
|
|
include_directories(
|
2016-09-02 07:41:27 +02:00
|
|
|
${CMAKE_SOURCE_DIR}/include/hidapi
|
2016-05-26 23:44:27 +02:00
|
|
|
${LIBUSB_1_INCLUDE_DIRS}
|
|
|
|
) # for Lightpack device
|
|
|
|
|
|
|
|
# Group the headers that go through the MOC compiler
|
|
|
|
SET(Leddevice_QT_HEADERS
|
2016-08-14 10:46:44 +02:00
|
|
|
${CURRENT_HEADER_DIR}/LedDevice.h
|
2016-08-28 07:12:48 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/ProviderRs232.h
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAtmoOrb.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.h
|
2016-08-28 07:12:48 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/ProviderHID.h
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceRawHID.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.h
|
|
|
|
)
|
|
|
|
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${CURRENT_HEADER_DIR}/LedDeviceFactory.h
|
|
|
|
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLightpack.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceMultiLightpack.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePaintpack.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePiBlaster.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceSedu.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFile.h
|
2016-05-30 23:58:31 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.h
|
2016-08-19 17:14:52 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.h
|
2016-08-28 07:12:48 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/ProviderUdp.h
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTpm2.h
|
2016-08-23 20:07:12 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTpm2net.h
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAtmo.h
|
|
|
|
)
|
|
|
|
|
|
|
|
SET(Leddevice_SOURCES
|
2016-06-25 22:08:17 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDevice.cpp
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFactory.cpp
|
|
|
|
|
2016-08-28 07:12:48 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/ProviderRs232.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/ProviderHID.cpp
|
2016-05-26 23:44:27 +02:00
|
|
|
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAtmoOrb.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceRawHID.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLightpack.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceMultiLightpack.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePaintpack.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePiBlaster.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceSedu.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFile.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.cpp
|
2016-05-30 23:58:31 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceUdpRaw.cpp
|
2016-08-19 17:14:52 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceUdpE131.cpp
|
2016-08-28 07:12:48 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/ProviderUdp.cpp
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTpm2.cpp
|
2016-08-23 20:07:12 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTpm2net.cpp
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAtmo.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
if(ENABLE_SPIDEV)
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${Leddevice_HEADERS}
|
2016-08-28 07:12:48 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/ProviderSpi.h
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceP9813.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWs2812SPI.h
|
2016-06-27 22:43:35 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceSk6812SPI.h
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAPA102.h
|
|
|
|
)
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${Leddevice_SOURCES}
|
2016-08-28 07:12:48 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/ProviderSpi.cpp
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceP9813.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWs2812SPI.cpp
|
2016-06-27 22:43:35 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceSk6812SPI.cpp
|
2016-05-26 23:44:27 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAPA102.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_WS2812BPWM)
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${Leddevice_HEADERS}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWS2812b.h
|
|
|
|
)
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${Leddevice_SOURCES}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWS2812b.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_WS281XPWM)
|
|
|
|
include_directories(../../dependencies/external/rpi_ws281x)
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${Leddevice_HEADERS}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWS281x.h
|
|
|
|
)
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${Leddevice_SOURCES}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWS281x.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_TINKERFORGE)
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${Leddevice_HEADERS}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTinkerforge.h
|
|
|
|
)
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${Leddevice_SOURCES}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTinkerforge.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-08-23 20:07:12 +02:00
|
|
|
set(LedDevice_RESOURCES
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceSchemas.qrc
|
|
|
|
)
|
|
|
|
|
2016-06-17 01:25:40 +02:00
|
|
|
QT5_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
|
2016-08-23 20:07:12 +02:00
|
|
|
qt5_add_resources(LedDevice_RESOURCES_RCC ${LedDevice_RESOURCES} OPTIONS "-no-compress")
|
|
|
|
|
2016-05-26 23:44:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
add_library(leddevice
|
|
|
|
${Leddevice_HEADERS}
|
|
|
|
${Leddevice_QT_HEADERS}
|
|
|
|
${Leddevice_HEADERS_MOC}
|
|
|
|
${Leddevice_SOURCES}
|
2016-08-23 20:07:12 +02:00
|
|
|
${LedDevice_RESOURCES}
|
|
|
|
${LedDevice_RESOURCES_RCC}
|
2016-05-26 23:44:27 +02:00
|
|
|
)
|
|
|
|
|
2016-06-23 00:11:09 +02:00
|
|
|
qt5_use_modules(leddevice Network SerialPort)
|
2016-05-26 23:44:27 +02:00
|
|
|
|
|
|
|
target_link_libraries(leddevice
|
|
|
|
hyperion-utils
|
|
|
|
${LIBUSB_1_LIBRARIES} #apt-get install libusb-1.0-0-dev
|
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
|
|
${QT_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(ENABLE_TINKERFORGE)
|
|
|
|
target_link_libraries(leddevice tinkerforge)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_WS281XPWM)
|
|
|
|
target_link_libraries(leddevice ws281x)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
target_link_libraries(leddevice hidapi-mac)
|
|
|
|
else()
|
|
|
|
target_link_libraries(leddevice hidapi-libusb)
|
|
|
|
endif()
|