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:/Dev/GNU/Boost" "C:/Qt/Qt5.14.2/5.14.2/mingw73_64" ) if (MSVC) if (GBK) add_compile_options(/source-charset:utf-8) else() add_compile_options(/utf-8) endif() # 以下抑制,主要作用与三方库。 add_compile_options(/wd4018) #有符号与无符号的比较 add_compile_options(/wd4800) #将值强制为布尔值“true”或“false”(性能警告) 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) add_subdirectory(net_server) add_subdirectory(net_com) add_subdirectory(net_client)