This commit is contained in:
2025-04-30 19:01:44 +02:00
parent 451e80f750
commit 429627c095
10 changed files with 100 additions and 73 deletions

View File

@@ -29,12 +29,15 @@ add_executable(factorygame
set(ASSETS_SOURCE_DIR "${CMAKE_SOURCE_DIR}/assets")
set(ASSETS_BINARY_DIR "${CMAKE_BINARY_DIR}/assets")
# Copy assets directory after build
add_custom_command(TARGET factorygame POST_BUILD
# Copy assets directory always
add_custom_target(copy_assets ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${ASSETS_SOURCE_DIR}" "${ASSETS_BINARY_DIR}"
COMMENT "Copying assets directory to build output..."
)
# Make sure factorygame depends on the assets being copied
add_dependencies(factorygame copy_assets)
target_link_libraries(factorygame SDL2 SDL2_ttf SDL2_image SDL2_gfx SDL2_mixer SDL2_net m)