CMake: Copy assets to the build directory automatically
This commit is contained in:
@@ -66,6 +66,13 @@ add_subdirectory("vendor")
|
||||
# Add engine target to project
|
||||
add_subdirectory("src")
|
||||
|
||||
# ------------------------------------------
|
||||
# Assets target
|
||||
|
||||
add_custom_target(${ENGINE}-assets ALL
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy-assets.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
# ------------------------------------------
|
||||
# Examples target
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/../assets DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
@@ -25,4 +25,5 @@ target_precompile_headers(${GAME} REUSE_FROM ${ENGINE})
|
||||
# Add 'make run' target
|
||||
add_custom_target(run
|
||||
COMMAND ${GAME}
|
||||
WORKING_DIRECTORY ".."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user