优化输出目录, 增加构建脚本

This commit is contained in:
DevWiki 2024-09-26 16:52:24 +08:00
parent 2d9ae52f48
commit 9371d67b00

View File

@ -86,15 +86,23 @@ target_link_libraries(WinDevice PRIVATE ${DirectX_LIBS})
# output # output
set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/output) set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/output)
file(MAKE_DIRECTORY ${OUTPUT_DIR}) #
set_target_properties(WinDevice PROPERTIES if(CMAKE_SIZEOF_VOID_P EQUAL 8)
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug" set(ARCH_DIR "x64")
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug" else()
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug" set(ARCH_DIR "x86")
endif()
ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release" #
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release" file(MAKE_DIRECTORY ${OUTPUT_DIR}/${ARCH_DIR})
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release" 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") if (CMAKE_BUILD_TYPE STREQUAL "Debug")