cmake_minimum_required(VERSION 3.5)

project(SerialOpr LANGUAGES CXX)

if (MSVC)
    add_definitions(-D_WIN32_WINNT=0x0601)
    add_compile_options(/source-charset:utf-8)
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../3rd/asio-1.30.2/include)
add_library(SerialOpr SHARED serial.h serial.cpp)
target_compile_definitions(SerialOpr PRIVATE SERIALOPR_LIB DYNAMIC_DLL)
if (UNIX)
target_link_libraries(SerialOpr PRIVATE pthread)
endif()