Skip to content

Commit

Permalink
Add install rules for SDL runtime artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Jun 8, 2024
1 parent 8c2d691 commit 3dcbaae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
project(centurion-test CXX)

function(cen_install_sdl_runtime_dependencies to)
if (WIN32)
install(IMPORTED_RUNTIME_ARTIFACTS SDL3-shared DESTINATION "${to}")

if (CEN_USE_SDL_IMAGE)
install(IMPORTED_RUNTIME_ARTIFACTS SDL3_image-shared DESTINATION "${to}")
endif ()

if (CEN_USE_SDL_MIXER)
install(IMPORTED_RUNTIME_ARTIFACTS SDL3_mixer-shared DESTINATION "${to}")
endif ()

if (CEN_USE_SDL_TTF)
install(IMPORTED_RUNTIME_ARTIFACTS SDL3_ttf-shared DESTINATION "${to}")
endif ()
endif ()
endfunction()

if (CEN_BUILD_DEMO_TESTS)
add_subdirectory(demo)
endif ()
Expand Down
2 changes: 2 additions & 0 deletions test/demo/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ target_sources(centurion_basic_demo PRIVATE "main.cpp")
cen_prepare_target_options(centurion_basic_demo)

target_link_libraries(centurion_basic_demo PUBLIC centurion::centurion)

cen_install_sdl_runtime_dependencies("${PROJECT_BINARY_DIR}")
2 changes: 2 additions & 0 deletions test/demo/iostream/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ target_sources(centurion_iostream_demo PRIVATE "main.cpp")
cen_prepare_target_options(centurion_iostream_demo)

target_link_libraries(centurion_iostream_demo PUBLIC centurion::centurion)

cen_install_sdl_runtime_dependencies("${PROJECT_BINARY_DIR}")
1 change: 1 addition & 0 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ target_link_libraries(centurion-unit-tests
)

cen_install_assets("${PROJECT_BINARY_DIR}")
cen_install_sdl_runtime_dependencies("${PROJECT_BINARY_DIR}")

0 comments on commit 3dcbaae

Please sign in to comment.