cmake_minimum_required(VERSION 3.8) message(STATUS "cmake version ${CMAKE_VERSION}") set(TOOLCHAIN_DIR /opt/atk-dlrv1126-toolchain) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/usr/bin/arm-linux-gnueabihf-g++) set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/usr/bin/arm-linux-gnueabihf-gcc) set(SYSROOT ${TOOLCHAIN_DIR}/arm-buildroot-linux-gnueabihf/sysroot/usr/include) set(CMAKE_SYSROOT ${TOOLCHAIN_DIR}/arm-buildroot-linux-gnueabihf/sysroot) set(CMAKE_CXX_STANDARD 11) add_definitions(-g -O0 -ggdb -gdwarf -funwind-tables -rdynamic) add_definitions(-Wno-write-strings -Wno-return-type) link_directories(include .) find_package(CURL REQUIRED) include_directories(${CURL_INCLUDE_DIR}) include_directories(.) add_executable(ymodem-test ymodem_test.c serial_port.c ymodem.c download.cpp ) target_link_libraries(ymodem-test pthread dl ${CURL_LIBRARIES})