set(Boost_USE_STATIC_LIBS ON) find_package(Boost 1.62 REQUIRED) if(WIN32) find_package(LIBUSB REQUIRED) else() find_package(PkgConfig REQUIRED) pkg_check_modules(LibUSB REQUIRED libusb-1.0) endif() set(PRINTER_SOURCES posprinter.cpp utils.cpp ) add_library(printer STATIC ${PRINTER_SOURCES}) if(WIN32) target_link_libraries(printer core ${LIBUSB_1_LIBRARIES}) else() target_link_libraries(printer core ${LibUSB_LIBRARIES}) endif() target_include_directories(printer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)