From 9d6fc5629f348961547d2ba4983e52ce50cbdebe Mon Sep 17 00:00:00 2001 From: taynpg Date: Sun, 5 Jan 2025 22:01:17 +0800 Subject: [PATCH] =?UTF-8?q?change=EF=BC=9A=E6=A8=A1=E6=9D=BFCMakeLists?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/template/CMakeLists.txt b/template/CMakeLists.txt index 538cf88..de32dee 100644 --- a/template/CMakeLists.txt +++ b/template/CMakeLists.txt @@ -8,7 +8,17 @@ if (MSVC) add_compile_options(/source-charset:utf-8) 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=gbk) +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}/) + add_executable(demo main.cpp) \ No newline at end of file