cmake_minimum_required(VERSION 3.16)

project(transm LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (MSVC)
    add_compile_options(/source-charset:utf-8)
endif()

set(CMAKE_DEBUG_POSTFIX "d")
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")

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

include_directories(3rd)
include_directories(.)
add_subdirectory(ofen)
add_subdirectory(net)
add_subdirectory(util)
add_subdirectory(server)
add_subdirectory(client)

add_executable(transm_test1 test1.cpp)
target_link_libraries(transm_test1 PRIVATE trans_net trans_util)
add_executable(transm_test2 test2.cpp)
target_link_libraries(transm_test2 PRIVATE trans_net trans_util)