优化输出目录, 增加构建脚本
This commit is contained in:
parent
2d9ae52f48
commit
9371d67b00
@ -86,15 +86,23 @@ target_link_libraries(WinDevice PRIVATE ${DirectX_LIBS})
|
||||
|
||||
# 创建 output 目录
|
||||
set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/output)
|
||||
file(MAKE_DIRECTORY ${OUTPUT_DIR})
|
||||
set_target_properties(WinDevice PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug"
|
||||
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug"
|
||||
# 获取架构信息
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(ARCH_DIR "x64")
|
||||
else()
|
||||
set(ARCH_DIR "x86")
|
||||
endif()
|
||||
|
||||
ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release"
|
||||
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release"
|
||||
# 创建架构特定的输出目录
|
||||
file(MAKE_DIRECTORY ${OUTPUT_DIR}/${ARCH_DIR})
|
||||
set_target_properties(WinDevice PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/${ARCH_DIR}/debug"
|
||||
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/${ARCH_DIR}/debug"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/${ARCH_DIR}/debug"
|
||||
|
||||
ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/${ARCH_DIR}/release"
|
||||
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/${ARCH_DIR}/release"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/${ARCH_DIR}/release"
|
||||
)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
Loading…
Reference in New Issue
Block a user