cmake_minimum_required(VERSION 3.5)

project(nettrans LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_PREFIX_PATH
    "C:/Qt/Qt5.14.2/5.14.2/msvc2017_64"
)

if (MSVC)
    add_compile_options(/source-charset:utf-8)
    # 以下抑制，主要作用与三方库。
    add_compile_options(/wd4018) #有符号与无符号的比较
    add_compile_options(/wd4800) #将值强制为布尔值“true”或“false”(性能警告)
    add_compile_options(/wd4307) #整形常量溢出
endif()

if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
    MESSAGE(STATUS "Add MinGW Param.")
    add_compile_options(-finput-charset=utf-8)
    add_compile_options(-fexec-charset=utf-8)
endif()

message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Compiler C ID: ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")

set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)

include_directories(3rd/spdlog-1.13.0/include)
include_directories(3rd/asio-1.30.2/include)

add_subdirectory(net_server)
add_subdirectory(net_com)
add_subdirectory(net_client)
add_subdirectory(util)
