# Win32-specific options go here.
message(STATUS "Detected Win32 system")
list(APPEND LIBSRC hidapi/windows/hid.c)
+ list(APPEND PLATFORM_LIBS setupapi)
elseif(APPLE)
# Apple-specific options go here.
message(STATUS "Detected Apple system")
message(STATUS "Detected non-windows, non-apple system; assuming some Linux variant")
include_directories(/usr/include/libusb-1.0)
list(APPEND LIBSRC hidapi/linux/hid-libusb.c)
+ list(APPEND PLATFORM_LIBS usb-1.0 pthread rt)
endif()
list(APPEND LIBSRC src/touchmouse.c src/mono_timer.c)
add_executable(consoledemo consoledemo.c)
-if(WIN32)
- target_link_libraries(consoledemo touchmouse setupapi)
-elseif(NOT APPLE)
- target_link_libraries(consoledemo touchmouse usb-1.0 pthread rt)
-else()
- target_link_libraries(consoledemo touchmouse)
-endif()
+target_link_libraries(consoledemo touchmouse ${PLATFORM_LIBS})
QT4_WRAP_CPP(QTVIEW_MOC_OUTFILES ${QTVIEW_HEADERS} )
add_executable(qtview ${QTVIEW_SOURCES} ${QTVIEW_MOC_OUTFILES})
- if(WIN32)
- target_link_libraries(qtview touchmouse ${QT_LIBRARIES} setupapi)
- elseif(NOT APPLE)
- target_link_libraries(qtview touchmouse ${QT_LIBRARIES} usb-1.0 pthread rt)
- else()
- target_link_libraries(qtview touchmouse ${QT_LIBRARIES})
- endif()
+ target_link_libraries(qtview touchmouse ${QT_LIBRARIES} ${PLATFORM_LIBS})
else()
message(STATUS "Didn't find Qt, will not build qtview example")