Tool-CMake-add_custom_command-copy

Tool-CMake-add_custom_command-copy

https://cmake.org/cmake/help/latest/command/add_custom_command.html?highlight=add_custom_command

add_custom_command(TARGET <target>
                   PRE_BUILD | PRE_LINK | POST_BUILD
                   COMMAND command1 [ARGS] [args1...]
                   [COMMAND command2 [ARGS] [args2...] ...]
                   [BYPRODUCTS [files...]]
                   [WORKING_DIRECTORY dir]
                   [COMMENT comment]
                   [VERBATIM] [USES_TERMINAL]
                   [COMMAND_EXPAND_LISTS])

copy

add_custom_command(
	TARGET ${CURR_EXE_NAME}
	POST BUILD
	COMMAND ${CMAKE_COMMAND} ARGS -E copy ${CURR_EXE_NAME} ${PROJECT_BINARY_DIR}
)

copy_directory

posted @ 2023-05-09 05:58  Theseus‘Ship  阅读(18)  评论(0编辑  收藏  举报
Live2D