Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
tuorqai authored Nov 26, 2023
1 parent cd236e6 commit 1b9f543
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ueit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ find_package(SDL2 CONFIG REQUIRED)
add_executable(ueit ueit.c)
target_link_libraries(ueit PRIVATE SDL2::SDL2 SDL2::SDL2main libsecam)

install(TARGETS ueit RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(WIN32)
set(UEIT_INSTALL_DIR "ueit")
else()
set(UEIT_INSTALL_DIR "${CMAKE_INSTALL_LIBEXECDIR}/ueit")
endif()

install(TARGETS ueit RUNTIME DESTINATION ${UEIT_INSTALL_DIR})

file(GLOB BITMAPS *.bmp)

Expand All @@ -13,6 +19,12 @@ foreach(BITMAP IN LISTS BITMAPS)
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BITMAP} $<TARGET_FILE_DIR:ueit>
COMMENT "Copying bitmap: ${BITMAP}")
install(FILES ${BITMAP} DESTINATION ${CMAKE_INSTALL_DATADIR}/ueit)
install(FILES ${BITMAP} DESTINATION ${UEIT_INSTALL_DIR})
endforeach()

if(${CMAKE_VERSION} VERSION_GREATER "3.20")
add_custom_command(TARGET ueit POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:ueit> $<TARGET_FILE_DIR:ueit>
COMMAND_EXPAND_LISTS)
install(FILES $<TARGET_RUNTIME_DLLS:ueit> DESTINATION ${UEIT_INSTALL_DIR})
endif()

0 comments on commit 1b9f543

Please sign in to comment.