cmake_minimum_required(VERSION 3.5)
#vcpkg config
if (MSVC)
set(CMAKE_TOOLCHAIN_FILE "E:/01MyCode/vcpkg/vcpkgclion/scripts/buildsystems/vcpkg.cmake")
endif()
project(is11lib)



if (MSVC)
    find_package(cserialport  REQUIRED)
    # 静态链接多线程版本的运行时库
    set(CMAKE_CXX_FLAGS "/MT")
    set(CMAKE_C_FLAGS "/MT")
    include_directories(${CSerialPort_INCLUDE_DIR})
    message(STATUS "CSerialPort_INCLUDE_DIR: ${CSerialPort_INCLUDE_DIR}")
endif()

include_directories(../../src/test)
include_directories(../../src/IRIS_IS3)
include_directories(../../src/comman)
include_directories(../../src/thirdpart/iris_proto_tool/src)
add_library(iris_is3lib SHARED
        ../../src/thirdpart/iris_proto_tool/src/IRIS_Method.cpp
        ../../src/IRIS_IS3/SensorIS3.cpp
        ../../src/IRIS_IS3/IS3_INST.cpp
        ../../src/IRIS_IS3/IS3Comon.cpp

)



if (MSVC)
add_executable(is3test
        testmain.cpp
)

target_link_libraries(is3test iris_is3lib ${CSerialPort_LIBRARY})
message(STATUS "CSerialPort_LIBRARY: ${CSerialPort_LIBRARY}")

#add_executable(is11test
#        testmain.cpp
#)
endif()
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)