add support for tinkerforge

Former-commit-id: 8dbd3d915f70ace8d1b27602f0d76a2a546ac043
This commit is contained in:
Bjoern Bilger
2014-03-04 20:38:54 +01:00
parent 2a083f0293
commit 2b683fdfaa
6 changed files with 288 additions and 7 deletions

View File

@@ -6,10 +6,20 @@ 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)
if(ENABLE_TINKERFORGE)
find_package(libtinkerforge-1.0 REQUIRED)
endif(ENABLE_TINKERFORGE)
include_directories(
../../include/hidapi
${LIBUSB_1_INCLUDE_DIRS}) # for Lightpack device
../../include/hidapi
${LIBUSB_1_INCLUDE_DIRS}) # for Lightpack device
if(ENABLE_TINKERFORGE)
include_directories(
${LIBTINKERFORGE_1_INCLUDE_DIRS}) # for Tinkerforge device
endif(ENABLE_TINKERFORGE)
# Group the headers that go through the MOC compiler
SET(Leddevice_QT_HEADERS
@@ -67,6 +77,17 @@ if(ENABLE_SPIDEV)
)
endif(ENABLE_SPIDEV)
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)
QT4_WRAP_CPP(Leddevice_HEADERS_MOC ${Leddevice_QT_HEADERS})
@@ -78,12 +99,19 @@ add_library(leddevice
)
target_link_libraries(leddevice
hyperion-utils
serialport
${LIBUSB_1_LIBRARIES} #apt-get install libusb-1.0-0-dev
${CMAKE_THREAD_LIBS_INIT}
${QT_LIBRARIES}
hyperion-utils
serialport
${LIBUSB_1_LIBRARIES} #apt-get install libusb-1.0-0-dev
${CMAKE_THREAD_LIBS_INIT}
${QT_LIBRARIES}
)
if(ENABLE_TINKERFORGE)
target_link_libraries(leddevice
${LIBTINKERFORGE_1_LIBRARIES}
)
endif()
if(APPLE)
target_link_libraries(leddevice hidapi-mac)
else()