Skip to content

Commit c4f5cb5

Browse files
ev3nvy375gnu
authored andcommitted
build: fix SDL installation on Windows
1 parent 6ab40f0 commit c4f5cb5

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/celestia/sdl/CMakeLists.txt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,22 @@ else()
8282
target_link_libraries(imgui PUBLIC ${SDL2_LIBRARIES})
8383
endif()
8484

85-
install(
86-
TARGETS celestia-sdl
87-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
88-
COMPONENT sdlgui
89-
)
85+
if(WIN32)
86+
install(
87+
TARGETS celestia-sdl
88+
RUNTIME_DEPENDENCIES
89+
PRE_EXCLUDE_REGEXES "^api-ms" "^ext-ms-"
90+
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll$"
91+
DIRECTORIES $<TARGET_FILE_DIR:celestia> $<TARGET_FILE_DIR:SDL2::SDL2>
92+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
93+
COMPONENT sdlgui
94+
)
95+
else()
96+
install(
97+
TARGETS celestia-sdl
98+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
99+
COMPONENT sdlgui
100+
)
101+
endif()
90102

91103
add_subdirectory(data)

0 commit comments

Comments
 (0)