2013-12-17 19:50:15 +01: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)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
include_directories(
|
2014-03-04 20:38:54 +01:00
|
|
|
../../include/hidapi
|
|
|
|
${LIBUSB_1_INCLUDE_DIRS}) # for Lightpack device
|
2013-12-17 19:50:15 +01:00
|
|
|
|
|
|
|
# Group the headers that go through the MOC compiler
|
2013-12-19 09:29:26 +01:00
|
|
|
SET(Leddevice_QT_HEADERS
|
2014-05-04 11:41:55 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedRs232Device.h
|
2013-12-19 09:29:26 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.h
|
2015-10-13 19:11:01 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.h
|
2015-01-05 15:12:47 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAmbiLed.h
|
2014-05-03 10:12:41 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.h
|
2015-11-08 16:31:18 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedHIDDevice.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceRawHID.h
|
2016-01-04 12:16:44 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTest.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.h
|
2013-12-19 09:29:26 +01:00
|
|
|
)
|
2013-12-17 19:50:15 +01:00
|
|
|
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${CURRENT_HEADER_DIR}/LedDevice.h
|
|
|
|
${CURRENT_HEADER_DIR}/LedDeviceFactory.h
|
|
|
|
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLightpack.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceMultiLightpack.h
|
2014-01-04 11:35:11 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePaintpack.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePiBlaster.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceSedu.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTest.h
|
2016-01-04 12:16:44 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.h
|
2014-03-09 11:36:46 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.h
|
2014-06-15 02:19:09 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTpm2.h
|
2015-02-04 21:49:33 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAtmo.h
|
2013-12-17 19:50:15 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFactory.cpp
|
|
|
|
|
|
|
|
${CURRENT_SOURCE_DIR}/LedRs232Device.cpp
|
2015-11-08 16:31:18 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedHIDDevice.cpp
|
2014-01-04 11:35:11 +01:00
|
|
|
|
2013-12-17 19:50:15 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.cpp
|
2015-10-13 19:11:01 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAdalightApa102.cpp
|
2015-01-05 15:12:47 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAmbiLed.cpp
|
2015-11-08 16:31:18 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceRawHID.cpp
|
2013-12-17 19:50:15 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLightpack.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceMultiLightpack.cpp
|
2014-01-04 11:35:11 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePaintpack.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePiBlaster.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceSedu.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTest.cpp
|
2016-01-04 12:16:44 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceFadeCandy.cpp
|
2014-03-09 11:36:46 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceHyperionUsbasp.cpp
|
2014-04-27 12:59:44 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.cpp
|
2014-06-15 02:19:09 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTpm2.cpp
|
2015-02-04 21:49:33 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAtmo.cpp
|
2013-12-17 19:50:15 +01:00
|
|
|
)
|
|
|
|
|
2013-12-17 22:53:16 +01:00
|
|
|
if(ENABLE_SPIDEV)
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${Leddevice_HEADERS}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedSpiDevice.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.h
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.h
|
2014-01-18 13:43:39 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceP9813.h
|
2014-01-18 23:49:32 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.h
|
2014-12-03 18:36:18 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAPA102.h
|
2013-12-17 22:53:16 +01:00
|
|
|
)
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${Leddevice_SOURCES}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedSpiDevice.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd6803.cpp
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceLpd8806.cpp
|
2014-01-18 13:43:39 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceP9813.cpp
|
2014-01-18 23:49:32 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWs2801.cpp
|
2014-12-03 18:36:18 +01:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceAPA102.cpp
|
2013-12-17 22:53:16 +01:00
|
|
|
)
|
|
|
|
endif(ENABLE_SPIDEV)
|
|
|
|
|
2014-09-19 16:37:58 +02:00
|
|
|
if(ENABLE_WS2812BPWM)
|
2014-09-16 00:17:23 +02:00
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${Leddevice_HEADERS}
|
2014-09-17 21:20:36 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWS2812b.h
|
2014-09-16 00:17:23 +02:00
|
|
|
)
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${Leddevice_SOURCES}
|
2014-09-17 21:20:36 +02:00
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceWS2812b.cpp
|
2014-09-16 00:17:23 +02:00
|
|
|
)
|
2014-09-19 16:37:58 +02:00
|
|
|
endif(ENABLE_WS2812BPWM)
|
2014-09-16 00:17:23 +02:00
|
|
|
|
2014-03-04 20:38:54 +01:00
|
|
|
if(ENABLE_TINKERFORGE)
|
|
|
|
SET(Leddevice_HEADERS
|
|
|
|
${Leddevice_HEADERS}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTinkerforge.h
|
|
|
|
)
|
|
|
|
SET(Leddevice_SOURCES
|
|
|
|
${Leddevice_SOURCES}
|
|
|
|
${CURRENT_SOURCE_DIR}/LedDeviceTinkerforge.cpp
|
|
|
|
)
|
|
|
|
endif(ENABLE_TINKERFORGE)
|
|
|
|
|
2016-01-06 17:31:23 +01:00
|
|
|
if(ENABLE_QT5)
|
|
|
|
QT5_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
|
|
|
|
else(ENABLE_QT5)
|
2013-12-17 19:50:15 +01:00
|
|
|
QT4_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
|
2016-01-06 17:31:23 +01:00
|
|
|
endif(ENABLE_QT5)
|
|
|
|
|
2013-12-17 19:50:15 +01:00
|
|
|
|
|
|
|
add_library(leddevice
|
|
|
|
${Leddevice_HEADERS}
|
|
|
|
${Leddevice_QT_HEADERS}
|
|
|
|
${Leddevice_HEADERS_MOC}
|
|
|
|
${Leddevice_SOURCES}
|
|
|
|
)
|
|
|
|
|
2016-01-06 17:31:23 +01:00
|
|
|
if(ENABLE_QT5)
|
|
|
|
qt5_use_modules(leddevice Widgets Network)
|
|
|
|
endif(ENABLE_QT5)
|
|
|
|
|
2013-12-17 19:50:15 +01:00
|
|
|
target_link_libraries(leddevice
|
2014-03-04 20:38:54 +01:00
|
|
|
hyperion-utils
|
2016-01-04 12:16:44 +01:00
|
|
|
serialport
|
2014-03-04 20:38:54 +01:00
|
|
|
${LIBUSB_1_LIBRARIES} #apt-get install libusb-1.0-0-dev
|
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
|
|
${QT_LIBRARIES}
|
2013-12-17 19:50:15 +01:00
|
|
|
)
|
2014-03-04 20:38:54 +01:00
|
|
|
|
|
|
|
if(ENABLE_TINKERFORGE)
|
2014-03-06 21:48:11 +01:00
|
|
|
target_link_libraries(leddevice tinkerforge)
|
2014-03-04 20:38:54 +01:00
|
|
|
endif()
|
|
|
|
|
2013-12-17 22:53:16 +01:00
|
|
|
if(APPLE)
|
|
|
|
target_link_libraries(leddevice hidapi-mac)
|
|
|
|
else()
|
|
|
|
target_link_libraries(leddevice hidapi-libusb)
|
|
|
|
endif()
|