﻿cmake_minimum_required(VERSION 2.8)
project(lts_sdk_cpp)
#set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_CXX_STANDARD 98)

find_package(Protobuf REQUIRED)

if(PROTOBUF_FOUND)
        message ("protobuf found")
else()
        message (FATAL_ERROR "Cannot find Protobuf")
endif()

# Generate the .h and .cxx files by .proto
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS common.proto resource.proto logs.proto)

# Print path to generated files
message ("PROTO_SRCS = ${PROTO_SRCS}")
message ("PROTO_HDRS = ${PROTO_HDRS}")

include_directories(include build)

add_library(ltssdk STATIC
	clientConfig.cpp
	client.cpp
	json.cpp
    ctIam.cpp
    populateLogsMessage.cpp
    constant.cpp
    producerBatch.cpp
    producerConfig.cpp
    logItem.cpp
	logAccumulator.cpp
	threadPool.cpp
	ioWorker.cpp
	mover.cpp
	producer.cpp
        ${PROTO_SRCS})

target_link_libraries(ltssdk crypto ssl curl lz4 protobuf pthread )#  boost_system boost_filesystem   #链接静态库

install(TARGETS ltssdk
       LIBRARY DESTINATION lib
       ARCHIVE DESTINATION lib)

#install(FILES ${PROTO_HDRS}
 #       DESTINATION include)
