cmake: copy assets to build dir

This commit is contained in:
Anonymous Maarten 2021-03-26 23:33:38 +01:00
parent 351ddded34
commit bcfe402fe9
7 changed files with 34 additions and 11 deletions

View File

@ -10,14 +10,12 @@ if(LIBRW_PLATFORM_PS2)
add_subdirectory(ps2test)
endif()
if(UNIX)
if(NOT LIBRW_PLATFORM_NULL AND NOT LIBRW_PLATFORM_PS2)
add_subdirectory(playground)
add_subdirectory(lights)
add_subdirectory(subrast)
add_subdirectory(camera)
add_subdirectory(im2d)
add_subdirectory(im3d)
add_subdirectory(ska2anm)
endif()
if(NOT LIBRW_PLATFORM_NULL AND NOT LIBRW_PLATFORM_PS2)
add_subdirectory(playground)
add_subdirectory(lights)
add_subdirectory(subrast)
add_subdirectory(camera)
add_subdirectory(im2d)
add_subdirectory(im3d)
add_subdirectory(ska2anm)
endif()

View File

@ -6,3 +6,8 @@ target_link_libraries(camera
PUBLIC
librw librw_skeleton librw_skeleton_imgui
)
add_custom_command(
TARGET camera POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/files" "$<TARGET_FILE_DIR:camera>/files"
)

View File

@ -6,3 +6,8 @@ target_link_libraries(im2d
PUBLIC
librw librw_skeleton librw_skeleton_imgui
)
add_custom_command(
TARGET im2d POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/files" "$<TARGET_FILE_DIR:im2d>/files"
)

View File

@ -6,3 +6,8 @@ target_link_libraries(im3d
PUBLIC
librw librw_skeleton librw_skeleton_imgui
)
add_custom_command(
TARGET im3d POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/files" "$<TARGET_FILE_DIR:im3d>/files"
)

View File

@ -6,3 +6,8 @@ target_link_libraries(lights
PUBLIC
librw librw_skeleton librw_skeleton_imgui
)
add_custom_command(
TARGET lights POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/checker.dff" "$<TARGET_FILE_DIR:lights>"
)

View File

@ -6,3 +6,8 @@ target_link_libraries(playgound
PUBLIC
librw librw_skeleton
)
add_custom_command(
TARGET playgound POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/teapot.dff" "${CMAKE_CURRENT_SOURCE_DIR}/maze.tga" "${CMAKE_CURRENT_SOURCE_DIR}/Bm437_IBM_VGA8.FON" "${CMAKE_CURRENT_SOURCE_DIR}/Bm437_IBM_BIOS.FON" "$<TARGET_FILE_DIR:playground>"
)

View File

@ -258,7 +258,7 @@ InitRW(void)
tex = rw::Texture::read("maze", nil);
tex2 = rw::Texture::read("checkers", nil);
const char *filename = "teapot2.dff";
const char *filename = "teapot.dff";
if(sk::args.argc > 1)
filename = sk::args.argv[1];
rw::StreamFile in;